@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #09111f;
  --bg-soft: #0f1a2d;
  --surface: rgba(13, 20, 34, 0.82);
  --surface-2: rgba(16, 25, 43, 0.94);
  --surface-3: rgba(18, 30, 51, 0.98);
  --surface-elevated: rgba(13, 21, 38, 0.96);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #eef4ff;
  --muted: #91a2c3;
  --muted-strong: #c3d1ea;
  --primary: #49b7ff;
  --primary-strong: #2f89ff;
  --primary-soft: rgba(73, 183, 255, 0.14);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 300px;
  --topbar-height: 102px;
}

body.portal-admin {
  --primary: #8b5cf6;
  --primary-strong: #6d4aff;
  --primary-soft: rgba(139, 92, 246, 0.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(73, 183, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(47, 137, 255, 0.14), transparent 26%),
    linear-gradient(180deg, #060c15 0%, #0a1322 100%);
}

body.portal-admin {
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(73, 183, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #070b16 0%, #0b1222 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -7rem;
  left: -6rem;
  background: var(--primary);
}

body::after {
  right: -9rem;
  bottom: -8rem;
  background: var(--primary-strong);
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.small, small { color: inherit; }

.container-xxl {
  max-width: 1380px;
  position: relative;
  z-index: 1;
}

.portal-layout {
  position: relative;
}

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

.portal-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.15rem;
  background: rgba(6, 12, 22, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.portal-sidebar__header,
.portal-sidebar__body,
.portal-sidebar__footer {
  background: linear-gradient(180deg, rgba(13, 22, 39, 0.96), rgba(8, 14, 26, 0.96));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.portal-sidebar__header {
  padding: 1.2rem;
}

.portal-sidebar__body {
  flex: 1;
  padding: 1rem;
}

.portal-sidebar__footer {
  padding: 1rem;
}

.portal-sidebar--mobile {
  width: min(92vw, 340px) !important;
  min-width: auto;
  background: rgba(4, 9, 18, 0.94);
  border-right: 1px solid var(--border);
}

.portal-sidebar--mobile .offcanvas-header,
.portal-sidebar--mobile .offcanvas-body {
  color: var(--text);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.portal-brand__logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 16px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), var(--primary-soft));
  border: 1px solid rgba(255,255,255,0.08);
}

.portal-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.portal-brand__title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.portal-brand__subtitle {
  color: var(--muted);
  font-size: 0.8rem;
}

.portal-workspace {
  margin-top: 1.15rem;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
}

.portal-workspace__label,
.portal-nav-group__label,
.portal-topbar__eyebrow,
.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted-strong);
}

.portal-workspace strong,
.portal-sidebar-note strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
}

.portal-workspace small,
.portal-sidebar-note small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.portal-nav-group + .portal-nav-group {
  margin-top: 1rem;
}

.portal-nav-group__label {
  margin: 0 0 0.7rem 0.25rem;
}

.portal-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  color: var(--muted-strong);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.portal-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}

.portal-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.portal-nav-link__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  flex-shrink: 0;
}

.portal-nav-link.active .portal-nav-link__icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.portal-nav-link__text {
  font-weight: 600;
}

.portal-sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 0.9rem;
}

.portal-sidebar-note__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  flex-shrink: 0;
}

.portal-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.2rem 1.5rem;
}

.portal-topbar {
  position: sticky;
  top: 1rem;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--topbar-height);
  padding: 1rem 1.25rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 26, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

.portal-topbar__start,
.portal-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-topbar__heading h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.08;
  font-weight: 800;
}

.portal-topbar__heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 56rem;
}

.portal-chip,
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--muted-strong);
}

.portal-chip i,
.hero-pill i {
  font-size: 1rem;
  color: #fff;
}

.portal-chip strong,
.hero-pill strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
}

.portal-chip small,
.hero-pill small {
  color: var(--muted);
  font-size: 0.75rem;
}

.portal-chip--user {
  min-width: 230px;
}

.page-hero {
  margin-top: 1rem;
  padding: 1.45rem 1.55rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.03)),
    linear-gradient(180deg, rgba(12, 21, 37, 0.96), rgba(8, 14, 25, 0.96));
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.page-hero h2 {
  margin: 0.7rem 0 0;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 800;
}

.page-hero p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  max-width: 58rem;
}

.page-hero__content {
  max-width: 780px;
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
}

.portal-main {
  flex: 1;
  padding-top: 1rem;
}

.portal-content {
  width: 100%;
}

.portal-footer {
  margin-top: 1.2rem;
  padding: 0 0 0.25rem;
}

.portal-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 20px;
  background: rgba(9, 16, 28, 0.76);
  border: 1px solid var(--border);
  color: var(--muted);
}

.portal-section {
  margin-top: 1rem;
}

