@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic-300-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+1EE00-1EEBB;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+1EE00-1EEBB;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+1EE00-1EEBB;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+1EE00-1EEBB;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+1EE00-1EEBB;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic-800-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+1EE00-1EEBB;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Design Tokens & Theme Variables (WCAG AA Compliant & Anti-Slop)
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg-app: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-surface-active: #edf2f7;
  --bg-elevated: #ffffff;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-light: rgba(67, 56, 202, 0.1);
  --accent-border: rgba(67, 56, 202, 0.28);
  --accent-contrast: #ffffff;

  --success: #047857;
  --success-light: rgba(4, 120, 87, 0.1);
  --success-border: rgba(4, 120, 87, 0.25);

  --warning: #b45309;
  --warning-light: rgba(180, 83, 9, 0.1);
  --warning-border: rgba(180, 83, 9, 0.25);

  --danger: #dc2626;
  --danger-light: rgba(220, 38, 38, 0.1);
  --danger-border: rgba(220, 38, 38, 0.25);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-dropdown: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --sidebar-width: 256px;
  --topbar-height: 72px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #0f1726;
  --bg-surface-hover: #162032;
  --bg-surface-active: #1d2a42;
  --bg-elevated: #152033;
  --border: #1e2c44;
  --border-focus: #2d3e5e;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-light: rgba(99, 102, 241, 0.2);
  --accent-border: rgba(129, 140, 248, 0.4);
  --accent-contrast: #ffffff;

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.16);
  --success-border: rgba(16, 185, 129, 0.35);

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.16);
  --warning-border: rgba(245, 158, 11, 0.35);

  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.16);
  --danger-border: rgba(248, 113, 113, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
  --shadow-dropdown: 0 16px 32px rgba(0, 0, 0, 0.6);
}

