/* ============================================================
   SARA V2 — Design System · Light Mode Brand
   Colores: Orange #F86F03, Blue #4F7FFF, Light #FFF6F4
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Brand */
  --orange:       #F86F03;
  --orange-hover: #d96102;
  --orange-light: #FFF6F4;
  --orange-border: rgba(248,111,3,0.2);
  --blue:         #4F7FFF;
  --blue-hover:   #3d65cc;
  --blue-light:   #EEF2FF;
  --blue-border:  rgba(79,127,255,0.2);
  --yellow:       #FFA41B;
  --primary:      #4F7FFF;
  --accent:       #F86F03;

  /* Neutrals (light mode) */
  --bg:          #F8FAFC;   /* slate-50 */
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFC;
  --border:      #E2E8F0;   /* slate-200 */
  --border-2:    #CBD5E1;   /* slate-300 */
  --text:        #0F172A;   /* slate-900 */
  --text-2:      #475569;   /* slate-600 */
  --text-muted:  #94A3B8;   /* slate-400 */

  /* Semantic */
  --success:       #16A34A;
  --success-bg:    #DCFCE7;
  --success-border:#BBF7D0;
  --danger:        #DC2626;
  --danger-bg:     #FEE2E2;
  --danger-border: #FECACA;
  --warning:       #D97706;
  --warning-bg:    #FEF3C7;
  --warning-border:#FDE68A;

  /* Toast/Alert Colors */
  --color-success: #10b981;
  --color-error:   #ef4444;
  --color-warning: #f59e0b;
  --color-info:    #3b82f6;

  /* Spacing / Radius */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  /* Spacing Scale (base 4px) */
  --spacing-xs:  4px;
  --spacing-sm:  8px;
  --spacing-md:  12px;
  --spacing-lg:  16px;
  --spacing-xl:  20px;
  --spacing-2xl: 24px;

  /* Navigation */
  --nav-height-desktop: 72px;
  --nav-height-tablet:  64px;
  --nav-height-mobile:  56px;

  /* Breakpoints */
  --breakpoint-mobile:  640px;
  --breakpoint-tablet:  768px;
  --breakpoint-desktop: 992px;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Dashboard Layout ───────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
}

/* Sidebar colapsado (para estado futuro) */
.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span:not(.nav-icon):not(.nav-dot),
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-section-label {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
}

.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header .brand-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.sidebar-header h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: var(--blue-light);
  color: var(--blue);
}

.nav-item .nav-dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #E2E8F0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.sidebar-user-info p { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.sidebar-user-info span { font-size: 0.72rem; color: var(--text-muted); }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: 64px;
  min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.topbar-left {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 12px 12px;
}

.topbar-left .sidebar-toggle {
  grid-row: 1 / 3;
}

.topbar-left .topbar-breadcrumb {
  grid-column: 2;
  grid-row: 1;
}

.topbar-left .page-title {
  grid-column: 2;
  grid-row: 2;
}

.topbar-breadcrumb {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.sidebar-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-profile { display: flex; align-items: center; gap: 10px; }
.user-profile strong { font-size: 0.875rem; font-weight: 700; color: var(--text); }

/* ── Page Scroll Area ───────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

/* ── KPI Grid & Cards ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.kpi-card.accent-orange { border-left: 4px solid var(--orange); }
.kpi-card.accent-blue   { border-left: 4px solid var(--blue); }
.kpi-card.accent-green  { border-left: 4px solid var(--success); }

/* ── Tables ─────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg);
}

.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 11px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-blue    { background: var(--blue-light); color: var(--blue);    border: 1px solid var(--blue-border); }
.badge-orange  { background: var(--orange-light); color: var(--orange); border: 1px solid var(--orange-border); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s, box-shadow 0.12s;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 2px 8px rgba(248,111,3,0.25);
}
.btn-primary:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248,111,3,0.3);
}

.btn-blue {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,127,255,0.25);
}
.btn-blue:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger:hover { background: #FEE2E2; }
.btn-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,127,255,0.12);
}

select.form-control { cursor: pointer; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  display: none;
}
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.alert-info    { background: var(--blue-light); color: var(--blue);    border: 1px solid var(--blue-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* ── Loader ──────────────────────────────────────────────────── */
.loader {
  border: 3px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: 50%;
  width: 22px; height: 22px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Chart container ─────────────────────────────────────────── */
.chart-container { position: relative; }

/* ── Misc Utilities ──────────────────────────────────────────── */
h1, h2, h3, h4 { color: var(--text); }
p { line-height: 1.6; }
hr { border: none; border-top: 1px solid var(--border); }

.text-muted { color: var(--text-muted); }
.text-orange { color: var(--orange); }
.text-blue   { color: var(--blue); }

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 64px; min-width: 64px; }
  .sidebar-header h2, .nav-item span:not(.nav-icon):not(.nav-dot), .sidebar-user-info, .nav-section-label { display: none; }
  .nav-item .nav-icon { display: inline-flex; }
  .nav-item { justify-content: center; padding: 10px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}

/* Dashboard Gryphon */
.dashboard-gryphon-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.dashboard-gryphon-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.dashboard-gryphon-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.dashboard-gryphon-device {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.dashboard-gryphon-device-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.dashboard-gryphon-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.dashboard-gryphon-meta {
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.dashboard-gryphon-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.dashboard-gryphon-total {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.dashboard-gryphon-total span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.dashboard-gryphon-total strong {
  color: var(--text);
  font-size: 1rem;
}

.dashboard-gryphon-tubes {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 10px;
  align-items: end;
}

.dashboard-gryphon-tube {
  text-align: center;
  min-width: 0;
}

.dashboard-gryphon-denom {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.dashboard-gryphon-bar {
  position: relative;
  width: 28px;
  height: 82px;
  margin: 0 auto;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(15,23,42,0.08);
}

.dashboard-gryphon-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 2px;
  border-radius: 0 0 5px 5px;
}

.dashboard-gryphon-qty {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 5px;
}

@media (max-width: 768px) {
  .dashboard-gryphon-head,
  .dashboard-gryphon-device-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-gryphon-list {
    grid-template-columns: 1fr;
  }
  .dashboard-gryphon-tubes {
    gap: 8px;
  }
}

/* ============================================================
   SARA V2 visual refresh + access-control screens
   ============================================================ */
body.app-body,
body.auth-body {
  background: var(--bg);
  color: var(--text);
  display: block;
  align-items: initial;
  justify-content: initial;
  min-height: 100vh;
}

.access-banner {
  background: linear-gradient(135deg, var(--orange-light) 0%, rgba(248, 111, 3, 0.05) 100%);
  border-bottom: 2px solid var(--orange-border);
  color: var(--text);
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-xl);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: 20;
  animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.access-banner a {
  background: var(--orange);
  color: #fff;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.access-banner a:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(248, 111, 3, 0.3);
}

.brand-icon,
.nav-icon,
.btn svg,
.feature-card > span,
.summary-tile > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-header .brand-icon {
  color: var(--orange);
}

.nav-item .nav-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  color: var(--blue);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.btn.compact,
.topbar-btn {
  width: auto;
  font-size: 0.8rem;
  padding: 7px 12px;
}

.page-content > .alert,
.auth-body .alert {
  display: block;
}

.app-body .form-group {
  margin-bottom: 14px;
  text-align: left;
}

.app-body .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 5px;
}

.app-body .form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
}

.app-body .form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,127,255,0.12);
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.auth-body {
  min-height: 100vh;
  overflow: auto;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 40%) minmax(0, 60%);
  background: var(--bg);
}

