/* === Дизайн-система SaaS === */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.4);
  --sidebar-width: 270px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* === Лендинг === */
.landing {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  min-height: 100vh;
}
.landing-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px; border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.landing-logo { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.landing-nav-links { display: flex; gap: 32px; align-items: center; }
.landing-nav-links a { color: var(--text-muted); text-decoration: none; font-size: 15px; transition: color 0.2s; }
.landing-nav-links a:hover { color: var(--text); }
.landing-menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

.hero { text-align: center; padding: 100px 20px 80px; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: 56px; font-weight: 800; line-height: 1.1; margin-bottom: 24px; }
.hero h1 span { background: linear-gradient(90deg, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 20px; color: var(--text-muted); margin-bottom: 40px; line-height: 1.6; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 0 20px rgba(99,102,241,0.4); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.2); }
.btn-outline:hover { background: rgba(255,255,255,0.05); }
.btn-lg { padding: 16px 32px; font-size: 16px; }

.section { padding: 80px 40px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.section-subtitle { text-align: center; color: var(--text-muted); font-size: 18px; margin-bottom: 60px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.feature-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.2s;
}
.feature-card:hover { background: rgba(255,255,255,0.06); transform: translateY(-4px); }
.feature-icon { font-size: 40px; margin-bottom: 16px; }
.feature-card h3 { font-size: 20px; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 15px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.pricing-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
}
.pricing-card.popular { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.pricing-card .price { font-size: 48px; font-weight: 800; margin: 16px 0; }
.pricing-card .price span { font-size: 16px; color: var(--text-muted); font-weight: 400; }
.pricing-card ul { list-style: none; text-align: left; margin: 24px 0; }
.pricing-card li { padding: 10px 0; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.05); }
.pricing-card li:before { content: "✓"; color: var(--success); margin-right: 10px; }

.footer { text-align: center; padding: 40px; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.08); }

/* === Dashboard === */
.dashboard-app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100;
}
.sidebar-header { padding: 24px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-brand { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.sidebar-company { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.sidebar-user { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #a855f7); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sidebar-user .name { font-size: 14px; font-weight: 600; }
.sidebar-user .role { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav .section-title { padding: 12px 14px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-nav a.active { background: var(--primary); color: white; box-shadow: 0 0 15px rgba(99,102,241,0.3); }
.sidebar-nav .logout { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }

.main { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.badge { background: rgba(99,102,241,0.15); color: #a5b4fc; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

.content { padding: 28px; max-width: 1400px; margin: 0 auto; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.page-header p { color: var(--text-muted); font-size: 15px; }

.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 16px; font-weight: 700; margin: 0; }
.card-body { padding: 24px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }
.metric { padding: 24px; }
.metric-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.metric-value { font-size: 32px; font-weight: 800; }
.metric-change { font-size: 13px; margin-top: 6px; font-weight: 600; }
.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--danger); }
.metric-change.neutral { color: var(--text-muted); }

input, select, textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: all 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
input::placeholder { color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; background: rgba(255,255,255,0.02); }
tr:hover td { background: rgba(255,255,255,0.02); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-confirmed, .status-draft { background: rgba(59,130,246,0.15); color: #93c5fd; }
.status-confirmed::before, .status-draft::before { background: #3b82f6; }
.status-preparing, .status-transit { background: rgba(245,158,11,0.15); color: #fcd34d; }
.status-preparing::before, .status-transit::before { background: var(--warning); }
.status-ready { background: rgba(14,165,233,0.15); color: #7dd3fc; }
.status-ready::before { background: var(--info); }
.status-completed { background: rgba(34,197,94,0.15); color: #86efac; }
.status-completed::before { background: var(--success); }
.status-cancelled { background: rgba(239,68,68,0.15); color: #fca5a5; }
.status-cancelled::before { background: var(--danger); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: #1f2937; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.1); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,0.03); color: var(--text-muted); border: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.tab:hover { background: rgba(255,255,255,0.08); }
.tab.active { background: var(--primary); color: white; }

.ai-result {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.6;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }

/* === Mobile === */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .landing-nav-links { display: none; }
  .hero h1 { font-size: 36px; }
  .section { padding: 60px 20px; }
}

/* === Utils === */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }

/* === Анимации === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.5s ease-out forwards; }
.animate-slideInLeft { animation: slideInLeft 0.4s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s infinite; }

.card, .metric, .feature-card, .pricing-card {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}
.metric:nth-child(1) { animation-delay: 0.05s; }
.metric:nth-child(2) { animation-delay: 0.1s; }
.metric:nth-child(3) { animation-delay: 0.15s; }
.metric:nth-child(4) { animation-delay: 0.2s; }

.sidebar-nav a { position: relative; overflow: hidden; }
.sidebar-nav a::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary); transform: scaleY(0); transition: transform 0.2s;
}
.sidebar-nav a:hover::after, .sidebar-nav a.active::after { transform: scaleY(1); }

.btn { position: relative; overflow: hidden; }
.btn::before {
  content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  background: rgba(255,255,255,0.2); border-radius: 50%; transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}
.btn:active::before { width: 300px; height: 300px; }

.loading-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.glass {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
}

.gradient-text {
  background: linear-gradient(90deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hover-lift { transition: transform 0.2s, box-shadow 0.2s; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.admin-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}
.admin-card:hover { border-color: rgba(99,102,241,0.3); transform: translateY(-2px); }
.admin-card .icon { font-size: 32px; margin-bottom: 12px; }
.admin-card h3 { font-size: 18px; margin-bottom: 8px; }
.admin-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* === Новый продающий лендинг === */
.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(99,102,241,0.2);
}
.hero-stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stats div {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}
.hero-stats strong {
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}

.problem-section { background: rgba(0,0,0,0.15); }
.problem-grid .feature-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}
.problem-grid .feature-icon { font-size: 48px; }

.solution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.solution-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.04));
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.2s;
}
.solution-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.3); }
.solution-icon { font-size: 44px; margin-bottom: 16px; }
.solution-card h3 { font-size: 20px; margin-bottom: 10px; }
.solution-card p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }

.automation-section { background: rgba(0,0,0,0.2); }
.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  counter-reset: auto;
}
.automation-item {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.automation-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #a855f7);
}
.automation-number {
  font-size: 48px;
  font-weight: 900;
  color: rgba(255,255,255,0.06);
  line-height: 1;
  margin-bottom: 12px;
}
.automation-item h3 { font-size: 18px; margin-bottom: 8px; }
.automation-item p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.pricing-section { background: rgba(0,0,0,0.15); }
.pricing-card {
  position: relative;
  text-align: left;
  padding: 32px;
  background: rgba(255,255,255,0.02);
}
.pricing-card.popular {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.05));
  transform: scale(1.03);
}
.pricing-header { margin-bottom: 16px; }
.pricing-header h3 { font-size: 24px; margin-bottom: 4px; }
.pricing-header p { color: var(--text-muted); font-size: 14px; }
.pricing-discount {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.old-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 18px;
}
.discount-badge {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.pricing-card .price { text-align: left; margin: 8px 0 20px; }

.cta-section { padding-top: 40px; }
.cta-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  padding: 64px 40px;
  text-align: center;
}
.cta-card h2 { font-size: 36px; margin-bottom: 16px; }
.cta-card > p { color: var(--text-muted); font-size: 18px; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.cta-note { color: var(--warning); font-size: 14px; font-weight: 600; }

/* Savings section */
.savings-section { background: rgba(0,0,0,0.25); }
.savings-grid { max-width: 900px; margin: 0 auto; }
.savings-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px; background: rgba(255,255,255,0.03); border-radius: 10px; }
.savings-label { width: 160px; font-size: 15px; font-weight: 600; flex-shrink: 0; }
.savings-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; position: relative; }
.savings-bar::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: linear-gradient(90deg, var(--success), #4ade80); border-radius: 4px; }
.savings-values { width: 180px; text-align: right; font-size: 14px; flex-shrink: 0; }
.savings-values .old { color: var(--text-muted); text-decoration: line-through; }
.savings-values .new { color: var(--success); font-weight: 700; }
.savings-total { text-align: center; margin-top: 40px; padding: 32px; background: rgba(34,197,94,0.05); border: 1px solid rgba(34,197,94,0.15); border-radius: var(--radius); max-width: 500px; margin-left: auto; margin-right: auto; }
@media (max-width: 768px) {
    .savings-row { flex-wrap: wrap; }
    .savings-label { width: 100%; }
    .savings-values { width: 100%; text-align: left; }
}

.footer-content { max-width: 1200px; margin: 0 auto; }
.footer-brand { font-size: 20px; font-weight: 800; margin-bottom: 12px; }

/* === Mobile landing === */
@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hero-stats strong { font-size: 24px; }
  .section-title { font-size: 28px; }
  .pricing-card.popular { transform: none; }
  .cta-card { padding: 40px 24px; }
  .cta-card h2 { font-size: 26px; }
}
@media (max-width: 480px) {
  .landing-nav { padding: 16px 20px; }
  .hero { padding: 60px 20px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 60px 20px; }
  .pricing-card { padding: 24px; }
}

