:root {
  --brand-blue: #3b82f6;
  --brand-indigo: #6366f1;
  --brand-violet: #8b5cf6;
  --brand-cyan: #22d3ee;
  --navy-950: #081020;
  --navy-900: #0b1224;
  --navy-850: #111a30;
  --slate-950: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --canvas: #f4f7fb;
  --white: #fff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --sidebar-width: 252px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, .08);
  --gradient: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo) 52%, var(--brand-violet));
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--slate-950);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: Tahoma, "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #dbe7ff;
  background:
    radial-gradient(circle at 15% 5%, rgba(99, 102, 241, .22), transparent 28%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  border-inline-end: 1px solid rgba(148, 163, 184, .16);
  box-shadow: 10px 0 30px rgba(8, 16, 32, .08);
}
.sidebar-brand {
  height: 72px;
  display: flex;
  align-items: center;
  padding-inline: 20px;
  border-block-end: 1px solid rgba(148, 163, 184, .14);
}
.sidebar-brand img { width: 132px; height: auto; display: block; }
.sidebar-label {
  margin-inline-start: auto;
  padding: 4px 7px;
  border: 1px solid rgba(125, 211, 252, .24);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(34, 211, 238, .08);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.sidebar-context {
  margin: 16px 12px 8px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}
.context-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #c7d2fe;
  background: rgba(99, 102, 241, .18);
}
.context-mark i { width: 17px; height: 17px; }
.context-copy { min-width: 0; }
.context-copy strong, .context-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-copy strong { color: #f8fafc; font-size: 12px; font-weight: 700; }
.context-copy span { margin-block-start: 2px; color: var(--slate-400); font-size: 10.5px; }

.primary-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .25) transparent;
}
.nav-eyebrow {
  margin: 12px 10px 7px;
  color: #71819f;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-section { margin-block-end: 5px; }
.nav-main {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 10px;
  color: #aebbd2;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-main:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-main.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, .22), rgba(99, 102, 241, .12));
  box-shadow: inset 3px 0 0 var(--brand-cyan);
}
html[dir="rtl"] .nav-main.active { box-shadow: inset -3px 0 0 var(--brand-cyan); }
.nav-main i { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-main .nav-text { flex: 1; text-align: start; font-size: 13.5px; font-weight: 650; }
.nav-main .chevron { width: 14px; height: 14px; color: #71819f; transition: transform .18s ease; }
.nav-section.open .nav-main .chevron { transform: rotate(90deg); }
html[dir="rtl"] .nav-section.open .nav-main .chevron { transform: rotate(-90deg); }
.nav-badge {
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, .14);
  font-size: 10px;
  font-weight: 800;
}
.subnav { display: none; margin: 4px 0 8px 28px; padding-inline-start: 12px; border-inline-start: 1px solid rgba(148, 163, 184, .16); }
html[dir="rtl"] .subnav { margin: 4px 28px 8px 0; }
.nav-section.open .subnav { display: grid; gap: 2px; }
.subnav a {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  color: #8493ad;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.subnav a:hover, .subnav a.current { color: #e0e7ff; background: rgba(255, 255, 255, .045); }
.subnav a.current::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-cyan); }

.sidebar-footer { padding: 12px; border-block-start: 1px solid rgba(148, 163, 184, .14); }
.sidebar-user {
  width: 100%;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(255, 255, 255, .055); }
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fff;
  background: var(--gradient);
  font-size: 11px;
  font-weight: 800;
}
.sidebar-user-copy { min-width: 0; flex: 1; text-align: start; }
.sidebar-user-copy strong, .sidebar-user-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy strong { color: #f8fafc; font-size: 11.5px; }
.sidebar-user-copy span { margin-block-start: 2px; color: #7f8da7; font-size: 10px; }
.sidebar-user > i { width: 15px; height: 15px; color: #71819f; }

.main-column { min-height: 100vh; margin-inline-start: var(--sidebar-width); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-block-end: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
}
.mobile-menu { display: none; }
.icon-btn, .topbar-btn {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  color: var(--slate-600);
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.icon-btn:hover, .topbar-btn:hover { color: var(--slate-950); background: var(--slate-50); border-color: var(--slate-300); }
.icon-btn i, .topbar-btn i { width: 17px; height: 17px; }
.topbar-btn { padding-inline: 11px; font-size: 12px; font-weight: 650; }
.topbar-search {
  width: min(440px, 42vw);
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--slate-200);
  border-radius: 11px;
  color: var(--slate-500);
  background: var(--slate-50);
  cursor: pointer;
}
.topbar-search:hover { border-color: var(--slate-300); background: #fff; }
.topbar-search i { width: 17px; height: 17px; }
.topbar-search span { flex: 1; text-align: start; font-size: 12.5px; }
kbd { padding: 3px 6px; border: 1px solid var(--slate-200); border-radius: 6px; background: #fff; color: var(--slate-400); font-size: 10px; box-shadow: 0 1px 0 var(--slate-200); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.status-chip {
  min-height: 34px;
  padding-inline: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  color: #166534;
  background: #f0fdf4;
  font-size: 11px;
  font-weight: 750;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.notif-wrap, .profile-wrap { position: relative; }
.counter {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 9px;
  font-weight: 800;
}
.profile-button { padding: 3px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; }
.profile-button:hover { background: var(--slate-100); }
.profile-button .avatar { width: 36px; height: 36px; border-radius: 10px; }
.dropdown {
  position: absolute;
  inset-block-start: calc(100% + 9px);
  inset-inline-end: 0;
  z-index: 70;
  width: 310px;
  display: none;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.dropdown.open { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.dropdown-head { padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border-block-end: 1px solid var(--slate-100); }
.dropdown-head strong { font-size: 12.5px; }
.text-link { border: 0; padding: 0; color: #4f46e5; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.notification { padding: 12px 15px; display: grid; grid-template-columns: 31px 1fr; gap: 10px; border-block-end: 1px solid var(--slate-100); }
.notification:last-child { border: 0; }
.notification-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #4f46e5; background: #eef2ff; }
.notification-icon i { width: 15px; height: 15px; }
.notification strong, .notification span { display: block; }
.notification strong { font-size: 11.5px; }
.notification span { margin-top: 3px; color: var(--slate-500); font-size: 10.5px; line-height: 1.45; }
.profile-menu { width: 225px; padding: 7px; }
.profile-summary { padding: 10px 10px 12px; border-block-end: 1px solid var(--slate-100); margin-block-end: 5px; }
.profile-summary strong, .profile-summary span { display: block; }
.profile-summary strong { font-size: 12.5px; }
.profile-summary span { margin-top: 3px; color: var(--slate-500); font-size: 10.5px; }
.menu-link { width: 100%; padding: 9px 10px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 8px; color: var(--slate-700); background: transparent; text-decoration: none; font-size: 12px; cursor: pointer; }
.menu-link:hover { background: var(--slate-50); }
.menu-link i { width: 15px; height: 15px; color: var(--slate-400); }

.page { width: min(1460px, 100%); margin: 0 auto; padding: 28px 30px 48px; }
.page-heading { margin-block-end: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.breadcrumb { margin-block-end: 8px; display: flex; align-items: center; gap: 6px; color: var(--slate-500); font-size: 10.5px; font-weight: 650; }
.breadcrumb i { width: 12px; height: 12px; }
html[dir="rtl"] .breadcrumb i { transform: rotate(180deg); }
.eyebrow { margin: 0 0 7px; color: #4f46e5; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.page-heading h1 { margin: 0; color: var(--slate-950); font-size: clamp(23px, 2.6vw, 32px); line-height: 1.18; letter-spacing: -.03em; }
.page-heading p { max-width: 700px; margin: 7px 0 0; color: var(--slate-500); font-size: 12.5px; line-height: 1.6; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.btn {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  color: var(--slate-700);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.btn:hover { border-color: var(--slate-300); background: var(--slate-50); box-shadow: 0 4px 12px rgba(15, 23, 42, .06); }
.btn:active { transform: translateY(1px); }
.btn i { width: 16px; height: 16px; }
.btn-primary { border-color: transparent; color: #fff; background: var(--gradient); box-shadow: 0 8px 20px rgba(99, 102, 241, .22); }
.btn-primary:hover { border-color: transparent; background: var(--gradient); box-shadow: 0 10px 24px rgba(99, 102, 241, .3); }
.btn-quiet { border-color: transparent; background: transparent; box-shadow: none; }
.btn-danger { color: #b91c1c; background: #fff7f7; border-color: #fecaca; }
.btn-sm { min-height: 34px; padding: 7px 10px; font-size: 11px; }

.hero-strip {
  position: relative;
  margin-block-end: 18px;
  padding: 21px 23px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #dbe3f0;
  border-radius: 16px;
  background: linear-gradient(110deg, #fff 20%, #f6f7ff 70%, #eef8ff);
  box-shadow: var(--shadow-sm);
}
.hero-strip::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  inset-inline-end: -90px;
  inset-block-start: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .14), transparent 67%);
  pointer-events: none;
}
.hero-copy { flex: 1; min-width: 0; }
.hero-copy span { color: var(--slate-500); font-size: 11px; font-weight: 650; }
.hero-copy h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.015em; }
.hero-copy p { margin: 5px 0 0; color: var(--slate-500); font-size: 11.5px; line-height: 1.5; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-grid { margin-block-end: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.kpi {
  min-height: 132px;
  padding: 17px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 6px 10px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); border-color: #c7d2fe; box-shadow: 0 10px 24px rgba(99, 102, 241, .09); }
.kpi-label { color: var(--slate-500); font-size: 10.5px; font-weight: 700; }
.kpi-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; }
.kpi-icon i { width: 16px; height: 16px; }
.tone-blue { color: #2563eb; background: #eff6ff; }
.tone-indigo { color: #4f46e5; background: #eef2ff; }
.tone-green { color: #15803d; background: #f0fdf4; }
.tone-amber { color: #b45309; background: #fffbeb; }
.tone-rose { color: #be123c; background: #fff1f2; }
.tone-cyan { color: #0e7490; background: #ecfeff; }
.kpi-value { align-self: end; font-size: 28px; font-weight: 800; letter-spacing: -.035em; }
.kpi-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; color: var(--slate-400); font-size: 10px; }
.trend { padding: 2px 6px; border-radius: 999px; font-weight: 800; }
.trend.up { color: #15803d; background: #f0fdf4; }
.trend.warn { color: #b45309; background: #fffbeb; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .9fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.card { border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.card-head { min-height: 57px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-block-end: 1px solid var(--slate-100); }
.card-title { display: flex; align-items: center; gap: 9px; }
.card-title i { width: 17px; height: 17px; color: #4f46e5; }
.card-title h2, .card-title h3 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.card-title span { color: var(--slate-400); font-size: 10px; }
.card-body { padding: 17px; }
.card-foot { padding: 11px 17px; border-block-start: 1px solid var(--slate-100); }

.action-list { display: grid; }
.action-row { min-height: 67px; padding: 12px 16px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; border-block-end: 1px solid var(--slate-100); }
.action-row:last-child { border: 0; }
.action-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.action-icon i { width: 16px; height: 16px; }
.action-copy { min-width: 0; }
.action-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.action-copy span { display: block; margin-top: 3px; color: var(--slate-500); font-size: 10.5px; }
.action-cta { display: flex; align-items: center; gap: 8px; }
.mini-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
}
.mini-badge { padding: 3px 7px; font-size: 9.5px; }
.badge { padding: 4px 9px; font-size: 10px; }
.badge-blue { color: #1d4ed8; background: #eff6ff; }
.badge-indigo { color: #4338ca; background: #eef2ff; }
.badge-green { color: #166534; background: #f0fdf4; }
.badge-amber { color: #92400e; background: #fffbeb; }
.badge-red { color: #991b1b; background: #fef2f2; }
.badge-slate { color: var(--slate-600); background: var(--slate-100); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.data-table th { padding: 10px 14px; color: var(--slate-500); background: var(--slate-50); font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-align: start; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-block-start: 1px solid var(--slate-100); color: var(--slate-600); vertical-align: middle; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table strong { color: var(--slate-800); font-size: 11.5px; }
.table-title { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table-mark { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #4f46e5; background: #eef2ff; }
.table-mark i { width: 15px; height: 15px; }
.table-title span span { display: block; margin-top: 3px; color: var(--slate-400); font-size: 9.5px; }
.numeric { text-align: end !important; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--slate-500); background: transparent; cursor: pointer; }
.row-icon:hover { color: var(--slate-950); background: var(--slate-100); }
.row-icon i { width: 14px; height: 14px; }

.chart { height: 178px; padding: 12px 4px 0; display: flex; align-items: stretch; gap: 8px; }
.chart-y { width: 27px; padding-block: 0 22px; display: flex; flex-direction: column; justify-content: space-between; color: var(--slate-400); font-size: 8px; text-align: end; }
.bar-plot { position: relative; flex: 1; display: flex; align-items: end; justify-content: space-around; gap: 4px; border-block-end: 1px solid var(--slate-200); background: repeating-linear-gradient(to bottom, var(--slate-100) 0 1px, transparent 1px 38px); }
.bar-col { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.bar { width: min(24px, 68%); min-height: 8px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #818cf8, #4f46e5); opacity: .88; }
.bar-col:nth-child(3n) .bar { background: linear-gradient(180deg, #67e8f9, #3b82f6); }
.bar-label { height: 15px; color: var(--slate-400); font-size: 8px; }
.chart-legend { margin-top: 12px; display: flex; align-items: center; gap: 14px; color: var(--slate-500); font-size: 9.5px; }
.legend-line { width: 8px; height: 8px; border-radius: 3px; background: #6366f1; }
.legend-line.cyan { background: #3b82f6; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action { min-height: 83px; padding: 13px; border: 1px solid var(--slate-200); border-radius: 11px; background: #fff; text-decoration: none; transition: border-color .13s, background .13s; }
.quick-action:hover { border-color: #c7d2fe; background: #fafaff; }
.quick-action i { width: 17px; height: 17px; color: #4f46e5; }
.quick-action strong, .quick-action span { display: block; }
.quick-action strong { margin-top: 10px; font-size: 11px; }
.quick-action span { margin-top: 3px; color: var(--slate-400); font-size: 9.5px; line-height: 1.35; }

.toolbar { margin-block-end: 14px; padding: 11px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--slate-200); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.field-search { min-height: 38px; min-width: 240px; flex: 1; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--slate-200); border-radius: 9px; background: var(--slate-50); }
.field-search i { width: 15px; height: 15px; color: var(--slate-400); }
.field-search input { width: 100%; border: 0; outline: 0; color: var(--slate-800); background: transparent; font-size: 11.5px; }
.select { min-height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--slate-200); border-radius: 9px; color: var(--slate-600); background: #fff; font-size: 11px; }
html[dir="rtl"] .select { padding: 0 10px 0 30px; }
.segmented { padding: 3px; display: inline-flex; gap: 2px; border: 1px solid var(--slate-200); border-radius: 9px; background: var(--slate-50); }
.segmented button, .tab-button { border: 0; color: var(--slate-500); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.segmented button { width: 31px; height: 30px; display: grid; place-items: center; border-radius: 7px; }
.segmented button.active { color: #4338ca; background: #fff; box-shadow: var(--shadow-sm); }
.segmented i { width: 14px; height: 14px; }

.tabs { margin-block-end: 16px; display: flex; align-items: center; gap: 4px; overflow-x: auto; border-block-end: 1px solid var(--slate-200); }
.tab-button { min-height: 42px; padding: 8px 13px; position: relative; white-space: nowrap; }
.tab-button:hover { color: var(--slate-800); }
.tab-button.active { color: #4338ca; }
.tab-button.active::after { content: ""; position: absolute; inset-inline: 9px; inset-block-end: -1px; height: 2px; border-radius: 999px; background: var(--brand-indigo); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .16s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } }

.survey-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.survey-card { overflow: hidden; border: 1px solid var(--slate-200); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .14s, border-color .14s, box-shadow .14s; }
.survey-card:hover { transform: translateY(-2px); border-color: #c7d2fe; box-shadow: 0 10px 24px rgba(99, 102, 241, .08); }
.survey-cover { height: 72px; padding: 13px; display: flex; align-items: flex-start; justify-content: space-between; background: linear-gradient(125deg, #eef2ff, #f5f3ff); }
.survey-cover.blue { background: linear-gradient(125deg, #eff6ff, #ecfeff); }
.survey-cover.amber { background: linear-gradient(125deg, #fffbeb, #fff7ed); }
.survey-cover.rose { background: linear-gradient(125deg, #fff1f2, #faf5ff); }
.survey-card-body { padding: 15px; }
.survey-card h3 { margin: 0; font-size: 13px; }
.survey-card p { min-height: 32px; margin: 6px 0 13px; color: var(--slate-500); font-size: 10.5px; line-height: 1.5; }
.survey-stats { padding-block: 11px; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--slate-100); }
.survey-stat { text-align: center; }
.survey-stat + .survey-stat { border-inline-start: 1px solid var(--slate-100); }
.survey-stat strong, .survey-stat span { display: block; }
.survey-stat strong { font-size: 12px; }
.survey-stat span { margin-top: 3px; color: var(--slate-400); font-size: 8.5px; text-transform: uppercase; }
.survey-card-actions { padding-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.owner-stack { display: flex; align-items: center; }
.owner-stack span { width: 24px; height: 24px; margin-inline-end: -6px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #4338ca; background: #e0e7ff; font-size: 8px; font-weight: 800; }

.ai-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; }
.studio-card { min-height: 480px; }
.form-grid { display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--slate-700); font-size: 10.5px; font-weight: 750; }
.input, .textarea { width: 100%; border: 1px solid var(--slate-200); border-radius: 10px; color: var(--slate-800); background: #fff; font-size: 11.5px; }
.input { min-height: 41px; padding: 0 11px; }
.textarea { min-height: 125px; padding: 11px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus { border-color: #818cf8; outline: 3px solid rgba(99, 102, 241, .1); }
.hint { margin-top: 5px; color: var(--slate-400); font-size: 9.5px; line-height: 1.45; }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.option-card { padding: 11px; border: 1px solid var(--slate-200); border-radius: 10px; cursor: pointer; }
.option-card.selected { border-color: #818cf8; background: #f7f7ff; box-shadow: inset 0 0 0 1px #c7d2fe; }
.option-card strong, .option-card span { display: block; }
.option-card strong { font-size: 10.5px; }
.option-card span { margin-top: 4px; color: var(--slate-400); font-size: 9px; line-height: 1.35; }
.upload-box { min-height: 78px; padding: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px dashed var(--slate-300); border-radius: 10px; color: var(--slate-500); background: var(--slate-50); font-size: 10.5px; cursor: pointer; }
.upload-box:hover { border-color: #818cf8; background: #f7f7ff; }
.upload-box i { width: 17px; height: 17px; }
.activity-timeline { display: grid; gap: 0; }
.timeline-row { position: relative; padding: 0 0 17px 27px; }
html[dir="rtl"] .timeline-row { padding: 0 27px 17px 0; }
.timeline-row::before { content: ""; position: absolute; inset-inline-start: 8px; inset-block-start: 8px; inset-block-end: -2px; width: 1px; background: var(--slate-200); }
.timeline-row:last-child::before { display: none; }
.timeline-dot { position: absolute; inset-inline-start: 3px; inset-block-start: 3px; width: 11px; height: 11px; border: 3px solid #eef2ff; border-radius: 50%; background: #6366f1; }
.timeline-row strong { display: block; font-size: 10.5px; }
.timeline-row span { display: block; margin-top: 3px; color: var(--slate-400); font-size: 9.5px; line-height: 1.45; }

.admin-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-group { overflow: hidden; }
.admin-group-head { padding: 16px; display: flex; align-items: flex-start; gap: 11px; border-block-end: 1px solid var(--slate-100); }
.admin-group-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; }
.admin-group-icon i { width: 18px; height: 18px; }
.admin-group-head h2 { margin: 1px 0 0; font-size: 13px; }
.admin-group-head p { margin: 4px 0 0; color: var(--slate-500); font-size: 10px; line-height: 1.45; }
.setting-list { display: grid; }
.setting-link { min-height: 65px; padding: 12px 15px; display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-block-end: 1px solid var(--slate-100); text-decoration: none; }
.setting-link:last-child { border: 0; }
.setting-link:hover { background: #fafbff; }
.setting-link > i:first-child { width: 16px; height: 16px; color: #6366f1; }
.setting-link strong, .setting-link span { display: block; }
.setting-link strong { font-size: 11px; }
.setting-link span { margin-top: 3px; color: var(--slate-400); font-size: 9.5px; line-height: 1.35; }
.setting-link > i:last-child { width: 14px; height: 14px; color: var(--slate-300); }
html[dir="rtl"] .setting-link > i:last-child { transform: rotate(180deg); }
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.health-item { padding: 12px; border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); }
.health-item strong, .health-item span { display: block; }
.health-item strong { font-size: 10.5px; }
.health-item span { margin-top: 4px; color: var(--slate-400); font-size: 9px; }
.health-line { margin-top: 9px; height: 4px; overflow: hidden; border-radius: 99px; background: var(--slate-200); }
.health-line::before { content: ""; display: block; width: var(--health, 96%); height: 100%; border-radius: inherit; background: #22c55e; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 18px 18px;
  background: rgba(8, 16, 32, .5);
  backdrop-filter: blur(5px);
}
.modal-backdrop.open { display: flex; }
.command-palette { width: min(650px, 100%); overflow: hidden; border: 1px solid rgba(255, 255, 255, .4); border-radius: 16px; background: #fff; box-shadow: 0 30px 90px rgba(8, 16, 32, .28); }
.command-input { min-height: 58px; padding: 0 17px; display: flex; align-items: center; gap: 10px; border-block-end: 1px solid var(--slate-200); }
.command-input i { width: 19px; height: 19px; color: var(--slate-400); }
.command-input input { flex: 1; border: 0; outline: 0; color: var(--slate-800); font-size: 14px; }
.command-input button { border: 0; color: var(--slate-400); background: transparent; cursor: pointer; }
.command-results { max-height: 370px; padding: 8px; overflow-y: auto; }
.command-group-title { padding: 8px 10px 5px; color: var(--slate-400); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.command-item { padding: 9px 10px; display: grid; grid-template-columns: 33px 1fr auto; align-items: center; gap: 10px; border-radius: 9px; text-decoration: none; }
.command-item:hover { background: var(--slate-50); }
.command-item > span:first-child { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; color: #4f46e5; background: #eef2ff; }
.command-item i { width: 15px; height: 15px; }
.command-item strong, .command-item small { display: block; }
.command-item strong { font-size: 11.5px; }
.command-item small { margin-top: 3px; color: var(--slate-400); font-size: 9.5px; }
.command-item > small { color: var(--slate-400); }

.toast-stack { position: fixed; inset-inline-end: 22px; inset-block-end: 22px; z-index: 100; display: grid; gap: 8px; }
.toast { width: min(340px, calc(100vw - 44px)); padding: 12px 14px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.toast-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #15803d; background: #f0fdf4; }
.toast-icon i { width: 15px; height: 15px; }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { margin-top: 2px; color: var(--slate-500); font-size: 9.5px; }

.mobile-backdrop { display: none; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .survey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .ai-layout { grid-template-columns: 1fr; }
  .status-chip { display: none; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-column { margin-inline-start: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { height: 64px; padding-inline: 14px; }
  .topbar-search { width: auto; flex: 1; }
  .topbar-search kbd { display: none; }
  .page { padding: 22px 18px 38px; }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(8, 16, 32, .52); }
  .mobile-backdrop.open { display: block; }
  .admin-overview { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-search span { display: none; }
  .topbar-search { flex: 0 0 40px; min-height: 40px; padding: 0; justify-content: center; background: #fff; }
  .topbar-btn span { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .hero-strip { align-items: flex-start; flex-direction: column; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { min-height: 118px; padding: 14px; }
  .kpi-value { font-size: 23px; }
  .survey-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .field-search { min-width: 0; width: 100%; }
  .toolbar .select { width: 100%; }
  .admin-overview { gap: 11px; }
  .option-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .action-row { grid-template-columns: 34px minmax(0, 1fr); }
  .action-cta { grid-column: 2; justify-content: flex-start; }
  .health-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { min-height: 110px; }
  .language-label { display: none; }
  .page { padding-inline: 13px; }
  .quick-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