.card,
.portal-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(14, 23, 40, 0.98), rgba(8, 14, 26, 0.98));
  box-shadow: var(--shadow-md);
  color: var(--text);
  overflow: hidden;
}

.card-header,
.portal-card__header {
  padding: 1.25rem 1.35rem 0;
  border: 0;
  background: transparent;
}

.card-body,
.portal-card__body {
  padding: 1.35rem;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-title h4,
.section-title h5,
.card h4,
.card h5,
.card h6 {
  margin: 0;
  font-weight: 700;
}

.section-title p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -2rem -2rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 60%);
}

.metric-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  margin-top: 0.55rem;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  line-height: 1;
  font-weight: 800;
}

.metric-sub {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.chart-shell,
.canvas-wrap {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.chart-shell img,
.canvas-wrap img,
.canvas-wrap canvas {
  width: 100%;
  display: block;
  border-radius: 16px;
}

.mini-list {
  display: grid;
  gap: 0.8rem;
}

.mini-list__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.mini-list__item span:first-child {
  color: var(--muted);
}

.mini-list__item span:last-child {
  text-align: right;
  font-weight: 600;
}

.quick-actions {
  display: grid;
  gap: 0.8rem;
}

.quick-actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: 0.2s ease;
}

.quick-actions a:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.03));
  border-color: rgba(255,255,255,0.09);
}

.quick-actions strong {
  display: block;
  font-size: 0.98rem;
}

.quick-actions small {
  color: var(--muted) !important;
}

.quick-actions i {
  color: var(--muted-strong);
}

.empty-state {
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--muted-strong);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-responsive {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
}

.table {
  margin: 0;
  color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-bg: rgba(255,255,255,0.02);
  --bs-table-hover-bg: rgba(255,255,255,0.03);
  --bs-table-border-color: rgba(255,255,255,0.06);
}

.table thead th {
  padding: 1rem 1rem;
  border-bottom-width: 1px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-strong);
  background: rgba(255,255,255,0.02);
}

.table tbody td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.form-label {
  color: var(--muted-strong);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.form-control::placeholder {
  color: rgba(145,162,195,0.8);
}

.form-select option {
  color: #111827;
}

.form-text {
  color: var(--muted);
}

.btn {
  border-radius: 14px;
  font-weight: 600;
  padding: 0.72rem 1rem;
  box-shadow: none !important;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border: 0;
}

.btn-primary:hover,
.btn-primary:focus {
  opacity: 0.94;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-danger:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  color: #fff;
}

.alert {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.alert-success { border-color: rgba(52, 211, 153, 0.3); }
.alert-danger { border-color: rgba(251, 113, 133, 0.3); }
.alert-warning { border-color: rgba(251, 191, 36, 0.3); }

.badge {
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
  font-weight: 700;
}

.text-bg-success {
  background: rgba(52, 211, 153, 0.18) !important;
  color: #106f4a !important;
}

.text-bg-warning {
  background: rgba(251, 191, 36, 0.16) !important;
  color: #6d5101 !important;
}

.text-bg-danger {
  background: rgba(251, 113, 133, 0.18) !important;
  color: #85061f !important;
}

.text-bg-secondary {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #07357d !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
  gap: 1.35rem;
  align-items: stretch;
}

.auth-panel,
.auth-card {
  border-radius: 30px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 22, 39, 0.96), rgba(8, 14, 26, 0.98));
  box-shadow: var(--shadow-lg);
}

.auth-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-panel__headline {
  margin: 0.2rem 0 0;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.04;
  font-weight: 800;
}

