:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0c1728;
  --panel-2: #111f34;
  --text: #eef4ff;
  --muted: #9fb0c8;
  --line: rgba(255, 255, 255, 0.1);
  --primary: #15b8a6;
  --primary-2: #2dd4bf;
  --accent: #f0b429;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #edf2f7;
  --text: #07111f;
  --muted: #344256;
  --line: rgba(7, 17, 31, 0.16);
  --primary: #0f766e;
  --primary-2: #0d9488;
  --accent: #a16207;
  --danger: #b91c1c;
  --success: #047857;
  --warning: #b45309;
  --shadow: 0 18px 54px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(21, 184, 166, 0.08), transparent 420px),
    var(--bg);
  color: var(--text);
  font-family: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif;
  letter-spacing: 0;
}

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

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

.app-shell {
  min-height: 100vh;
}

.container {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  box-shadow: 0 10px 30px rgba(21, 184, 166, 0.25);
}

.desktop-nav,
.nav-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-nav {
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
}

.nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid transparent;
  font-weight: 700;
}

.nav-count {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--accent);
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  border-color: var(--line);
}

.nav-home {
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  border-color: var(--line);
}

.nav-group {
  position: relative;
}

.nav-group summary {
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  user-select: none;
}

.nav-group-summary:hover,
.nav-group-summary.active,
.nav-group[open] .nav-group-summary {
  color: var(--text);
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  border-color: var(--line);
}

.nav-group .chevron {
  width: 15px;
  height: 15px;
  transition: transform 0.18s ease;
}

.nav-group[open] .chevron {
  transform: rotate(180deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 230px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  z-index: 80;
}

.nav-menu .nav-link {
  justify-content: flex-start;
  min-height: 42px;
  width: 100%;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
}

.mobile-menu-btn,
.mobile-nav-panel {
  display: none;
}

.mobile-nav-panel {
  padding-bottom: 12px;
}

.mobile-nav-panel.open {
  display: block;
}

.mobile-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
}

.mobile-nav-grid .nav-link {
  min-height: 44px;
  justify-content: center;
}

.btn,
.icon-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.icon-btn {
  width: 42px;
  padding: 0;
}

.notification-button {
  position: relative;
}

.notification-button span {
  position: absolute;
  top: -7px;
  inset-inline-end: -7px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border: 2px solid var(--bg);
}

.mobile-menu-btn {
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  border-color: transparent;
  color: #fff;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.section {
  padding: 48px 0;
}

.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.96), rgba(7, 17, 31, 0.7), rgba(7, 17, 31, 0.55)),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.premium-hero {
  min-height: 82vh;
}

.premium-hero .hero-media {
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.97), rgba(7, 17, 31, 0.72), rgba(7, 17, 31, 0.5)),
    url("https://images.unsplash.com/photo-1494526585095-c41746248156?auto=format&fit=crop&w=1800&q=82") center/cover;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 36px;
  align-items: center;
}

.eyebrow {
  color: var(--primary-2);
  font-weight: 800;
  margin-bottom: 14px;
}

.hero h1,
.page-title h1 {
  margin: 0;
  font-size: clamp(38px, 5.3vw, 76px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p,
.page-title p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
  max-width: 760px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-console {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.18);
  padding-inline-start: 24px;
  display: grid;
  gap: 12px;
}

.console-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  color: var(--muted);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.console-row strong {
  color: var(--text);
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.notification-card.unread {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 7%);
}

.permission-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.permission-card summary::-webkit-details-marker {
  display: none;
}

.permission-card summary span {
  display: grid;
  gap: 3px;
}

.permission-card summary small,
.permission-row small {
  color: var(--muted);
  font-weight: 700;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.permission-module {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 52%, transparent);
}

.permission-module h3 {
  margin: 0 0 4px;
  font-weight: 900;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.permission-row > span {
  display: grid;
  gap: 2px;
  font-weight: 800;
}

.feature-card {
  min-height: 230px;
}

.feature-card h3,
.pricing-card h2,
.legal-grid h2 {
  margin: 12px 0 8px;
  font-weight: 900;
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #2563eb);
}

.band-section {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 38%, transparent);
}

.pricing-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 460px;
}

.featured-plan {
  border-color: color-mix(in srgb, var(--primary) 54%, var(--line));
  box-shadow: 0 26px 90px rgba(21, 184, 166, 0.22);
}

.price-metric .value {
  font-size: clamp(30px, 3vw, 44px);
}

.plan-limits {
  display: grid;
  gap: 9px;
}

.plan-limits span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.legal-hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(21, 184, 166, 0.10), transparent),
    var(--bg);
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.panel {
  padding: 22px;
}

