/* ============================================================
   assets/css/main.css
   VClass Design System — PANTOMATH Inspired Theme
   Light, Professional, Corporate, Educational Platform
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Color Palette — PANTOMATH Original Theme */
  --clr-primary:       #2F5F8A;  /* Primary Blue */
  --clr-primary-h:     #4A78A8;  /* Light Blue (hover) */
  --clr-primary-d:     #254D73;  /* Dark Blue */
  --clr-primary-light: rgba(47, 95, 138, 0.08);
  --clr-primary-glow:  rgba(47, 95, 138, 0.25);

  --clr-accent:        #D32F2F;  /* Accent Red */
  --clr-accent-h:      #EF4444;  /* Danger/Red hover */
  --clr-accent-light:  rgba(211, 47, 47, 0.08);

  --clr-success:       #22C55E;
  --clr-success-h:     #16A34A;
  --clr-success-light: rgba(34, 197, 94, 0.08);
  --clr-success-glow:  rgba(34, 197, 94, 0.25);

  --clr-warning:       #F59E0B;
  --clr-warning-h:     #D97706;
  --clr-warning-light: rgba(245, 158, 11, 0.08);

  --clr-danger:        #EF4444;
  --clr-danger-h:      #DC2626;
  --clr-danger-light:  rgba(239, 68, 68, 0.08);

  /* Gradients based on original brand colors */
  --grad-primary:      linear-gradient(135deg, #254D73 0%, #2F5F8A 50%, #4A78A8 100%);
  --grad-hero:         linear-gradient(135deg, #254D73 0%, #2F5F8A 60%, #4A78A8 100%);
  --grad-surface:      linear-gradient(180deg, #FFFFFF 0%, #F9FAFC 100%);
  --grad-card:         linear-gradient(145deg, #FFFFFF 0%, #F9FAFC 100%);
  --grad-accent:       linear-gradient(135deg, #D32F2F 0%, #EF4444 100%);

  /* Neutrals */
  --clr-bg:            #F5F7FA;      /* Background */
  --clr-surface:       #FFFFFF;      /* White / Card background */
  --clr-surface-2:     #F9FAFC;      /* Subtle surface variant */
  --clr-surface-3:     #E5E9F0;      /* Border/track */
  --clr-border:        #D9E2EC;      /* Border */
  --clr-border-2:      #C4D2E0;      /* Border hover/focus */

  /* Text */
  --clr-text:          #1F2937;      /* Text Primary */
  --clr-text-2:        #6B7280;      /* Text Secondary */
  --clr-text-3:        #9CA3AF;      /* Text Muted */
  --clr-text-inverse:  #FFFFFF;      /* Text on dark backgrounds */

  /* Sidebar / Top Nav (Original Dark Blue) */
  --clr-nav-bg:        #254D73;      /* Dark Blue */
  --clr-nav-text:      #FFFFFF;
  --clr-nav-hover:     #2F5F8A;      /* Primary Blue */
  --clr-nav-active:    #D32F2F;      /* Accent Red indicator */


  /* Glassmorphic tokens */
  --glass-bg:          rgba(255, 255, 255, 0.85);
  --glass-border:      rgba(255, 255, 255, 0.6);
  --glass-blur:        blur(16px);
  --glass-dock-bg:     rgba(15, 23, 42, 0.82);

  /* Typography */
  --font-primary:      'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:      'Poppins', system-ui, -apple-system, sans-serif;

  --text-xs:           0.75rem;      /* 12px */
  --text-sm:           0.875rem;     /* 14px */
  --text-base:         1rem;         /* 16px */
  --text-lg:           1.125rem;     /* 18px */
  --text-xl:           1.25rem;      /* 20px */
  --text-2xl:          1.5rem;       /* 24px */
  --text-3xl:          1.875rem;     /* 30px */
  --text-4xl:          2.25rem;      /* 36px */

  --fw-regular:        400;
  --fw-medium:         500;
  --fw-semibold:       600;
  --fw-bold:           700;

  /* Spacing — 8px grid */
  --sp-1:   0.25rem;   /* 4px */
  --sp-2:   0.5rem;    /* 8px */
  --sp-3:   0.75rem;   /* 12px */
  --sp-4:   1rem;      /* 16px */
  --sp-5:   1.25rem;   /* 20px */
  --sp-6:   1.5rem;    /* 24px */
  --sp-8:   2rem;      /* 32px */
  --sp-10:  2.5rem;    /* 40px */
  --sp-12:  3rem;      /* 48px */

  /* Radius */
  --r-sm:   0.375rem;   /* 6px */
  --r-md:   0.5rem;     /* 8px */
  --r-lg:   0.75rem;    /* 12px */
  --r-xl:   1rem;       /* 16px */
  --r-2xl:  1.5rem;     /* 24px */
  --r-full: 9999px;

  /* Shadows — High-definition modern elevation */
  --shadow-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:  0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:  0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg:  0 10px 25px -3px rgba(15, 23, 42, 0.10), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl:  0 20px 35px -5px rgba(15, 23, 42, 0.14), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 12px 28px -4px rgba(37, 99, 235, 0.12), 0 4px 10px rgba(15, 23, 42, 0.05);
  --shadow-dock: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);

  /* Transitions */
  --transition-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:  200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:  300ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --header-height:     64px;
  --sidebar-width:     260px;
  --sidebar-collapsed: 72px;

  /* Safe area (for notched phones) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--clr-primary-h); }

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

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  color: var(--clr-text);
}
h1 { font-size: var(--text-3xl); font-weight: var(--fw-bold); }
h2 { font-size: var(--text-2xl); font-weight: var(--fw-semibold); }
h3 { font-size: var(--text-xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-lg); font-weight: var(--fw-medium); }

p { color: var(--clr-text-2); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--clr-border-2); border-radius: var(--r-full); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-3); background-clip: content-box; }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--clr-border-2) transparent; }

/* ── Focus Visible ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background: var(--clr-primary-light);
  color: var(--clr-primary-d);
}

/* ── Utility Classes ──────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.text-primary    { color: var(--clr-primary); }
.text-accent     { color: var(--clr-accent); }
.text-success    { color: var(--clr-success); }
.text-warning    { color: var(--clr-warning); }
.text-danger     { color: var(--clr-danger); }
.text-muted      { color: var(--clr-text-2); }
.text-subtle     { color: var(--clr-text-3); }

.text-xs  { font-size: var(--text-xs); }
.text-sm  { font-size: var(--text-sm); }
.text-lg  { font-size: var(--text-lg); }
.text-xl  { font-size: var(--text-xl); }

.fw-medium    { font-weight: var(--fw-medium); }
.fw-semibold  { font-weight: var(--fw-semibold); }
.fw-bold      { font-weight: var(--fw-bold); }

.hidden { display: none !important; }

/* ── Layout Helpers ───────────────────────────────────────── */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }

.w-full { width: 100%; }
.flex-1 { flex: 1; }

.p-4 { padding: var(--sp-4); }
.p-5 { padding: var(--sp-5); }
.p-6 { padding: var(--sp-6); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }

.mt-4 { margin-top: var(--sp-4); }
.mb-4 { margin-bottom: var(--sp-4); }
.mx-auto { margin-left: auto; margin-right: auto; }

.rounded-lg { border-radius: var(--r-lg); }
.rounded-xl { border-radius: var(--r-xl); }
.rounded-full { border-radius: var(--r-full); }

.shadow-card { box-shadow: var(--shadow-card); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.96); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes liveRadar {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes speakerGlow {
  0%, 100% { border-color: var(--clr-success); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.4); }
  50%      { border-color: var(--clr-success-h); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.15); }
}

.animate-fade-in    { animation: fadeIn var(--transition-base) both; }
.animate-slide-up   { animation: slideUp var(--transition-slow) both; }
.animate-slide-down { animation: slideDown var(--transition-slow) both; }
.animate-scale-in   { animation: scaleIn var(--transition-base) both; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-spin       { animation: spin 1s linear infinite; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-5);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-primary);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  box-shadow: 0 2px 8px rgba(47, 95, 138, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--clr-primary-h);
  box-shadow: 0 6px 18px rgba(47, 95, 138, 0.35);
  transform: translateY(-1.5px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(47, 95, 138, 0.2);
}

.btn-secondary {
  background: var(--clr-surface);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--clr-surface-2);
  border-color: var(--clr-border-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-secondary:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--clr-text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--clr-surface-2);
  color: var(--clr-text);
}

.btn-danger {
  background: var(--clr-danger);
  color: var(--clr-text-inverse);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover:not(:disabled) {
  background: var(--clr-danger-h);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
  transform: translateY(-1.5px);
}
.btn-danger:active:not(:disabled) { transform: translateY(0); }

.btn-success {
  background: var(--clr-success);
  color: var(--clr-text-inverse);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-success:hover:not(:disabled) {
  background: var(--clr-success-h);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transform: translateY(-1.5px);
}
.btn-success:active:not(:disabled) { transform: translateY(0); }


.btn-warning {
  background: var(--clr-warning);
  color: var(--clr-text-inverse);
}
.btn-warning:hover:not(:disabled) {
  background: var(--clr-warning-h);
}

.btn-outline-primary {
  background: transparent;
  color: var(--clr-primary);
  border: 1px solid var(--clr-primary);
}
.btn-outline-primary:hover:not(:disabled) {
  background: var(--clr-primary-light);
  border-color: var(--clr-primary-h);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--r-full);
  background: var(--clr-surface-2);
  color: var(--clr-text-2);
  border: 1px solid var(--clr-border);
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover:not(:disabled) {
  background: var(--clr-surface);
  color: var(--clr-text);
  border-color: var(--clr-border-2);
}
.btn-icon.active {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  border-color: var(--clr-primary);
}
.btn-icon.danger {
  background: var(--clr-danger-light);
  color: var(--clr-danger);
  border-color: transparent;
}
.btn-icon.danger:hover:not(:disabled) {
  background: var(--clr-danger);
  color: var(--clr-text-inverse);
}

.btn-sm {
  height: 36px;
  padding: 0 var(--sp-3);
  font-size: var(--text-xs);
}

.btn-lg {
  height: 52px;
  padding: 0 var(--sp-6);
  font-size: var(--text-base);
}

.btn-full { width: 100%; }

/* Button group */
.btn-group { display: inline-flex; gap: var(--sp-2); }
.btn-group .btn { border-radius: var(--r-md); }
.btn-group .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group .btn:not(:first-child):not(:last-child) { border-radius: 0; }

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-4);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  color: var(--clr-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--clr-text-3); }
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--clr-border-2);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-light);
  background: var(--clr-surface);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--clr-danger);
}
.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px var(--clr-danger-light);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: var(--clr-success);
}
.form-input.success:focus,
.form-select.success:focus,
.form-textarea.success:focus {
  box-shadow: 0 0 0 3px var(--clr-success-light);
}