.auth-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.auth-form-wrap {
  width: 100%;
  max-width: 360px;
}

.login-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.login-back-link:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
  text-decoration: none;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand .login-brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  margin: 0 auto 18px;
  font-size: initial;
}

.auth-brand h1 {
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-with-icon .form-control {
  padding-left: 40px;
}

.auth-body .form-group {
  margin-bottom: 16px;
}

.auth-body .form-group label {
  color: var(--text-2);
  font-size: 0.86rem;
}

.auth-body .form-control {
  border-width: 1px;
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 0.92rem;
}

.auth-body .login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 127, 255, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font);
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  margin-top: 6px;
}

.auth-body .login-btn:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
}

.auth-body .login-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  color: var(--border-2);
  font-size: 0.86rem;
}

.auth-body .login-links a {
  color: var(--blue);
  margin: 0;
  font-weight: 700;
}

.auth-note {
  text-align: center;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-help {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 64px;
}

.auth-help-inner {
  max-width: 760px;
}

.section-eyebrow {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.auth-help h2 {
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 14px;
}

.auth-help p {
  color: var(--text-2);
  max-width: 680px;
}

.auth-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 26px 0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.auth-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.auth-preview-head div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-preview-head strong {
  font-size: 0.92rem;
}

.auth-preview-head > span {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(79, 127, 255, 0.14);
}

.auth-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.auth-preview-grid div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.auth-preview-grid small,
.auth-preview-bars span {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.auth-preview-grid strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
}

.auth-preview-bars {
  display: grid;
  gap: 10px;
}

.auth-preview-bars label {
  display: grid;
  gap: 5px;
}

.auth-preview-bars label::after {
  content: "";
  display: block;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  grid-row: 2;
  grid-column: 1;
}

.auth-preview-bars i {
  display: block;
  height: 8px;
  background: var(--blue);
  border-radius: 999px;
  grid-row: 2;
  grid-column: 1;
  z-index: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.tag-row span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.help-card,
.panel-card,
.home-plan-card,
.summary-tile,
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.help-card {
  padding: 22px;
  min-height: 190px;
}

.help-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  margin-bottom: 14px;
}

.help-card:first-child h3 svg {
  color: var(--orange);
}

.help-card:last-child h3 svg {
  color: var(--blue);
}

.help-card ul {
  color: var(--text-2);
  font-size: 0.88rem;
  padding-left: 18px;
}

.help-card li {
  margin: 8px 0;
}

.home-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.home-hero h2 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.home-hero p {
  color: var(--text-2);
  max-width: 720px;
}

.home-plan-card {
  min-width: 220px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.home-plan-card strong {
  font-size: 1.05rem;
}

.home-plan-card small,
.panel-card small,
.feature-card small,
.admin-user-row small {
  color: var(--text-muted);
  font-weight: 600;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.summary-tile {
  padding: 18px;
  display: grid;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.summary-tile:hover {
  text-decoration: none;
  border-color: var(--blue-border);
}

.summary-tile span {
  color: var(--blue);
  width: 36px;
  height: 36px;
  background: var(--blue-light);
  border-radius: var(--radius);
}

.summary-tile strong {
  font-size: 1.1rem;
}

.panel-card {
  padding: 22px;
  margin-bottom: 20px;
}

.panel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-card-header h3 {
  font-size: 1.3rem;
  font-weight: 900;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.feature-card {
  padding: 14px;
  display: flex;
  gap: 11px;
  align-items: center;
}

.feature-card > span {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--blue-light);
  color: var(--blue);
  flex-shrink: 0;
}

.feature-card strong {
  display: block;
  font-size: 0.9rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}



.user-list-card,
.permissions-card {
  margin-bottom: 0;
}

/* ── Tabs de dispositivos (admin) ───────────────────────── */
.devices-tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.devices-tab {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: var(--font);
}

.devices-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.devices-tab.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.admin-user-list {
  display: grid;
  gap: 8px;
}

.admin-user-row {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  text-decoration: none;
}

.admin-user-row:hover,
.admin-user-row.active {
  border-color: var(--blue);
  background: var(--blue-light);
  text-decoration: none;
}

.admin-user-row span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-user-row em {
  font-style: normal;
  color: var(--blue);
}

.permissions-form {
  display: grid;
  gap: 18px;
}

.permissions-meta-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}

.permissions-meta-grid label span {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.permissions-meta-grid input {
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font);
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.permission-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.permission-item input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.permission-item strong {
  display: block;
  font-size: 0.88rem;
}

.permission-item small {
  color: var(--text-muted);
  line-height: 1.4;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Admin: Asignación de equipos visibles ──────────────────── */
.admin-permissions-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 20px;
  align-items: start;
}

.device-assign-card {
  grid-column: 1 / -1; /* ocupa todo el ancho debajo de los dos paneles */
}

.device-assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.device-assign-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface);
  user-select: none;
}

.device-assign-item:hover {
  border-color: var(--blue-border);
  background: var(--blue-light);
}

.device-assign-item.assigned {
  border-color: var(--orange);
  background: rgba(248, 111, 3, 0.06);
}

.device-assign-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
  flex-shrink: 0;
}

.device-assign-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.device-assign-label strong {
  font-size: 0.85rem;
  color: var(--text);
}

.device-assign-label small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .auth-help {
    padding: 32px 22px;
  }
  .auth-help-grid,
  .admin-summary-grid,
  .admin-permissions-layout,
  .permissions-meta-grid {
    grid-template-columns: 1fr;
  }
  .home-hero {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .sidebar-header .brand-icon {
    margin: 0 auto;
  }
  .nav-item .nav-icon {
    margin: 0;
  }
  .topbar {
    padding: 0 14px;
  }
  .topbar-right {
    gap: 6px;
  }
  .user-profile strong {
    display: none;
  }
}

/* Dashboard and operational screens in Gemini style */
body.app-body {
  background: var(--bg);
}

.app-body .dashboard-layout {
  background: var(--bg);
}

.app-body .sidebar {
  width: 256px;
  min-width: 256px;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.02);
}

.app-body .sidebar.collapsed {
  width: 74px;
  min-width: 74px;
}

.app-body .sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-body .sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-body .sidebar.collapsed .nav-item .nav-dot {
  display: none;
}

.app-body .sidebar-header {
  height: 66px;
  padding: 0 18px;
  justify-content: flex-start;
}

.app-body .sidebar-header .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.app-body .sidebar-nav {
  padding: 22px 12px;
  gap: 7px;
}

.app-body .nav-item {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 700;
}

.app-body .nav-item.active {
  background: rgba(79, 127, 255, 0.1);
  color: var(--blue);
}

.app-body .nav-item:hover {
  background: var(--surface-2);
}

.app-body .topbar {
  min-height: 78px;
  height: auto;
  padding: 16px 24px;
  align-items: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-body .topbar-breadcrumb {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.app-body .page-title {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0;
}

.app-body .page-content {
  padding: 24px;
}

.page-filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.page-filter-bar .filter-block {
  min-width: 160px;
  flex: 1 1 180px;
}

.page-filter-bar .filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 2 1 360px;
}

.quick-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}

.quick-filter {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 7px 10px;
  font: 700 0.76rem var(--font);
  cursor: pointer;
}

.quick-filter:hover {
  background: var(--surface-2);
  color: var(--text);
}
.quick-filter.active {
  background: var(--orange);
  color: #fff;
}

.status-banner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.status-banner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.dashboard-kpi-grid .kpi-card,
.status-banner-card,
.table-card,
.chart-card,
.reminder-card,
.tank-card {
  border-radius: 14px;
}

.dashboard-kpi-grid .kpi-card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tank-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.tank-card-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tank-card-body {
  flex: 1;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tank-visual {
  position: relative;
  width: 150px;
  height: 250px;
  background: var(--surface);
  border: 4px solid var(--border);
  border-radius: 28px 28px 14px 14px;
  overflow: hidden;
  box-shadow: inset 0 2px 12px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: flex-end;
}

.tank-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #7FA4FF 0%, var(--blue) 100%);
  transition: height 0.7s ease;
}

.tank-fill::before {
  content: "";
  display: block;
  height: 8px;
  background: rgba(255,255,255,0.26);
}

.tank-measurements {
  position: absolute;
  inset: 18px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.tank-measurements > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tank-measurements > div > div {
  opacity: 0.45;
}

.tank-measurements span {
  color: #000000;
  font-size: 0.62rem;
  font-weight: 900;
}

.tank-stats {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  width: min(100%, 220px);
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.chart-card,
.table-card,
.reminder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  margin-top: 22px;
}

.dashboard-main-grid > .chart-card {
  grid-column: 1 / -1;
  margin-top: 0;
}

.card-body {
  padding: 20px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-row,
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.heatmap-grid {
  margin-top: 22px;
}

.heatmap-grid .chart-card:first-child {
  grid-column: 1 / -1;
}

.chart-wrapper {
  position: relative;
  min-height: 260px;
}

.table-card-header,
.reminder-card-header {
  background: rgba(248, 250, 252, 0.72);
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-inner {
  overflow-x: auto;
}

.reminder-body {
  padding: 16px 18px;
}

.reminder-footer {
  border-top: 1px solid var(--border);
  padding: 12px 18px;
}

.dashboard-gryphon-panel {
  margin-bottom: 22px;
}

.dashboard-gryphon-panel.hidden {
  display: none;
}

.dashboard-gryphon-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.dashboard-gryphon-sub {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.dashboard-gryphon-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.device-config-section {
  margin-top: 24px;
}

.device-config-section > h2 {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 14px;
}

#output-map-card,
#input-map-card {
  border-left: 4px solid var(--blue);
}

#output-map-reported-grid span,
#output-map-reported-grid div,
#input-map-reported-grid span,
#input-map-reported-grid div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

@media (max-width: 1100px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
  .tank-card {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .app-body .dashboard-layout {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }
  .app-body .sidebar {
    width: 74px;
    min-width: 74px;
  }
  .app-body .sidebar-header h2,
  .app-body .nav-item span:not(.nav-icon):not(.nav-dot),
  .app-body .sidebar-user-info {
    display: none;
  }
  .sidebar-toggle {
    display: none;
  }
  .app-body .nav-item .nav-icon {
    display: inline-flex;
  }
  .app-body .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar-left {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 8px 12px;
  }

  .topbar-left .sidebar-toggle {
    grid-row: 1 / 3;
  }
  .dashboard-kpi-grid,
  .status-banner-grid,
  .chart-row,
  .heatmap-grid {
    grid-template-columns: 1fr;
  }
  .page-content {
    padding: 16px;
  }
}

/* Standalone Home before dashboard */
body.panel-home-body {
  background: var(--bg);
  display: block;
  min-height: 100vh;
  color: var(--text);
}

.panel-home-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.panel-home-topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 74px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  margin-bottom: 24px;
}

.panel-home-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-home-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-home-brand strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.2;
}

.panel-home-brand span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.panel-home-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-pill i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: block;
}

.plan-pill.is-free {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

.plan-pill.is-free i {
  background: var(--warning);
}

.plan-pill.is-business {
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  color: var(--blue);
}

.plan-pill.is-business i {
  background: var(--blue);
}

.panel-home-alert {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.panel-home-welcome {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  display: grid;
  grid-template-columns: 1fr 250px;
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.panel-home-welcome::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 240px;
  height: 180px;
  background: linear-gradient(135deg, rgba(248, 111, 3, 0.06), transparent);
  pointer-events: none;
}

.panel-home-welcome-copy {
  position: relative;
  z-index: 1;
}

.panel-home-welcome h1 {
  font-size: 2.1rem;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.panel-home-welcome p {
  color: var(--text-2);
  max-width: 700px;
  font-size: 1rem;
}

.panel-home-meter {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.panel-home-meter-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-weight: 900;
  margin-bottom: 16px;
}

.panel-home-meter-head span {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--blue-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel-home-meter-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.panel-home-meter-row span {
  color: var(--text-muted);
  font-weight: 700;
}

.panel-home-meter-track {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.panel-home-meter-track i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
}

.panel-home-admin {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.panel-home-admin a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.panel-home-admin a:hover {
  border-color: var(--blue);
  text-decoration: none;
}

.panel-home-admin span {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-light);
  color: var(--blue);
}

.panel-home-admin small {
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-home-admin strong {
  font-size: 1.2rem;
}

.panel-home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.panel-home-card-head {
  padding: 26px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.panel-home-card-head h2 {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.panel-home-card-head p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.status-chip {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.feature-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  padding: 28px;
}

.feature-columns h3 {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.feature-columns h3.business-title {
  color: var(--blue);
}

.feature-columns h3.admin-title {
  color: var(--orange);
}

.feature-note {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: -4px 0 16px;
  max-width: 420px;
}

.feature-columns ul {
  list-style: none;
  display: grid;
  gap: 13px;
}

.feature-columns li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 700;
}

.feature-columns li svg {
  color: var(--blue);
  flex-shrink: 0;
}

.panel-home-actions {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 860px) {
  .panel-home-topbar,
  .panel-home-card-head {
    align-items: stretch;
    flex-direction: column;
  }
  .panel-home-account {
    justify-content: flex-start;
  }
  .panel-home-welcome {
    grid-template-columns: 1fr;
  }
  .panel-home-admin {
    grid-template-columns: 1fr;
  }
}

/* Public landing */
body.landing-body {
  min-height: 100%;
  background: #f8fafc;
  color: var(--text);
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-2xl);
  min-height: var(--nav-height-desktop);
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.landing-brand,
.landing-login,
.landing-nav nav {
  display: flex;
  align-items: center;
}

.landing-brand {
  gap: var(--spacing-sm);
  color: var(--text);
  text-decoration: none;
}

.landing-brand span {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--orange);
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
}

.landing-brand strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.nav-toggle {
  display: none;
}

.landing-nav nav {
  gap: 22px;
}

.landing-nav nav a {
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 800;
  transition: color 0.2s ease;
}

.landing-nav nav a:hover {
  color: var(--text);
}

/* Tabs system for landing nav */
.landing-tabs-nav {
  display: flex !important;
  gap: var(--spacing-lg);
  position: relative;
}

.landing-tabs-nav::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
}

.tab-link {
  position: relative;
  padding: var(--spacing-md) 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.tab-link:hover {
  color: var(--text-2);
}

.tab-link.active {
  color: var(--blue);
}

.tab-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
  animation: slideRight 0.3s ease;
}

@keyframes slideRight {
  from {
    width: 0;
    left: 50%;
  }
  to {
    width: 100%;
    left: 0;
  }
}

.landing-tabs-container {
  position: relative;
}

.landing-tab {
  display: none;
  animation: fade-in 0.3s ease;
  scroll-margin-top: 72px;
}

.landing-tab.active {
  display: block;
  padding-top: 20px;
}

.landing-login {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.landing-login:hover {
  border-color: var(--text);
  background: var(--surface-2);
}

.landing-hero,
.landing-section,
.landing-contact,
.landing-footer {
  width: min(1180px, calc(100% - 36px));
  margin-left: auto;
  margin-right: auto;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 52px 0;
}

.landing-eyebrow {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.landing-hero h1 {
  max-width: 720px;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  font-weight: 900;
}

.landing-hero-copy > p:not(.landing-eyebrow) {
  max-width: 640px;
  margin-top: 22px;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.7;
}

.landing-actions,
.landing-proof,
.landing-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.landing-actions {
  margin-top: 30px;
}

.landing-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.landing-btn:hover {
  text-decoration: none;
}

.landing-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.landing-btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 12px 24px rgba(248, 111, 3, 0.22);
}

.landing-btn-primary:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(248, 111, 3, 0.32);
}

.landing-btn-secondary {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
}

.landing-btn-secondary:hover {
  border-color: var(--text-2);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.landing-btn.is-disabled {
  opacity: 0.62;
  cursor: default;
  transform: none !important;
}

.landing-proof {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.landing-proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.landing-proof svg {
  color: var(--success);
}

.landing-visual {
  min-height: 520px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94)),
    repeating-linear-gradient(90deg, rgba(79,127,255,0.06) 0 1px, transparent 1px 26px);
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
}

.board-visual {
  width: min(360px, 82%);
  aspect-ratio: 1.35;
  position: relative;
  border-radius: 18px;
  background: linear-gradient(135deg, #133f3f, #0f766e);
  border: 1px solid rgba(15, 118, 110, 0.45);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,0.05), 0 22px 40px rgba(15,23,42,0.18);
}

.board-visual.compact {
  width: min(320px, 100%);
}

.board-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 118px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.board-port,
.board-line {
  position: absolute;
  display: block;
}

.board-port {
  width: 58px;
  height: 15px;
  border-radius: 5px;
  background: rgba(255,255,255,0.9);
}

.board-port.p1 { left: 28px; top: 32px; }
.board-port.p2 { right: 28px; top: 38px; }
.board-port.p3 { right: 34px; bottom: 34px; }

.board-line {
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
}

.board-line.l1 { left: 88px; top: 40px; width: 92px; }
.board-line.l2 { right: 88px; top: 46px; width: 82px; }
.board-line.l3 { right: 94px; bottom: 42px; width: 116px; }

.board-module {
  position: absolute;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 12px 20px rgba(15,23,42,0.12);
}

.board-module.m1 { left: 22px; bottom: 30px; }
.board-module.m2 { right: 26px; top: 86px; }
.board-module.m3 { left: 132px; top: 24px; }

.landing-panel-preview {
  position: absolute;
  right: 34px;
  bottom: 30px;
  width: 230px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  box-shadow: 0 18px 36px rgba(15,23,42,0.14);
}

.preview-top {
  height: 8px;
  width: 86px;
  border-radius: 999px;
  background: var(--blue);
}

.preview-metric {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.preview-metric strong {
  color: var(--text);
}

.preview-chart {
  height: 64px;
  display: flex;
  align-items: end;
  gap: 8px;
}

.preview-chart i {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: var(--blue-light);
}

.preview-chart i:nth-child(1) { height: 38%; }
.preview-chart i:nth-child(2) { height: 68%; background: var(--orange-light); }
.preview-chart i:nth-child(3) { height: 52%; }
.preview-chart i:nth-child(4) { height: 82%; background: var(--orange); }

.landing-section {
  padding: 64px 0;
}

.landing-section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.landing-section-head h2,
.landing-business h2,
.landing-contact h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.landing-section-head p:not(.landing-eyebrow),
.landing-business p,
.landing-contact p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.68;
}

.landing-feature-grid,
.landing-hardware-grid,
.landing-resource-row {
  display: grid;
  gap: 16px;
}

.landing-feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.landing-feature-grid article,
.landing-hardware-grid article,
.landing-resource-row a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.landing-feature-grid svg,
.landing-resource-row svg {
  color: var(--blue);
  margin-bottom: 14px;
}

.landing-feature-grid h3,
.landing-hardware-grid strong,
.landing-resource-row strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.landing-feature-grid p,
.landing-hardware-grid span,
.landing-resource-row span {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.6;
}

.landing-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.landing-flow div {
  position: relative;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.landing-flow span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-light);
}

.landing-flow strong {
  font-size: 1rem;
  font-weight: 900;
}

.landing-flow small {
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.5;
}

.landing-hardware-grid {
  grid-template-columns: repeat(4, 1fr);
}

.landing-business,
.landing-contact {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 34px;
  align-items: center;
  padding: clamp(26px, 5vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(15,23,42,0.06);
}

.landing-business ul {
  list-style: none;
  display: grid;
  gap: 13px;
}

.landing-business li {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text-2);
  font-weight: 800;
}

.landing-business li svg {
  color: var(--success);
  flex-shrink: 0;
}

.landing-resource-row {
  grid-template-columns: repeat(3, 1fr);
}

.landing-resource-row a {
  color: inherit;
  text-decoration: none;
}

.landing-contact {
  margin-top: 60px;
  margin-bottom: 38px;
  background: #0f172a;
  color: #fff;
}

.landing-contact .landing-eyebrow {
  color: #93c5fd;
}

.landing-contact h2 {
  color: #fff;
}

.landing-contact p {
  color: rgba(255,255,255,0.72);
}

.landing-contact-actions {
  justify-content: flex-end;
}

.landing-contact .landing-btn-secondary {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}

.landing-contact-form-section {
  padding-top: 12px;
}

.service-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.public-service-form {
  max-width: 900px;
}

.service-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.service-form label {
  display: grid;
  gap: 7px;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 900;
}

.service-form input,
.service-form textarea {
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 11px 12px;
  outline: none;
}

.service-form textarea {
  resize: vertical;
  min-height: 128px;
}

.service-form input:focus,
.service-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 127, 255, 0.12);
}

.service-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.service-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.service-form button:disabled .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
}

.contact-status {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.contact-status.is-success {
  color: var(--success);
}

.contact-status.is-error {
  color: var(--color-error);
}

.contact-status.is-error {
  color: var(--danger);
}

.contact-hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.landing-muted {
  color: rgba(255,255,255,0.74);
  font-size: 0.9rem;
  font-weight: 800;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 42px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

/* Private docs */
.docs-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.docs-hero h2 {
  font-size: 1.8rem;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.docs-hero p:not(.section-eyebrow) {
  max-width: 760px;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.65;
}

.docs-private-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.docs-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

.docs-subnav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.docs-subnav a.active {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--blue-border);
}

.docs-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.docs-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.docs-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.docs-topic-card,
.docs-info-card,
.docs-diagnostic-card,
.docs-download-card,
.docs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.docs-topic-card,
.docs-info-card,
.docs-diagnostic-card {
  padding: 22px;
}

.docs-topic-card {
  color: inherit;
  text-decoration: none;
}

.docs-topic-card:hover {
  text-decoration: none;
  border-color: var(--blue-border);
}

.docs-topic-card svg,
.docs-info-card svg {
  color: var(--blue);
  margin-bottom: 14px;
}

.docs-topic-card h3,
.docs-info-card h3,
.docs-diagnostic-card h3,
.docs-download-card h3,
.docs-panel h3 {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.docs-topic-card p,
.docs-info-card p,
.docs-diagnostic-card li,
.docs-download-card p,
.docs-panel p {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.62;
}

.docs-topic-muted {
  background: var(--surface-2);
}

.docs-panel {
  padding: 24px;
  margin-bottom: 18px;
}

.docs-panel-head {
  margin-bottom: 18px;
}

.docs-panel-head h3 {
  font-size: 1.25rem;
}

.docs-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 26px;
  align-items: center;
}

.docs-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #92400e !important;
  font-weight: 800;
}

.docs-board-placeholder {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 20px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
}

.docs-board-placeholder small {
  color: var(--text-muted);
  font-weight: 800;
}

.docs-architecture,
.docs-flow-wide {
  display: grid;
  align-items: center;
  gap: 10px;
}

.docs-architecture {
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
}

.docs-flow-wide {
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
}

.docs-architecture div,
.docs-flow-wide div {
  min-height: 136px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 9px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.docs-architecture span,
.docs-flow-wide span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--blue-light);
  color: var(--blue);
}

.docs-architecture strong,
.docs-flow-wide strong {
  color: var(--text);
  font-weight: 900;
}

.docs-architecture small,
.docs-flow-wide small {
  color: var(--text-2);
  font-size: 0.78rem;
  line-height: 1.45;
}

.docs-architecture i,
.docs-flow-wide i {
  height: 2px;
  background: var(--border-2);
  border-radius: 999px;
}

.docs-checklist,
.docs-warning-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.docs-checklist span,
.docs-warning-list span {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
}

.docs-checklist svg {
  color: var(--success);
  flex-shrink: 0;
}

.docs-warning-list span {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #92400e;
}

.docs-mini-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.docs-mini-flow span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.docs-steps {
  list-style: none;
  display: grid;
  gap: 12px;
  counter-reset: docsStep;
}

.docs-steps li {
  counter-increment: docsStep;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.docs-steps li::before {
  content: counter(docsStep);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

.docs-steps strong {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
}

.docs-steps span {
  display: block;
  margin-top: 3px;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.docs-diagnostic-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
}

.docs-diagnostic-card h3 svg {
  color: var(--orange);
}

.docs-diagnostic-card ul {
  list-style: none;
  display: grid;
  gap: 9px;
}

.docs-diagnostic-card li {
  position: relative;
  padding-left: 18px;
}

.docs-diagnostic-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.docs-download-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.docs-download-card > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--blue-light);
  color: var(--blue);
}

.docs-download-card small {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

/* Tablet (768px - 991px) */
@media (max-width: 768px) {
  .landing-nav {
    min-height: var(--nav-height-tablet);
  }
}

@media (max-width: 992px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: var(--spacing-sm);
    cursor: pointer;
    z-index: 31;
  }

  .nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: translateY(12px) rotate(45deg);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-12px) rotate(-45deg);
  }

  .landing-nav nav {
    position: fixed;
    left: -100%;
    top: var(--nav-height-tablet);
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    width: 100%;
    height: calc(100vh - var(--nav-height-tablet));
    padding: var(--spacing-lg) var(--spacing-lg);
    gap: var(--spacing-lg);
    overflow-y: auto;
    transition: left 0.3s ease;
    border-bottom: 1px solid var(--border);
    z-index: 30;
  }

  .landing-nav nav.active {
    left: 0;
  }

  .landing-nav nav a {
    display: block;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-2);
    font-size: 1rem;
  }

  .landing-nav nav a:last-child {
    border-bottom: none;
  }
  .landing-hero,
  .landing-business,
  .landing-contact,
  .docs-split {
    grid-template-columns: 1fr;
  }
  .landing-visual {
    min-height: 440px;
  }
  .landing-feature-grid,
  .landing-hardware-grid,
  .landing-resource-row,
  .landing-flow,
  .service-form-grid,
  .docs-grid-2,
  .docs-grid-3,
  .docs-checklist,
  .docs-warning-list {
    grid-template-columns: 1fr;
  }
  .docs-architecture,
  .docs-flow-wide {
    grid-template-columns: 1fr;
  }
  .docs-architecture i,
  .docs-flow-wide i {
    width: 2px;
    height: 22px;
    justify-self: center;
  }
}