.auth-panel__text {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 56rem;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.auth-feature {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.auth-feature strong {
  display: block;
  font-size: 0.98rem;
}

.auth-feature span {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-card {
  padding: 1.6rem;
}

.auth-card__header h2 {
  margin: 0;
  font-weight: 800;
}

.auth-card__header p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.auth-footer {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1399.98px) {
  .portal-shell {
    padding-inline: 1rem;
  }

  .portal-topbar,
  .page-hero,
  .portal-footer__inner {
    border-radius: 22px;
  }
}

@media (max-width: 1199.98px) {
  .portal-app {
    display: block;
  }

  .portal-shell {
    padding: 1rem;
  }

  .portal-topbar {
    position: static;
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
  }

  .portal-topbar__actions,
  .page-hero,
  .portal-footer__inner,
  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-hero__meta {
    justify-content: flex-start;
  }

  .portal-chip--user {
    min-width: 0;
  }
}

@media (max-width: 991.98px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-feature-grid {
    grid-template-columns: 1fr;
  }

  .page-hero,
  .portal-topbar,
  .auth-panel,
  .auth-card {
    border-radius: 24px;
  }
}

@media (max-width: 767.98px) {
  .portal-shell,
  .portal-sidebar {
    padding: 0.8rem;
  }

  .portal-topbar,
  .page-hero {
    padding: 1rem;
  }

  .portal-card__body,
  .card-body {
    padding: 1rem;
  }

  .portal-card__header,
  .card-header {
    padding: 1rem 1rem 0;
  }

  .table thead th,
  .table tbody td {
    padding-inline: 0.8rem;
  }

  .mini-list__item,
  .quick-actions a {
    flex-direction: column;
    align-items: flex-start;
  }

  .mini-list__item span:last-child {
    text-align: left;
  }

  .portal-footer__inner {
    padding: 0.9rem 1rem;
  }
}


/* ===== SaaS v4 premium enhancements ===== */
html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #eaf0f8;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-3: rgba(248, 251, 255, 0.98);
  --surface-elevated: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #142033;
  --muted: #64748b;
  --muted-strong: #334155;
  --primary-soft: rgba(47, 137, 255, 0.10);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 16px 34px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(73, 183, 255, 0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(47, 137, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #f6f9fd 0%, #edf3fb 100%);
}

html[data-theme="light"] body.portal-admin {
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(73, 183, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #f8f8ff 0%, #eef3ff 100%);
}

html[data-theme="light"] body::before,
html[data-theme="light"] body::after {
  opacity: 0.14;
}

.portal-sidebar {
  background: color-mix(in srgb, var(--surface-elevated) 76%, transparent);
}

.portal-sidebar__header,
.portal-sidebar__body,
.portal-sidebar__footer,
.portal-topbar,
.page-hero,
.portal-footer__inner,
.card,
.portal-card,
.auth-panel,
.auth-card,
.table-responsive {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  border-color: var(--border);
}

.portal-nav-group__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-nav-link {
  position: relative;
  padding: 0.92rem 1rem;
  border-radius: 18px;
}

.portal-nav-link::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translateY(-50%) scale(0);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  transition: transform .2s ease;
}

.portal-nav-link:hover::after,
.portal-nav-link.active::after {
  transform: translateY(-50%) scale(1);
}

.portal-nav-link__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.portal-nav-link__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 60%);
  opacity: .8;
}

.portal-nav-link__icon i {
  position: relative;
  z-index: 1;
  font-size: 1rem;
}

.portal-nav-link.active .portal-nav-link__icon {
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 28%, transparent);
}

.portal-topbar__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-theme-toggle {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-inline: 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  color: var(--text);
}

.portal-theme-toggle:hover {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.04));
  color: var(--text);
}

.portal-theme-toggle__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.portal-theme-toggle__text {
  font-weight: 700;
}

.saas-stat {
  position: relative;
  overflow: hidden;
}

.saas-stat::before {
  content: "";
  position: absolute;
  inset: -35% auto auto -12%;
  width: 10rem;
  height: 10rem;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%);
  pointer-events: none;
}

.saas-stat__header,
.saas-stat__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.saas-stat__icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 16px 32px color-mix(in srgb, var(--primary) 28%, transparent);
}

.saas-stat__icon i {
  font-size: 1.15rem;
}

.saas-stat__trend {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted-strong);
}

.saas-stat__trend.is-success {
  color: #b9ffe4;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.24);
}

.saas-stat__trend.is-warning {
  color: #ffe7a0;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.24);
}

html[data-theme="light"] .saas-stat__trend.is-success {
  color: #0f7a53;
}

html[data-theme="light"] .saas-stat__trend.is-warning {
  color: #9a6700;
}

.saas-stat__footer {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.saas-stat__meta {
  color: var(--muted-strong);
  font-weight: 700;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.03));
}

.table-toolbar__meta h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.table-toolbar__meta p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-toolbar__summary {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted-strong);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  font-weight: 700;
}

.table-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.table-toolbar__filters .form-control,
.table-toolbar__filters .form-select {
  min-width: 220px;
}

.table-toolbar--form {
  align-items: end;
}

.table-toolbar--form .row {
  flex: 1;
}

.table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,0.02) !important;
}

.table-hover > tbody > tr:hover > * {
  background-color: rgba(255,255,255,0.04) !important;
}

.table thead th,
.table tbody td,
.table strong,
.table a,
.table .small,
.table small,
.table .text-muted {
  color: inherit !important;
}

.table tbody td {
  color: var(--text) !important;
}

.table tbody td .text-muted,
.table tbody td small {
  color: var(--muted) !important;
}

.table code {
  color: color-mix(in srgb, var(--primary) 82%, white);
}

.form-control,
.form-select,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  border-color: rgba(255,255,255,0.10);
}