.form-textarea {
  min-height: 100px;
  padding: var(--sp-3) var(--sp-4);
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-10);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--clr-text-3);
}
.form-hint.error { color: var(--clr-danger); }
.form-hint.success { color: var(--clr-success); }

.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-primary);
  cursor: pointer;
}
.form-check label {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
  cursor: pointer;
}

.input-group {
  display: flex;
}
.input-group .form-input { border-radius: var(--r-md) 0 0 var(--r-md); border-right: none; }
.input-group .btn { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* Floating label style */
.form-floating {
  position: relative;
}
.form-floating .form-input,
.form-floating .form-select,
.form-floating .form-textarea {
  padding-top: var(--sp-5);
  padding-bottom: var(--sp-2);
}
.form-floating .form-label {
  position: absolute;
  top: 50%;
  left: var(--sp-4);
  transform: translateY(-50%);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  color: var(--clr-text-3);
  pointer-events: none;
  transition: all var(--transition-fast);
  background: transparent;
  padding: 0 var(--sp-1);
}
.form-floating .form-input:focus ~ .form-label,
.form-floating .form-input:not(:placeholder-shown) ~ .form-label,
.form-floating .form-select:focus ~ .form-label,
.form-floating .form-select:not([value=""]) ~ .form-label,
.form-floating .form-textarea:focus ~ .form-label,
.form-floating .form-textarea:not(:placeholder-shown) ~ .form-label {
  top: 0;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--clr-primary);
  background: var(--clr-surface);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-border-2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--clr-border);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--clr-text);
}