/* ── Welcome Onboarding Section ────────────────────────────── */
.welcome-section {
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, var(--blue-light) 0%, rgba(79, 127, 255, 0.05) 100%);
  margin-bottom: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.welcome-card {
  max-width: 1100px;
  margin: 0 auto;
}

.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-xl);
}

.welcome-header h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--blue);
  margin: 0;
  letter-spacing: -0.02em;
}

.welcome-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.welcome-close:hover {
  color: var(--text);
  transform: rotate(90deg);
}

.welcome-subtitle {
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0 0 var(--spacing-xl) 0;
  font-weight: 500;
}

.welcome-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.welcome-step {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: var(--spacing-lg);
  border-radius: var(--radius);
  border: 1px solid rgba(79, 127, 255, 0.2);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.welcome-step:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--blue-border);
  box-shadow: 0 8px 24px rgba(79, 127, 255, 0.15);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: var(--spacing-md);
}

.welcome-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--spacing-sm) 0;
}

.welcome-step p {
  font-size: 0.9rem;
  color: var(--text-2);
  margin: 0 0 var(--spacing-md) 0;
  flex: 1;
  line-height: 1.5;
}

.btn-small {
  font-size: 0.85rem;
  padding: var(--spacing-sm) var(--spacing-md);
  height: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-small:hover {
  transform: translateY(-1px);
}

/* Modal & Dialog Transitions */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
}