html[data-theme="light"] .portal-sidebar,
html[data-theme="light"] .portal-sidebar--mobile,
html[data-theme="light"] .portal-topbar,
html[data-theme="light"] .page-hero,
html[data-theme="light"] .portal-footer__inner,
html[data-theme="light"] .card,
html[data-theme="light"] .portal-card,
html[data-theme="light"] .portal-sidebar__header,
html[data-theme="light"] .portal-sidebar__body,
html[data-theme="light"] .portal-sidebar__footer,
html[data-theme="light"] .auth-panel,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .table-responsive,
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] .btn-outline-secondary,
html[data-theme="light"] .btn-outline-primary,
html[data-theme="light"] .btn-outline-danger,
html[data-theme="light"] .portal-theme-toggle,
html[data-theme="light"] .alert,
html[data-theme="light"] .mini-list__item,
html[data-theme="light"] .quick-actions a,
html[data-theme="light"] .portal-sidebar-note,
html[data-theme="light"] .chart-shell,
html[data-theme="light"] .canvas-wrap,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .table-toolbar,
html[data-theme="light"] .portal-chip,
html[data-theme="light"] .hero-pill {
  background-color: rgba(255,255,255,0.92) !important;
}

html[data-theme="light"] .portal-nav-link:hover,
html[data-theme="light"] .portal-nav-link.active,
html[data-theme="light"] .quick-actions a:hover,
html[data-theme="light"] .portal-theme-toggle:hover {
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.98));
}

html[data-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(15, 23, 42, 0.03) !important;
}

html[data-theme="light"] .table-hover > tbody > tr:hover > * {
  background-color: rgba(47, 137, 255, 0.05) !important;
}

html[data-theme="light"] .form-select option {
  color: #0f172a;
}

@media (max-width: 991.98px) {
  .table-toolbar,
  .table-toolbar__filters {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar__filters .form-control,
  .table-toolbar__filters .form-select,
  .portal-theme-toggle {
    width: 100%;
  }
}


/* ===== SaaS v5 premium experience ===== */
.portal-icon-btn,
.portal-user-menu {
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  color: var(--text);
}

.portal-icon-btn {
  position: relative;
  width: 58px;
  display: inline-grid;
  place-items: center;
}

.portal-icon-btn:hover,
.portal-user-menu:hover,
.portal-user-menu.show,
.portal-icon-btn.show {
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.05));
  border-color: var(--border-strong);
  color: var(--text);
}

.portal-icon-btn__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.portal-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.9rem;
}

.portal-user-menu__avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 25%, transparent);
  flex-shrink: 0;
}

.portal-user-menu__avatar--lg {
  width: 52px;
  height: 52px;
  border-radius: 18px;
}

.portal-user-menu__meta {
  display: block;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.portal-user-menu__meta small {
  color: var(--muted);
  line-height: 1.1;
}

.portal-user-menu__meta strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-menu__chevron {
  color: var(--muted-strong);
  font-size: 0.82rem;
}

.portal-dropdown {
  width: min(94vw, 360px);
  margin-top: 0.75rem !important;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 22, 39, 0.98), rgba(8, 14, 26, 0.98));
  box-shadow: var(--shadow-md);
}

.portal-dropdown__header,
.portal-dropdown__profile,
.portal-dropdown__footer {
  padding: 1rem 1rem;
}

.portal-dropdown__header,
.portal-dropdown__profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-dropdown__header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.portal-dropdown__header strong,
.portal-dropdown__profile strong {
  display: block;
}

.portal-dropdown__header small,
.portal-dropdown__profile small {
  color: var(--muted);
}

.portal-dropdown__body {
  padding: 0.55rem;
}

.portal-dropdown__item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem;
  border-radius: 16px;
  color: var(--text);
}

.portal-dropdown__item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.portal-dropdown__item + .portal-dropdown__item {
  margin-top: 0.2rem;
}

.portal-dropdown__item-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted-strong);
  flex-shrink: 0;
}

.portal-dropdown__item-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-dropdown__item-content strong {
  font-size: 0.95rem;
}

.portal-dropdown__item-content small {
  margin-top: 0.22rem;
  color: var(--muted);
  line-height: 1.45;
}

