/* ============================================================
   STUDIOS GUEST SYSTEM — DESIGN SYSTEM v2
   Dark sidebar app shell · per-studio accents · RTL-ready
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #0a0c10;
  --bg-raised: #10131a;
  --surface: #141821;
  --surface-2: #1a1f2b;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #eef0f4;
  --text-2: #9aa3b2;
  --text-3: #626b7a;

  /* Accent (app brand) */
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-strong: #8f74ff;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #5c8aff 100%);

  /* Studio identities */
  --watar: #f43f5e;
  --beat: #8b5cf6;
  --mood: #14b8a6;

  /* States */
  --error: #ef4444;
  --success: #22c55e;
  --star-empty: #333a48;
  --star-filled: #f59e0b;

  /* Type */
  --font-sans: 'Inter', 'Tajawal', sans-serif;
  --font-display: 'Outfit', 'Tajawal', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Geometry */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 264px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 24px 60px -15px rgba(0, 0, 0, 0.75);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.22s var(--ease);
}

/* Arabic typography */
html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea,
html[lang="ar"] button {
  font-family: 'Tajawal', 'Inter', sans-serif;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 {
  font-family: 'Tajawal', 'Outfit', sans-serif;
  letter-spacing: 0;
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-soft);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Subtle scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  padding: 28px 32px 48px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-raised);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 14px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(124, 92, 255, 0.6);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.brand-mark-lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 14px;
}

.brand-mark-lg svg { width: 30px; height: 30px; }

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

.brand-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Studio chips legend */
.studio-legend {
  display: flex;
  gap: 6px;
  padding: 0 20px 16px;
  flex-wrap: wrap;
}

.studio-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

.chip-watar { color: #fda4b3; background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.35); }
.chip-beat  { color: #c4b0fb; background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(139, 92, 246, 0.35); }
.chip-mood  { color: #7fe0d3; background: rgba(20, 184, 166, 0.12); border: 1px solid rgba(20, 184, 166, 0.35); }

/* Nav */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding: 14px 10px 6px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.nav-tab .icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.85;
}

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

.nav-tab.active {
  color: #fff;
  background: var(--accent-soft);
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  inset-inline-start: -12px;
  top: 20%;
  height: 60%;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-grad);
}

/* Sidebar footer / user card */
.sidebar-footer {
  padding: 14px 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.user-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
}

.user-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: var(--text-3);
  font-size: 11px;
}

.user-card .icon-sm {
  width: 15px;
  height: 15px;
  fill: var(--text-3);
  flex-shrink: 0;
}

.logout-action {
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
}

/* Overlay for mobile drawer */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.6);
  backdrop-filter: blur(2px);
  z-index: 190;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 19px;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: inline-flex;
}

/* Desktop sidebar collapse (toggled by the menu button) */
@media (min-width: 901px) {
  .app-shell.sidebar-collapsed .sidebar {
    display: none;
  }
}

/* ============================================================
   ICONS & BUTTONS
   ============================================================ */
.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-sm { width: 14px; height: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(124, 92, 255, 0.5);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px -4px rgba(124, 92, 255, 0.65);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background-color: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background-color: #202636;
}

.btn-secondary.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-icon {
  padding: 6px;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.07);
}

.btn-icon-danger:hover {
  color: var(--error);
  background-color: rgba(239, 68, 68, 0.08);
}

/* ============================================================
   PANELS & LAYOUT BLOCKS
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-1);
}

.page-intro {
  margin-bottom: 22px;
}

.page-intro h2 { font-size: 21px; margin-bottom: 4px; }
.page-intro p { color: var(--text-2); font-size: 13.5px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: start;
}

.dashboard-grid.min-sidebar {
  grid-template-columns: 320px 1fr;
}

@media (max-width: 1100px) {
  .dashboard-grid, .dashboard-grid.min-sidebar {
    grid-template-columns: 1fr;
  }
}

.card-form { align-self: start; }

.card-header { margin-bottom: 20px; }
.card-header h2, .card-header h3 { font-size: 18px; margin-bottom: 4px; }
.card-header p { font-size: 13px; color: var(--text-2); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .icon { width: 22px; height: 22px; }

.stat-icon-violet { background: rgba(139, 92, 246, 0.14); color: #a78bfa; }
.stat-icon-rose   { background: rgba(244, 63, 94, 0.12);  color: #fb7185; }
.stat-icon-amber  { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.stat-icon-teal   { background: rgba(20, 184, 166, 0.12); color: #2dd4bf; }

.stat-body {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.stat-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-row {
  display: flex;
  gap: 16px;
}

.col-6 { flex: 0 0 calc(50% - 8px); }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: var(--transition);
  outline: none;
}

select option {
  background-color: var(--bg-raised);
  color: var(--text);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.7;
}

/* ============================================================
   STUDIO PICKER (register visit) & TAGS
   ============================================================ */
.studio-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-pick-btn {
  flex: 1;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.studio-pick-btn .studio-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  box-shadow: 0 0 8px var(--dot, var(--accent));
}

.studio-pick-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.studio-pick-btn.active {
  border-color: var(--dot, var(--accent));
  color: #fff;
  background: color-mix(in srgb, var(--dot, var(--accent)) 12%, var(--bg-raised));
}

/* Studio assignment checkboxes (create account form) */
.studio-checkboxes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0;
}

.studio-checkbox:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.studio-checkbox:has(input:checked) {
  border-color: var(--dot, var(--accent));
  color: #fff;
  background: color-mix(in srgb, var(--dot, var(--accent)) 12%, var(--bg-raised));
}

