/* ===== IT YORDAM — SHARED STYLES (2025-2026) ===== */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1c1c26;
  --surface3: #22222f;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --text: #f0f0f8;
  --muted: #7878a0;
  --muted2: #4e4e6a;
  --success: #22d3a5;
  --warn: #f59e0b;
  --danger: #f87171;
  --info: #60a5fa;
  --sidebar-w: 240px;
  --bottom-nav-h: 64px;
  --topbar-h: 60px;
  --font-base: 'DM Sans', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Syne', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

body.light-mode {
  --bg: #f4f4f8;
  --surface: #ffffff;
  --surface2: #f9f9fb;
  --surface3: #f0f0f5;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.12);
  --text: #13131a;
  --muted: #6b7280;
  --muted2: #9ca3af;
}

body.light-mode::before { background: none; }
body.light-mode .topbar { background: rgba(244,244,248,0.94); }
body.light-mode .bottom-nav { background: rgba(249,249,251,0.97); }
body.light-mode td { border-bottom: 1px solid var(--border); }
body.light-mode tr:hover td { background: rgba(0,0,0,0.03); }

/* ===== BASE ===== */
body {
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  /* mobil scroll uchun */
  overscroll-behavior: none;
}

/* ===== BG EFFECTS ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 10% 0%, rgba(108,99,255,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 30% 40% at 90% 100%, rgba(167,139,250,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sidebar-logo .name span { color: var(--accent2); }
.sidebar-logo .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== AVATAR ===== */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}

.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--muted); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-section {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  /* mobil uchun min touch target */
  min-height: 44px;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(108,99,255,0.15); color: var(--accent2); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

/* ===== SIDEBAR OVERLAY (mobil) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ===== HAMBURGER BUTTON ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface2);
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

/* ===== STAT CARDS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-card.blue::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.warn::before { background: linear-gradient(90deg, var(--warn), #fbbf24); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #fb923c); }

.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value {
  font-family: var(--font-base);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; display: inline-block; }

.badge-pending { background: rgba(245,158,11,0.12); color: var(--warn); }
.badge-pending::before { background: var(--warn); }
.badge-progress { background: rgba(96,165,250,0.12); color: var(--info); }
.badge-progress::before { background: var(--info); }
.badge-done { background: rgba(34,211,165,0.12); color: var(--success); }
.badge-done::before { background: var(--success); }
.badge-high { background: rgba(248,113,113,0.12); color: var(--danger); }
.badge-high::before { background: var(--danger); }
.badge-medium { background: rgba(245,158,11,0.12); color: var(--warn); }
.badge-medium::before { background: var(--warn); }
.badge-low { background: rgba(34,211,165,0.12); color: var(--success); }
.badge-low::before { background: var(--success); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  min-height: 48px; /* Mobile touch-friendly */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { border-color: var(--accent); color: var(--accent2); }
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover { opacity: 0.88; color: #fff; }

.btn-success {
  background: rgba(34,211,165,0.15);
  border-color: rgba(34,211,165,0.3);
  color: var(--success);
}

.btn-danger {
  background: rgba(248,113,113,0.1);
  border-color: rgba(248,113,113,0.3);
  color: var(--danger);
}

.btn-secondary {
  background: var(--surface3);
  border-color: var(--border2);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); min-height: 36px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-base);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px; /* Mobile touch-friendly */
  /* mobil uchun zoom oldini olish */
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237878a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

body.light-mode .form-select option { background: #fff; color: #13131a; }
.form-select option { background: #1c1c26; }
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; min-width: 560px; }

th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}

td {
  padding: 13px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== PRIORITY DOTS ===== */
.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.p-high { background: var(--danger); }
.p-medium { background: var(--warn); }
.p-low { background: var(--success); }

/* ===== SECTION HEADER ===== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
}

/* ===== FILTER CHIPS ===== */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border2);
  color: var(--muted);
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: rgba(108,99,255,0.15); border-color: var(--accent); color: var(--accent2); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px 36px;
  width: 100%;
  max-width: 520px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Desktop modallarda markazlangan */
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
  .modal {
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 480px;
  }
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: rgba(34,211,165,0.4); }
.toast.success::before { content: '✓'; color: var(--success); font-weight: 700; }
.toast.error { border-color: rgba(248,113,113,0.4); }
.toast.error::before { content: '✕'; color: var(--danger); font-weight: 700; }