.portal-dropdown__footer {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.chart-shell--hero {
  min-height: 100%;
}

.insight-card .portal-card__body {
  display: flex;
  flex-direction: column;
}

.progress-stack {
  display: grid;
  gap: 1rem;
}

.progress-metric {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.progress-metric__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.progress-metric__meta strong {
  font-size: 0.95rem;
}

.progress-metric__meta span {
  color: var(--muted-strong);
  font-weight: 700;
}

.progress-metric small {
  display: block;
  margin-top: 0.65rem;
  color: var(--muted);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.progress-bar {
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.progress-bar--success {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.progress-bar--violet {
  background: linear-gradient(135deg, #8b5cf6, #6d4aff);
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 0.85rem;
  align-items: end;
  min-height: 270px;
}

.trend-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  height: 100%;
}

.trend-bar__value,
.trend-bar__label {
  text-align: center;
}

.trend-bar__value {
  font-size: 0.78rem;
  color: var(--muted-strong);
  font-weight: 700;
}

.trend-bar__track {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
}

.trend-bar__fill {
  width: 100%;
  border-radius: 14px;
  min-height: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.65), var(--primary));
  box-shadow: 0 16px 24px color-mix(in srgb, var(--primary) 25%, transparent);
}

.trend-bar__fill--admin {
  background: linear-gradient(180deg, rgba(255,255,255,0.65), #8b5cf6);
  box-shadow: 0 16px 24px rgba(139, 92, 246, 0.24);
}

.trend-bar__label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.activity-timeline {
  display: grid;
  gap: 0.95rem;
}

.activity-timeline__item {
  position: relative;
  display: flex;
  gap: 0.9rem;
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.activity-timeline__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.activity-timeline__item--success .activity-timeline__icon {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.activity-timeline__item--warning .activity-timeline__icon {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.activity-timeline__item--info .activity-timeline__icon {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.activity-timeline__item--secondary .activity-timeline__icon {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.activity-timeline__content {
  min-width: 0;
  flex: 1;
}

.activity-timeline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.activity-timeline__head strong {
  font-size: 0.95rem;
}

.activity-timeline__head span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.activity-timeline__content p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.soft-data-list {
  display: grid;
  gap: 0.65rem;
}

.soft-data-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.2rem;
}

.soft-data-list__header h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.soft-data-list__header span {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.soft-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.soft-data-row strong {
  display: block;
}

.soft-data-row small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.soft-data-row__side {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}

.auth-grid--enterprise {
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 500px);
}

.auth-panel--brand {
  position: relative;
  overflow: hidden;
}

.auth-panel--brand::after {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -7rem;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%);
  pointer-events: none;
}

.auth-card--enterprise {
  position: relative;
}

.auth-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.04));
  color: var(--muted-strong);
  border: 1px solid rgba(255,255,255,0.07);
  font-weight: 700;
  font-size: 0.82rem;
}

.auth-note-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  margin: 1.1rem 0 1.25rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
}

.auth-note-card i {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  flex-shrink: 0;
}

.auth-note-card strong {
  display: block;
}

.auth-note-card small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  line-height: 1.5;
}

.auth-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.auth-stat {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.auth-stat strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}

.auth-stat span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.auth-contact-bar span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.auth-input-group {
  display: flex;
  gap: 0.65rem;
}

.auth-input-group .form-control {
  flex: 1;
}

.auth-input-group__action {
  min-width: 92px;
}

.auth-footer--rich {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

html[data-theme="light"] .portal-dropdown {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,253,0.98));
}

html[data-theme="light"] .portal-dropdown__item:hover,
html[data-theme="light"] .soft-data-row,
html[data-theme="light"] .progress-metric,
html[data-theme="light"] .activity-timeline__item,
html[data-theme="light"] .auth-stat,
html[data-theme="light"] .auth-contact-bar span,
html[data-theme="light"] .auth-note-card {
  background-color: rgba(255,255,255,0.88);
}

html[data-theme="light"] .trend-bar__track {
  background: linear-gradient(180deg, rgba(15,23,42,0.03), rgba(15,23,42,0.01));
}

html[data-theme="light"] .progress {
  background: rgba(15,23,42,0.08);
}

@media (max-width: 1199.98px) {
  .portal-user-menu__meta strong {
    max-width: 130px;
  }
}

@media (max-width: 991.98px) {
  .auth-grid--enterprise {
    grid-template-columns: 1fr;
  }

  .trend-bars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .portal-topbar__actions {
    width: 100%;
    justify-content: stretch;
  }

  .portal-icon-btn,
  .portal-user-menu,
  .portal-theme-toggle {
    width: 100%;
  }

  .portal-user-menu {
    justify-content: space-between;
  }

  .activity-timeline__head,
  .soft-data-row,
  .soft-data-row__side,
  .auth-card__topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-input-group {
    flex-direction: column;
  }

  .auth-stat-strip,
  .trend-bars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .auth-stat-strip,
  .trend-bars {
    grid-template-columns: 1fr;
  }
}

/* ===== SaaS v6 search, charts, widgets ===== */
.portal-topbar__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-search {
  position: relative;
  min-width: min(100%, 340px);
  width: min(100%, 340px);
}

.portal-search__field {
  position: relative;
  display: flex;
  align-items: center;
}

.portal-search__field > i {
  position: absolute;
  left: 1rem;
  color: var(--muted);
  z-index: 2;
}

.portal-search__field .form-control {
  min-height: 58px;
  padding-left: 2.7rem;
  padding-right: 3rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  color: var(--text);
  box-shadow: none;
}

.portal-search__field .form-control:focus {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.05));
  color: var(--text);
  box-shadow: 0 0 0 0.2rem rgba(73, 183, 255, 0.08);
}

