:root {
  --blue-950: #0b2034;
  --blue-900: #1b4f7c;
  --blue-700: #3a7eb9;
  --blue-500: #78add7;
  --slate-900: #16212b;
  --slate-800: #283948;
  --slate-700: #3a4b5a;
  --slate-600: #526475;
  --slate-500: #6b7c8c;
  --cta: #f5811e;
  --bg: #e9eef5;
  --glass-bg: rgba(255, 255, 255, 0.74);
  --glass-border: rgba(28, 90, 144, 0.18);
  --glass-dark: rgba(9, 22, 36, 0.72);
  --shadow-soft: 0 18px 32px rgba(9, 24, 38, 0.12);
  --shadow: 0 24px 46px rgba(9, 24, 38, 0.18);
  --shadow-hover: 0 30px 64px rgba(9, 24, 38, 0.26);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --border: rgba(10, 33, 52, 0.12);
  --success: #2e9d74;
  --warning: #f0a243;
  --danger: #e35d5d;
  --info: #4a91e2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Inter", system-ui, sans-serif;
  color: var(--slate-800);
  background: var(--bg);
  background-image: radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.9), transparent 52%),
    radial-gradient(circle at 82% 0%, rgba(54, 131, 194, 0.2), transparent 42%),
    linear-gradient(180deg, #f1f5fa 0%, #e3eaf3 100%);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(86, 130, 170, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 130, 170, 0.12) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5rem;
  font-family: "Sora", system-ui, sans-serif;
  color: var(--blue-900);
  line-height: 1.2;
}

p {
  margin: 0.4rem 0 0;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: var(--blue-900);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 2000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.app-shell {
  position: relative;
  display: flex;
  min-height: 100vh;
  z-index: 1;
}

.sidebar {
  width: 270px;
  background: linear-gradient(160deg, rgba(9, 24, 38, 0.98), rgba(15, 46, 74, 0.92));
  color: #e6f1fb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(74, 145, 226, 0.2);
  box-shadow: 14px 0 30px rgba(7, 18, 31, 0.4);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.brand-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 241, 251, 0.65);
}

.icon-btn {
  border: 1px solid rgba(148, 195, 242, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 22px rgba(5, 16, 28, 0.4);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(230, 241, 251, 0.84);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(74, 145, 226, 0.2);
  color: #fff;
  border-color: rgba(148, 195, 242, 0.35);
  box-shadow: 0 12px 26px rgba(5, 16, 28, 0.4);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  font-size: 0.92rem;
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  width: 100%;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(230, 241, 251, 0.7);
}

.footer-note {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: rgba(244, 248, 252, 0.94);
  border-bottom: 1px solid rgba(18, 45, 70, 0.12);
  box-shadow: 0 16px 34px rgba(8, 22, 35, 0.12);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-700);
  font-weight: 600;
}

.topbar-title h1 {
  font-size: 1.55rem;
  margin: 0.2rem 0;
}

.topbar-title p {
  color: var(--slate-600);
  font-size: 0.95rem;
}

.topbar-controls {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: nowrap;
}

.select-field {
  display: grid;
  gap: 6px;
}

.select-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-600);
  font-weight: 600;
}

.select-field select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(28, 90, 144, 0.25);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
}

.realtime {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(28, 90, 144, 0.2);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.realtime-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--blue-900);
  line-height: 1.1;
}

.realtime-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--slate-600);
  line-height: 1.1;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 rgba(46, 157, 116, 0.5);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 157, 116, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(46, 157, 116, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 157, 116, 0);
  }
}

.view {
  padding: 28px 32px 48px;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.view-header h2 {
  margin: 0;
}

.view-header p {
  margin: 6px 0 0;
  color: var(--slate-600);
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f1f6fb 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(28, 90, 144, 0.2);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-900);
}

.kpi-label {
  color: var(--slate-600);
  font-size: 0.92rem;
}

.kpi-meta {
  font-size: 0.78rem;
  color: var(--slate-500);
}

.chart-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: end;
  height: 160px;
  margin-top: 18px;
}

.bar {
  height: calc(var(--value) * 100%);
  background: linear-gradient(180deg, rgba(74, 145, 226, 0.9), rgba(58, 126, 185, 0.9));
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 12px;
}

.bar span {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: var(--slate-500);
}

.chart-donut {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  position: relative;
  margin: 18px auto 0;
  display: grid;
  place-items: center;
}

.chart-donut::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: inset 0 0 18px rgba(12, 32, 52, 0.08);
}