.card-body { }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--clr-border);
}

/* Dashboard stat card */
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-border-2);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.primary { background: var(--clr-primary-light); color: var(--clr-primary); }
.stat-icon.success { background: var(--clr-success-light); color: var(--clr-success); }
.stat-icon.warning { background: var(--clr-warning-light); color: var(--clr-warning); }
.stat-icon.danger  { background: var(--clr-danger-light); color: var(--clr-danger); }
.stat-icon.accent  { background: var(--clr-accent-light); color: var(--clr-accent); }

.stat-content { flex: 1; min-width: 0; }
.stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-text);
  line-height: 1.2;
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
  margin-top: var(--sp-1);
}
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  margin-top: var(--sp-2);
}
.stat-trend.up { color: var(--clr-success); }
.stat-trend.down { color: var(--clr-danger); }
.stat-trend.neutral { color: var(--clr-text-3); }

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1-5, 6px);
  padding: 3px var(--sp-2-5, 10px);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
}
.badge-primary   { background: var(--clr-primary-light); color: var(--clr-primary); border: 1px solid rgba(47, 95, 138, 0.15); }
.badge-success   { background: var(--clr-success-light); color: var(--clr-success); border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-warning   { background: var(--clr-warning-light); color: var(--clr-warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger    { background: var(--clr-danger-light); color: var(--clr-danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-accent    { background: var(--clr-accent-light); color: var(--clr-accent); border: 1px solid rgba(211, 47, 47, 0.2); }
.badge-neutral   { background: var(--clr-surface-2); color: var(--clr-text-2); border: 1px solid var(--clr-border); }

/* Live Pulsing Badge */
.badge-live {
  background: var(--clr-success-light);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.badge-live .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clr-success);
  display: inline-block;
  animation: liveRadar 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Glassmorphic Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}


/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
}
.avatar-xs  { width: 24px; height: 24px; font-size: var(--text-xs); }
.avatar-sm  { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar-md  { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-lg  { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl  { width: 72px; height: 72px; font-size: var(--text-xl); }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--clr-surface); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ── Table ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th,
.table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}
.table th {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--clr-primary-light); }
.table tbody tr:last-child td { border-bottom: none; }
.table td { color: var(--clr-text); }
.table .text-muted { color: var(--clr-text-2); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--clr-border);
  overflow-x: auto;
}
.tab-btn {
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.tab-btn:hover { color: var(--clr-text); }
.tab-btn.active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
}

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  min-width: 200px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: none;
  background: transparent;
  color: var(--clr-text);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--clr-surface-2); }