.portal-search__hint {
  position: absolute;
  right: 0.9rem;
  padding: 0.24rem 0.45rem;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  font-size: 0.73rem;
  line-height: 1;
}

.portal-search__dropdown {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  right: 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12, 20, 35, 0.98), rgba(8, 14, 26, 0.98));
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: none;
  z-index: 1100;
}

.portal-search__dropdown.is-open {
  display: block;
}

.portal-search__item,
.portal-search__empty {
  display: flex;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  color: var(--text);
}

.portal-search__item + .portal-search__item,
.portal-search__empty {
  border-top: 1px solid rgba(255,255,255,0.05);
}

.portal-search__item:hover {
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.04));
}

.portal-search__item-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  flex-shrink: 0;
}

.portal-search__item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.portal-search__item-content strong {
  font-size: 0.94rem;
}

.portal-search__item-content small,
.portal-search__empty {
  color: var(--muted);
}

.portal-icon-btn--unread {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 0 0 6px color-mix(in srgb, var(--primary) 14%, transparent);
}

.portal-icon-btn__badge[hidden] {
  display: none !important;
}

.chart-card,
.chart-panel {
  position: relative;
}

.chart-card__canvas,
.chart-panel__canvas {
  position: relative;
  min-height: 280px;
}

.chart-card__canvas canvas,
.chart-panel__canvas canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-panel__meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.chart-panel__metric {
  min-width: 140px;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.chart-panel__metric strong {
  display: block;
  font-size: 1rem;
  color: #fff;
}

.chart-panel__metric small {
  color: var(--muted);
}

.portal-widget {
  position: relative;
}

.portal-widget > .card,
.portal-widget > .row > div > .card {
  cursor: move;
}

.portal-widget::after {
  content: "⋮⋮";
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 3;
}

.portal-widget.is-dragging {
  opacity: 0.7;
}

.portal-widget.is-dragging > .card,
.portal-widget.is-dragging > .row > div > .card {
  transform: scale(0.985);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.portal-widget-board__hint {
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}

html[data-theme="light"] .portal-search__field .form-control,
html[data-theme="light"] .portal-search__dropdown,
html[data-theme="light"] .chart-panel__metric {
  background: rgba(255,255,255,0.94);
}

html[data-theme="light"] .portal-search__item:hover {
  background: linear-gradient(135deg, var(--primary-soft), rgba(255,255,255,0.98));
}

@media (max-width: 1199.98px) {
  .portal-search {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .portal-search {
    min-width: 100%;
    width: 100%;
  }

  .chart-card__canvas,
  .chart-panel__canvas {
    min-height: 240px;
  }
}


/* === TurkIX simplified dark theme override === */
:root {
  --bg: #090b10;
  --bg-soft: #10141b;
  --surface: #12171f;
  --surface-2: #161c26;
  --surface-3: #1a2230;
  --surface-elevated: #0f141b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #edf1f7;
  --muted: #95a0b1;
  --muted-strong: #d3dae5;
  --primary: #ff0f47;
  --primary-strong: #7e58b6;
  --primary-soft: rgba(255, 15, 71, 0.10);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.20);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 286px;
  --topbar-height: 88px;
}

body.portal-admin {
  --primary: #7e58b6;
  --primary-strong: #ff0f47;
  --primary-soft: rgba(126, 88, 182, 0.12);
}

html,
html[data-theme="dark"] {
  color-scheme: dark;
}

body,
body.portal-admin {
  background:
    radial-gradient(circle at top right, rgba(126, 88, 182, 0.10), transparent 24%),
    radial-gradient(circle at top left, rgba(255, 15, 71, 0.08), transparent 24%),
    linear-gradient(180deg, #080a0f 0%, #0d1118 100%);
}

body::before,
body::after {
  width: 16rem;
  height: 16rem;
  filter: blur(88px);
  opacity: 0.10;
}

.portal-sidebar,
.portal-sidebar--mobile {
  background: #0c1016;
  border-right: 1px solid var(--border);
  backdrop-filter: none;
}

.portal-sidebar__header,
.portal-sidebar__body,
.portal-sidebar__footer,
.portal-topbar,
.page-hero,
.portal-footer__inner,
.card,
.portal-card,
.table-responsive,
.chart-shell,
.canvas-wrap,
.empty-state,
.table-toolbar,
.portal-dropdown,
.auth-card,
.auth-panel,
.portal-search__dropdown,
.portal-search__field .form-control,
.form-control,
.form-select,
.hero-pill,
.portal-chip,
.portal-sidebar-note,
.quick-actions a,
.mini-list__item {
  background: #121821;
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.portal-sidebar__header,
.portal-sidebar__body,
.portal-sidebar__footer,
.portal-topbar,
.page-hero,
.portal-footer__inner,
.card,
.portal-card,
.table-responsive,
.portal-dropdown,
.auth-card,
.auth-panel,
.portal-sidebar-note,
.quick-actions a,
.mini-list__item,
.hero-pill,
.portal-chip {
  border-radius: 18px;
}

.portal-topbar,
.page-hero {
  backdrop-filter: none;
}

.portal-topbar {
  padding: 0.95rem 1.1rem;
}

.portal-topbar__heading h1 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 700;
}

.page-hero {
  padding: 1.2rem 1.35rem;
  background: linear-gradient(180deg, rgba(18, 24, 33, 0.98), rgba(15, 20, 28, 0.98));
}

.page-hero__eyebrow,
.portal-topbar__eyebrow,
.portal-nav-group__label,
.portal-workspace__label {
  color: #bac4d3;
  letter-spacing: 0.10em;
}

.portal-brand__logo {
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

.portal-workspace,
.auth-security-pill,
.auth-note-card,
.auth-contact-bar span,
.auth-stat,
.portal-nav-link:hover,
.portal-nav-link.active,
.portal-icon-btn,
.portal-user-menu,
.portal-search__field,
.quick-actions a:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.portal-nav-link {
  border-radius: 14px;
}

.portal-nav-link:hover,
.portal-nav-link.active {
  color: #fff;
}

.portal-nav-link.active .portal-nav-link__icon,
.portal-nav-link:hover .portal-nav-link__icon,
.portal-sidebar-note__icon,
.auth-card__eyebrow {
  color: #fff;
}

.portal-nav-link.active .portal-nav-link__icon,
.portal-nav-link:hover .portal-nav-link__icon,
.portal-sidebar-note__icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.portal-search__field,
.portal-user-menu,
.portal-icon-btn {
  border-color: var(--border);
}

.portal-user-menu__avatar,
.portal-icon-btn__badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.card,
.portal-card {
  background: linear-gradient(180deg, rgba(18, 24, 33, 0.98), rgba(15, 20, 28, 0.98));
}

.card-header,
.portal-card__header {
  padding: 1.1rem 1.2rem 0;
}

.card-body,
.portal-card__body {
  padding: 1.2rem;
}

.metric-card::after {
  opacity: 0.45;
}

.table thead th {
  background: rgba(255,255,255,0.03);
}

.table tbody td,
.table thead th {
  border-color: rgba(255,255,255,0.06);
}

.form-control,
.form-select,
.portal-search__field .form-control {
  background: #0f141c;
  border-color: rgba(255,255,255,0.08);
  min-height: 46px;
}

.form-control:focus,
.form-select:focus,
.portal-search__field .form-control:focus {
  background: #111722;
  border-color: rgba(255, 15, 71, 0.35);
}

.btn {
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 62%, var(--primary-strong)));
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.10);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-danger:hover {
  background: rgba(255,255,255,0.06);
}

.portal-footer__inner,
.portal-sidebar-note,
.hero-pill,
.portal-chip,
.quick-actions a,
.mini-list__item,
.chart-shell,
.canvas-wrap,
.empty-state {
  box-shadow: none;
}

/* minimal login */
.auth-shell {
  padding: 2rem 1rem;
}

.auth-grid--minimal {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: block;
}

.auth-grid--minimal .auth-panel,
.auth-grid--minimal .auth-card__topline,
.auth-grid--minimal .auth-note-card,
.auth-grid--minimal .auth-security-pill,
.auth-grid--minimal .auth-kicker,
.auth-grid--minimal .auth-stat-strip,
.auth-grid--minimal .auth-feature-grid,
.auth-grid--minimal .auth-contact-bar {
  display: none !important;
}

.auth-card--minimal {
  padding: 1.8rem;
  background: linear-gradient(180deg, rgba(18, 24, 33, 0.98), rgba(14, 19, 27, 0.98));
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.auth-card__logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  padding: 0.45rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.auth-card__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  margin-bottom: 0.6rem;
}

.auth-card__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.95rem);
  line-height: 1.1;
}

