/* ═══════════════════════════════════════════════════════
   CREATIVEFLOW — DESIGN SYSTEM & STYLES
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables (Light Mode) ── */
:root {
  --bg:           #f4f6fb;
  --bg2:          #eef1f8;
  --surface:      #ffffff;
  --surface2:     #f8faff;
  --border:       #e5e9f2;
  --border2:      #dde2ee;

  --text:         #0f172a;
  --text2:        #475569;
  --text3:        #94a3b8;
  --text-inv:     #ffffff;

  --brand:        #D70040;
  --brand-h:      #b8003a;
  --brand-light:  #fff0f4;
  --brand-mid:    rgba(215,0,64,0.12);

  --sidebar-bg:   #0f0f23;
  --sidebar-b:    rgba(255,255,255,0.06);
  --sidebar-text: #64748b;
  --sidebar-th:   #cbd5e1;
  --sidebar-act:  #D70040;
  --sidebar-actb: rgba(215,0,64,0.15);
  --sidebar-w:    240px;

  --green:    #22c55e;  --green-l:  #dcfce7;
  --blue:     #3b82f6;  --blue-l:   #dbeafe;
  --purple:   #8b5cf6;  --purple-l: #ede9fe;
  --amber:    #f59e0b;  --amber-l:  #fef3c7;
  --orange:   #f97316;  --orange-l: #ffedd5;
  --red:      #ef4444;  --red-l:    #fee2e2;
  --gray:     #6b7280;  --gray-l:   #f3f4f6;
  --indigo:   #6366f1;  --indigo-l: #eef2ff;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 2px 6px rgba(15,23,42,0.06);
  --shadow:    0 4px 12px rgba(15,23,42,0.08), 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 40px rgba(15,23,42,0.14), 0 4px 12px rgba(15,23,42,0.08);

  --r-sm:  6px;
  --r:     10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-f:   9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.18s var(--ease);
  --t2:   0.28s var(--ease);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg:       #0b0f1a;
  --bg2:      #111827;
  --surface:  #1a2235;
  --surface2: #1e2842;
  --border:   #2d3a52;
  --border2:  #374357;

  --text:  #f1f5f9;
  --text2: #94a3b8;
  --text3: #4b6080;

  --brand-light: rgba(215,0,64,0.15);
  --brand-mid:   rgba(215,0,64,0.10);

  --sidebar-bg:   #080c16;
  --sidebar-b:    rgba(255,255,255,0.04);
  --sidebar-text: #4b6080;
  --sidebar-th:   #94a3b8;

  --green-l:  rgba(34,197,94,0.12);
  --blue-l:   rgba(59,130,246,0.12);
  --purple-l: rgba(139,92,246,0.12);
  --amber-l:  rgba(245,158,11,0.12);
  --orange-l: rgba(249,115,22,0.12);
  --red-l:    rgba(239,68,68,0.12);
  --gray-l:   rgba(107,114,128,0.12);
  --indigo-l: rgba(99,102,241,0.12);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow:    0 4px 12px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.35);
}

/* ═══════════════════════════════════════════════════════
   PAGE LOADER — full-screen blur overlay during navigation
   ═══════════════════════════════════════════════════════ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: rgba(244, 246, 251, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
}
[data-theme="dark"] #page-loader {
  background: rgba(11, 15, 26, 0.6);
}
#page-loader.pl-out {
  opacity: 0;
  pointer-events: none;
}

/* Spinner ring */
.pl-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--brand);
  border-right-color: rgba(215, 0, 64, 0.3);
  animation: pl-spin 0.7s linear infinite;
  position: relative;
}
.pl-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(215, 0, 64, 0.4);
  animation: pl-spin 1.2s linear infinite reverse;
}
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background var(--t2), color var(--t2);
}

a { color: var(--brand); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1040 50%, #0d1b3e 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: #D70040; top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: #a80032; bottom: -80px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 250px; height: 250px; background: #ff2060; top: 50%; left: 60%; animation-delay: -6s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05) inset;
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.brand-icon-wrap {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #D70040, #a80032);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(215,0,64,0.4);
  flex-shrink: 0;
}
.brand-icon-wrap.sm { width: 32px; height: 32px; border-radius: var(--r-sm); }
.brand-icon-wrap .material-symbols-outlined { color: white; font-size: 22px; }
.brand-icon-wrap.sm .material-symbols-outlined { font-size: 17px; }

.brand-name  { font-size: 1.1rem; font-weight: 700; color: white; line-height: 1.1; }
.brand-tagline { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 2px; }

.login-title { margin-bottom: 28px; }
.login-title h1 { font-size: 1.6rem; font-weight: 700; color: white; margin-bottom: 6px; }
.login-title p  { font-size: 0.88rem; color: rgba(255,255,255,0.5); }

/* Login Form */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.7); margin-bottom: 8px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon-left {
  position: absolute; left: 13px;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}
.input-icon-right-btn {
  position: absolute; right: 10px;
  background: none; border: none; padding: 4px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex; align-items: center;
  transition: color var(--t);
}
.input-icon-right-btn:hover { color: rgba(255,255,255,0.7); }

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  padding: 11px 40px 11px 42px;
  font-size: 0.9rem;
  color: white;
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.form-input::placeholder { color: rgba(255,255,255,0.28); }
.form-input:focus {
  border-color: rgba(215,0,64,0.6);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(215,0,64,0.2);
}

/* App form inputs (inside app shell) */
.app-form .form-label { color: var(--text2); }
.app-form .input-wrap .input-icon-left { color: var(--text3); }
.app-form .form-input {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  padding: 10px 12px 10px 42px;
}
.app-form .form-input::placeholder { color: var(--text3); }
.app-form .form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-mid);
}
.app-form .form-input.no-icon { padding-left: 12px; }
.app-form select.form-input { padding-left: 12px; cursor: pointer; appearance: none; }
.app-form textarea.form-input { resize: vertical; min-height: 80px; padding: 10px 12px; }

