/* CB System Core Stylesheet - Modern Dashboard & Productivity Suite */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - Indigo & Slate Premium Dark Theme (Default) */
  --bg-main: #0f172a;
  --bg-sidebar: #0b1120;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-input: #1e293b;
  --bg-header: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #0ea5e9;

  --modal-bg: #1e293b;
  --kanban-col-bg: rgba(15, 23, 42, 0.6);
  --progress-bg: #1e293b;
  --gantt-bg: #1e293b;
  --card-bg: rgba(30, 41, 59, 0.7);
  --code-bg: #0b1120;
  --code-inline-bg: rgba(255, 255, 255, 0.08);

  --btn-secondary-bg: rgba(255, 255, 255, 0.08);
  --btn-secondary-hover: rgba(255, 255, 255, 0.14);

  --bg-item-row: rgba(255, 255, 255, 0.02);
  --bg-item-hover: rgba(255, 255, 255, 0.05);
  --bg-pill: rgba(255, 255, 255, 0.05);
  --bg-view-switcher: rgba(255, 255, 255, 0.06);
  --overlay-bg: rgba(15, 23, 42, 0.65);

  --theme-switcher-bg: rgba(15, 23, 42, 0.85);
  --theme-switcher-border: rgba(255, 255, 255, 0.1);
  --theme-switcher-btn-active: #1e293b;
  --theme-switcher-btn-active-color: #ffffff;
  --theme-switcher-btn-active-shadow: 0 2px 6px rgba(0,0,0,0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-drawer: 0 0 35px rgba(0, 0, 0, 0.6);
  --glass-effect: backdrop-filter: blur(12px);
}

[data-theme="light"] {
  /* Color Palette - Clean Crisp Light Theme */
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-header: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #4f46e5;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dark: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.08);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --info: #0284c7;

  --modal-bg: #ffffff;
  --kanban-col-bg: #f1f5f9;
  --progress-bg: #e2e8f0;
  --gantt-bg: #ffffff;
  --card-bg: #ffffff;
  --code-bg: #f8fafc;
  --code-inline-bg: #f1f5f9;

  --btn-secondary-bg: #f1f5f9;
  --btn-secondary-hover: #e2e8f0;

  --bg-item-row: #f8fafc;
  --bg-item-hover: #f1f5f9;
  --bg-pill: #f1f5f9;
  --bg-view-switcher: #e2e8f0;
  --overlay-bg: rgba(15, 23, 42, 0.45);

  --theme-switcher-bg: #f1f5f9;
  --theme-switcher-border: #e2e8f0;
  --theme-switcher-btn-active: #ffffff;
  --theme-switcher-btn-active-color: #4f46e5;
  --theme-switcher-btn-active-shadow: 0 2px 5px rgba(0,0,0,0.06);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-drawer: 0 0 30px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* App Layout */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  z-index: 40;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

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

.sidebar-nav {
  padding: 1.25rem 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark);
  padding: 0.75rem 0.75rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  transform: translateX(3px);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-item i, .nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.sidebar-footer {
  padding: 1.15rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex-shrink: 0;
  background: var(--bg-sidebar);
}

.sidebar-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.sidebar-user-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  overflow: hidden;
}

/* Theme Switcher in Left-Bottom Sidebar */
.theme-switcher {
  display: flex;
  background: var(--theme-switcher-bg);
  border: 1px solid var(--theme-switcher-border);
  border-radius: var(--radius-full);
  padding: 3px;
  width: 100%;
  gap: 2px;
  transition: background 0.2s, border-color 0.2s;
}

.theme-switch-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch-btn i, .theme-switch-btn svg {
  width: 14px;
  height: 14px;
}

.theme-switch-btn:hover:not(.active) {
  color: var(--text-main);
}

.theme-switch-btn.active {
  background: var(--theme-switcher-btn-active);
  color: var(--theme-switcher-btn-active-color);
  box-shadow: var(--theme-switcher-btn-active-shadow);
  font-weight: 700;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #334155;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid #475569;
}

[data-theme="light"] .user-avatar {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}

.user-info {
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
}