.auth-card__subtitle {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form-simple {
  margin-top: 0.2rem;
}

.auth-input-group {
  gap: 0.6rem;
}

.auth-input-group__action {
  min-width: 96px;
}

.auth-footer--minimal {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

@media (max-width: 767.98px) {
  .portal-shell,
  .portal-sidebar {
    padding: 0.75rem;
  }

  .portal-topbar,
  .page-hero,
  .card,
  .portal-card,
  .table-responsive,
  .portal-dropdown,
  .auth-card--minimal {
    border-radius: 16px;
  }

  .auth-card--minimal {
    padding: 1.25rem;
  }

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

/* === TurkIX simplified top navigation refresh === */
:root {
  --bg: #070a11;
  --bg-soft: #0c1120;
  --surface: rgba(12, 17, 29, 0.9);
  --surface-2: rgba(14, 21, 36, 0.95);
  --surface-3: rgba(11, 18, 31, 0.98);
  --surface-elevated: rgba(12, 18, 31, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2ff;
  --muted: #93a0bf;
  --muted-strong: #cfd8f6;
  --primary: #ff355d;
  --primary-strong: #a93bff;
  --primary-soft: rgba(255, 53, 93, 0.12);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.28);
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 53, 93, 0.12), transparent 26%),
    radial-gradient(circle at top center, rgba(169, 59, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #05070d 0%, #0a1020 55%, #080c16 100%);
}

body::before {
  background: rgba(255, 53, 93, 0.8);
  opacity: 0.14;
}

body::after {
  background: rgba(169, 59, 255, 0.65);
  opacity: 0.12;
}

.portal-app > aside.portal-sidebar {
  display: none !important;
}

.portal-shell {
  width: 100%;
  padding: 1rem 1.2rem 1.4rem;
}

.portal-topbar {
  display: block;
  min-height: auto;
  padding: 1.1rem 1.25rem 1rem;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(11, 18, 31, 0.96), rgba(8, 13, 24, 0.94)),
    linear-gradient(90deg, rgba(255, 53, 93, 0.05), transparent 40%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-topbar__start {
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 1rem;
}

.portal-topbar__heading {
  min-width: 0;
}

.portal-topbar__heading h1 {
  margin-top: 0.2rem;
  font-size: clamp(1.3rem, 2vw, 1.95rem);
}

.portal-topbar__heading p {
  max-width: 56rem;
  font-size: 0.92rem;
}

.portal-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 200px;
  padding-right: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-topbar-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.portal-topbar-brand__text strong {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.portal-topbar-brand__text small {
  color: var(--muted);
  font-size: 0.78rem;
}

.portal-topbar__actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-search--member {
  min-width: min(100%, 320px);
}

.portal-topnav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.portal-topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.82rem 1rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  font-weight: 600;
  white-space: nowrap;
  transition: 0.2s ease;
}

.portal-topnav__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.portal-topnav__link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 53, 93, 0.18), rgba(169, 59, 255, 0.12));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.18);
}