/* Alert */
.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 0.84rem; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 0.88rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  line-height: 1;
}
.btn .material-symbols-outlined { font-size: 17px; }
.btn-primary {
  background: linear-gradient(135deg, #D70040, #b8003a);
  color: white;
  box-shadow: 0 4px 14px rgba(215,0,64,0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #b8003a, #96002f); box-shadow: 0 6px 20px rgba(215,0,64,0.45); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text2); }
.btn-secondary:hover { background: var(--bg2); border-color: var(--border2); color: var(--text); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg2); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-sm .material-symbols-outlined { font-size: 15px; }
.btn-lg { padding: 13px 24px; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }

/* Login-specific buttons */
.login-screen .btn-primary {
  background: linear-gradient(135deg, #D70040, #b8003a);
  color: white;
}
.login-screen .btn-full { margin-top: 4px; }

.login-demo { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.login-demo-label { font-size: 0.75rem; color: rgba(255,255,255,0.35); text-align: center; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 9px 12px;
  transition: all var(--t);
  font-family: inherit;
  cursor: pointer;
}
.demo-btn .material-symbols-outlined { font-size: 15px; }
.demo-btn:hover { background: rgba(215,0,64,0.2); border-color: rgba(215,0,64,0.4); color: white; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--t2), transform var(--t2);
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  height: 100vh;
  border-right: 1px solid var(--sidebar-b);
}

.sidebar.collapsed { width: 64px; }

.sidebar-header {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--sidebar-b);
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.brand-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  transition: opacity var(--t), width var(--t);
}
.sidebar.collapsed .brand-text { opacity: 0; width: 0; overflow: hidden; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-b); border-radius: 2px; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-text);
  padding: 10px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 0.855rem;
  font-weight: 450;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  position: relative;
}
.nav-item .material-symbols-outlined {
  font-size: 19px;
  flex-shrink: 0;
  transition: color var(--t);
}
.nav-item-label { transition: opacity var(--t); }
.sidebar.collapsed .nav-item-label { opacity: 0; width: 0; overflow: hidden; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--sidebar-th); }
.nav-item.active { background: var(--sidebar-actb); color: white; }
.nav-item.active .material-symbols-outlined { color: var(--sidebar-act); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--sidebar-act);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-f);
  flex-shrink: 0;
  transition: opacity var(--t);
}
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  border-top: 1px solid var(--sidebar-b);
  padding: 12px 8px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
  overflow: hidden;
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.sidebar-user-info { overflow: hidden; transition: opacity var(--t); }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 500; color: var(--sidebar-th); white-space: nowrap; }
.sidebar-user-role { font-size: 0.7rem; color: var(--sidebar-text); white-space: nowrap; margin-top: 1px; }

.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 0.855rem;
  cursor: pointer;
  transition: all var(--t);
  margin-top: 2px;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.1); color: #fca5a5; }
.sidebar-logout .material-symbols-outlined { font-size: 19px; flex-shrink: 0; }
.sidebar-logout-label { transition: opacity var(--t); }
.sidebar.collapsed .sidebar-logout-label { opacity: 0; width: 0; overflow: hidden; }

/* ── MAIN WRAPPER ── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  transition: margin-left var(--t2);
  min-width: 0;
}
.sidebar.collapsed ~ .main-wrapper,
.main-wrapper.expanded { margin-left: 64px; }

/* ── HEADER ── */
.app-header {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.88rem; color: var(--text2);
}
.breadcrumb .material-symbols-outlined { font-size: 14px; color: var(--text3); }
.breadcrumb-home { color: var(--text3); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 7px 14px;
  width: 240px;
  transition: all var(--t);
}
.search-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-mid); background: var(--surface); }
.search-bar .material-symbols-outlined { color: var(--text3); font-size: 17px; flex-shrink: 0; }
.search-bar input { background: none; border: none; outline: none; font-size: 0.84rem; color: var(--text); width: 100%; }
.search-bar input::placeholder { color: var(--text3); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text2);
  transition: all var(--t);
  position: relative;
}
.icon-btn:hover { background: var(--bg2); color: var(--text); }
.icon-btn .material-symbols-outlined { font-size: 20px; }

.sidebar-collapse-btn { color: var(--text2); }

.badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 17px; height: 17px;
  background: var(--red);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: var(--r-f);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

.header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--border);
  transition: transform var(--t), box-shadow var(--t);
}
.header-avatar:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--brand); }

/* ── NOTIFICATION PANEL — Feature 2 enhanced ── */
.notif-wrap { position: relative; }
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.notif-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.notif-filter-tab {
  font-size: .74rem; font-weight: 600;
  padding: 3px 12px; border-radius: 20px;
  border: none; cursor: pointer; font-family: inherit;
  transition: background var(--t), color var(--t);
  color: var(--text3); background: transparent;
}
.notif-filter-tab.active { background: var(--brand); color: #fff; }
.link-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; color: var(--brand); font-family: inherit;
  transition: opacity var(--t);
}
.link-btn:hover { opacity: 0.75; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-group-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text3);
  padding: 10px 16px 4px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--brand-light); }
[data-theme="dark"] .notif-item.unread { background: var(--brand-mid); }
.notif-item:last-child { border-bottom: none; }
.notif-icon-wrap {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.notif-icon-wrap .material-symbols-outlined { font-size: 16px; }
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0;
  margin-top: 7px; margin-right: -4px;
}
/* keep old dot class working for any legacy code */
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; margin-top: 5px; }
.notif-dot.read { background: transparent; border: 1.5px solid var(--border2); }
.notif-text { font-size: 0.82rem; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--text3); margin-top: 3px; }
.notif-empty { padding: 40px 16px; text-align: center; color: var(--text3); font-size: 0.84rem; }
.notif-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── MONTHLY REPORT — Feature 5 ── */
.report-month-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.report-month-tab {
  font-size: .76rem; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer; font-family: inherit;
  color: var(--text2); background: var(--bg2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.report-month-tab.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.report-chart-wrap { height: 180px; padding: 0 4px; }
.report-breakdown-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px;
}
.report-breakdown-section { }
.report-breakdown-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text3); margin-bottom: 8px;
}
.report-breakdown-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
.report-breakdown-row:last-child { border-bottom: none; }
.report-breakdown-name { flex: 1; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-breakdown-bar-wrap { width: 60px; background: var(--bg2); border-radius: 4px; height: 5px; overflow: hidden; }
.report-breakdown-bar { height: 100%; border-radius: 4px; background: var(--brand); }
.report-breakdown-count { font-weight: 700; color: var(--text); min-width: 20px; text-align: right; font-size: .78rem; }

/* ── PAGE CONTENT ── */
.page-content { flex: 1; padding: 28px; overflow-x: hidden; }

/* ═══════════════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════════════ */

/* Page Header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-header-info {}
.page-title { font-size: 1.45rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-subtitle { font-size: 0.85rem; color: var(--text2); }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--border2); }
.card-sm { padding: 14px 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 0.78rem; color: var(--text3); margin-top: 2px; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex; align-items: flex-start; gap: 14px;
  transition: all var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon .material-symbols-outlined { font-size: 22px; }
.stat-body {}
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: 0.78rem; color: var(--text2); font-weight: 500; }
.stat-change { font-size: 0.72rem; color: var(--green); margin-top: 4px; display: flex; align-items: center; gap: 2px; }
.stat-change.down { color: var(--red); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Avatar */
.avatar {
  border-radius: var(--r-f);
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-md { width: 36px; height: 36px; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.68rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.4rem; font-weight: 800; }

/* Brand Picker */
.brand-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
}
.brand-pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: var(--r);
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  transition: all var(--t);
  min-width: 60px;
  user-select: none;
}
.brand-pick-item img {
  width: 40px;
  height: 28px;
  object-fit: contain;
}
.brand-pick-item span {
  font-size: .67rem;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
  letter-spacing: .01em;
}
.brand-pick-item:hover { border-color: var(--brand); background: var(--bg2); }
.brand-pick-item:hover span { color: var(--text2); }
.brand-pick-item.selected { border-color: var(--brand); background: rgba(215,0,64,.07); }
.brand-pick-item.selected span { color: var(--brand); }