/* Header */
.top-header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Content Body */
.content-body {
  padding: 2rem;
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .card:hover {
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid Utilities */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Stat Card Color Theme Variants for Dark & Light Mode */
.stat-card.stat-primary .stat-val { color: #818cf8; }
.stat-card.stat-primary .stat-icon { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
[data-theme="light"] .stat-card.stat-primary .stat-val { color: #4338ca; }
[data-theme="light"] .stat-card.stat-primary .stat-icon { background: #eef2ff; color: #4338ca; }

.stat-card.stat-info .stat-val { color: #38bdf8; }
.stat-card.stat-info .stat-icon { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
[data-theme="light"] .stat-card.stat-info .stat-val { color: #0284c7; }
[data-theme="light"] .stat-card.stat-info .stat-icon { background: #f0f9ff; color: #0284c7; }

.stat-card.stat-success .stat-val { color: #34d399; }
.stat-card.stat-success .stat-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }
[data-theme="light"] .stat-card.stat-success .stat-val { color: #059669; }
[data-theme="light"] .stat-card.stat-success .stat-icon { background: #ecfdf5; color: #059669; }

.stat-card.stat-warning .stat-val { color: #fbbf24; }
.stat-card.stat-warning .stat-icon { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
[data-theme="light"] .stat-card.stat-warning .stat-val { color: #d97706; }
[data-theme="light"] .stat-card.stat-warning .stat-icon { background: #fffbeb; color: #d97706; }

/* Item Row & Item Pill Utilities */
.item-row {
  background: var(--bg-item-row);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.item-row:hover {
  background: var(--bg-item-hover);
}
.item-pill {
  background: var(--bg-pill);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* View Switcher Utility */
.view-switcher {
  display: inline-flex;
  background: var(--bg-view-switcher);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  align-items: center;
}
.view-switcher .btn {
  border: none !important;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  box-shadow: none;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: all 0.15s ease;
}
.view-switcher .btn:hover:not(.active):not(.btn-primary) {
  color: var(--text-main);
  background: var(--bg-item-hover);
}
.view-switcher .btn.btn-primary, .view-switcher .btn.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
[data-theme="light"] .view-switcher .btn:hover:not(.active):not(.btn-primary) {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-active, .badge-in_progress {
  background: var(--primary-light);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-completed, .badge-done {
  background: var(--success-light);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-todo {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-review {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-urgent {
  background: var(--danger-light);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-high {
  background: var(--warning-light);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-medium {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-low {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Light Theme Badge Enhancements for High Contrast & Legibility */
[data-theme="light"] .badge-active, [data-theme="light"] .badge-in_progress {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
[data-theme="light"] .badge-completed, [data-theme="light"] .badge-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
[data-theme="light"] .badge-todo {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
[data-theme="light"] .badge-review {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
[data-theme="light"] .badge-urgent {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
[data-theme="light"] .badge-high {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
[data-theme="light"] .badge-medium {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
[data-theme="light"] .badge-low {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #3b82f6);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Form inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Alert notifications */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

[data-theme="light"] .alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--modal-bg) !important;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  overflow: hidden;
  position: relative;
  z-index: 10000;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3, .modal-header h4 {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(280px, 1fr));
  }
}

.kanban-col {
  background: var(--kanban-col-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.kanban-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .task-card:hover {
  border-color: #cbd5e1;
}

/* Gantt Chart Overrides */
.gantt .bar {
  rx: 4px;
}
.gantt .bar-progress {
  rx: 4px;
}
.gantt .bar-done .bar {
  fill: #10b981 !important;
}
.gantt .bar-in_progress .bar {
  fill: #3b82f6 !important;
}
.gantt .bar-todo .bar {
  fill: #64748b !important;
}
.gantt-container {
  background: var(--gantt-bg);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

/* FullCalendar Theme Adjustments */
.fc-theme-standard td, .fc-theme-standard th {
  border-color: var(--border-color) !important;
}
.fc .fc-toolbar-title {
  font-size: 1.25rem !important;
  color: var(--text-main) !important;
  font-weight: 700;
}
.fc .fc-button-primary {
  background-color: var(--btn-secondary-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
}
.fc .fc-button-primary:hover, .fc .fc-button-primary.fc-button-active {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.fc-daygrid-day-number {
  color: var(--text-muted) !important;
  font-weight: 600;
}
.fc-day-today {
  background: rgba(99, 102, 241, 0.08) !important;
}
.fc-theme-standard .fc-list,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--border-color) !important;
}
.fc .fc-list-day-cushion {
  background-color: var(--bg-card-hover) !important;
  color: var(--text-main) !important;
}
.fc .fc-list-event:hover td {
  background-color: var(--bg-item-hover) !important;
}
.fc .fc-col-header-cell-cushion {
  color: var(--text-muted) !important;
}

/* Markdown preview prose */
.markdown-body {
  color: var(--text-main);
  line-height: 1.7;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}
.markdown-body p, .markdown-body ul, .markdown-body ol {
  margin-bottom: 1rem;
}
.markdown-body pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
  color: var(--text-main);
}
.markdown-body code {
  font-family: var(--font-mono);
  background: var(--code-inline-bg);
  color: var(--text-main);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  text-align: left;
}
.markdown-body th {
  background: var(--bg-card-hover);
  color: var(--text-main);
  font-weight: 600;
}

/* Mobile Sidebar Toggle & Overlay (Default Hidden on Desktop) */
.sidebar-toggle-btn {
  display: none;
}
.sidebar-close-btn {
  display: none;
}
.sidebar-overlay {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  /* Header Toggle Button */
  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar-toggle-btn:hover, .sidebar-toggle-btn:active {
    background: var(--bg-card-hover);
    color: var(--primary);
    border-color: var(--primary);
  }
  .sidebar-toggle-btn i, .sidebar-toggle-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
  }

  /* Sidebar Drawer on Mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    z-index: 100;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: var(--shadow-drawer);
  }

  /* Sidebar Close Button */
  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
  }
  .sidebar-close-btn:hover, .sidebar-close-btn:active {
    color: var(--text-main);
    background: var(--bg-card-hover);
    border-color: var(--border-color);
  }
  .sidebar-close-btn i, .sidebar-close-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Backdrop Overlay */
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .content-body {
    padding: 1rem;
  }
  .top-header {
    padding: 0.65rem 1rem;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .page-title {
    font-size: 1.15rem;
  }

  /* Responsive Grids on SP */
  .grid-2-1, .grid-1-1, .grid-responsive {
    grid-template-columns: 1fr !important;
  }
  .doc-form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Table horizontal scroll wrapper on SP */
  .table-responsive-sp {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* FullCalendar SP Layout */
  .fc .fc-toolbar {
    flex-direction: column;
    gap: 0.65rem;
    align-items: stretch;
  }
  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    text-align: center;
  }

  /* Modal on Mobile */
  .modal-overlay {
    padding: 0.85rem;
  }
  .modal-dialog {
    max-width: 100%;
    border-radius: var(--radius-md);
  }
}
