/* ============================================================================
   MY TASKS — PERSONAL OPERATING SYSTEM
   Visual Identity:
   - Night Mode (Default): Midnight Crimson (#050505, #101010, #171717, #7E0106, #A10B12)
   - Day Mode: Ivory Crimson (#F3EFE6, #EAE5DB, #FAF8F3, #7E0106, #A10B12, #24211E)
   - iOS-Inspired Liquid Glass Interface & Selective Realistic Marble Surfaces
   ============================================================================ */

:root,
[data-theme="night"] {
  --bg-primary: #050505;
  --bg-secondary: #101010;
  --bg-surface: #171717;
  --bg-elevated: #1e1e1e;
  --bg-glass-heavy: rgba(20, 20, 22, 0.82);
  --bg-glass-medium: rgba(23, 23, 26, 0.68);
  --bg-glass-light: rgba(30, 30, 34, 0.48);
  --bg-glass-floating: rgba(14, 14, 16, 0.88);
  --bg-input: rgba(10, 10, 12, 0.72);

  --accent-primary: #7E0106;
  --accent-secondary: #A10B12;
  --accent-bright: #cf1720;
  --accent-soft: rgba(126, 1, 6, 0.22);
  --accent-glow: rgba(161, 11, 18, 0.38);

  --text-primary: #F2F2F2;
  --text-secondary: #A5A5A5;
  --text-muted: #6E6E73;
  --text-inverse: #FAF8F3;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-silver: rgba(210, 214, 220, 0.15);
  --border-highlight: rgba(255, 255, 255, 0.22);
  --border-crimson: rgba(161, 11, 18, 0.55);

  --shadow-ambient: 0 18px 42px -12px rgba(0, 0, 0, 0.78), 0 2px 10px rgba(0, 0, 0, 0.5);
  --shadow-floating: 0 24px 60px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-crimson: 0 8px 28px rgba(126, 1, 6, 0.36);

  /* Realistic Dark Obsidian / Nero Marquina Subtle Marble Surface */
  --marble-surface: 
    radial-gradient(ellipse at 18% 22%, rgba(126, 1, 6, 0.14) 0%, transparent 55%),
    linear-gradient(125deg, rgba(255,255,255,0.03) 0%, transparent 38%, rgba(255,255,255,0.025) 40%, transparent 72%),
    linear-gradient(35deg, transparent 45%, rgba(190, 195, 205, 0.04) 48%, rgba(126, 1, 6, 0.06) 50%, transparent 54%),
    linear-gradient(165deg, #161618 0%, #0d0d0f 55%, #141213 100%);

  --status-critical: #e11d48;
  --status-high: #ea580c;
  --status-normal: #3b82f6;
  --status-low: #64748b;
  --status-success: #10b981;

  --blur-strength: 20px;
  --card-radius: 16px;
  --transition-speed: 0.26s;
}

[data-theme="day"] {
  --bg-primary: #F3EFE6;
  --bg-secondary: #EAE5DB;
  --bg-surface: #FAF8F3;
  --bg-elevated: #FFFFFF;
  --bg-glass-heavy: rgba(250, 248, 243, 0.88);
  --bg-glass-medium: rgba(250, 248, 243, 0.74);
  --bg-glass-light: rgba(243, 239, 230, 0.62);
  --bg-glass-floating: rgba(250, 248, 243, 0.92);
  --bg-input: rgba(234, 229, 219, 0.65);

  --accent-primary: #7E0106;
  --accent-secondary: #A10B12;
  --accent-bright: #8f040a;
  --accent-soft: rgba(126, 1, 6, 0.11);
  --accent-glow: rgba(126, 1, 6, 0.22);

  --text-primary: #24211E;
  --text-secondary: #777168;
  --text-muted: #9A9388;
  --text-inverse: #FAF8F3;

  --border-subtle: #D8D0C3;
  --border-silver: rgba(119, 113, 104, 0.25);
  --border-highlight: rgba(255, 255, 255, 0.85);
  --border-crimson: rgba(126, 1, 6, 0.45);

  --shadow-ambient: 0 12px 32px -8px rgba(36, 33, 30, 0.09), 0 2px 6px rgba(36, 33, 30, 0.05);
  --shadow-floating: 0 20px 48px rgba(36, 33, 30, 0.14), 0 0 0 1px rgba(216, 208, 195, 0.85);
  --shadow-crimson: 0 8px 24px rgba(126, 1, 6, 0.22);

  /* Realistic Calacatta / Warm Ivory Natural Stone Marble Surface */
  --marble-surface:
    radial-gradient(ellipse at 82% 18%, rgba(126, 1, 6, 0.06) 0%, transparent 55%),
    linear-gradient(128deg, rgba(160, 150, 136, 0.09) 0%, transparent 34%, rgba(145, 136, 122, 0.07) 37%, transparent 70%),
    linear-gradient(42deg, transparent 44%, rgba(175, 166, 152, 0.12) 47%, rgba(126, 1, 6, 0.04) 49%, transparent 53%),
    linear-gradient(160deg, #FAF8F3 0%, #F1ECE1 55%, #EAE3D5 100%);
}

/* Study Room Always Offers Deep Focus Immersion */
.study-room-active-surface {
  --study-bg: #040405;
  --study-card: rgba(16, 16, 19, 0.86);
  --study-border: rgba(255, 255, 255, 0.1);
}

/* Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
  background-image: 
    radial-gradient(circle at 12% 8%, var(--accent-soft) 0%, transparent 36%),
    radial-gradient(circle at 88% 92%, rgba(126, 1, 6, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

body[dir="ltr"] {
  font-family: 'Inter', 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Respect Reduced Motion & User Animation Settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body.animations-disabled *,
body.animations-disabled *::before,
body.animations-disabled *::after {
  animation: none !important;
  transition: none !important;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-silver);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ============================================================================
   LIQUID GLASS SURFACES & MARBLE SELECTIVE PANELS
   ============================================================================ */

.glass-panel {
  background: var(--bg-glass-medium);
  backdrop-filter: blur(var(--blur-strength)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(150%);
  border: 1px solid var(--border-silver);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-ambient);
  transition: transform var(--transition-speed) cubic-bezier(0.22, 1, 0.36, 1),
              border-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
}

.glass-panel-heavy {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(calc(var(--blur-strength) * 1.3)) saturate(170%);
  -webkit-backdrop-filter: blur(calc(var(--blur-strength) * 1.3)) saturate(170%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-floating);
}

.glass-panel-light {
  background: var(--bg-glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--card-radius) - 4px);
}

/* Selective Natural Marble Texture Cards */
.marble-card {
  background: var(--marble-surface);
  border: 1px solid var(--border-silver);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-ambient);
  position: relative;
  overflow: hidden;
}