/* Avatar Upload */
.avatar-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.avatar-upload-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}
.avatar-upload-wrap .avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 1.6rem;
  border: 3px solid var(--border);
  transition: filter 0.2s;
}
.avatar-upload-wrap:hover .avatar-xl { filter: brightness(0.85); }
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
  color: #fff;
  pointer-events: none;
}
.avatar-upload-overlay .material-symbols-outlined { font-size: 22px; }
.avatar-upload-wrap:hover .avatar-upload-overlay { opacity: 1; }
.avatar-upload-hint {
  font-size: 0.75rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 4px;
}
@keyframes avatar-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Badges / Tags */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-f);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.tag .material-symbols-outlined { font-size: 12px; }

/* Priority tags */
.tag-low      { background: var(--green-l);  color: var(--green); }
.tag-medium   { background: var(--amber-l);  color: var(--amber); }
.tag-high     { background: var(--orange-l); color: var(--orange); }
.tag-urgent   { background: var(--red-l);    color: var(--red); }

/* Status tags */
.tag-new      { background: var(--indigo-l); color: var(--indigo); }
.tag-assigned { background: var(--purple-l); color: var(--purple); }
.tag-wip      { background: var(--blue-l);   color: var(--blue); }
.tag-review   { background: var(--amber-l);  color: var(--amber); }
.tag-revision { background: var(--orange-l); color: var(--orange); }
.tag-completed{ background: var(--green-l);  color: var(--green); }
.tag-published,
.tag-archived { background: var(--purple-l); color: var(--purple); }

/* Role tags */
.tag-role-admin    { background: var(--indigo-l); color: var(--indigo); }
.tag-role-director { background: #fce7f3;         color: #be185d; }
.tag-role-manager  { background: var(--purple-l); color: var(--purple); }
.tag-role-writer   { background: var(--blue-l);   color: var(--blue); }
.tag-role-creative { background: var(--orange-l); color: var(--orange); }

/* Filters bar */
.filters-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 32px 8px 12px;
  font-size: 0.83rem;
  color: var(--text2);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--t);
}
.filter-select:focus { border-color: var(--brand); }

/* Table */
.table-wrap { overflow-x: auto; margin: -1px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 13px 14px;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }

/* Mobile card meta — hidden on desktop, shown on mobile via media query */
.mobile-card-meta { display: none; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-icon {
  width: 64px; height: 64px;
  background: var(--bg2);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.empty-icon .material-symbols-outlined { font-size: 30px; color: var(--text3); }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 0.84rem; color: var(--text2); max-width: 300px; margin: 0 auto 20px; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════ */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-wrap { position: relative; height: 240px; }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.activity-text { font-size: 0.83rem; color: var(--text); line-height: 1.5; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.72rem; color: var(--text3); margin-top: 3px; }

/* Team workload row */
.team-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-row:last-child { margin-bottom: 0; }
.team-row-info { display: flex; align-items: center; gap: 10px; width: 140px; flex-shrink: 0; }
.team-row-name { font-size: 0.83rem; font-weight: 500; color: var(--text); }
.progress-bar-wrap { flex: 1; }
.progress-bar {
  height: 8px;
  background: var(--bg2);
  border-radius: var(--r-f);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #ff2060);
  border-radius: var(--r-f);
  transition: width 0.5s ease;
}
.team-row-count { font-size: 0.78rem; color: var(--text2); width: 40px; text-align: right; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   REQUESTS LIST
   ═══════════════════════════════════════════════════════ */
.request-row { cursor: pointer; }
.request-title-cell { display: flex; flex-direction: column; }
.request-title-main { font-weight: 500; color: var(--text); margin-bottom: 2px; }
.request-title-sub { font-size: 0.75rem; color: var(--text3); }
.deadline-cell { font-size: 0.83rem; }
.deadline-overdue { color: var(--red); font-weight: 500; }
.deadline-soon { color: var(--amber); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   REQUEST DETAIL
   ═══════════════════════════════════════════════════════ */
.request-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text3); margin-bottom: 14px;
}
.detail-field { margin-bottom: 16px; }
.detail-field-label { font-size: 0.78rem; color: var(--text3); margin-bottom: 4px; }
.detail-field-value { font-size: 0.9rem; color: var(--text); font-weight: 450; }

.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding-bottom: 20px;
  position: relative;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute;
  left: 11px; top: 24px;
  width: 2px; height: calc(100% - 24px);
  background: var(--border);
}
.timeline-step:last-child::before { display: none; }
.timeline-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}
.timeline-dot .material-symbols-outlined { font-size: 13px; color: var(--text3); }
.timeline-dot.done { border-color: var(--green); background: var(--green); }
.timeline-dot.done .material-symbols-outlined { color: white; }
.timeline-dot.active { border-color: var(--brand); background: var(--brand); }
.timeline-dot.active .material-symbols-outlined { color: white; }
.timeline-info {}
.timeline-label { font-size: 0.84rem; font-weight: 500; color: var(--text); }
.timeline-date { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment-item { display: flex; gap: 10px; }
.comment-body { background: var(--bg); border-radius: var(--r); padding: 12px 14px; flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-author { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.comment-time { font-size: 0.72rem; color: var(--text3); }
.comment-text { font-size: 0.84rem; color: var(--text2); line-height: 1.5; }
.comment-input-row { display: flex; gap: 10px; align-items: flex-end; }
.comment-textarea { flex: 1; }

/* Attachment chips */
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 0.8rem; color: var(--text2);
  cursor: pointer;
  transition: all var(--t);
}
.attachment-chip:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.attachment-chip .material-symbols-outlined { font-size: 16px; }

/* File upload zone */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.file-drop-zone .material-symbols-outlined { font-size: 32px; color: var(--text3); margin-bottom: 8px; }
.file-drop-zone p { font-size: 0.83rem; color: var(--text3); }
.file-drop-zone span { color: var(--brand); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   KANBAN BOARD
   ═══════════════════════════════════════════════════════ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
  width: 100%;
}

.kanban-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0;
  margin-bottom: 0;
}
.kanban-col-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}
.kanban-col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.kanban-col-count {
  font-size: 0.72rem; font-weight: 700;
  background: var(--bg2);
  color: var(--text2);
  padding: 2px 8px;
  border-radius: var(--r-f);
}