@media (min-width: 769px) {
  .toast {
    left: auto;
    right: 24px;
    bottom: 24px;
    transform: translateY(20px);
    border-radius: var(--radius-md);
  }
  .toast.show { transform: translateY(0); }
}

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty p { font-size: 14px; }

/* ===== SKELETON LOADING ===== */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--surface2) 25%,
    var(--surface3) 50%,
    var(--surface2) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.wide { width: 80%; }
.skeleton-text.medium { width: 55%; }
.skeleton-text.narrow { width: 35%; }

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
}

/* Phase 3: spec-aligned skeleton dimensions */
.skeleton-text { height: 12px; }
.skeleton-card { padding: 16px 20px; }

/* ===== BOTTOM NAV (mobil) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: rgba(19,19,26,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 98;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-base);
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}

.bottom-nav-item.active {
  color: var(--accent2);
}

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(8px);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  pointer-events: none;
}

.bottom-nav-item { position: relative; }

/* ===== PULL TO REFRESH ===== */
/* Vizual ko'rsatkich butunlay o'chirilgan — pastga tortib yangilash funksiyasi
   (reloadCallback chaqiruvi) ishlab turadi, faqat indikator chiqmaydi */
.ptr-indicator {
  display: none;
}

.ptr-indicator.visible { transform: translateX(-50%) translateY(12px); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.fade-up { animation: fadeUp 0.4s ease both; }
.fade-in { animation: fadeIn 0.3s ease both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

/* ===== RESPONSIVE — TABLET (max 1024) ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .page-content { padding: 20px; }
}

/* ===== RESPONSIVE — MOBILE (max 768) ===== */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }

  .main { margin-left: 0; }

  .page-content {
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 16px);
  }

  .topbar { padding: 0 16px; }

  .hamburger { display: flex; }

  .bottom-nav { display: block; }

  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .stat-value { font-size: 22px; }

  .card { padding: 16px 18px; }

  .section-head { flex-direction: column; align-items: flex-start; }

  /* Jadval mobilda scroll bo'lsin */
  .table-wrap { border-radius: var(--radius-md); overflow: hidden; }

  /* Modal mobilga to'la kenglik */
  .modal { padding: 24px 20px 32px; }
}

/* ===== RESPONSIVE — KICHIK MOBIL (max 480) ===== */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }
  .modal-footer { flex-direction: column; gap: 8px; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ===== FOCUS RING (accessibility) ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ===== NOTIFICATION BELL ===== */
.notif-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.notif-bell-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}
.notif-bell-btn:hover { background: var(--surface2); color: var(--text); }
#notif-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--danger, #e53e3e);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
#notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#notif-dropdown.open { display: flex; }
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.notif-header button {
  font-size: 12px;
  color: var(--accent2);
  background: none;
  border: none;
  cursor: pointer;
}
#notif-list {
  max-height: 300px;
  overflow-y: auto;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--surface2); }
.notif-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--muted); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--muted2); margin-top: 4px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-toast {
  position: fixed;
  bottom: 80px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 9999;
  max-width: 300px;
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== TOGGLE SWITCH ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toggle-label span { font-size: 14px; font-weight: 500; }
.toggle-label small { font-size: 12px; color: var(--muted); }
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border2, #444);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent, #6c63ff); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
.notif-settings-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface2);
  border-radius: 12px;
}
.notif-settings-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ===== PHASE 3: OFFLINE BANNER ===== */
.offline-banner {
  background: rgba(245,158,11,0.15);
  border-bottom: 1px solid rgba(245,158,11,0.3);
  color: var(--warn);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: var(--topbar-h);
  z-index: 49;
  transition: transform 0.3s ease;
}

/* ===== PHASE 3: REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--surface3); }
  .fade-up, .fade-in { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
