/* ═══════════════════════════════════════════════
   Portfolio Tracker — Modern Dashboard Theme
   ═══════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(17, 24, 39, 0.8);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glass-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #3b82f6);
  --accent-gradient-2: linear-gradient(135deg, #14b8a6, #3b82f6);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray: #6b7280;
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(124,58,237,0.03) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── Layout ─── */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-glass);
}

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

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  font-weight: 700;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

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

.nav-item.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.nav-item .badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active .badge {
  background: rgba(255,255,255,0.2);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.sidebar-footer-text {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 14px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.sidebar-version {
  padding: 8px 20px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
  text-align: center;
}

/* ─── Main ─── */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 0;
  position: relative;
}

/* ─── Header ─── */
.header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.header-title {
  font-size: 18px;
  font-weight: 600;
}

.header-date {
  font-size: 13px;
  color: var(--text-muted);
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* ─── Content ─── */
.content {
  padding: 28px 32px;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active { display: block; }

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

/* ─── Page Header ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4); }

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

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }

/* ─── Stats Cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  backdrop-filter: blur(10px);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover { background: var(--bg-card-hover); border-color: var(--border-glass-hover); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-card-icon.purple { background: rgba(124, 58, 237, 0.15); color: var(--accent-purple); }
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-card-icon.teal { background: rgba(20, 184, 166, 0.15); color: var(--accent-teal); }
.stat-card-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-card-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-card-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.card:hover { border-color: var(--border-glass-hover); }

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

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

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

/* ─── Project Cards ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  transition: opacity var(--transition);
}

.project-card:hover { background: var(--bg-card-hover); border-color: var(--border-glass-hover); transform: translateY(-2px); }

.project-card.health-green::before { background: var(--success); }
.project-card.health-red::before { background: var(--danger); }
.project-card.health-gray::before { background: var(--gray); }
.project-card.health-yellow::before { background: var(--warning); }

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-card-name {
  font-size: 16px;
  font-weight: 600;
}

.project-card-status {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.status-planning { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.status-active { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-on-hold { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-completed { background: rgba(20, 184, 166, 0.15); color: var(--accent-teal); }
.status-archived { background: rgba(107, 114, 128, 0.15); color: var(--gray); }

.project-card-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
}

.project-card-detail i {
  width: 16px;
  color: var(--text-muted);
}

.project-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
  font-size: 12px;
  color: var(--text-muted);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.health-dot.green { background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.health-dot.red { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.health-dot.gray { background: var(--gray); }
.health-dot.yellow { background: var(--warning); box-shadow: 0 0 8px rgba(245,158,11,0.5); }

/* ─── Budget Gauge ─── */
.budget-gauge {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

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

.budget-gauge-title { font-size: 16px; font-weight: 600; }

.budget-gauge-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.budget-spend {
  font-size: 32px;
  font-weight: 700;
}

.budget-sep { color: var(--text-muted); font-size: 20px; }

.budget-limit {
  font-size: 24px;
  color: var(--text-secondary);
  font-weight: 500;
}

.budget-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-gradient);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.budget-bar-fill.warning { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.budget-bar-fill.danger { background: var(--danger); animation: pulse-bar 1.5s ease infinite; }

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.budget-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Table ─── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-glass);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,0.02); }

.priority-critical { color: var(--danger); font-weight: 600; }
.priority-high { color: var(--warning); font-weight: 500; }
.priority-medium { color: var(--accent-blue); }
.priority-low { color: var(--text-muted); }

.type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.type-task { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.type-risk { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.type-blocker { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.backlog { background: rgba(107, 114, 128, 0.15); color: var(--gray); }
.status-badge.in-progress { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.status-badge.in-review { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-badge.done { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-badge.cancelled { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.table-actions {
  display: flex;
  gap: 6px;
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}

.form-select option {
  background: #1e293b;
  color: #f1f5f9;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; }
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important; }

.input-valid { border-color: #22c55e !important; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important; }

.field-error { font-size: 12px; color: #ef4444; margin-top: 4px; min-height: 18px; line-height: 1.3; display: flex; align-items: center; gap: 4px; }
.field-error:empty { display: none; }
.field-error:not(:empty)::before { content: '\f071'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px; }

.input-helper { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

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

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: slideUp 0.3s ease;
}

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

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

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

/* ─── Chart Container ─── */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* ─── Daily Log ─── */
.log-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  transition: all var(--transition);
}

.log-entry:hover { border-color: var(--border-glass-hover); }

.log-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
}

.log-entry-date {
  font-size: 15px;
  font-weight: 600;
}

.log-entry-cost {
  font-size: 13px;
  color: var(--text-muted);
}

.log-entry-section {
  margin-bottom: 10px;
}

.log-entry-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.log-entry-section-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main { margin-left: 0; }
  .mobile-toggle { display: block; }
  .header { padding: 0 16px; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .header-title { font-size: 15px; }
  .sidebar { width: 100%; }
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: white;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--accent-blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Loading ─── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading i {
  font-size: 32px;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

/* ─── Now Working ─── */
.now-working {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.now-working::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-blue));
}

.now-working-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.now-working-title {
  font-size: 17px;
  font-weight: 600;
}

.now-working-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.in-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.in-progress-item:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-card-hover);
}

.in-progress-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 8px rgba(20,184,166,0.5);
  flex-shrink: 0;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.in-progress-item-body {
  flex: 1;
  min-width: 0;
}

.in-progress-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.in-progress-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── AI Buttons ─── */
.ai-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-result-close:hover {
  color: var(--text-primary) !important;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.cache-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.ai-result-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.ai-result-body h1, .ai-result-body h2, .ai-result-body h3,
.ai-result-body h4, .ai-result-body h5, .ai-result-body h6 {
  color: var(--text-primary);
  margin: 12px 0 6px;
  font-weight: 600;
}
.ai-result-body h1 { font-size: 20px; }
.ai-result-body h2 { font-size: 18px; }
.ai-result-body h3 { font-size: 16px; }
.ai-result-body h4, .ai-result-body h5, .ai-result-body h6 { font-size: 15px; }
.ai-result-body p { margin: 6px 0; }
.ai-result-body ul { margin: 6px 0 6px 20px; padding: 0; }
.ai-result-body li { margin: 3px 0; }
.ai-result-body code {
  background: var(--bg-glass);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
  font-family: 'SF Mono', Menlo, monospace;
}
.ai-result-body pre {
  background: var(--bg-glass);
  padding: 10px 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
}
.ai-result-body pre code { background: transparent; padding: 0; }
.ai-result-body strong { color: var(--text-primary); font-weight: 600; }
.ai-result-body em { font-style: italic; }
.ai-result-body a { color: var(--accent-blue); text-decoration: none; }
.ai-result-body a:hover { text-decoration: underline; }
.ai-result-body table.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.ai-result-body table.md-table th,
.ai-result-body table.md-table td {
  padding: 6px 10px;
  border: 1px solid var(--border-glass);
  text-align: left;
}
.ai-result-body table.md-table th {
  background: var(--bg-glass);
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── Toggle Switch ─── */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #334155;
  transition: var(--transition);
  border-radius: 24px;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: var(--transition);
  border-radius: 50%;
}

.switch input:checked + .switch-slider {
  background: var(--accent-gradient);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* ─── Section ─── */
.section { margin-bottom: 28px; }