.kanban-col-body {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  padding: 10px;
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--t);
}
.kanban-col-body.drag-over { background: var(--brand-light); border-color: var(--brand); }
[data-theme="dark"] .kanban-col-body.drag-over { background: var(--brand-mid); }
.kanban-empty-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 12px;
  color: var(--text3);
  font-size: .75rem;
  opacity: .5;
  pointer-events: none;
  border: 2px dashed var(--border);
  border-radius: var(--r);
}
.kanban-empty-col .material-symbols-outlined { font-size: 1.4rem; }

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
  position: relative;
}
.kanban-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); border-color: var(--border2); }
.kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
.kanban-card.removing { opacity: 0; transform: scale(0.92); transition: all 0.28s ease; }

/* Highlight cards assigned to the current viewer */
/* Highlight cards assigned to current viewer (all-tasks scope only) */
.kanban-card--mine { background: var(--brand-light); }
.kanban-card--mine:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .kanban-card--mine { background: var(--brand-mid); }

/* "You" pill badge */
.kanban-mine-badge {
  flex-shrink: 0;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 20px;
  padding: 1px 7px;
  line-height: 1.6;
}
[data-theme="dark"] .kanban-mine-badge { background: var(--brand-mid); }

.kanban-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.kanban-card-title { font-size: 0.84rem; font-weight: 500; color: var(--text); line-height: 1.4; }
.kanban-card:hover .kanban-card-title { color: var(--brand); }
.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: flex-end;
  overflow: hidden;
}
.kanban-publish-btn {
  display: flex; align-items: center; gap: 3px;
  height: 22px;
  border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  color: var(--green, #22c55e);
  cursor: pointer;
  font-size: .65rem; font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-right: 0;
  transition: max-width 0.28s ease, opacity 0.22s ease,
              padding 0.28s ease, margin-right 0.28s ease,
              background var(--t), border-color var(--t);
}
.kanban-publish-btn .material-symbols-outlined { font-size: 13px; flex-shrink: 0; }
.kanban-publish-btn:hover { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); }
.kanban-card:hover .kanban-publish-btn {
  max-width: 90px;
  opacity: 1;
  padding: 0 6px;
  margin-right: 6px;
}

.kanban-delete-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  color: var(--red, #ef4444);
  cursor: pointer;
  flex-shrink: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-right: 0;
  transition: max-width 0.28s ease, opacity 0.22s ease,
              padding 0.28s ease, margin-right 0.28s ease,
              background var(--t), border-color var(--t);
}
.kanban-delete-btn .material-symbols-outlined { font-size: 13px; flex-shrink: 0; }
.kanban-delete-btn:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); }
.kanban-card:hover .kanban-delete-btn {
  max-width: 26px;
  opacity: 1;
  padding: 0 4px;
  margin-right: 4px;
}

/* btn-success */
.btn-success {
  background: var(--green, #22c55e); color: #fff;
  border: none; cursor: pointer;
}
.btn-success:hover { opacity: .88; }

/* Published widget blur + show more */
.pub-widget-wrap { position: relative; overflow: hidden; }
.pub-blur-row { opacity: 0.35; filter: blur(2.5px); pointer-events: none; user-select: none; }
.pub-widget-more {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; align-items: flex-end;
  padding: 32px 0 16px;
  background: linear-gradient(to bottom, transparent 0%, var(--surface, #fff) 55%);
  pointer-events: none;
}
.pub-widget-more button { pointer-events: all; }
[data-theme="dark"] .pub-widget-more {
  background: linear-gradient(to bottom, transparent 0%, var(--surface, #1e1e2e) 55%);
}

/* ══════════════════════════════════════════════════════
   CALENDAR
   ══════════════════════════════════════════════════════ */
.cal-header {
  display: flex;
  align-items: center;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}
.cal-month-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  min-width: 200px;
  text-align: center;
  flex: 1;
}
.cal-grid { border-top: 1px solid var(--border); }
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg2);
}
.cal-dow {
  padding: 8px 0;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-right: 1px solid var(--border);
}
.cal-dow:last-child { border-right: none; }
.cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-row:last-child { border-bottom: none; }
.cal-cell {
  min-height: 108px;
  padding: 7px 6px 6px;
  border-right: 1px solid var(--border);
  vertical-align: top;
  overflow: hidden;
  transition: background .12s;
  display: flex;
  flex-direction: column;
}
.cal-cell:last-child { border-right: none; }
.cal-cell:hover:not(.cal-cell-empty) { background: var(--bg2); }
.cal-cell-empty { background: var(--bg2); opacity: .4; min-height: 108px; }
.cal-past .cal-cell-num { color: var(--text3); }
.cal-weekend { background: rgba(0,0,0,.015); }
[data-theme="dark"] .cal-weekend { background: rgba(255,255,255,.015); }
.cal-today { background: rgba(99,102,241,.06) !important; }
.cal-cell-num {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text2);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.cal-today-num {
  background: var(--brand, #6366f1);
  color: #fff !important;
  font-weight: 700;
}
.cal-special-days-wrap {
  margin-top: auto;
  padding-top: 3px;
}
.cal-special-day {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  font-size: .67rem;
  font-weight: 600;
  color: #e53935;
  background: rgba(229,57,53,.1);
  border: 1px solid rgba(229,57,53,.25);
  border-radius: 4px;
  padding: 2px 5px;
  margin-top: 2px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  cursor: pointer;
  transition: background .12s;
}
.cal-special-day .cal-sd-icon { flex-shrink: 0; margin-top: 1px; }
.cal-special-day:hover { background: rgba(229,57,53,.2); }
.cal-task {
  display: block;
  font-size: .67rem;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--text);
  transition: filter .12s;
  text-decoration: none;
}
.cal-task:hover { filter: brightness(1.12); }
.cal-task-more {
  font-size: .64rem;
  color: var(--text3);
  padding: 1px 5px;
  cursor: default;
}

/* Responsive: shrink cells on small screens */
@media (max-width: 700px) {
  .cal-cell { min-height: 60px; padding: 4px 3px; }
  .cal-cell-empty { min-height: 60px; }
  .cal-dow { font-size: .62rem; }
  .cal-task { display: none; }
  .cal-task-more { display: none; }
  .cal-special-day { font-size: .6rem; padding: 1px 3px; }
  .cal-cell-num { font-size: .72rem; width: 20px; height: 20px; }
}

/* ── Day-detail popup ── */
.day-detail-special {
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.18);
  margin-bottom: 10px;
}
.day-detail-summary {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.55;
}
.day-detail-loading {
  font-size: .78rem;
  color: var(--text3);
  font-style: italic;
}
.day-detail-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: .83rem;
}
.day-detail-task-row:last-child { border-bottom: none; }