.studio-checkbox input {
  width: 14px;
  height: 14px;
}

.studio-checkbox .studio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
}

/* Studio tag in tables */
.studio-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.studio-tag .studio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--text-3));
}

.position-tag {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}

.role-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-2);
}

.role-tag.role-admin { color: #93c5fd; background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.35); }
.role-tag.role-super_admin { color: #fbbf24; background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); }
.role-tag.role-user { color: #86efac; background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); }

/* ============================================================
   TABLES
   ============================================================ */
.table-header-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-header-block h2 { font-size: 18px; margin-bottom: 4px; }
.table-header-block p { font-size: 13px; color: var(--text-2); }

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

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.backup-table-spacing { margin-top: 16px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
}

.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--text-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: start;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: start;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.025);
}

.font-mono { font-family: var(--font-mono); font-size: 12.5px; }

.col-checkbox {
  width: 40px;
  text-align: center;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.page-info {
  font-size: 12.5px;
  color: var(--text-2);
  font-family: var(--font-mono);
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-col {
  flex: 1;
  min-width: 140px;
}

.search-input-col {
  flex: 2;
  min-width: 220px;
}

/* ============================================================
   STAR RATING
   ============================================================ */
.star-rating {
  color: var(--star-filled);
  font-size: 15px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.star-rating-container {
  display: flex;
  gap: 10px;
  font-size: 30px;
  cursor: pointer;
  user-select: none;
}

.star-btn {
  color: var(--star-empty);
  transition: transform 0.12s ease, color 0.12s ease;
}

.star-btn.active, .star-btn:hover {
  color: var(--star-filled);
  transform: scale(1.12);
}

/* ============================================================
   CENTERED FORMS
   ============================================================ */
.form-container-centered {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 0;
}

.form-card {
  width: 100%;
  max-width: 560px;
  padding: 30px;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-viewport {
  position: relative;
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.35;
}

.orb-1 { width: 420px; height: 420px; background: var(--watar); top: -12%; inset-inline-start: 8%; }
.orb-2 { width: 360px; height: 360px; background: var(--beat); bottom: -18%; inset-inline-end: 6%; opacity: 0.22; }
.orb-3 { width: 300px; height: 300px; background: var(--mood); bottom: 10%; inset-inline-start: -8%; opacity: 0.2; }

.login-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  z-index: 1;
}

.login-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.login-card {
  padding: 36px 32px;
  border-radius: 20px;
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow-pop);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo h2 {
  font-size: 26px;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-2);
  font-size: 13.5px;
}

.login-legend {
  justify-content: center;
  padding: 14px 0 0;
}

/* ============================================================
   STUDIOS & PROGRAMS PAGE
   ============================================================ */
.studios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.studio-card {
  padding: 0;
  overflow: hidden;
}

.studio-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--dot, var(--accent)) 10%, transparent), transparent);
}

.studio-card-header .studio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  box-shadow: 0 0 12px var(--dot, var(--accent));
  flex-shrink: 0;
}

.studio-card-header h3 {
  font-size: 17px;
  flex: 1;
}

.studio-card-header .program-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.program-list {
  list-style: none;
  padding: 8px 8px;
}

.program-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.program-list li:hover { background: rgba(255, 255, 255, 0.03); }

.program-name { font-size: 13.5px; font-weight: 500; }

.program-actions { display: flex; gap: 2px; }

.program-empty {
  color: var(--text-3);
  font-size: 13px;
  padding: 14px 12px;
  text-align: center;
}

.add-program-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

.add-program-row input { flex: 1; }

/* ============================================================
   ANALYTICS
   ============================================================ */
.analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.analytics-header h2 { font-size: 19px; margin-bottom: 12px; }

.analytics-studio-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.studio-filter-btn .studio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--text-3));
}

.studio-filter-btn:hover { color: var(--text); border-color: var(--border-strong); }

.studio-filter-btn.active {
  color: #fff;
  border-color: var(--dot, var(--accent));
  background: color-mix(in srgb, var(--dot, var(--accent)) 14%, var(--bg-raised));
}

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

.custom-date-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-date-inputs input[type="date"] {
  width: 140px;
  padding: 7px 10px;
  font-size: 12px;
}

.analytics-row {
  display: flex;
  gap: 22px;
  margin-bottom: 22px;
}

.card-analytics { flex-grow: 1; min-width: 0; }

/* ============================================================
   ALERTS & TOASTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 16px;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background-color: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.toast {
  background-color: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 6, 9, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalScale 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-pop);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.modal-header h3 { font-size: 17px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

html[dir="rtl"] .modal-actions { justify-content: flex-start; }

.csv-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.modal-hint {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.template-box {
  background: var(--bg-raised);
  border: 1px dashed var(--border-strong);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  direction: ltr;
  text-align: left;
  line-height: 1.7;
}

.csv-actions-row { display: flex; }

.csv-upload-label { cursor: pointer; }

/* ============================================================
   UTILITIES & ANIMATION
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }

.col-comment-text {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-comment-text:hover {
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.page-section.hidden { display: none; }

.page-section {
  animation: pageIn 0.3s var(--ease);
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   RESPONSIVE / MOBILE DRAWER
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-pop);
  }

  html[dir="rtl"] .sidebar { transform: translateX(105%); }

  .sidebar.open { transform: translateX(0) !important; }

  .sidebar-overlay.visible { display: block; }

  .menu-toggle { display: inline-flex; }

  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 40px; }

  .form-row { flex-direction: column; gap: 0; }
  .col-6 { flex: 1 1 auto; }

  .analytics-row { flex-direction: column; }
}