.modal-overlay.active .modal-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
  transform: rotate(90deg);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-width: 400px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
  animation: toast-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
}

.toast.success {
  border-left-color: var(--green, #10b981);
}

.toast.error {
  border-left-color: var(--red, #ef4444);
}

.toast.warning {
  border-left-color: var(--orange);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
}

.toast-message {
  font-size: 0.9rem;
  color: var(--text-2);
  margin: 0;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--text);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
  display: block;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 12px;
}

.skeleton-text.large {
  height: 24px;
  margin-bottom: 16px;
}

.skeleton-text.small {
  height: 12px;
  width: 70%;
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  gap: var(--spacing-md);
  display: flex;
  flex-direction: column;
}

.skeleton-kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-kpi .skeleton-text.large {
  width: 80%;
}

.skeleton-table-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.skeleton-table-row .skeleton {
  height: 20px;
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  min-height: 240px;
  background: linear-gradient(135deg, rgba(79, 127, 255, 0.02) 0%, rgba(248, 111, 3, 0.02) 100%);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  gap: var(--spacing-lg);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.8rem;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.empty-state-message {
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0;
  max-width: 400px;
  line-height: 1.5;
}

.empty-state-action {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--spacing-md);
}

.empty-state-action .btn {
  font-size: 0.9rem;
  padding: var(--spacing-sm) var(--spacing-lg);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Empty state in table cells */
.table-empty {
  text-align: center;
  padding: var(--spacing-2xl) !important;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
}

.table-empty-icon {
  display: block;
  margin-bottom: var(--spacing-md);
  font-size: 2rem;
  opacity: 0.6;
}

/* Button & Interactive Polish */
.btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:not(.is-disabled):hover {
  transform: translateY(-1px);
}

.btn:not(.is-disabled):active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
  pointer-events: none;
}

.btn:not(.is-disabled):hover::before {
  left: 100%;
}

/* Link hover effects */
a:not(.btn) {
  transition: color 0.2s ease;
  position: relative;
  text-decoration-color: rgba(79, 127, 255, 0.4);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

a:not(.btn):hover {
  text-decoration-color: var(--blue);
}

/* Form input polish */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 127, 255, 0.1);
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
input[type="date"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

/* Loading state indicator */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Card Polish & Depth */
.kpi-card {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.table-card {
  transition: all 0.3s ease;
}

.table-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Data table row hover */
.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

/* Status badges polish */
.badge {
  transition: all 0.2s ease;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.badge:hover {
  transform: scale(1.05);
}

/* Status colors */
.state-success {
  color: var(--color-success);
}

.state-error {
  color: var(--color-error);
}

.state-warning {
  color: var(--color-warning);
}

.state-info {
  color: var(--color-info);
}

/* Form error states */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
  font-size: 0.85rem;
  color: var(--color-error);
  margin-top: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
  animation: fade-in 0.2s ease;
}

.form-success {
  font-size: 0.85rem;
  color: var(--color-success);
  margin-top: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* Form Input Error State */
.form-error {
  color: var(--color-error);
  font-size: 0.75rem;
  margin-top: 4px;
  display: block;
  animation: fade-in 0.2s ease;
}

input[style*="border-color: var(--color-error)"],
textarea[style*="border-color: var(--color-error)"],
select[style*="border-color: var(--color-error)"] {
  background-color: rgba(239, 68, 68, 0.02);
}

/* Disabled state */
.is-disabled,
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Content Animations */
.fade-in {
  animation: fade-in 0.3s ease forwards;
}

.slide-up {
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.slide-down {
  animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.scale-in {
  animation: scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger animation for lists */
.list-item {
  animation: fade-in 0.3s ease forwards;
}

.list-item:nth-child(1) { animation-delay: 0.05s; }
.list-item:nth-child(2) { animation-delay: 0.1s; }
.list-item:nth-child(3) { animation-delay: 0.15s; }
.list-item:nth-child(4) { animation-delay: 0.2s; }
.list-item:nth-child(5) { animation-delay: 0.25s; }
.list-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Welcome section entrance animation */
.welcome-section {
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.welcome-card {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.welcome-card:hover {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.welcome-step {
  animation: fade-in 0.3s ease forwards;
}

.welcome-step:nth-child(1) { animation-delay: 0.1s; }
.welcome-step:nth-child(2) { animation-delay: 0.2s; }
.welcome-step:nth-child(3) { animation-delay: 0.3s; }

/* Page section entrance animations */
.landing-section {
  animation: fade-in 0.4s ease forwards;
}

.landing-section:nth-child(n+2) {
  animation-delay: 0.1s;
}

.page-content {
  animation: fade-in 0.3s ease forwards;
}

/* Pricing Section */
.landing-pricing-section {
  background: transparent;
}

.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-2xl);
  margin-top: var(--spacing-2xl);
}

.pricing-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: var(--spacing-2xl);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease;
}

.pricing-card:hover {
  border-color: var(--blue-border);
  box-shadow: 0 16px 48px rgba(79, 127, 255, 0.15);
  transform: translateY(-4px);
}

.pricing-card-featured {
  border-color: var(--orange);
  background: linear-gradient(135deg, rgba(248, 111, 3, 0.02) 0%, rgba(79, 127, 255, 0.02) 100%);
}

.pricing-card-featured:hover {
  border-color: var(--orange);
  box-shadow: 0 16px 48px rgba(248, 111, 3, 0.2);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 12px;
  text-transform: uppercase;
}

.pricing-badge-featured {
  background: var(--orange);
}

.pricing-header {
  margin-bottom: var(--spacing-xl);
}

.pricing-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--spacing-md) 0;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pricing-price span {
  font-size: 1.1rem;
  font-weight: 600;
}

.pricing-price strong {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--blue);
}

.pricing-card-featured .pricing-price strong {
  color: var(--orange);
}

.pricing-price small {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-desc {
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0 0 var(--spacing-xl) 0;
  line-height: 1.4;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-xl) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.pricing-features svg {
  color: var(--blue);
  flex-shrink: 0;
}

.pricing-card-featured .pricing-features svg {
  color: var(--orange);
}

.landing-pricing-btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .welcome-section {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }

  .welcome-header h2 {
    font-size: 1.4rem;
  }

  .welcome-content {
    grid-template-columns: 1fr;
  }

  .landing-pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .pricing-card {
    padding: var(--spacing-lg);
  }

  .pricing-header h3 {
    font-size: 1.25rem;
  }

  .pricing-price strong {
    font-size: 2rem;
  }

  .empty-state {
    padding: var(--spacing-lg);
    min-height: 200px;
  }

  .empty-state-icon {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }

  .empty-state-title {
    font-size: 1rem;
  }

  .empty-state-message {
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .landing-nav {
    padding: 0 var(--spacing-lg);
  }
  .landing-brand strong {
    display: none;
  }
  .landing-hero,
  .landing-section,
  .landing-contact,
  .landing-footer {
    width: min(100% - var(--spacing-2xl), 1180px);
  }
  .landing-hero h1 {
    font-size: 2.55rem;
  }
  .landing-visual {
    min-height: 360px;
  }
  .landing-panel-preview {
    right: 14px;
    bottom: 14px;
    width: min(220px, calc(100% - 28px));
  }
  .landing-business,
  .landing-contact,
  .docs-hero {
    padding: 22px;
  }
  .landing-contact-actions {
    justify-content: flex-start;
  }
  .landing-footer,
  .docs-hero {
    flex-direction: column;
  }
  .docs-download-card {
    grid-template-columns: 42px 1fr;
  }
  .docs-download-card small {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* ── Pricing billing toggle ─────────────────────────────── */
.pricing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 8px;
}

.pricing-toggle-label {
  font-size: 0.95rem;
  color: var(--text-2);
  font-weight: 700;
  transition: font-weight 0.2s, color 0.2s;
  user-select: none;
}

.pricing-toggle {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--border-2, #cbd5e1);
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.pricing-toggle.active {
  background: var(--orange);
}

.pricing-toggle-thumb {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.pricing-toggle.active .pricing-toggle-thumb {
  transform: translateX(22px);
}

.pricing-savings-badge {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ============================================================
   MOBILE — Panel & Landing responsive polish
   Breakpoints: 576px (phone), 768px (tablet, already handled above)
   ============================================================ */

/* Prevent horizontal scroll on all pages */
html, body { overflow-x: hidden; }

/* iOS: prevent form input zoom (font-size must be ≥ 16px on mobile) */
@media (max-width: 576px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ── Panel: off-canvas sidebar on phones ────────────────────── */
@media (max-width: 576px) {
  /* Sidebar becomes a fixed drawer, hidden off-left by default */
  .app-body .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    bottom: 0;
    width: 240px;
    min-width: 240px;
    z-index: 200;
    box-shadow: none;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.28s ease;
  }

  /* Restore full sidebar text when drawer is open */
  .app-body .sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }

  .app-body .sidebar.mobile-open .sidebar-header h2,
  .app-body .sidebar.mobile-open .nav-item span:not(.nav-icon):not(.nav-dot),
  .app-body .sidebar.mobile-open .sidebar-user-info,
  .app-body .sidebar.mobile-open .nav-section-label {
    display: revert;
  }

  .app-body .sidebar.mobile-open .nav-item {
    justify-content: flex-start;
    padding: 10px 14px;
  }

  /* Backdrop when sidebar is open */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 199;
    backdrop-filter: blur(2px);
  }

  .app-body.sidebar-drawer-open .sidebar-backdrop {
    display: block;
  }

  /* Main content takes full width — no sidebar offset */
  .app-body .main-content {
    width: 100%;
    min-width: 0;
  }
}

/* ── Panel: topbar simplification on phones ─────────────────── */
@media (max-width: 576px) {
  .topbar {
    padding: 0 var(--spacing-md);
    height: 56px;
    min-height: 56px;
  }

  /* Hide breadcrumb — title alone is enough */
  .topbar-breadcrumb { display: none; }

  /* Collapse topbar-left to just toggle + title in a single row */
  .topbar-left {
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr;
    gap: 8px;
    align-items: center;
  }

  .topbar-left .sidebar-toggle { grid-row: 1; }

  .topbar-left .page-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.95rem;
  }

  /* Hide user info and secondary nav buttons */
  .topbar-right .user-profile { display: none; }
  .topbar-right .topbar-btn { display: none; }

  /* Show only the logout button — as icon-only */
  .topbar-right a[href*="logout"] {
    display: inline-flex !important;
    padding: 0;
    width: 36px;
    height: 36px;
    font-size: 0;       /* hide text */
    gap: 0;
    border-radius: var(--radius);
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
    align-items: center;
    justify-content: center;
  }

  .topbar-right a[href*="logout"] svg { font-size: initial; }
}

/* ── Panel: page content & grids on phones ──────────────────── */
@media (max-width: 576px) {
  .page-content { padding: var(--spacing-md); }

  /* KPI cards: 2 columns on phones (balanced for 4 KPIs) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
  /* 3-KPI grids (devices page): force 3 cols so they fit in one row */
  #devices-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  #devices-kpi-grid .kpi-card {
    padding: 12px 8px;
  }
  #devices-kpi-grid .kpi-value {
    font-size: 1.6rem;
  }
  #devices-kpi-grid .kpi-label {
    font-size: 0.7rem;
  }

  /* Tables: allow horizontal scroll instead of breaking layout */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Cards */
  .card { padding: var(--spacing-lg); }
}

/* ── Panel: access-banner wraps cleanly on phones ───────────── */
@media (max-width: 576px) {
  .access-banner {
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    font-size: 0.88rem;
    text-align: center;
    top: 0;
  }
}

/* ── Landing: tab nav drawer polish on mobile ───────────────── */
@media (max-width: 992px) {
  /* Remove the tab underline indicator in the vertical drawer */
  .landing-nav nav.active .tab-link::after { display: none; }
  .landing-nav nav.active .tab-link {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-2);
    border-radius: 0;
    width: 100%;
    text-align: left;
  }
  .landing-nav nav.active .tab-link:last-child { border-bottom: none; }
  .landing-nav nav.active .tab-link.active {
    color: var(--blue);
    background: var(--blue-light);
  }

  /* Hide the login link inside the drawer to avoid double display */
  .landing-nav nav.active ~ .landing-login { opacity: 0; pointer-events: none; }
}

/* ── Landing: tab nav overflow on small screens ─────────────── */
@media (max-width: 576px) {
  /* When closed, the tab nav is hidden — show it scrollable for ≥577 */
  .landing-nav nav:not(.active) {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .landing-nav nav:not(.active)::-webkit-scrollbar { display: none; }

  /* Reduce hero heading size further on small phones */
  .landing-hero h1 { font-size: 2rem; }

  /* Contact section padding */
  .landing-contact,
  .landing-business { padding: var(--spacing-lg); }
}

/* ── Touch target minimum sizes ─────────────────────────────── */
@media (max-width: 768px) {
  .btn, .nav-item, .tab-link, .landing-btn {
    min-height: 44px;
  }

  .nav-item {
    padding: 10px 14px;
  }

  /* Ensure form controls are tall enough */
  .form-control {
    padding: 11px 14px;
    min-height: 44px;
  }
}

/* ── Sidebar toggle: always 40×40 hit area ──────────────────── */
.sidebar-toggle {
  min-width: 40px;
  min-height: 40px;
}

/* ── Sidebar icon spacing in 64px mode ──────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 64px; min-width: 64px; }

  .nav-item {
    padding: 10px;
    justify-content: center;
  }

  /* Tooltip on hover for icon-only mode */
  .nav-item[data-label] {
    position: relative;
  }

  .nav-item[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    z-index: 30;
    pointer-events: none;
  }
}

/* ============================================================
   MOBILE BOTTOM NAV — Panel
   Inspired by spura.jov.mx mobile UX layer.
   Only shown on screens ≤ 576px.
   ============================================================ */

/* iOS safe-area support */
:root {
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top:    env(safe-area-inset-top,    0px);
  --bottom-nav-height: 58px;
}

/* Hidden by default, activated via media query */
.mobile-bottom-nav { display: none; }

@media (max-width: 576px) {
  /* ── Hide the desktop sidebar on mobile (it's off-canvas now) ── */
  .app-body .sidebar {
    /* Already positioned as off-canvas overlay in previous block */
  }

  /* ── Bottom nav bar ──────────────────────────────────────────── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    align-items: stretch;
    justify-content: space-around;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  /* ── Bottom nav items ────────────────────────────────────────── */
  .mobile-bottom-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 3px;
    padding: 6px 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease;
    font-family: var(--font);
    border-radius: 12px;
    min-height: 44px;
  }

  .mobile-bottom-nav__item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
  }

  .mobile-bottom-nav__item:hover,
  .mobile-bottom-nav__item:active {
    color: var(--blue);
    text-decoration: none;
  }

  .mobile-bottom-nav__item:active svg {
    transform: scale(0.9);
  }

  /* Active page item */
  .mobile-bottom-nav__item.active {
    color: var(--blue);
  }

  .mobile-bottom-nav__item.active::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--blue-light);
    border-radius: 10px;
    z-index: -1;
  }

  /* Menu (más) button — opens sidebar overlay */
  .mobile-bottom-nav__item--menu.drawer-open {
    color: var(--orange);
  }

  .mobile-bottom-nav__item--menu.drawer-open::before {
    background: var(--orange-light);
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    z-index: -1;
  }

  /* ── Add bottom padding so page content clears the bar ──────── */
  .page-content {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 1rem) !important;
  }

  /* ── Hide bar when native keyboard is visible ───────────────── */
  body.keyboard-visible .mobile-bottom-nav {
    transform: translateY(calc(100% + var(--safe-area-bottom)));
    opacity: 0;
    pointer-events: none;
  }

  body.keyboard-visible .page-content {
    padding-bottom: 1rem !important;
  }

  /* ── Topbar: hide toggle (replaced by bottom menu item) ─────── */
  /* Keep toggle visible — it's the "menu" action */
}