/* ── Sidebar upcoming special days ── */
.sidebar-upcoming {
  margin: 12px 8px 0;
  border-radius: var(--r);
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.18);
  padding: 8px 10px 6px;
  overflow: hidden;
  transition: opacity var(--t);
}
.sidebar.collapsed .sidebar-upcoming { opacity: 0; pointer-events: none; }
.sidebar-upcoming-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--amber, #f59e0b);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-upcoming-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(245,158,11,.12);
  cursor: pointer;
}
.sidebar-upcoming-row:last-of-type { border-bottom: none; }
.sidebar-upcoming-row:hover .sidebar-upcoming-name { color: var(--amber, #f59e0b); }
.sidebar-upcoming-name {
  font-size: .73rem;
  font-weight: 500;
  color: var(--sidebar-th, #fff);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.sidebar-upcoming-days {
  font-size: .68rem;
  font-weight: 700;
  color: var(--amber, #f59e0b);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}
.sidebar-upcoming-more {
  display: block;
  text-align: center;
  font-size: .7rem;
  color: var(--amber, #f59e0b);
  margin-top: 6px;
  cursor: pointer;
  opacity: .8;
}
.sidebar-upcoming-more:hover { opacity: 1; }

/* Sidebar upcoming row urgency highlights */
.sidebar-upcoming-row--today {
  background: rgba(239,68,68,.12);
  border-radius: 5px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-bottom: none !important;
}
.sidebar-upcoming-row--today .sidebar-upcoming-name { color: #fca5a5; font-weight: 600; }
.sidebar-upcoming-row--today .sidebar-upcoming-days { color: #f87171; }
.sidebar-upcoming-row--soon {
  background: rgba(245,158,11,.14);
  border-radius: 4px;
  padding: 3px 5px;
  margin: 0 -5px;
}
.sidebar-upcoming-row--soon .sidebar-upcoming-days { color: #fbbf24; }
.sidebar-upcoming-row--near .sidebar-upcoming-days { color: var(--amber, #f59e0b); opacity: .85; }

/* ── Login special day note ── */
.login-sd-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 18px;
}
.login-sd-text { display: flex; flex-direction: column; gap: 2px; }
.login-sd-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.65);
}
.login-sd-names {
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.9);
}
@keyframes sd-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(1.15); }
}

/* ── Login Page Position Variants ── */
.login-screen.login-pos-left  { justify-content: flex-start; }
.login-screen.login-pos-right { justify-content: flex-end; }

/* ── Login Page Customization: Position Picker ── */
.login-pos-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--text2);
  font-size: .75rem;
  transition: border-color .15s, background .15s;
}
.login-pos-btn:hover { border-color: var(--brand); }
.login-pos-btn.active {
  border-color: var(--brand);
  background: rgba(215,0,64,.07);
  color: var(--brand);
}
.login-pos-preview {
  width: 64px;
  height: 36px;
  background: var(--bg2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.login-pos-card {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 22px;
  border-radius: 3px;
  background: var(--brand);
  opacity: .7;
}
.login-pos-card.left   { left: 4px; }
.login-pos-card.center { left: 50%; transform: translateX(-50%); }
.login-pos-card.right  { right: 4px; }

/* ── Dashboard today special day banner ── */
.today-special-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--brand);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(215,0,64,.3);
}
.today-special-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.today-special-body { flex: 1; min-width: 0; }
.today-special-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.75);
  margin-bottom: 3px;
}
.today-special-names {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-special-star {
  font-size: 22px;
  color: rgba(255,255,255,.3);
  flex-shrink: 0;
}

/* ── Calendar icon box (dashboard banner + login note) ── */
.sd-cal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.sd-cal-month {
  width: 100%;
  text-align: center;
  background: rgba(0,0,0,.35);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(255,255,255,.9);
  padding: 3px 0 2px;
  text-transform: uppercase;
}
.sd-cal-day {
  width: 100%;
  text-align: center;
  background: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  padding: 5px 0 6px;
}

/* Login note cal box — slightly smaller */
.login-sd-note .sd-cal-box {
  width: 38px;
}
.login-sd-note .sd-cal-month {
  font-size: .52rem;
  padding: 2px 0 2px;
}
.login-sd-note .sd-cal-day {
  font-size: 1.1rem;
  padding: 4px 0 5px;
  color: var(--brand, #D70040);
}

.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.kanban-card-deadline { font-size: 0.72rem; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.kanban-card-deadline .material-symbols-outlined { font-size: 13px; }
.kanban-card-people { display: flex; align-items: center; gap: -4px; }
.kanban-card-people .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.kanban-card-people .avatar:first-child { margin-left: 0; }
.priority-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--r) 0 0 var(--r);
}

/* ═══════════════════════════════════════════════════════
   USERS PAGE
   ═══════════════════════════════════════════════════════ */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
  position: relative;
}
.user-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.user-card-avatar { margin: 0 auto 14px; }
.user-card-name { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.user-card-email { font-size: 0.78rem; color: var(--text3); margin-bottom: 12px; }
.user-card-stats { display: flex; gap: 0; justify-content: center; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.user-stat { flex: 1; text-align: center; }
.user-stat-val { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.user-stat-label { font-size: 0.68rem; color: var(--text3); margin-top: 2px; }
.user-card-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.user-status-dot {
  position: absolute; top: 14px; right: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.user-status-dot.active { background: var(--green); }
.user-status-dot.disabled { background: var(--gray); }

/* ═══════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════ */
.profile-header-card {
  background: linear-gradient(135deg, #D70040 0%, #b8003a 40%, #8c0030 100%);
  border-radius: var(--r-lg);
  padding: 32px;
  color: white;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(215,0,64,0.35);
}
.profile-avatar { border: 4px solid rgba(255,255,255,0.25); }
.profile-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.profile-role { font-size: 0.88rem; opacity: 0.75; }
.profile-info-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; opacity: 0.8; font-size: 0.84rem; }
.profile-info-row .material-symbols-outlined { font-size: 16px; }

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: modal-in 0.2s var(--ease);
  border: 1px solid var(--border);
}
.modal-box.modal-lg { max-width: 720px; }
.modal-box.modal-sm { max-width: 400px; }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  transition: all var(--t);
}
.modal-close:hover { background: var(--bg2); color: var(--text); }
.modal-close .material-symbols-outlined { font-size: 18px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* App Form (inside modal or page) */
.app-form { display: flex; flex-direction: column; gap: 18px; }
.app-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.app-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.app-form .form-label { font-size: 0.8rem; font-weight: 500; color: var(--text2); }
.app-form .form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}
.app-form .form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-mid);
}
.app-form textarea.form-input { resize: vertical; min-height: 90px; }

/* ── Flash animations ── */
@keyframes status-flash-anim {
  0%   { box-shadow: 0 0 0 0 rgba(215,0,64,0.6); background: var(--brand-light); }
  70%  { box-shadow: 0 0 0 8px rgba(215,0,64,0); }
  100% { box-shadow: none; background: inherit; }
}
.status-flash { animation: status-flash-anim 0.6s ease-out forwards; }

/* Live update: external change arrived via SSE */
@keyframes live-update-anim {
  0%   { outline: 2px solid rgba(34,197,94,0.8); outline-offset: 0px; background: rgba(34,197,94,.08); }
  60%  { outline: 2px solid rgba(34,197,94,0.1); outline-offset: 3px; }
  100% { outline: none; background: inherit; }
}
.card-live-update {
  animation: live-update-anim 0.8s ease-out forwards;
  border-radius: var(--r-f);
}
.cell-live-update {
  animation: live-update-anim 0.8s ease-out forwards;
  border-radius: 4px;
}

/* Live remove: card deleted by someone else */
@keyframes live-remove-anim {
  0%   { opacity: 1; transform: scaleY(1); max-height: 200px; }
  40%  { opacity: 0.2; background: rgba(239,68,68,.1); }
  100% { opacity: 0; transform: scaleY(0); max-height: 0; margin: 0; padding: 0; }
}
.card-live-remove {
  animation: live-remove-anim 0.35s ease-in forwards;
  overflow: hidden;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   FEATURE 1 — DEADLINE ALERT WIDGET
   ═══════════════════════════════════════════════════════ */
.deadline-alert-card { border-color: var(--red) !important; }

@keyframes deadline-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.deadline-pulse-icon {
  font-size: 18px;
  animation: deadline-pulse 1.6s ease-in-out infinite;
}

.deadline-alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--bg2);
  cursor: pointer;
  transition: background 0.15s;
}
.deadline-alert-item:hover { background: var(--bg3); }
.deadline-alert-icon { font-size: 20px; flex-shrink: 0; }