.dropdown-item.danger { color: var(--clr-danger); }
.dropdown-item.danger:hover { background: var(--clr-danger-light); }
.dropdown-divider { height: 1px; background: var(--clr-border); margin: var(--sp-2) 0; }

/* ── Toast Notification ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--sp-6) + var(--safe-bottom));
  right: var(--sp-4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--transition-slow) both;
  pointer-events: all;
}
.toast.success { border-left: 4px solid var(--clr-success); }
.toast.error   { border-left: 4px solid var(--clr-danger); }
.toast.warning { border-left: 4px solid var(--clr-warning); }
.toast.info    { border-left: 4px solid var(--clr-primary); }

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}
.toast.success .toast-icon { color: var(--clr-success); }
.toast.error .toast-icon   { color: var(--clr-danger); }
.toast.warning .toast-icon { color: var(--clr-warning); }
.toast.info .toast-icon    { color: var(--clr-primary); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--clr-text); }
.toast-message { font-size: var(--text-sm); color: var(--clr-text-2); margin-top: var(--sp-1); }

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--clr-text-3);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all var(--transition-fast);
}
.toast-close:hover { background: var(--clr-surface-2); color: var(--clr-text); }

@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%); }
}
.toast.removing { animation: toastOut var(--transition-base) forwards; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.modal-backdrop:not(.open) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.modal-backdrop.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}
.modal-backdrop.open .modal { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--clr-border);
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--clr-text-3);
  cursor: pointer;
  border-radius: var(--r-md);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--clr-surface-2); color: var(--clr-text); }

.modal-md { max-width: 560px; }
.modal-lg { max-width: 640px; }

.modal-body { padding: var(--sp-6); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--clr-border);
  background: var(--clr-surface-2);
}

/* ── Settings Modal Tabs & Components ────────────────────── */
.settings-nav-tabs {
  display: flex;
  background: var(--clr-surface-2);
  border-bottom: 1px solid var(--clr-border);
  padding: 0 var(--sp-6);
  gap: var(--sp-2);
  overflow-x: auto;
}

.settings-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.settings-nav-tab:hover { color: var(--clr-text); }
.settings-nav-tab.active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
  font-weight: var(--fw-semibold);
}

.settings-panel { animation: fadeIn var(--transition-fast) both; }