.marble-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(126,1,6,0.05) 100%);
  pointer-events: none;
}

/* ============================================================================
   APP SHELL & RESPONSIVE ARCHITECTURE
   ============================================================================ */

.app-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
  gap: 0;
  position: relative;
}

body.sidebar-collapsed .app-layout {
  grid-template-columns: 84px 1fr;
}

/* Desktop Sidebar - Liquid Glass Floating Column */
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-inline-end: 1px solid var(--border-silver);
  z-index: 40;
  transition: width var(--transition-speed) ease, padding var(--transition-speed) ease;
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: radial-gradient(circle at 30% 30%, #A10B12, #7E0106 70%, #2a0002 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(126, 1, 6, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FAF8F3;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-titles h1 {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-titles span {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
}

body.sidebar-collapsed .brand-titles,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .user-mini-details {
  display: none;
}

/* Primary Navigation List */
.nav-section {
  margin-bottom: 16px;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 6px 12px;
  font-weight: 700;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: start;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item-btn i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-item-btn:hover {
  background: var(--bg-glass-light);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.nav-item-btn.active {
  background: linear-gradient(135deg, rgba(126, 1, 6, 0.32) 0%, rgba(161, 11, 18, 0.14) 100%);
  color: var(--text-primary);
  border-color: var(--border-crimson);
  box-shadow: 0 4px 16px rgba(126, 1, 6, 0.22);
  font-weight: 600;
}

.nav-item-btn.active i {
  color: var(--accent-secondary);
}

.nav-badge {
  margin-inline-start: auto;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Requirement: Settings accessible from the bottom-left of the desktop layout */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.desktop-bottom-left-anchor {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-left-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--bg-glass-floating);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-silver);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-floating);
  transition: all 0.22s ease;
}

.bottom-left-settings-btn:hover,
.bottom-left-settings-btn.active {
  border-color: var(--accent-secondary);
  box-shadow: var(--shadow-crimson);
  transform: translateY(-2px);
}

.bottom-left-settings-btn i {
  color: var(--accent-secondary);
}

/* Main Content Area */
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 28px 96px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Top Floating Glass Header Bar */
.top-glass-bar {
  position: sticky;
  top: 14px;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  margin-bottom: 24px;
  background: var(--bg-glass-floating);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border-silver);
  border-radius: 18px;
  box-shadow: var(--shadow-ambient);
}