.deadline-alert-countdown {
  flex-shrink: 0;
  font-size: .74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .03em;
}
.deadline-alert-countdown.deadline-overdue {
  background: rgba(239,68,68,.12);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.25);
}
.deadline-alert-countdown.deadline-soon {
  background: rgba(245,158,11,.12);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,.25);
}

/* ═══════════════════════════════════════════════════════
   FEATURE 7 — QUICK STATUS CHANGE DROPDOWN
   ═══════════════════════════════════════════════════════ */
.quick-status-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  font: inherit;
  padding: 3px 8px;
  border-radius: 20px;
  transition: opacity 0.15s, transform 0.1s;
}
.quick-status-btn:hover { opacity: 0.82; transform: scale(1.03); }

.quick-status-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  min-width: 170px;
  overflow: hidden;
  animation: fadeIn 0.1s ease-out;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

.quick-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text);
  transition: background 0.1s;
}
.quick-status-option:hover  { background: var(--bg2); }
.quick-status-option.active { background: var(--brand-light); font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   FEATURE 6 — STATUS TIMELINE TIMESTAMPS
   ═══════════════════════════════════════════════════════ */
.timeline-duration {
  font-size: .7rem;
  color: var(--text3);
  margin-top: 1px;
}
.timeline-date-exact {
  font-size: .72rem;
  color: var(--text3);
  margin-top: 1px;
}
.timeline-dot.done  { background: var(--green); border-color: var(--green); }
.timeline-dot.active { border-color: var(--brand); }

/* ── Settings save row ── */
.settings-save-row {
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.app-form select.form-input { cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 2000;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  min-width: 300px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-in 0.3s var(--ease);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.removing { opacity: 0; transform: translateX(100%); }
@keyframes toast-in { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
.toast-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon .material-symbols-outlined { font-size: 17px; }
.toast-success .toast-icon { background: var(--green-l); color: var(--green); }
.toast-error   .toast-icon { background: var(--red-l);   color: var(--red); }
.toast-info    .toast-icon { background: var(--blue-l);  color: var(--blue); }
.toast-warn    .toast-icon { background: var(--amber-l); color: var(--amber); }
.toast-body { flex: 1; }
.toast-title { font-size: 0.84rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.toast-msg   { font-size: 0.78rem; color: var(--text2); line-height: 1.4; }

/* ═══════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  padding: 9px 14px;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--t);
  display: flex; align-items: center; gap: 9px;
}
.settings-nav-item .material-symbols-outlined { font-size: 17px; }
.settings-nav-item:hover { background: var(--bg2); color: var(--text); }
.settings-nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
[data-theme="dark"] .settings-nav-item.active { background: var(--brand-mid); }
.settings-section { display: flex; flex-direction: column; gap: 16px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info {}
.settings-row-label { font-size: 0.9rem; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.settings-row-desc { font-size: 0.78rem; color: var(--text3); }

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border2);
  border-radius: var(--r-f);
  cursor: pointer;
  transition: background var(--t);
}
.toggle-track::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track { background: var(--brand); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════
   SEARCH RESULTS — Feature 8 enhanced
   ═══════════════════════════════════════════════════════ */
.search-results-overlay {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.search-results-list { overflow-y: auto; flex: 1; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--t);
  border-bottom: 1px solid var(--border);
}
.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }
.search-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text3);
  font-size: .85rem;
}

/* Filter bar inside search overlay */
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.search-filter-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.search-filter-select {
  font-size: .78rem;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  outline: none;
  max-width: 130px;
}
.search-filter-select:focus { border-color: var(--brand); }
.search-filter-select.active { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* Footer */
.search-overlay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.search-overlay-footer-hint { font-size: .72rem; color: var(--text3); }
.search-go-btn {
  font-size: .78rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border: none;
  border-radius: var(--r);
  padding: 5px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background var(--t);
}
.search-go-btn:hover { background: var(--brand-mid); }

/* ═══════════════════════════════════════════════════════
   WORKLOAD PAGE — Feature 4
   ═══════════════════════════════════════════════════════ */
.workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.workload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  transition: box-shadow var(--t);
  cursor: default;
}
.workload-card:hover { box-shadow: var(--shadow-md); }
.workload-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.workload-card-info { flex: 1; min-width: 0; }
.workload-card-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.workload-card-role { font-size: .74rem; color: var(--text3); margin-top: 2px; }
.workload-bar-wrap {
  margin-bottom: 14px;
}
.workload-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--text3);
  margin-bottom: 5px;
}
.workload-bar-track {
  height: 8px;
  background: var(--bg2);
  border-radius: 8px;
  overflow: hidden;
}
.workload-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}
.workload-stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.workload-stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.workload-tasks-list { display: flex; flex-direction: column; gap: 6px; }
.workload-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg2);
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--t);
  font-size: .8rem;
}
.workload-task-row:hover { background: var(--bg3); }
.workload-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.workload-overdue-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 20px;
  background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.2);
}

/* ═══════════════════════════════════════════════════════
   STATUS SELECTOR
   ═══════════════════════════════════════════════════════ */
.status-select {
  display: flex; flex-direction: column; gap: 6px;
}
.status-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
  font-size: 0.85rem;
  color: var(--text2);
}
.status-option:hover { background: var(--bg2); }
.status-option.selected { background: var(--brand-light); color: var(--brand); font-weight: 500; }
[data-theme="dark"] .status-option.selected { background: var(--brand-mid); }
.status-option-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar Mobile Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--t2);
}
.sidebar-overlay.visible { opacity: 1; }