.profile-header-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-5);
}

.avatar-xl {
  width: 60px;
  height: 60px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: #ffffff;
  flex-shrink: 0;
  transition: background-color var(--transition-base);
}

.profile-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-preview-name {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text);
}
.profile-preview-email {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
}

.avatar-color-picker {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--clr-border);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  box-shadow: 0 0 0 3px var(--clr-primary);
  transform: scale(1.1);
}

.settings-section-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text);
  margin-bottom: 2px;
}
.settings-section-desc {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  margin-bottom: var(--sp-4);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.setting-item:hover { border-color: var(--clr-border-2); }

.setting-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.setting-item-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text);
}
.setting-item-desc {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
}

.toggle-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  background: var(--clr-border);
  border-radius: var(--r-full);
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background var(--transition-fast);
  flex-shrink: 0;
  border: none;
}
.toggle-switch::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.toggle-switch:checked { background: var(--clr-primary); }
.toggle-switch:checked::before { transform: translateX(20px); }

.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--clr-border);
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--sp-4) 0;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--clr-text-3);
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
  color: var(--clr-text-3);
}
.empty-state-title { font-size: var(--text-lg); font-weight: var(--fw-semibold); color: var(--clr-text); margin-bottom: var(--sp-2); }
.empty-state-text { font-size: var(--text-sm); color: var(--clr-text-2); }

/* ── Page Wrapper ─────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

/* ── Responsive Breakpoints ───────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --sp-6: 1.25rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
    --text-xl: 1.125rem;
  }
}

@media (min-width: 768px) {
  :root {
    --text-base: 1rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --text-base: 1rem;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
}

/* ============================================================
   Layout: Sidebar & Top Navigation
   ============================================================ */

.main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
  transition: margin-left var(--transition-base), width var(--transition-base);
}

@media (min-width: 1024px) {
  body:not(.login-page):not(.meeting-page) .main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
  body.sidebar-collapsed:not(.login-page):not(.meeting-page) .main-wrapper {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
  }
}

body.meeting-page .main-wrapper,
body.meeting-page .main-content {
  display: contents;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: var(--sidebar-width);
  background: var(--clr-nav-bg);
  color: var(--clr-nav-text);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--clr-nav-text);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--clr-primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  opacity: 1;
  transition: opacity var(--transition-fast), width var(--transition-fast);
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: var(--r-md);
  color: var(--clr-nav-text);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.2); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
}

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

.nav-item { margin-bottom: var(--sp-1); }

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: var(--clr-nav-text);
}
.nav-link.active {
  background: var(--clr-primary);
  color: var(--clr-nav-text);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--clr-accent);
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

.nav-section-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: var(--sp-4) calc(var(--sp-4) * -1);
}

.sidebar-footer {
  padding: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-nav-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
}

.sidebar-logout {
  color: rgba(255,255,255,0.7);
}
.sidebar-logout:hover {
  background: rgba(239,68,68,0.2);
  color: var(--clr-danger-h);
}

/* Sidebar collapsed state */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .sidebar-logo-text { opacity: 0; width: 0; }
body.sidebar-collapsed .nav-link span { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: var(--sp-3); }
body.sidebar-collapsed .nav-link::before { display: none; }
body.sidebar-collapsed .sidebar-user-info { display: none; }
body.sidebar-collapsed .sidebar-user { justify-content: center; padding: var(--sp-2); }
body.sidebar-collapsed .sidebar-footer .sidebar-logout span { display: none; }
body.sidebar-collapsed .sidebar-footer .sidebar-logout { justify-content: center; padding: var(--sp-3); }