.donut-label {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-label span {
  display: block;
  font-size: 0.75rem;
  color: var(--slate-600);
}

.donut-label strong {
  font-size: 1.3rem;
  color: var(--blue-900);
}

.legend {
  margin-top: 18px;
  display: grid;
  width: 100%;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--slate-600);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.grid-two {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500);
  padding: 10px 6px;
}

tbody td {
  padding: 12px 6px;
  border-top: 1px solid rgba(18, 45, 70, 0.1);
  color: var(--slate-700);
}

tbody tr:hover {
  background: rgba(74, 145, 226, 0.06);
}

.status-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-ok {
  background: rgba(46, 157, 116, 0.14);
  color: #1f7a59;
}

.status-warn {
  background: rgba(240, 162, 67, 0.18);
  color: #b06a1e;
}

.status-danger {
  background: rgba(227, 93, 93, 0.16);
  color: #b24848;
}

.status-info {
  background: rgba(74, 145, 226, 0.16);
  color: #1e5ea5;
}

.type-alerta {
  background: rgba(227, 93, 93, 0.18);
  color: #b24848;
}

.type-autorizacion {
  background: rgba(46, 157, 116, 0.16);
  color: #1f7a59;
}

.type-registro {
  background: rgba(74, 145, 226, 0.18);
  color: #1e5ea5;
}

.filters {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-600);
  font-weight: 600;
}

.filter-field input,
.filter-field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(28, 90, 144, 0.2);
  background: rgba(255, 255, 255, 0.96);
  font-size: 0.9rem;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 20px;
  font-weight: 600;
  font-family: "Sora", system-ui, sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #f2a35a 0%, #e88933 55%, #d87322 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(172, 95, 26, 0.22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(172, 95, 26, 0.3);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue-900);
  border-color: rgba(28, 90, 144, 0.35);
  box-shadow: 0 8px 18px rgba(9, 24, 38, 0.12);
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(9, 24, 38, 0.18);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--blue-900);
  border-color: rgba(28, 90, 144, 0.2);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.text-link {
  color: var(--blue-900);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill-muted {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(230, 241, 251, 0.85);
  border: 1px solid rgba(148, 195, 242, 0.3);
}

.pill-soft {
  background: rgba(74, 145, 226, 0.12);
  color: var(--blue-900);
  border: 1px solid rgba(74, 145, 226, 0.2);
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--slate-600);
  display: grid;
  gap: 10px;
  place-items: center;
}

.empty-state h3 {
  margin: 0;
}

.loading-state {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.skeleton {
  background: linear-gradient(90deg, rgba(230, 238, 246, 0.8), rgba(255, 255, 255, 0.7), rgba(230, 238, 246, 0.8));
  background-size: 200% 100%;
  border-radius: 12px;
  animation: shimmer 1.4s infinite;
}

.skeleton-title {
  height: 22px;
  width: 240px;
}

.skeleton-row {
  height: 12px;
  width: 70%;
}

.skeleton-card {
  height: 120px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: -200% 0%;
  }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: rgba(15, 46, 74, 0.95);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 18px 34px rgba(5, 16, 28, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: rgba(46, 157, 116, 0.95);
}

.toast-warning {
  background: rgba(240, 162, 67, 0.95);
}

.toast-error {
  background: rgba(227, 93, 93, 0.95);
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-600);
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(28, 90, 144, 0.2);
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
}

.form-note {
  font-size: 0.82rem;
  color: var(--slate-500);
  margin-top: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.media-box {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(12, 45, 70, 0.12);
  box-shadow: var(--shadow-soft);
}

.media-box img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(28, 90, 144, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.status-row .status-dot {
  animation: none;
  width: 8px;
  height: 8px;
}

.status-row .status-label {
  font-weight: 600;
  color: var(--blue-900);
}

.status-row .status-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--slate-600);
}

.flow-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.flow-step {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(28, 90, 144, 0.18);
  box-shadow: var(--shadow-soft);
  font-weight: 600;
  color: var(--blue-900);
}

.flow-arrow {
  color: var(--blue-700);
  font-weight: 700;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-backdrop {
  display: none;
}

.mobile-toggle {
  display: none;
}

@media (max-width: 1100px) {
  .topbar {
    padding: 18px 20px;
  }

  .view {
    padding: 24px 20px 40px;
  }

  .topbar-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 18, 31, 0.45);
    z-index: 150;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .mobile-toggle {
    display: grid;
  }

  .topbar {
    gap: 16px;
  }

  .topbar-controls {
    display: none;
  }
}

@media (max-width: 720px) {
  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .kpi-grid,
  .chart-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    grid-template-columns: repeat(6, 1fr);
    height: 140px;
  }
}