.top-bar-start {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Requirement: Three-line menu at the top of the Dashboard that opens additional modules */
.three-line-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-silver);
  background: var(--bg-glass-light);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.three-line-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.22s ease;
}

.three-line-menu-btn:hover {
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
}

.top-date-clock-cluster {
  display: flex;
  flex-direction: column;
}

.top-current-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-dual-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

/* Command Palette Search Trigger */
.cmd-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cmd-search-trigger:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.cmd-kbd {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: monospace;
}

/* Theme Toggle Button (Sun in Night Mode, Moon in Day Mode) */
.icon-glass-btn {
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-glass-light);
  border: 1px solid var(--border-silver);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-glass-btn:hover {
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 8px var(--accent-secondary);
}

/* ============================================================================
   THREE-LINE MODULE DRAWER / FLOATING GLASS LAUNCHER
   ============================================================================ */

.modules-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.modules-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modules-glass-Launcher {
  position: fixed;
  top: 76px;
  inset-inline-start: 24px;
  width: min(540px, calc(100vw - 32px));
  padding: 22px;
  z-index: 85;
  transform: translateY(-12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modules-glass-Launcher.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.launcher-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-glass-light);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  text-align: start;
  transition: all 0.2s ease;
}

.launcher-card:hover {
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.launcher-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(126, 1, 6, 0.2);
  border: 1px solid var(--border-crimson);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.launcher-card-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.launcher-card-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* ============================================================================
   SPECIAL TASK VISUAL DESIGN (STRICT SPECIFICATION SECTION 7)
   - Center background: #050505
   - Radial gradient transitioning toward #7E0106 at the edges
   - Thin crimson border
   - Subtle crimson outer glow
   - Premium elevated appearance
   ============================================================================ */

.task-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--bg-glass-medium);
  border: 1px solid var(--border-subtle);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.task-card:hover {
  border-color: var(--border-silver);
  transform: translateY(-1px);
}

/* Requirement: Every task must have a three-dot menu positioned in its upper-left area */
.task-card-upper-left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  order: -1; /* Keep visually positioned on the left / start area */
}

.task-three-dot-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass-light);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.task-three-dot-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
}

/* Special Task Elevated Radial Crimson Design */
.task-card.special-task {
  background: radial-gradient(circle at center, #050505 32%, #3b0104 76%, #7E0106 100%) !important;
  color: #F2F2F2 !important;
  border: 1px solid #A10B12 !important;
  box-shadow: 0 8px 26px rgba(126, 1, 6, 0.42), 0 0 16px rgba(161, 11, 18, 0.28) !important;
  transform: translateY(-1px);
}

.task-card.special-task .task-title {
  color: #FFFFFF !important;
  font-weight: 700;
}

.task-card.special-task .task-desc,
.task-card.special-task .task-meta-chip {
  color: #E2D9D9 !important;
}

.special-star-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(161, 11, 18, 0.35);
  border: 1px solid rgba(255, 180, 180, 0.4);
  color: #ffd6d8;
}

/* Task Three-Dot Dropdown Context Menu */
.task-context-menu {
  position: absolute;
  top: 34px;
  left: 0;
  min-width: 195px;
  padding: 7px;
  border-radius: 12px;
  background: var(--bg-glass-floating);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-highlight);
  box-shadow: var(--shadow-floating);
  z-index: 60;
  display: none;
  flex-direction: column;
  gap: 3px;
}

.task-context-menu.open {
  display: flex;
  animation: fadeScaleIn 0.16s ease forwards;
}

.context-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  text-align: start;
}