/* Curated Designer Accent Presets (all >= 4.5:1 WCAG AA contrast on #ffffff) */
[data-accent="indigo"] {
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-light: rgba(67, 56, 202, 0.12);
  --accent-border: rgba(67, 56, 202, 0.3);
}
[data-accent="emerald"] {
  --accent: #047857;
  --accent-hover: #065f46;
  --accent-light: rgba(4, 120, 87, 0.12);
  --accent-border: rgba(4, 120, 87, 0.3);
}
[data-accent="violet"] {
  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --accent-light: rgba(109, 40, 217, 0.12);
  --accent-border: rgba(109, 40, 217, 0.3);
}
[data-accent="amber"] {
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-light: rgba(180, 83, 9, 0.12);
  --accent-border: rgba(180, 83, 9, 0.3);
}
[data-accent="rose"] {
  --accent: #be123c;
  --accent-hover: #9f1239;
  --accent-light: rgba(190, 18, 60, 0.12);
  --accent-border: rgba(190, 18, 60, 0.3);
}
[data-accent="teal"] {
  --accent: #0e7490;
  --accent-hover: #155e75;
  --accent-light: rgba(14, 116, 144, 0.12);
  --accent-border: rgba(14, 116, 144, 0.3);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */

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

html {
  font-size: 14px;
  line-height: 1.6;
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: clip;
  direction: rtl;
  text-align: right;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Authentication Screen
   ========================================================================== */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, var(--bg-surface-hover), var(--bg-app) 80%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: fadeInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 4px 12px var(--accent-light);
}

.auth-brand strong {
  display: block;
  font-size: 1.35rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.auth-tab {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.auth-tab.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.auth-form h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.auth-form p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-app);
  margin-bottom: 16px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-password-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.auth-password-field input {
  margin-bottom: 0;
  padding-left: 44px;
}

.auth-password-toggle {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.auth-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: -10px 0 16px;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  margin-top: 8px;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.auth-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.auth-error {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.auth-security-note {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ==========================================================================
   Main App Layout Shell
   ========================================================================== */

.main-content {
  display: block;
  width: 100%;
  min-height: 100vh;
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1000;
  padding: 24px 16px;
  transition: transform var(--transition-normal), background-color var(--transition-normal);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .logo h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.sidebar .logo span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-close-btn {
  display: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.sidebar-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 18px 8px 6px;
  letter-spacing: 0.04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-item.active .nav-badge {
  background: var(--accent);
  color: var(--accent-contrast);
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-streak {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.streak-icon {
  font-size: 1.6rem;
}

.daily-streak strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.daily-streak small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  transition: var(--transition-fast);
}

.sidebar-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* ==========================================================================
   Main Workspace & Topbar
   ========================================================================== */

.main {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px 32px 48px;
  transition: margin-right var(--transition-normal);
  max-width: 1600px;
}

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

.topbar-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  flex: 1;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

.topbar-title .welcome {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.topbar-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Date Badge Container */
.date-badge-container {
  display: flex;
  align-items: center;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

/* Search Box */
.search-box {
  flex: 1;
  max-width: 380px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-toggle-btn,
button.search-toggle-btn,
.icon-button.search-toggle-btn {
  display: none !important;
}

.search-dropdown-panel {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 38px 10px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-shortcut {
  position: absolute;
  left: 12px;
  padding: 2px 6px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: monospace;
}

/* Top Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.15rem;
  position: relative;
  transition: var(--transition-fast);
}

.icon-button:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Quiet Notifications Drawer (Toggled only on click) */
.notification-area {
  position: relative;
}

.notifications-drawer {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  z-index: 1100;
  padding: 16px;
  animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.notifications-header strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.drawer-close-btn {
  padding: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

.drawer-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.notification-item {
  padding: 10px 12px;
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-item-text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.notification-item-text small {
  color: var(--danger);
  font-size: 0.75rem;
}

.notification-item-btn {
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-item-btn:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

/* Profile Menu */
.profile-menu-wrap {
  position: relative;
}

.profile-menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.profile-menu-button:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.profile-labels {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.profile-labels strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

.profile-labels span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.profile-chevron {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  transform-origin: center;
  will-change: transform;
}

.profile-menu-button[aria-expanded="true"] .profile-chevron {
  transform: rotate(180deg);
  color: var(--primary, #4338ca);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  padding: 12px;
  z-index: 1100;
  animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-menu-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.profile-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.profile-menu-heading strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.profile-menu-heading small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.profile-menu-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.profile-menu-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

.logout-item {
  color: var(--danger);
}

.logout-item:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ==========================================================================
   Stats Overview Cards
   ========================================================================== */

.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.stat-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.stat-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-card span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.progress-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-info strong {
  font-size: 1.15rem;
  color: var(--accent);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Workspace Grid (Tasks + Side Panels)
   ========================================================================== */

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

.tasks-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tasks Toolbar */
.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 4px;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-full);
}

.filter-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.tasks-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-selector select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--accent-light);
  transition: var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary kbd {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

.copy-agenda-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.copy-agenda-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Quick Inline Task Capture */
.quick-capture-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.quick-capture-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.quick-capture-icon {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
}

.quick-capture-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.quick-capture-input::placeholder {
  color: var(--text-muted);
}

.quick-capture-submit {
  padding: 6px 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition-fast);
}

.quick-capture-submit:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   Task Cards & Checklist
   ========================================================================== */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.task-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.task-card.completed {
  opacity: 0.72;
  background: var(--bg-surface-hover);
}

.task-main-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* Custom Interactive Checkbox (WCAG AA 44px Touch Target) */
.task-checkbox-btn {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-focus);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: transparent;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--bg-surface);
  transition: var(--transition-fast);
}

.task-checkbox-btn::after {
  content: "";
  position: absolute;
  top: -9px;
  left: -9px;
  right: -9px;
  bottom: -9px;
}

.task-checkbox-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.task-card.completed .task-checkbox-btn {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
  transform: scale(0.95);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
  transition: color var(--transition-fast);
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}

/* Task Meta Badges */
.task-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-category {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-priority-high {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-priority-medium {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-priority-low {
  background: var(--bg-surface-hover);
  color: var(--text-muted);
}

.badge-date {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
}

.badge-overdue {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  animation: pulseOverdue 2s infinite;
}

@keyframes pulseOverdue {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.task-tags-list {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-tag {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Task Card Actions */
.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.task-card:hover .task-actions {
  opacity: 1;
}

.task-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.task-action-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.task-action-btn.duplicate-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.task-action-btn.delete-btn:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* Subtask Mini Progress on Card */
.subtask-card-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.subtask-mini-bar {
  width: 44px;
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.subtask-mini-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-full);
  transition: width var(--transition-fast);
}

/* ==========================================================================
   Subtasks / Checklist Accordion
   ========================================================================== */

.subtasks-wrapper {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.subtasks-summary-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
}

.subtasks-summary-btn:hover {
  color: var(--accent);
}

.subtasks-toggle-arrow {
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.subtasks-wrapper.open .subtasks-toggle-arrow {
  transform: rotate(180deg);
}

.subtasks-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-hover);
  font-size: 0.85rem;
}

.subtask-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--border-focus);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition-fast);
}

.subtask-checkbox::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

.subtask-item.completed .subtask-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.subtask-text {
  flex: 1;
  color: var(--text-primary);
}

.subtask-item.completed .subtask-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.subtask-delete-btn {
  color: var(--text-muted);
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.subtask-delete-btn:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.subtask-inline-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.subtask-inline-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  font-size: 0.8rem;
}

.subtask-inline-btn {
  padding: 6px 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   Right Side Panels
   ========================================================================== */

.right-panels {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-badge {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Circular SVG Progress */
.circle-progress {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--border);
}

.progress-ring-circle {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.circle-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circle-inner strong {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.circle-inner span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-message {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Focus Goal Card */
.focus-card {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-surface-hover));
  border-color: var(--accent-border);
}

.focus-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.focus-icon {
  font-size: 1.5rem;
}

.focus-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.focus-header small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.focus-content p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.focus-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.focus-progress-wrap span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Schedule Panel */
.schedule-count-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.schedule-time-badge {
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* ==========================================================================
   Focus Mode (Tranquil, Distraction-Free Workspace)
   ========================================================================== */

body.focus-mode .sidebar,
body.focus-mode .right-panels,
body.focus-mode .stats-overview,
body.focus-mode .tasks-toolbar,
body.focus-mode .date-badge-container {
  display: none !important;
}

body.focus-mode .main {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 48px;
}

body.focus-mode .workspace-grid {
  grid-template-columns: 1fr;
}

body.focus-mode .topbar {
  justify-content: center;
}

body.focus-mode .topbar-banner {
  justify-content: center;
}

body.focus-mode .topbar-tools {
  display: none !important;
}

body.focus-mode .topbar-title {
  text-align: center;
}

/* ==========================================================================
   Calendar & History View
   ========================================================================== */

.calendar-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.calendar-header-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.calendar-explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calendar-actions {
  display: flex;
  gap: 10px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.calendar-month-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-month-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-month-title strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.calendar-today-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}

.month-progress-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.month-progress-summary strong {
  color: var(--accent);
}

.month-progress-summary small {
  color: var(--text-muted);
}

.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.calendar-grid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day-cell {
  aspect-ratio: 1;
  width: 100%;
  font-family: inherit;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: var(--bg-app);
  color: inherit;
  transition: var(--transition-fast);
}

.calendar-day-cell:hover,
.calendar-day-cell:focus-visible {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  outline: 2px solid var(--accent-border);
  outline-offset: 1px;
}

.calendar-day-cell.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.calendar-day-cell.today {
  border-width: 2px;
  border-color: var(--accent);
}

.calendar-day-cell.other-month {
  opacity: 0.35;
}

.day-number {
  font-weight: 700;
  font-size: 0.9rem;
}

.day-cell-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.day-cell-fill {
  height: 100%;
  background: var(--success);
}

.calendar-day-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calendar-day-heading h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.day-percent-pill {
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.calendar-subheading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 4px;
}

.calendar-history-filters {
  display: flex;
  gap: 8px;
}

.calendar-history-filters select,
.calendar-history-filters input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  font-size: 0.8rem;
}

.calendar-day-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.history-item {
  padding: 8px 10px;
  background: var(--bg-surface-hover);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border-right: 3px solid var(--accent);
}

.history-item.created { border-right-color: #3b82f6; }
.history-item.completed { border-right-color: var(--success); }
.history-item.reopened { border-right-color: var(--warning); }
.history-item.edited { border-right-color: #8b5cf6; }
.history-item.deleted { border-right-color: var(--danger); }

/* ==========================================================================
   Admin Users View (Surveillance-Free)
   ========================================================================== */

.admin-users-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-role-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.role-admin { background: rgba(109, 40, 217, 0.14); color: #6d28d9; }
.role-user { background: var(--bg-surface-hover); color: var(--text-muted); }

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close-btn {
  padding: 6px;
  color: var(--text-muted);
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.required-star {
  color: var(--danger);
}

.optional-label {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quick-date-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.date-pill {
  padding: 3px 8px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.date-pill:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.date-pill.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

/* Taxonomy Inline Creator */
.taxonomy-creator {
  margin-top: 6px;
}

.taxonomy-creator summary {
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
}

.taxonomy-inline-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.taxonomy-inline-form input {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.taxonomy-inline-form button {
  padding: 6px 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Subtasks Modal Builder */
.subtasks-input-builder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.subtask-builder-row {
  display: flex;
  gap: 8px;
}

.subtask-builder-row input {
  flex: 1;
}

.remove-subtask-row {
  padding: 0 10px;
  color: var(--danger);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.btn-text-add {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
}

.btn-text-add:hover {
  text-decoration: underline;
}

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

.btn-cancel {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-cancel:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-submit {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  transition: background-color var(--transition-fast);
}

.btn-submit:hover {
  background: var(--accent-hover);
}

/* Settings Card Styles */
.settings-section {
  margin-bottom: 24px;
}

.settings-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.settings-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.theme-choice {
  position: relative;
  cursor: pointer;
}

.theme-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-preview {
  display: block;
  text-align: center;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.theme-choice input:checked + .theme-preview {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* Palette Presets Chips */
.palette-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.palette-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: var(--transition-fast);
}

.palette-chip span {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--chip-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
}

.palette-chip small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.palette-chip.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Avatar Picker Grid */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.avatar-choice-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-app);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ==========================================================================
   Toast Notification (Undo Capable)
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1500;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--text-primary);
  color: var(--bg-app);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-action {
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ==========================================================================
   Responsive Reflow (Mobile, Tablet, Desktop)
   ========================================================================== */

@media (max-width: 1112px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 20px;
  }

  .topbar-banner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .topbar-tools {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .search-box {
    flex: none;
    max-width: none;
    position: relative;
    order: unset;
  }

  .search-toggle-btn,
  button.search-toggle-btn,
  .icon-button.search-toggle-btn {
    display: flex !important;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
  }

  .search-toggle-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-focus);
    color: var(--text-primary);
  }

  .search-dropdown-panel {
    display: none !important;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 24px);
    padding: 8px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dropdown);
    z-index: 1100;
    box-sizing: border-box;
    animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .search-dropdown-panel.open {
    display: flex !important;
  }

  /* Compact LAN Sync button label on <= 1112px to prevent any container overflow */
  .sync-quick-btn .action-btn-label {
    display: none;
  }

  .sync-quick-btn {
    padding: 0 10px;
    min-width: 42px;
    height: 42px;
    justify-content: center;
  }
}

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

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .palette-presets {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    box-shadow: var(--shadow-dropdown);
  }

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

  .sidebar-close-btn {
    display: block;
  }

  .main {
    margin-right: 0;
    max-width: 100%;
    overflow-x: clip;
    padding: 16px;
  }

  .mobile-toggle-btn {
    display: flex;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-banner {
    gap: 8px;
  }

  .date-badge-container {
    display: none;
  }

  .topbar-tools {
    gap: 8px;
  }

  .stats-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal-card {
    padding: 20px 16px;
  }

  .theme-options-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar-title h2 {
    font-size: 1.25rem;
  }

  .filter-tabs {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }

  .tasks-actions-bar {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .copy-agenda-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .palette-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .upcoming-header-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
  }

  .upcoming-actions {
    width: 100%;
  }

  .upcoming-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .jalali-picker-card {
    max-width: calc(100vw - 24px);
    padding: 14px 12px;
  }

  /* Compact responsive top actions for small mobile */
  .sync-quick-btn .action-btn-label {
    display: none;
  }

  .sync-quick-btn {
    padding: 0 10px;
    min-width: 42px;
    height: 42px;
    justify-content: center;
  }

  /* Notification Bell & Profile Menu Viewport Anchoring on Small Screens */
  .search-dropdown-panel {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45) !important;
    z-index: 1200 !important;
  }

  .notifications-drawer {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45) !important;
    z-index: 1200 !important;
  }

  .profile-menu {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45) !important;
    z-index: 1200 !important;
  }

  .auth-card {
    padding: 24px 18px;
    margin: 10px;
    max-width: calc(100vw - 20px);
  }

  .modal-card {
    max-width: calc(100vw - 16px);
    margin: 8px;
  }
}

/* ==========================================================================
   PERSPECTIVE CRAFTSMANSHIP: SHAMSI JALALI DATEPICKER & CALENDAR ENGINE
   ========================================================================== */

.jalali-datepicker-trigger-wrap {
  position: relative;
  width: 100%;
}

.jalali-date-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: right;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.jalali-date-btn:hover {
  border-color: var(--accent);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.jalali-date-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jalali-date-btn.secondary {
  background: var(--bg-surface-hover);
  border-style: dashed;
}

.date-btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.date-btn-text {
  flex: 1;
  font-variant-numeric: tabular-nums;
}

.date-btn-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.date-pill-custom {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.date-pill-custom:hover,
.date-pill-custom.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   RECURRENCE OPTIONS (ROCK-SOLID ROUTINE & HABIT ENGINE)
   ========================================================================== */

.select-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.select-with-icon select {
  width: 100%;
}

.recurrence-options-panel {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-out;
}

.input-with-suffix {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-with-suffix input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.input-with-suffix input:focus {
  outline: none;
}

.input-suffix {
  padding: 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.weekday-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.weekday-pill {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.weekday-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.weekday-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 2px 6px var(--accent-border);
}

/* ==========================================================================
   JALALI DATEPICKER POPOVER / MODAL
   ========================================================================== */

.jalali-picker-overlay {
  z-index: 1350;
  backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.45);
}

.jalali-picker-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-dropdown);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.jalali-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.jalali-picker-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jalali-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jalali-nav-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.jalali-picker-selectors {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jalali-select-clean {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.jalali-picker-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jalali-picker-close:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.jalali-presets-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}

.jalali-preset-pill {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jalali-preset-pill:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.jalali-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.jalali-weekdays-grid .friday-col {
  color: var(--danger);
}

.jalali-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.jalali-day-cell {
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.jalali-day-cell:hover:not(.empty),
.jalali-day-cell:focus-visible:not(.empty) {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  outline: 2px solid var(--accent-border);
  outline-offset: 1px;
  transform: scale(1.05);
}

.jalali-day-cell.empty {
  cursor: default;
  opacity: 0;
  pointer-events: none;
}

.jalali-day-cell.today {
  font-weight: 800;
  color: var(--accent);
  border: 1px dashed var(--accent);
}

.jalali-day-cell.selected {
  background: var(--accent) !important;
  color: var(--accent-contrast) !important;
  font-weight: 700;
  box-shadow: 0 4px 10px var(--accent-border);
}

.jalali-day-cell.friday {
  color: var(--danger);
}

.jalali-day-cell.selected.friday {
  color: var(--accent-contrast) !important;
}

.jalali-picker-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

/* ==========================================================================
   UPCOMING / FUTURE PLANNING TIMELINE VIEW (LINEAR / THINGS 3 INSPIRATION)
   ========================================================================== */

.upcoming-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.25s ease-out;
}

.upcoming-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.upcoming-header-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--success));
}

.upcoming-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.upcoming-header-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.upcoming-header-info h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.upcoming-header-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.upcoming-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-bucket {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.timeline-bucket.overdue {
  border-color: rgba(239, 68, 68, 0.4);
}

.timeline-bucket.today {
  border-color: rgba(79, 70, 229, 0.4);
}

.timeline-bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-surface-hover);
  border-bottom: 1px solid var(--border);
}

.timeline-bucket-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-bucket-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.timeline-bucket.overdue .timeline-bucket-badge {
  background: var(--danger-light);
  border-color: var(--danger-border);
  color: var(--danger);
}

.timeline-bucket.today .timeline-bucket-badge {
  background: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent);
}

.timeline-bucket-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.timeline-bucket-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-bucket-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-bucket-add:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.timeline-bucket-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-empty-bucket {
  padding: 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Recurring Task Chip on Task Cards */
.badge-recurring {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   WEB PUSH NOTIFICATIONS UX & SETTINGS
   ========================================================================== */

.notification-settings-card {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notification-settings-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notification-settings-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
  transition: all var(--transition-fast);
}

.notification-status-dot.active {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-border);
}

.notification-status-dot.error,
.notification-status-dot.blocked {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-border);
}

.notification-status-dot.inactive,
.notification-status-dot.disabled {
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

.notification-settings-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.notification-settings-info small {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.notification-test-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.notification-test-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-primary-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary-sm:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline-sm:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.notifications-push-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--accent-border);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.btn-banner-link {
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-banner-link:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   Desktop Frameless Window Controls & Titlebar (Electron)
   ========================================================================== */

.desktop-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  user-select: none;
  position: relative;
  z-index: 2000;
  -webkit-app-region: drag;
}

.desktop-titlebar-drag {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  flex: 1;
  height: 100%;
}

.desktop-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-logo-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.desktop-app-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.desktop-sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-secondary);
  -webkit-app-region: no-drag;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.desktop-sync-status-badge:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text-primary);
}

.desktop-sync-status-badge .sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.desktop-window-controls {
  display: flex;
  align-items: center;
  height: 100%;
  -webkit-app-region: no-drag;
}

.window-control-btn {
  width: 44px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.window-control-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.window-control-btn.btn-close:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ==========================================================================
   Quick Action Buttons (LAN Sync in Topbar)
   ========================================================================== */

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.quick-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.sync-quick-btn {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.sync-quick-btn:hover {
  border-color: #10b981;
  background: #10b981;
  color: #ffffff;
}

/* ==========================================================================
   Local-First LAN Sync Modal Styles
   ========================================================================== */

.sync-modal-card {
  max-width: 640px;
  width: 95%;
}

.sync-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sync-instructions-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.sync-instructions-box .info-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.sync-pairing-section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 580px) {
  .sync-pairing-section {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.qr-code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-code-box {
  width: 170px;
  height: 170px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.qr-code-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-placeholder {
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.qr-caption {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pairing-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.pairing-code-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pairing-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pairing-code-val {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent);
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px dashed var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius-md);
  direction: ltr;
}

.btn-copy-code {
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background: var(--border);
}

.pairing-code-expiry {
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.lan-address-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.lan-address-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lan-url-row {
  display: flex;
  gap: 8px;
}

.lan-url-row input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: monospace;
  direction: ltr;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.pairing-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.connected-devices-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-sub-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.device-count-badge {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.synced-devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.synced-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.synced-device-card:hover {
  border-color: var(--accent-border);
}

.device-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-card-icon {
  font-size: 1.3rem;
}

.device-card-info strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.device-card-info small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.btn-revoke-device {
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-revoke-device:hover {
  background: #ef4444;
  color: #ffffff;
}

.empty-devices-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Admin Backup Section (Copy JSON, Download & Restore)
   ========================================================================== */

.backup-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.btn-quick-export-card,
.btn-quick-import-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-align: right;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-quick-export-card:hover,
.btn-quick-import-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-quick-export-card:focus-visible,
.btn-quick-import-card:focus-visible,
.admin-backup-json-pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.backup-btn-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.btn-quick-export-card strong,
.btn-quick-import-card strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.btn-quick-export-card small,
.btn-quick-import-card small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.admin-backup-header {
  flex-wrap: wrap;
  gap: 12px;
}

.admin-backup-header p:not(.section-subtitle) {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 0.88rem;
}

.admin-backup-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-backup-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-backup-preview-wrap {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.admin-backup-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-backup-preview-head h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.admin-backup-status {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.admin-backup-state {
  padding: 20px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.9rem;
}

.admin-backup-state.is-error {
  background: var(--danger-light);
  border-color: var(--danger-border);
  color: var(--danger);
  font-weight: 600;
}

.admin-backup-json-pre {
  margin: 0;
  padding: 16px;
  max-height: 440px;
  overflow: auto;
  border-radius: var(--radius-md);
  background: var(--bg-app);
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 768px) {
  .backup-action-grid {
    grid-template-columns: 1fr;
  }

  .admin-backup-json-pre {
    max-height: 320px;
    padding: 12px;
    font-size: 0.75rem;
  }
}

.desktop-autostart-bar {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Mobile Pair Modal */
.mobile-pair-card {
  max-width: 440px;
}

.mobile-pair-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-pair-code-input {
  font-size: 1.6rem !important;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  direction: ltr;
}

/* Auth Screen Companion Connect Link */
.auth-sync-connect {
  margin: 14px 0 6px 0;
  text-align: center;
}

.btn-link-sync {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-link-sync:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* Multi-Adapter Selector Chips */
.lan-adapters-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lan-adapters-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.lan-adapters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lan-adapter-chip {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-family: monospace;
  direction: ltr;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.lan-adapter-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.lan-adapter-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Readable WCAG AA Accent Ink on Dark Surfaces */
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .calendar-today-btn,
[data-theme="dark"] .btn-link-sync,
[data-theme="dark"] .lan-adapter-chip.active,
[data-theme="dark"] .taxonomy-creator summary,
[data-theme="dark"] .day-percent-pill,
[data-theme="dark"] .month-progress-summary strong,
[data-theme="dark"] .btn-outline-sm:hover {
  color: #a5b4fc;
}

[data-theme="dark"][data-accent="emerald"] .nav-item.active,
[data-theme="dark"][data-accent="emerald"] .calendar-today-btn,
[data-theme="dark"][data-accent="emerald"] .btn-link-sync,
[data-theme="dark"][data-accent="emerald"] .lan-adapter-chip.active,
[data-theme="dark"][data-accent="emerald"] .taxonomy-creator summary,
[data-theme="dark"][data-accent="emerald"] .day-percent-pill,
[data-theme="dark"][data-accent="emerald"] .month-progress-summary strong,
[data-theme="dark"][data-accent="emerald"] .btn-outline-sm:hover {
  color: #6ee7b7;
}

[data-theme="dark"][data-accent="violet"] .nav-item.active,
[data-theme="dark"][data-accent="violet"] .calendar-today-btn,
[data-theme="dark"][data-accent="violet"] .btn-link-sync,
[data-theme="dark"][data-accent="violet"] .lan-adapter-chip.active,
[data-theme="dark"][data-accent="violet"] .taxonomy-creator summary,
[data-theme="dark"][data-accent="violet"] .day-percent-pill,
[data-theme="dark"][data-accent="violet"] .month-progress-summary strong,
[data-theme="dark"][data-accent="violet"] .btn-outline-sm:hover {
  color: #c4b5fd;
}

[data-theme="dark"][data-accent="amber"] .nav-item.active,
[data-theme="dark"][data-accent="amber"] .calendar-today-btn,
[data-theme="dark"][data-accent="amber"] .btn-link-sync,
[data-theme="dark"][data-accent="amber"] .lan-adapter-chip.active,
[data-theme="dark"][data-accent="amber"] .taxonomy-creator summary,
[data-theme="dark"][data-accent="amber"] .day-percent-pill,
[data-theme="dark"][data-accent="amber"] .month-progress-summary strong,
[data-theme="dark"][data-accent="amber"] .btn-outline-sm:hover {
  color: #fcd34d;
}

[data-theme="dark"][data-accent="rose"] .nav-item.active,
[data-theme="dark"][data-accent="rose"] .calendar-today-btn,
[data-theme="dark"][data-accent="rose"] .btn-link-sync,
[data-theme="dark"][data-accent="rose"] .lan-adapter-chip.active,
[data-theme="dark"][data-accent="rose"] .taxonomy-creator summary,
[data-theme="dark"][data-accent="rose"] .day-percent-pill,
[data-theme="dark"][data-accent="rose"] .month-progress-summary strong,
[data-theme="dark"][data-accent="rose"] .btn-outline-sm:hover {
  color: #fda4af;
}

[data-theme="dark"][data-accent="teal"] .nav-item.active,
[data-theme="dark"][data-accent="teal"] .calendar-today-btn,
[data-theme="dark"][data-accent="teal"] .btn-link-sync,
[data-theme="dark"][data-accent="teal"] .lan-adapter-chip.active,
[data-theme="dark"][data-accent="teal"] .taxonomy-creator summary,
[data-theme="dark"][data-accent="teal"] .day-percent-pill,
[data-theme="dark"][data-accent="teal"] .month-progress-summary strong,
[data-theme="dark"][data-accent="teal"] .btn-outline-sm:hover {
  color: #67e8f9;
}

/* Custom Taxonomy Management Chips */
.taxonomy-manage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.taxonomy-manage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-primary);
}

.taxonomy-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--danger-light);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.taxonomy-chip-del:hover {
  background: var(--danger);
  color: #ffffff;
}

.taxonomy-empty-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.taxonomy-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.taxonomy-settings-card {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.taxonomy-settings-card h5 {
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

/* Custom Confirm & Admin Reset Modals */
.confirm-modal-card {
  max-width: 440px;
}

.confirm-modal-body {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}

.btn-danger-solid {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: #b91c1c;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-danger-solid:hover {
  background: #991b1b;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-temp-password-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-app);
  border: 1px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-temp-password-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  direction: ltr;
  color: var(--text-primary);
}

/* ==========================================================================
   GLOBAL CURVY-BULLDOG LOADER OVERLAY
   From Uiverse.io by Shoh2008 - https://uiverse.io/Shoh2008/curvy-bulldog-27
   MIT License, Copyright (c) Shoh2008 (c0der)
   ========================================================================== */
.global-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-canvas, #0f172a);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
  opacity: 1;
  visibility: visible;
}

.global-loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.global-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: fadeInModal 0.2s ease-out;
}

.global-loader-visual {
  width: 120px;
  height: 150px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(#ddd 50%, #bbb 51%),
    linear-gradient(#ddd, #ddd),
    linear-gradient(#ddd, #ddd),
    radial-gradient(ellipse at center, #aaa 25%, #eee 26%, #eee 50%, #0000 55%),
    radial-gradient(ellipse at center, #aaa 25%, #eee 26%, #eee 50%, #0000 55%),
    radial-gradient(ellipse at center, #aaa 25%, #eee 26%, #eee 50%, #0000 55%);
  background-position:
    0 20px, 45px 0, 8px 6px,
    55px 3px, 75px 3px, 95px 3px;
  background-size:
    100% 4px, 1px 23px, 30px 8px,
    15px 15px, 15px 15px, 15px 15px;
  position: relative;
  border-radius: 6%;
  animation: globalLoaderShake 3s ease-in-out infinite;
  transform-origin: 60px 180px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.global-loader-visual::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 100%;
  width: 7px;
  height: 5px;
  background: #aaa;
  border-radius: 0 0 4px 4px;
  box-shadow: 102px 0 #aaa;
}

.global-loader-visual::after {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  left: 0;
  right: 0;
  margin: auto;
  bottom: 20px;
  background-color: #bbdefb;
  background-image:
    linear-gradient(to right, #0004 0%, #0004 49%, #0000 50%, #0000 100%),
    linear-gradient(135deg, #64b5f6 50%, #607d8b 51%);
  background-size: 30px 100%, 90px 80px;
  border-radius: 50%;
  background-repeat: repeat, no-repeat;
  background-position: 0 0;
  box-sizing: border-box;
  border: 10px solid #ddd;
  box-shadow:
    0 0 0 4px #999 inset,
    0 0 6px 6px #0004 inset;
  animation: globalLoaderSpin 3s ease-in-out infinite;
}

.global-loader-text {
  color: var(--text-primary, #ffffff);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  text-align: center;
  margin: 0;
  letter-spacing: normal;
}

@keyframes globalLoaderSpin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(360deg); }
  75% { transform: rotate(750deg); }
  100% { transform: rotate(1800deg); }
}

@keyframes globalLoaderShake {
  65%, 80%, 88%, 96% { transform: rotate(0.5deg); }
  50%, 75%, 84%, 92% { transform: rotate(-0.5deg); }
  0%, 50%, 100% { transform: rotate(0); }
}

/* ==========================================================================
   INTERACTIVE BUTTON LOADING STATES & SPINNERS
   ========================================================================== */
.btn-loading {
  position: relative !important;
  pointer-events: none !important;
  opacity: 0.85 !important;
  cursor: wait !important;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  margin-inline-end: 8px;
  vertical-align: middle;
}

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

/* ==========================================================================
   CUSTOM FORM & FIELD VALIDATION FEEDBACK (NO NATIVE BROWSER POPOVERS)
   ========================================================================== */
.auth-field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--danger, #ef4444);
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 4px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm, 6px);
  animation: shakeFadeIn 0.25s ease-out;
}

.auth-field-error::before {
  content: "⚠";
  font-size: 0.9rem;
  line-height: 1;
}

.input-invalid {
  border-color: var(--danger, #ef4444) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

@keyframes shakeFadeIn {
  0% { opacity: 0; transform: translateY(-4px) scale(0.98); }
  50% { transform: translateY(0) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   PWA INSTALL BANNER & PROMPTS
   ========================================================================== */
.pwa-install-banner {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.08) 0%, rgba(99, 102, 241, 0.12) 100%);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  position: relative;
  z-index: 40;
  animation: fadeIn 0.3s ease-out;
}

.pwa-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pwa-banner-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md, 10px);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.25);
  flex-shrink: 0;
}

.pwa-banner-texts {
  flex: 1;
  min-width: 240px;
}

.pwa-banner-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pwa-banner-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pwa-install-action-btn {
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
}

.pwa-dismiss-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.pwa-dismiss-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* iOS Safari Guidance Modal */
.ios-install-card {
  max-width: 500px;
}

.ios-install-steps {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ios-install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ios-install-steps .step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ios-install-steps strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.ios-install-steps p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* ==========================================================================
   DUAL-MODE SYNC TABS (HOST VS CLIENT)
   ========================================================================== */
.sync-mode-tabs {
  display: flex;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.sync-mode-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sync-mode-tab:hover {
  color: var(--text-primary);
}

.sync-mode-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sync-client-panel {
  animation: fadeIn 0.25s ease-out;
}

.sync-client-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.4rem;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
}

.sync-client-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