.page-hero {
  display: none !important;
}

.portal-footer__inner {
  background: rgba(9, 14, 25, 0.78);
}

.card,
.portal-card,
.portal-sidebar__header,
.portal-sidebar__body,
.portal-sidebar__footer {
  background: linear-gradient(180deg, rgba(11, 18, 31, 0.98), rgba(8, 13, 24, 0.98));
}

.section-title__eyebrow {
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted-strong);
  margin-bottom: 0.75rem;
}

.traffic-showcase-card {
  position: relative;
}

.traffic-showcase__header {
  align-items: flex-start;
}

.traffic-explorer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.traffic-explorer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.traffic-explorer__switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.traffic-explorer__switch-btn {
  border: 0;
  outline: 0;
  padding: 0.78rem 1.05rem;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
  line-height: 1;
  transition: 0.18s ease;
}

.traffic-explorer__switch-btn:hover {
  color: #fff;
}

.traffic-explorer__switch-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 53, 93, 0.2), rgba(169, 59, 255, 0.15));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.2);
}

.traffic-explorer__frame {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.traffic-explorer__frame-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.traffic-explorer__kicker {
  display: inline-flex;
  margin-bottom: 0.45rem;
  color: var(--muted-strong);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

.traffic-explorer__frame-head h5 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.traffic-explorer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.traffic-explorer__meta span {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 600;
}

.traffic-explorer__image-wrap {
  padding: 0.8rem;
  border-radius: 18px;
  background: #eef1f7;
  border: 1px solid rgba(16, 24, 40, 0.08);
  overflow: hidden;
}

.traffic-explorer__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #fff;
}

.traffic-explorer.is-loading .traffic-explorer__image {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

@media (max-width: 1199.98px) {
  .portal-topbar__row {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-topbar__start,
  .portal-topbar__actions {
    width: 100%;
  }

  .portal-search--member {
    min-width: 0;
    flex: 1 1 260px;
  }
}

@media (max-width: 767.98px) {
  .portal-shell {
    padding: 0.75rem 0.75rem 1.1rem;
  }

  .portal-topbar {
    top: 0.75rem;
    padding: 1rem;
    border-radius: 20px;
  }

  .portal-topbar-brand {
    min-width: 0;
    padding-right: 0.75rem;
  }

  .portal-topbar-brand__text {
    display: none;
  }

  .portal-topbar__heading h1 {
    font-size: 1.22rem;
  }

  .portal-topnav {
    gap: 0.55rem;
  }

  .portal-topnav__link {
    padding: 0.72rem 0.85rem;
  }

  .traffic-explorer__toolbar,
  .traffic-explorer__frame-head {
    flex-direction: column;
    align-items: stretch;
  }

  .traffic-explorer__meta {
    justify-content: flex-start;
  }
}