/* Mobile sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-base);
}
body.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }
body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-xl); }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar-backdrop { display: block; opacity: 0; pointer-events: none; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: all; }
}

/* ── Top Navigation ───────────────────────────────────────── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  width: 100%;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  flex-shrink: 0;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: 0 0 auto;
}

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

.page-title-area { display: flex; flex-direction: column; min-width: 0; }

.page-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-subtitle {
  font-size: var(--text-xs);
  color: var(--clr-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-text-3);
  font-size: 1.125rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-4) 0 var(--sp-12);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-full);
  color: var(--clr-text);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}
.search-input::placeholder { color: var(--clr-text-3); }
.search-input:hover { border-color: var(--clr-border-2); background: var(--clr-surface); }
.search-input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-light);
  background: var(--clr-surface);
}

.search-clear {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--clr-text-3);
  cursor: pointer;
  border-radius: var(--r-full);
  transition: all var(--transition-fast);
}
.search-clear:hover { background: var(--clr-surface-2); color: var(--clr-text); }

.top-nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 0 auto;
}

.nav-icon-btn { position: relative; }

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--clr-danger);
  color: var(--clr-text-inverse);
  font-size: 10px;
  font-weight: var(--fw-bold);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--clr-surface);
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--r-full);
  transition: background var(--transition-fast);
}
.profile-trigger:hover { background: var(--clr-surface-2); }

.profile-name { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--clr-text); }

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-flex;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  min-width: 280px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-lg { min-width: 360px; }

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  margin: calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) var(--sp-2);
  border-bottom: 1px solid var(--clr-border);
}
.dropdown-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.dropdown-body { max-height: 360px; overflow-y: auto; padding: 0 var(--sp-2); }
.dropdown-footer {
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-2) calc(var(--sp-2) * -1) calc(var(--sp-2) * -1);
  border-top: 1px solid var(--clr-border);
}

.dropdown-user-name { font-weight: var(--fw-semibold); color: var(--clr-text); }
.dropdown-user-email { font-size: var(--text-xs); color: var(--clr-text-3); }

/* Notification Items */
.notification-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  transition: background var(--transition-fast);
}
.notification-item.unread { background: var(--clr-primary-light); }
.notification-item:hover { background: var(--clr-surface-2); }

.notification-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.notification-icon.primary { background: var(--clr-primary-light); color: var(--clr-primary); }
.notification-icon.success { background: var(--clr-success-light); color: var(--clr-success); }
.notification-icon.warning { background: var(--clr-warning-light); color: var(--clr-warning); }
.notification-icon.danger  { background: var(--clr-danger-light); color: var(--clr-danger); }

.notification-content { flex: 1; min-width: 0; }
.notification-title { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--clr-text); }
.notification-text { font-size: var(--text-xs); color: var(--clr-text-2); margin-top: 2px; }
.notification-time { font-size: var(--text-xs); color: var(--clr-text-3); margin-top: 4px; }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: var(--sp-6);
  background: var(--clr-bg);
  min-height: calc(100dvh - var(--header-height));
}

.main-content-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .mobile-menu-btn { display: flex !important; }
  .top-nav-center { max-width: none; flex: 1; }
  .main-content { padding: var(--sp-4); }
}

/* Hide title area only on small mobile where space is critical */
@media (max-width: 640px) {
  .page-title-area { display: none; }
}


@media (max-width: 640px) {
  .top-nav { padding: 0 var(--sp-4); }
  .search-box { max-width: none; }
  .profile-name { display: none; }
  .dropdown-menu { right: -var(--sp-4); min-width: calc(100vw - 2rem); }
  .dropdown-menu-lg { min-width: calc(100vw - 2rem); }
}

/* ── Utility display classes ──────────────────────────────── */
.d-none { display: none !important; }
.d-md-inline { display: none !important; }
@media (min-width: 768px) {
  .d-md-inline { display: inline !important; }
}

/* ── Global Clean Recordings Classes ─────────────────────── */
.recording-clean-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.recording-clean-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(47, 95, 138, 0.25);
}

.recording-clean-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: 1;
  min-width: 240px;
}

.recording-thumb-box {
  width: 62px;
  height: 48px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-d));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.35rem;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(47, 95, 138, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.recording-thumb-box:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(47, 95, 138, 0.4);
}

.recording-thumb-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

.recording-clean-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.recording-clean-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.recording-clean-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2-5, 10px);
}

.recording-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--clr-text-2);
}

.recording-chip i {
  font-size: 0.95rem;
  color: var(--clr-primary);
}

.recording-clean-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.btn-speed {
  padding: 3px 9px;
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-speed:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.btn-speed.active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(47, 95, 138, 0.4);
}

@media (max-width: 768px) {
  .recording-clean-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
    padding: var(--sp-3-5, 14px);
  }
  .recording-clean-actions {
    width: 100%;
  }
  .recording-clean-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 0 var(--sp-3);
  }
}

/* ── Mobile Helper Defaults for Desktop ───────────────────── */
.show-on-mobile,
.show-on-mobile-flex,
.show-on-mobile-block {
  display: none !important;
}