/* Label text under icon */
.mobile-bottom-nav__label {
  display: block;
  line-height: 1;
}

/* ── Data table: card layout on mobile ───────────────────────────────────
 * Add class="data-table--cards" to any complex table that needs this.
 * Each <td> must have data-label="Column Name" (set in JS when rendering).
 * ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .data-table--cards thead {
    display: none;
  }

  .data-table--cards,
  .data-table--cards tbody,
  .data-table--cards tbody tr {
    display: block;
    width: 100%;
  }

  .data-table--cards tbody tr {
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    margin-bottom: 0.75rem;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  }

  /* Loading / empty colspan rows — keep centered */
  .data-table--cards tbody td[colspan] {
    display: table-cell;
    text-align: center !important;
    padding: 1.5rem !important;
    border: none !important;
  }

  .data-table--cards tbody td[colspan]::before {
    content: none;
  }

  .data-table--cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 0.875rem;
    text-align: right !important;
  }

  .data-table--cards tbody td:last-child {
    border-bottom: none !important;
    padding-bottom: 0;
    font-weight: 700;
    font-size: 0.95rem;
  }

  /* Label from data-label attribute */
  .data-table--cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Multi-line cell (e.g. Contacto): label top-aligned, value stacks below on mobile */
  .data-table--cards tbody td.data-table--multiline {
    flex-direction: column;
    align-items: flex-start;
    text-align: left !important;
    gap: 3px;
  }
  .data-table--cards tbody td.data-table--multiline::before {
    margin-bottom: 2px;
  }

  /* Full-width cell (e.g. Mensaje): no label side-by-side, fills whole card row */
  .data-table--cards tbody td.data-table--full {
    flex-direction: column;
    align-items: flex-start;
    text-align: left !important;
    gap: 3px;
    font-weight: 400 !important;
    font-size: 0.85rem !important;
  }
  .data-table--cards tbody td.data-table--full::before {
    font-size: 0.75rem;
  }

  /* Sales filter controls: stack on mobile */
  #sales-table + * .btn,
  .sales-filters {
    width: 100%;
  }
}