.context-menu-item:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.priority-submenu {
  display: flex;
  gap: 4px;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.prio-dot-btn {
  flex: 1;
  padding: 4px 2px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.68rem;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
}

.prio-dot-btn:hover,
.prio-dot-btn.active {
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
}

/* Priority Pills */
.prio-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
}
.prio-critical {
  background: rgba(225, 29, 72, 0.16);
  color: #fb7185;
  border: 1px solid rgba(225, 29, 72, 0.4);
}
.prio-high {
  background: rgba(234, 88, 12, 0.16);
  color: #fb923c;
  border: 1px solid rgba(234, 88, 12, 0.4);
}
.prio-normal {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.prio-low {
  background: rgba(100, 116, 139, 0.16);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

[data-theme="day"] .prio-critical { color: #be123c; }
[data-theme="day"] .prio-high { color: #c2410c; }
[data-theme="day"] .prio-normal { color: #1d4ed8; }
[data-theme="day"] .prio-low { color: #475569; }

/* Custom Checkbox */
.task-check-btn {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border-silver);
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.task-check-btn:hover {
  border-color: var(--accent-secondary);
}

.task-check-btn.checked {
  background: var(--accent-primary);
  border-color: var(--accent-secondary);
  color: #FFFFFF;
}

.task-card.completed .task-title {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ============================================================================
   DASHBOARD GRID & WIDGETS
   ============================================================================ */

.dashboard-hero {
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.hero-greeting h2 {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.hero-dates-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-glass-light);
  border: 1px solid var(--border-silver);
}

.date-pill.crimson {
  background: var(--accent-soft);
  border-color: var(--border-crimson);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Dashboard Customizable Widget Grid */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.widget-col-8 { grid-column: span 8; }
.widget-col-6 { grid-column: span 6; }
.widget-col-4 { grid-column: span 4; }
.widget-col-12 { grid-column: span 12; }

.widget-box {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}

.widget-title i {
  color: var(--accent-secondary);
}

/* ============================================================================
   FLOATING YEAR PROGRESS WIDGET (OUTER PERIMETER SVG STROKE REQUIREMENT)
   Supports Circle, Square, Rectangle where stroke travels along outer edge
   ============================================================================ */

.floating-year-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 70;
  user-select: none;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.22s ease, transform 0.2s ease;
}

.floating-year-widget:active {
  cursor: grabbing;
}

.floating-year-widget.hidden-widget {
  display: none !important;
}

.year-perimeter-shell {
  position: relative;
  background: var(--bg-glass-floating);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow-floating);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: visible;
}

.year-perimeter-shell.shape-circle {
  width: 158px;
  height: 158px;
  border-radius: 50%;
}

.year-perimeter-shell.shape-square {
  width: 160px;
  height: 160px;
  border-radius: 20px;
}

.year-perimeter-shell.shape-rectangle {
  width: 236px;
  height: 124px;
  border-radius: 18px;
}

.year-perimeter-shell.size-sm.shape-circle,
.year-perimeter-shell.size-sm.shape-square {
  width: 132px;
  height: 132px;
}
.year-perimeter-shell.size-sm.shape-rectangle {
  width: 198px;
  height: 106px;
}
.year-perimeter-shell.size-lg.shape-circle,
.year-perimeter-shell.size-lg.shape-square {
  width: 188px;
  height: 188px;
}
.year-perimeter-shell.size-lg.shape-rectangle {
  width: 276px;
  height: 144px;
}

.perimeter-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.perimeter-track {
  fill: none;
  stroke: var(--border-silver);
  stroke-width: 4.5;
}

.perimeter-progress {
  fill: none;
  stroke: var(--yr-widget-accent, #A10B12);
  stroke-width: 4.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(161, 11, 18, 0.65));
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.year-widget-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.yw-year-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.6px;
}

.yw-percent {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.yw-days-meta {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.yw-sub-pills {
  display: flex;
  gap: 5px;
  margin-top: 3px;
  font-size: 0.64rem;
  color: var(--text-muted);
}

.yw-controls-mini {
  position: absolute;
  top: -10px;
  right: -6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.floating-year-widget:hover .yw-controls-mini {
  opacity: 1;
}

.yw-mini-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-highlight);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-ambient);
}

.yw-mini-btn:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* ============================================================================
   STUDY ROOM & REAL 3D FLIP CLOCK (SECTION 16)
   ============================================================================ */

.study-room-wrapper {
  background: radial-gradient(circle at 50% 0%, rgba(126, 1, 6, 0.2) 0%, #050506 60%, #020203 100%);
  color: #F2F2F2;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 26px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.85);
}

.study-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.study-tab-btn {
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #A5A5A5;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.study-tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.study-tab-btn.active {
  background: linear-gradient(135deg, #7E0106 0%, #A10B12 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 16px rgba(126, 1, 6, 0.45);
}

/* Flip Clock Stage */
.flip-clock-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  border-radius: 20px;
  background: radial-gradient(circle at center, #111114 0%, #070709 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.flip-clock-cards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  direction: ltr;
  flex-wrap: wrap;
}

.flip-unit-box {
  position: relative;
  width: var(--flip-card-w, 130px);
  height: var(--flip-card-h, 152px);
  border-radius: var(--flip-radius, 18px);
  background: linear-gradient(180deg, #1a1a1e 0%, #121215 49.5%, #060607 50%, #141417 50.5%, #0e0e11 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 600px;
  overflow: hidden;
}

/* Horizontal Split Hinge Line */
.flip-unit-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 0, 0, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
  z-index: 4;
}

.flip-digit-value {
  font-family: 'Inter', monospace;
  font-size: var(--flip-font-size, 4.4rem);
  font-weight: 800;
  color: #F4F4F6;
  letter-spacing: -2px;
  line-height: 1;
  z-index: 2;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flip-unit-box.flipping .flip-digit-value {
  animation: flipCardPulse 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes flipCardPulse {
  0% { transform: rotateX(0deg) scale(1); }
  45% { transform: rotateX(-38deg) scale(0.95); opacity: 0.75; }
  100% { transform: rotateX(0deg) scale(1); opacity: 1; }
}

.flip-unit-label {
  position: absolute;
  bottom: 9px;
  left: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  z-index: 5;
}

.flip-ampm-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #A10B12;
  z-index: 5;
}

.flip-colon {
  font-size: 3rem;
  font-weight: 800;
  color: #7E0106;
  padding-bottom: 10px;
}

/* Focus Mode Fullscreen Overlay */
.focus-mode-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #1a0204 0%, #050505 55%, #020202 100%);
  color: #F2F2F2;
  z-index: 120;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.focus-mode-overlay.active {
  display: flex;
  animation: fadeScaleIn 0.3s ease forwards;
}

/* ============================================================================
   CALENDAR GRID (INDEPENDENT JALALI & GREGORIAN)
   ============================================================================ */

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

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

.cal-day-cell {
  min-height: 92px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-glass-light);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cal-day-cell:hover {
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
}

.cal-day-cell.today {
  border: 1.5px solid var(--accent-secondary);
  box-shadow: 0 0 16px rgba(126, 1, 6, 0.32);
  background: linear-gradient(145deg, rgba(126, 1, 6, 0.22), var(--bg-glass-light));
}

.cal-day-cell.selected {
  border-color: #ffffff;
  background: rgba(126, 1, 6, 0.32);
}

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

.cal-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
}

.cal-day-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.cal-dots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.cal-event-pill {
  width: 100%;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(126, 1, 6, 0.28);
  border-inline-start: 2px solid var(--accent-secondary);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   MODALS, FORMS, BUTTONS & COMMAND PALETTE
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeScaleIn 0.2s ease forwards;
}

.modal-glass-card {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-highlight);
  border-radius: 20px;
  box-shadow: var(--shadow-floating);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: span 2;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.glass-input,
.glass-select,
.glass-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-silver);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-input:focus,
.glass-select:focus,
.glass-textarea:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-crimson {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #7E0106 0%, #A10B12 100%);
  color: #FAF8F3;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-crimson);
  transition: all 0.2s ease;
}

.btn-crimson:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn-secondary-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-silver);
  background: var(--bg-glass-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-glass:hover {
  border-color: var(--accent-secondary);
  background: var(--accent-soft);
}

/* Toggle Switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ios-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-silver);
  transition: 0.25s;
  border-radius: 34px;
}
.ios-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.25s;
  border-radius: 50%;
}
.ios-switch input:checked + .ios-slider {
  background-color: var(--accent-primary);
}
.ios-switch input:checked + .ios-slider::before {
  transform: translateX(20px);
}

/* Charts Fixed Height Container Rule */
.chart-box-fixed {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Animations */
@keyframes fadeScaleIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.view-section {
  display: none;
  animation: fadeScaleIn 0.24s ease forwards;
}

.view-section.active {
  display: block;
}

/* ============================================================================
   MOBILE & TABLET DEDICATED RESPONSIVE ARCHITECTURE
   ============================================================================ */

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1024px) {
  .widget-col-8,
  .widget-col-6,
  .widget-col-4 {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .app-main {
    padding: 12px 14px 104px;
  }

  .top-glass-bar {
    top: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
  }

  .cmd-search-trigger span,
  .cmd-kbd {
    display: none;
  }

  .dashboard-hero {
    padding: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: span 1;
  }

  .desktop-bottom-left-anchor {
    bottom: 76px;
    left: 12px;
  }

  .floating-year-widget {
    bottom: 76px;
    right: 12px;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 12px;
    right: 12px;
    height: 60px;
    background: var(--bg-glass-floating);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid var(--border-highlight);
    border-radius: 18px;
    box-shadow: var(--shadow-floating);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    z-index: 75;
  }

  .mob-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
  }

  .mob-nav-btn i {
    font-size: 1.05rem;
  }

  .mob-nav-btn.active {
    color: var(--text-primary);
    background: var(--accent-soft);
  }
  .mob-nav-btn.active i {
    color: var(--accent-secondary);
  }

  .flip-unit-box {
    --flip-card-w: 88px;
    --flip-card-h: 108px;
    --flip-font-size: 2.8rem;
  }
}