/* === Comprehensive Responsive === */
@media (max-width: 1024px) {
  .content { padding: 20px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Dashboard */
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 16px; }
  .content { padding: 16px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-group { margin-bottom: 14px; }

  /* Cards and grids */
  .metric-grid { grid-template-columns: 1fr; gap: 12px; }
  .features-grid { grid-template-columns: 1fr; }
  .solution-grid { grid-template-columns: 1fr; }
  .automation-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }

  /* Tables */
  .table-wrap { margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  table { min-width: 600px; }
  th, td { padding: 12px 14px; font-size: 13px; }

  /* Typography */
  .page-header h1 { font-size: 22px; }
  .section-title { font-size: 26px; }
  .section-subtitle { font-size: 16px; }

  /* Buttons */
  .btn { padding: 12px 20px; font-size: 14px; width: 100%; }
  .btn-sm { padding: 8px 14px; }
  .hero-btns .btn, .cta-btns .btn { width: 100%; }

  /* Landing */
  .landing-menu-toggle { display: block; }
  .landing-nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
  }
  .landing-nav-links.open { display: flex; }
  .landing-nav-links .btn { width: 100%; }
  .hero { padding: 60px 20px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 16px; }
  .hero-badge { font-size: 12px; padding: 8px 14px; }
  .section { padding: 60px 20px; }
  .feature-card, .solution-card, .automation-item, .pricing-card {
    padding: 24px;
  }
  .automation-number { font-size: 36px; }

  /* Auth */
  .login-page { padding: 40px 20px; }
  .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero-stats strong { font-size: 22px; }
  .section-title { font-size: 24px; }
  .cta-card h2 { font-size: 24px; }
  .pricing-card .price { font-size: 36px; }
  .old-price { font-size: 16px; }

  /* Dashboard cards */
  .card-header { padding: 16px; }
  .card-body { padding: 16px; }
  .metric-value { font-size: 26px; }

  /* Tables even tighter */
  th, td { padding: 10px 12px; font-size: 12px; }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .sidebar-nav a { padding: 14px 16px; }
  .landing-nav-links a { padding: 12px; }
}

/* Prevent horizontal overflow */
body, html { overflow-x: hidden; }
img, video, svg { max-width: 100%; height: auto; }

/* Light theme */
[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-light: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
}
[data-theme="light"] .landing { background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 50%, #c7d2fe 100%); }
[data-theme="light"] .card { border-color: rgba(0,0,0,0.06); }
[data-theme="light"] table th { background: rgba(0,0,0,0.02); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
    background: #fff; border-color: rgba(0,0,0,0.1); color: var(--text);
}
[data-theme="light"] .sidebar-nav a:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .status-confirmed, [data-theme="light"] .status-draft { background: rgba(59,130,246,0.1); color: #2563eb; }
[data-theme="light"] .status-completed { background: rgba(34,197,94,0.1); color: #16a34a; }
[data-theme="light"] .glass { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.06); }