@media (max-width: 900px) {
  /* Sidebar becomes a drawer */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay { display: block; }
  .main-wrapper { margin-left: 0 !important; }

  /* Layouts */
  .grid-2 { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .request-detail-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }

  /* Hide inline search bar — replaced by icon toggle */
  .search-bar { display: none; }
  .search-bar.mobile-visible {
    display: flex;
    position: fixed;
    top: 60px; left: 0; right: 0;
    margin: 8px 16px;
    z-index: 60;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--r);
    width: calc(100% - 32px);
  }
  /* Show mobile search toggle button on all sub-900px sizes */
  #mobile-search-btn { display: flex !important; }

  .search-results-overlay { width: calc(100vw - 32px); left: 16px; transform: none; top: 116px; }
  .profile-header-card { flex-direction: column; text-align: center; }
  .profile-header-card > div:last-child { margin-left: 0; margin-top: 12px; }
}

/* ── Tablet-specific (641–900px) ── */
@media (min-width: 641px) and (max-width: 900px) {
  .page-content { padding: 20px 24px 24px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .users-grid { grid-template-columns: repeat(3, 1fr); }
  .kanban-board { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  /* Layout */
  .page-content { padding: 14px; }
  .page-header { margin-bottom: 18px; gap: 12px; }
  .page-title { font-size: 1.2rem; }
  .page-actions .btn span.material-symbols-outlined + * { display: none; } /* icon-only btns in header */
  .page-actions .btn { padding: 9px; border-radius: var(--r-sm); }
  .page-actions .btn .material-symbols-outlined { font-size: 19px; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-icon .material-symbols-outlined { font-size: 19px; }
  .stat-value { font-size: 1.45rem; }
  .stat-label { font-size: 0.72rem; }
  .stat-change { display: none; }

  /* Cards */
  .card { padding: 16px; }
  .card-header { margin-bottom: 14px; }
  .card-title { font-size: 0.9rem; }
  .charts-grid { gap: 14px; }
  .chart-wrap { height: 200px; }
  .grid-2 { gap: 14px; }

  /* Header */
  .app-header { padding: 0 14px; gap: 8px; }
  .breadcrumb .breadcrumb-home { display: none; }
  .breadcrumb .material-symbols-outlined { display: none; }
  .breadcrumb-current { font-size: 0.92rem; }
  .header-right { gap: 4px; }
  .icon-btn { width: 38px; height: 38px; }

  /* Request table → mobile cards */
  .table-wrap { overflow-x: visible; }
  table { display: block; }
  thead { display: none; }
  tbody { display: flex; flex-direction: column; gap: 10px; }
  tr {
    display: flex; flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px 14px 14px 16px;
    cursor: pointer;
    transition: background var(--t), box-shadow var(--t);
    background: var(--surface);
  }
  tr:hover { background: var(--bg); box-shadow: var(--shadow-sm); }
  tr:hover td { background: transparent; }
  td { display: block; padding: 0; border-bottom: none; font-size: 0.85rem; }
  td:empty { display: none; }

  /* Show only the first title cell on mobile — others hidden */
  tr td:nth-child(n+2) { display: none; }
  tr td:first-child { display: block; }
  .mobile-card-meta { display: flex !important; }

  /* Mobile card cell layout */
  .request-title-main { font-size: 0.88rem; font-weight: 600; color: var(--text); }
  .request-title-sub { font-size: 0.73rem; color: var(--text3); margin-top: 3px; }

  /* Table in non-request contexts (like profile) */
  .profile-page tbody tr td:nth-child(n+2) { display: table-cell; }

  /* Filters */
  .filters-bar { gap: 8px; }
  .filters-bar .search-bar { display: flex !important; position: static; width: 100%; margin: 0; box-shadow: none; border-radius: var(--r); }
  .filter-select { font-size: 0.78rem; padding: 7px 26px 7px 10px; }

  /* Users grid */
  .users-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .user-card { padding: 16px 12px; }
  .user-card-name { font-size: 0.85rem; }
  .user-card-email { font-size: 0.7rem; margin-bottom: 8px; }
  .user-card-actions { gap: 6px; }

  /* Kanban */
  .kanban-board { grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 20px; }
  .kanban-col { min-width: 0; }
  .kanban-card { padding: 12px; }

  /* Modals — full screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    animation: modal-slide-up 0.28s var(--ease);
  }
  .modal-box.modal-sm { max-width: 100%; }
  .modal-box.modal-lg { max-width: 100%; }
  @keyframes modal-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .modal-body { padding: 18px; }
  .modal-header { padding: 16px 18px; }
  .modal-footer { padding: 14px 18px; }
  .app-form .form-row { grid-template-columns: 1fr; }

  /* Request detail */
  .request-detail-grid { gap: 16px; }
  .profile-header-card { padding: 24px 18px; gap: 16px; }
  .profile-name { font-size: 1.2rem; }

  /* Settings */
  .settings-grid { gap: 14px; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .settings-nav-item { padding: 7px 12px; font-size: 0.78rem; }
  .settings-nav-item .material-symbols-outlined { font-size: 15px; }

  /* Activity feed */
  .team-row-info { width: 100px; }
  .team-row-name { font-size: 0.78rem; }

  /* Comments */
  .comment-input-row { gap: 8px; }
  .comment-input-row .avatar { display: none; }

  /* Toast */
  .toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: 100%; }

  /* Login */
  .login-card { padding: 28px 22px; }
  .login-brand { margin-bottom: 24px; }
  .demo-btns { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Search results */
  .search-results-overlay { top: 68px; left: 8px; right: 8px; width: auto; }

  /* Notification panel */
  .notif-panel { width: calc(100vw - 24px); right: -60px; }

  /* Bottom nav spacing so content isn't hidden */
  .page-content { padding-bottom: 90px; }
}

/* ── Very small screens ── */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .users-grid { grid-template-columns: 1fr; }
  .demo-btns { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: repeat(4, minmax(150px, 1fr)); overflow-x: auto; }
}

/* ── Mobile Bottom Navigation Bar ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 90;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  border-radius: var(--r);
  color: var(--text3);
  transition: color var(--t), background var(--t);
  min-width: 52px;
  position: relative;
}
.mobile-nav-btn .material-symbols-outlined { font-size: 22px; }
.mobile-nav-btn span.label { font-size: 0.62rem; font-weight: 500; }
.mobile-nav-btn.active { color: var(--brand); }
.mobile-nav-btn.active .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.mobile-nav-badge {
  position: absolute;
  top: 4px; right: 8px;
  min-width: 15px; height: 15px;
  background: var(--red);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  border-radius: var(--r-f);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--surface);
}

@media (max-width: 640px) {
  .mobile-bottom-nav { display: flex; flex-direction: column; }
  /* Show hamburger on mobile for sidebar drawer */
  .sidebar-collapse-btn { display: flex !important; }
}

/* ── Database loading indicator ── */
.db-loading-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r); font-size: .85rem; color: var(--text2);
}
.db-loading-wrap code {
  display: inline-block; margin-top: 4px; padding: 2px 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; font-family: monospace; font-size: .8rem; color: var(--brand);
}
.db-loading-error { border-color: var(--red); color: var(--red); background: var(--red-l); }
.db-loading-icon {
  font-size: 20px; color: var(--brand);
  animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Attachment chip hover (detail page) ── */
a.attachment-chip:hover, .attachment-chip-click:hover {
  background: var(--bg2);
  border-color: var(--brand);
}

/* ── Upload status label ── */
#upload-status { color: var(--text3); font-size: .82rem; }

/* ════════════════════════════════════════
   FILE PREVIEW LIGHTBOX
   ════════════════════════════════════════ */
#file-preview-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: fp-fade-in .15s ease;
}
@keyframes fp-fade-in { from { opacity: 0; } to { opacity: 1; } }