.card {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.metric {
  display: grid;
  gap: 8px;
}

.metric .value {
  font-size: 28px;
  font-weight: 900;
}

.metric .label {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge-success {
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
}

.badge-danger {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
}

[data-theme="light"] .badge {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.16);
}

[data-theme="light"] .badge-success {
  color: #064e3b;
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.34);
}

[data-theme="light"] .badge-warning {
  color: #78350f;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(180, 83, 9, 0.34);
}

[data-theme="light"] .badge-danger {
  color: #7f1d1d;
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(185, 28, 28, 0.34);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 14px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 48%, var(--panel));
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
  background: #ffffff;
}

.check-row {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
}

.color-input {
  padding: 5px;
  min-height: 44px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.alert {
  border-radius: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.alert-success {
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.26);
}

.alert-error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.26);
}

[data-theme="light"] .alert-success {
  color: #064e3b;
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.32);
}

[data-theme="light"] .alert-error {
  color: #7f1d1d;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(185, 28, 28, 0.3);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr;
  text-align: left;
}

.compact-title {
  margin-bottom: 20px;
}

.compact-title h1,
.section-head h2 {
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.22;
}

.client-shell {
  background:
    linear-gradient(180deg, rgba(21, 184, 166, 0.07), transparent 360px),
    radial-gradient(circle at 15% 18%, rgba(240, 180, 41, 0.08), transparent 280px),
    var(--bg);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-weight: 900;
}

.section-head .eyebrow {
  margin: 0 0 4px;
}

.brand-preview {
  min-height: 300px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--preview-primary, var(--primary)) 42%, transparent), transparent 55%),
    linear-gradient(220deg, color-mix(in srgb, var(--preview-secondary, var(--primary-2)) 28%, transparent), transparent 48%),
    var(--panel);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-header span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--preview-primary, var(--primary)), var(--preview-secondary, var(--primary-2)));
}

.brand-preview h2 {
  font-size: 34px;
  line-height: 1.15;
  margin: 24px 0 6px;
  font-weight: 900;
}

.brand-preview p {
  color: var(--muted);
}

.preview-actions,
.integration-list {
  display: grid;
  gap: 9px;
}

.preview-actions span,
.integration-list span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 72%, transparent);
  font-weight: 800;
}

.preview-actions span:first-child {
  color: #111827;
  border-color: transparent;
  background: var(--preview-accent, var(--accent));
}

.head-icon {
  width: 34px;
  height: 34px;
  color: var(--primary-2);
}

.wide-field {
  grid-column: span 2;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  font-weight: 800;
}

.module-chip svg {
  color: var(--success);
}

.stat-list {
  display: grid;
  gap: 10px;
}

.stat-list > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.stat-list > div:last-child {
  border-bottom: 0;
}

.stat-list span,
.mini-row span {
  color: var(--muted);
}

.list-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.mini-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 58%, transparent);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: 34px;
  align-items: stretch;
  padding: 32px;
}

.auth-media {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 34px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.92), rgba(7, 17, 31, 0.62)),
    url("https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1600&q=80") center/cover;
  border: 1px solid var(--line);
}

.auth-media h1 {
  max-width: 760px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.05;
  margin: 0;
}

.auth-media p {
  max-width: 680px;
  color: #d8e4f5;
  line-height: 1.9;
  font-size: 18px;
}

.auth-brand {
  display: inline-grid;
  align-self: flex-start;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
}

.auth-brand small {
  grid-column: 2;
  color: #c8d7eb;
  font-weight: 800;
}

.auth-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-checks span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.auth-card {
  align-self: center;
}

.login-presets {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
}

.login-presets code {
  direction: ltr;
  text-align: left;
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
  color: var(--text);
}

@media (max-width: 1120px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 920px) {
  .hero {
    min-height: auto;
    padding: 54px 0 28px;
  }

  .hero-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  [style*="grid-column:span"],
  [style*="grid-column:1/-1"] {
    grid-column: auto !important;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .auth-media {
    min-height: 520px;
  }

  .hero-console {
    border-inline-start: 0;
    padding-inline-start: 0;
  }

  .topbar-inner {
    min-height: 66px;
    align-items: center;
    flex-direction: row;
    padding: 10px 0;
    gap: 10px;
  }

  .topbar-actions {
    flex-wrap: nowrap;
  }

  .topbar-actions .btn span {
    display: none;
  }

  .mobile-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .brand-text small {
    display: none;
  }

  .brand-mark,
  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .btn,
  .icon-btn {
    min-height: 38px;
  }

  .mobile-nav-grid {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .stat-list > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .permission-row {
    grid-template-columns: 1fr;
  }
}