/* ── Dashboard filter bar: grid layout on mobile ────────────────────── */
@media (max-width: 640px) {
  /* Convert flex filter bar to a 2-col grid */
  .page-filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 14px;
    gap: 10px;
    margin-bottom: 14px;
  }

  /* Full-width filter block (Equipo selector) */
  .page-filter-bar .filter-block:first-child,
  .page-filter-bar .filter-block.filter-block--full {
    grid-column: 1 / -1;
  }

  /* Desde + Hasta: share a row (1 col each) */
  .page-filter-bar .filter-block:not(:first-child):not(.filter-block--full) {
    grid-column: span 1;
  }

  /* Actions row: full width, wrap content */
  .page-filter-bar .filter-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-filter-bar .filter-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  /* Search input: full width, below buttons */
  .page-filter-bar .filter-actions #ventasSearch {
    flex: 0 0 100%;
    order: 3;
  }

  /* Quick-filter pill container: fill remaining space */
  .quick-filters {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  /* Section titles inside filter: tighter */
  .page-filter-bar .section-title {
    font-size: 0.7rem;
    margin-bottom: 4px;
  }
}

/* ── Sales: search placeholder shorter on phones ─────────────────────── */
@media (max-width: 576px) {
  #ventasSearch::placeholder { font-size: 0.82rem; }
}