.fp-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
}
.fp-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: min(92vw, 1080px);
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: fp-slide-in .18s ease;
}
@keyframes fp-slide-in { from { transform: scale(.97) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.fp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0; gap: 12px;
}
.fp-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .88rem; font-weight: 600; color: var(--text);
  min-width: 0; overflow: hidden;
}
.fp-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-title .material-symbols-outlined { color: var(--brand); flex-shrink: 0; }
.fp-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.fp-body {
  flex: 1; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2);
  min-height: 0;
}
.fp-image {
  max-width: 100%; max-height: 80vh;
  object-fit: contain;
  display: block;
  padding: 16px;
  box-sizing: border-box;
}
.fp-pdf {
  width: 100%; height: 80vh;
  border: none;
  display: block;
}

/* ═══════════════════════════════════════════════════════
   WELCOME BANNER POPUP
   ═══════════════════════════════════════════════════════ */
.wb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .28s ease;
  backdrop-filter: blur(2px);
}
.wb-overlay.wb-visible { opacity: 1; }

.wb-popup {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.12);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(18px) scale(.97);
  transition: transform .28s cubic-bezier(.34,1.3,.64,1);
}
.wb-overlay.wb-visible .wb-popup {
  transform: translateY(0) scale(1);
}

.wb-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.12);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: background var(--t);
}
.wb-close:hover { background: rgba(0,0,0,.28); }
.wb-close .material-symbols-outlined { font-size: 16px; }

/* When there's NO image, close button adapts to surface colour */
.wb-body-no-image ~ .wb-close,
.wb-popup:not(:has(.wb-image-wrap)) .wb-close {
  background: var(--bg2);
  color: var(--text2);
}

.wb-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
}
.wb-image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.wb-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow-y: auto;
  text-align: center;
}
.wb-body-no-image {
  padding-top: 32px;
}

.wb-desc {
  font-size: .85rem;
  color: var(--text2);
  margin: 0;
  line-height: 1.65;
  max-width: 320px;
}

.wb-actions { display: flex; justify-content: center; width: 100%; }
.wb-cta-btn {
  font-size: .9rem;
  padding: 10px 28px;
  border-radius: var(--r);
  justify-content: center;
}

/* ── Banner Settings UI ── */
.banner-img-placeholder {
  width: 130px; height: 130px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.banner-img-placeholder:hover { border-color: var(--brand); background: var(--bg2); }

.banner-radio-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: border-color var(--t), background var(--t);
  font-size: .88rem;
  color: var(--text2);
}
.banner-radio-label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-alpha, rgba(99,102,241,.08));
  color: var(--text);
}

.banner-user-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
  background: var(--bg);
}
.banner-user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
}
.banner-user-row:hover { background: var(--bg2); }
.banner-user-row label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; width: 100%;
  font-size: .85rem; color: var(--text2);
}
.banner-user-row label input[type="checkbox"] { flex-shrink: 0; }

/* Responsive — small screens */
@media (max-width: 480px) {
  .wb-popup { max-width: 100%; border-radius: 14px 14px 0 0; }
  .wb-overlay { align-items: flex-end; padding: 0; }
}

/* ═══════════════════════════════════════════════════════
   THEATER
   ═══════════════════════════════════════════════════════ */

/* Main viewer */
.theater-main {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  cursor: pointer;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theater-main-img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  background: var(--bg);
}
.theater-pdf-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  gap: 8px;
}
.theater-pdf-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theater-main-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  gap: 10px;
}
.theater-live-badge {
  position: absolute;
  top: 12px; right: 14px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  background: var(--red,#ef4444);
  border-radius: 5px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(239,68,68,.45);
  animation: theater-live-pulse 2s ease-in-out infinite;
}
@keyframes theater-live-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(239,68,68,.45); }
  50%       { box-shadow: 0 2px 16px rgba(239,68,68,.75); }
}
.theater-main-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: rgba(255,255,255,.95);
  overflow: hidden;
  min-width: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.theater-main-meta .avatar {
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.35);
}
.theater-main-meta-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theater-main-meta-time {
  opacity: .7;
  font-size: .72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Delete button — main viewer (top-left) */
.theater-delete-btn {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s, background .18s;
  backdrop-filter: blur(4px);
}
.theater-delete-btn .material-symbols-outlined { font-size: 17px; }
.theater-main:hover .theater-delete-btn { opacity: 1; }
.theater-delete-btn:hover { background: rgba(220,38,38,.8); }

/* Delete button — queue thumb */
.theater-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  padding: 0;
  line-height: 1;
}
.theater-thumb:hover .theater-thumb-delete { opacity: 1; }
.theater-thumb-delete:hover { background: rgba(220,38,38,.85); }

/* Empty state */
.theater-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  margin-bottom: 16px;
}

/* Queue */
.theater-queue-section {
  margin-top: 8px;
}
.theater-queue-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.theater-queue {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.theater-queue::-webkit-scrollbar { height: 4px; }
.theater-queue::-webkit-scrollbar-track { background: transparent; }
.theater-queue::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.theater-thumb {
  flex-shrink: 0;
  position: relative;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--bg2);
  transition: border-color var(--t), transform var(--t);
}
.theater-thumb:hover { border-color: var(--brand); transform: translateY(-2px); }
.theater-thumb.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.theater-thumb-pdf {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
}
.theater-thumb-live-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red, #ef4444);
  box-shadow: 0 0 0 2px rgba(239,68,68,.3);
  animation: theater-pulse 1.6s ease-in-out infinite;
}
@keyframes theater-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(.85); }
}

/* ── Back to top ── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
#back-to-top .material-symbols-outlined { font-size: 18px; }