body.sidebar-collapsed .sidebar {
  width: 88px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer {
  display: none;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
}

body.sidebar-collapsed .nav-icon {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.detail-list dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-600);
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--blue-900);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--slate-600);
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-700);
}

.topbar {
  flex-wrap: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: nowrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(28, 90, 144, 0.2);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--slate-600);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  text-transform: uppercase;
}

.lang-btn.is-active {
  background: rgba(74, 145, 226, 0.18);
  color: var(--blue-900);
  box-shadow: var(--shadow-soft);
}

.user-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid rgba(28, 90, 144, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.user-name {
  font-weight: 600;
  color: var(--blue-900);
  font-size: 0.86rem;
}

.user-company {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-600);
}

.user-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .topbar-controls,
  .topbar-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-controls,
  .topbar-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .topbar-controls {
    gap: 12px;
  }
}

@media (max-width: 720px) {
  .user-chip {
    width: 100%;
  }

  .user-meta {
    min-width: 0;
  }
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
  gap: 36px;
  padding: 48px clamp(24px, 5vw, 64px);
  align-items: start;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-intro {
  display: grid;
  gap: 12px;
  max-width: 440px;
}

.auth-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--slate-600);
  font-weight: 600;
}

.auth-description {
  color: var(--slate-600);
}

.auth-content {
  display: grid;
  gap: 24px;
}

.auth-card {
  display: grid;
  gap: 18px;
}

.login-details {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.65);
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.auth-quick {
  display: grid;
  gap: 14px;
}

.auth-quick-header h2 {
  margin-bottom: 0.35rem;
}

.user-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.user-card {
  border: 1px solid rgba(28, 90, 144, 0.22);
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  width: 100%;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.user-card.is-selected {
  border-color: rgba(74, 145, 226, 0.6);
  box-shadow: var(--shadow);
}

.user-card-title {
  font-weight: 600;
  color: var(--blue-900);
  font-size: 0.95rem;
}

.user-card-meta {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-600);
}

.user-card-site {
  font-size: 0.82rem;
  color: var(--slate-700);
}

.user-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-900);
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    padding: 40px 24px;
  }

  .auth-intro {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    padding: 32px 20px;
  }

  .auth-header {
    align-items: flex-start;
  }

  .auth-actions {
    width: 100%;
  }

  .user-card-grid {
    grid-template-columns: 1fr;
  }
}

.guided-demo-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  background: rgba(11, 20, 36, 0.65);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.guided-demo-modal-wrapper.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.guided-demo-modal {
  width: min(420px, 92vw);
  background: #f9fbff;
  border-radius: 22px;
  padding: 32px;
  border: 1px solid rgba(6, 30, 72, 0.18);
  box-shadow: 0 24px 56px rgba(9, 23, 44, 0.35);
  color: #0d172b;
}

.guided-demo-modal h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.guided-demo-modal p {
  color: #3c4c64;
  line-height: 1.4;
}

.guided-demo-modal-actions {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.guided-demo-modal button {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.guided-demo-modal button[data-guided-action="start"] {
  background: var(--cta);
  color: #fff;
}

.guided-demo-modal button[data-guided-action="skip"] {
  background: transparent;
  border: 1px solid rgba(13, 23, 43, 0.18);
  color: #0d172b;
}

.guided-demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.guided-demo-overlay.is-visible {
  opacity: 1;
}

.guided-demo-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 26, 0.6);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.guided-demo-highlight {
  position: fixed;
  border-radius: 18px;
  border: 2px solid rgba(34, 147, 191, 0.8);
  box-shadow: 0 0 0 12px rgba(34, 147, 191, 0.15);
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.guided-demo-highlight.is-visible {
  opacity: 1;
}

.guided-demo-tooltip {
  position: fixed;
  z-index: 1410;
  width: min(320px, 90vw);
  background: #0f1f34;
  border-radius: 18px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px rgba(5, 12, 26, 0.45);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto;
}

.guided-demo-tooltip h4 {
  margin: 6px 0;
  font-size: 1.1rem;
}

.guided-demo-tooltip-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.guided-demo-tooltip button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.65rem;
  cursor: pointer;
}

.guided-demo-tooltip button.guided-demo-next {
  background: #fff;
  color: #0b1324;
  padding: 8px 14px;
  border-radius: 999px;
  letter-spacing: 0.2em;
}

.guided-demo-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #fff;
  color: #0d172b;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 18px 36px rgba(11, 17, 30, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(12px);
  z-index: 1600;
}

.guided-demo-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-footer {
  position: relative;
}

.guided-demo-restart {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  color: #e6f1fb;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.guided-demo-restart:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}


