/* ================================================
   TIMEWISE — Core Stylesheet
   Aesthetic: Industrial Precision / Dark Command
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-base:       #0a0a0c;
  --bg-surface:    #111116;
  --bg-card:       #16161e;
  --bg-elevated:   #1e1e2a;
  --border:        #2a2a38;
  --border-bright: #3d3d52;

  --amber:         #f5a623;
  --amber-dim:     #b87a18;
  --amber-glow:    rgba(245, 166, 35, 0.12);
  --amber-glow-lg: rgba(245, 166, 35, 0.06);

  --text-primary:  #f0f0f5;
  --text-secondary:#8888a8;
  --text-muted:    #55556a;

  --green:  #2ecc71;
  --red:    #e74c3c;
  --blue:   #4a9eff;
  --purple: #9b59b6;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --font-body:    'DM Sans', sans-serif;

  --sidebar-w: 240px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--amber); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 99px; }

/* ================================================
   LAYOUT
   ================================================ */

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--amber);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.sidebar-logo .logo-text span { color: var(--amber); }

.sidebar-clock {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-clock .clock-time {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--amber);
  letter-spacing: 2px;
}
.sidebar-clock .clock-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-item.active {
  color: var(--amber);
  background: var(--amber-glow);
  border-left-color: var(--amber);
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--amber);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.productivity-score {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.score-bar-wrap { background: var(--bg-elevated); border-radius: 99px; height: 6px; }
.score-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  border-radius: 99px;
  transition: width 0.6s ease;
}
.score-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
  margin-top: 4px;
}

/* MAIN */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}
.topbar-search {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  gap: 6px;
  width: 220px;
}
.topbar-search input {
  border: none;
  background: none;
  padding: 6px 0;
  width: 100%;
  font-size: 0.82rem;
}
.topbar-search .icon { color: var(--text-muted); font-size: 0.9rem; }

.topbar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition);
}
.topbar-btn:hover { border-color: var(--amber); color: var(--amber); }
.topbar-btn.primary {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
  width: auto;
  padding: 0 14px;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}
.topbar-btn.primary:hover { background: #ffc145; }

/* VIEWS */
.view { display: none; padding: 28px; animation: fadeIn 0.3s ease; }
.view.active { display: block; }

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

/* ================================================
   COMPONENTS — Cards / Grid
   ================================================ */

.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.section-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent, var(--amber));
  opacity: 0.7;
}
.stat-card:hover { border-color: var(--border-bright); transform: translateY(-1px); }
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--text-primary);
  line-height: 1;
}
.stat-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.stat-meta.up { color: var(--green); }
.stat-meta.down { color: var(--red); }

/* ── Panel ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-head h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}
.panel-head .ml { margin-left: auto; }
.panel-body { padding: 16px 20px; }

/* ── Tag / Badge ── */
.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.tag.amber { background: var(--amber-glow); color: var(--amber); border-color: var(--amber-dim); }
.tag.green { background: rgba(46,204,113,0.1); color: var(--green); border-color: rgba(46,204,113,0.3); }
.tag.red   { background: rgba(231,76,60,0.1); color: var(--red); border-color: rgba(231,76,60,0.3); }
.tag.blue  { background: rgba(74,158,255,0.1); color: var(--blue); border-color: rgba(74,158,255,0.3); }
.tag.high { background: rgba(231,76,60,0.15); color: var(--red); border-color: rgba(231,76,60,0.4); }
.tag.medium { background: var(--amber-glow); color: var(--amber); border-color: var(--amber-dim); }
.tag.low { background: rgba(46,204,113,0.15); color: var(--green); border-color: rgba(46,204,113,0.4); }

/* ── Btn ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-elevated);
}
.btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
.btn.primary { background: var(--amber); color: #000; border-color: var(--amber); }
.btn.primary:hover { background: #ffc145; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-elevated); border-color: var(--border); }
.btn.danger { background: rgba(231,76,60,0.12); color: var(--red); border-color: rgba(231,76,60,0.3); }
.btn.danger:hover { background: rgba(231,76,60,0.2); }
.btn.sm { padding: 5px 10px; font-size: 0.75rem; }
.btn.icon-only { padding: 6px; width: 30px; height: 30px; justify-content: center; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
  display: flex; align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}
.modal-body { padding: 20px 24px; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  min-width: 260px;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ================================================
   DASHBOARD VIEW
   ================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* Today's schedule */
.schedule-timeline { position: relative; }
.timeline-slot {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
  position: relative;
}
.timeline-slot:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 41px;
  top: 34px;
  bottom: -4px;
  width: 1px;
  background: var(--border);
}
.timeline-hour {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 40px;
  flex-shrink: 0;
  padding-top: 10px;
  text-align: right;
}
.timeline-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-card);
  flex-shrink: 0;
  margin-top: 14px;
  z-index: 1;
}
.timeline-dot.active { background: var(--amber); }
.timeline-dot.done { background: var(--green); }
.timeline-event {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all var(--transition);
  margin-bottom: 8px;
}
.timeline-event:hover { border-color: var(--border-bright); }
.timeline-event.active { border-color: var(--amber); background: var(--amber-glow); }
.timeline-event.done { opacity: 0.55; }
.timeline-event .ev-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 3px; }
.timeline-event .ev-meta  { font-size: 0.72rem; color: var(--text-muted); }
.timeline-event .ev-duration {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  float: right;
}

/* Quick add */
.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.quick-add input { flex: 1; }

/* Mini calendar */
.mini-calendar { margin-bottom: 0; }
.cal-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.cal-month {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}
.cal-nav { color: var(--text-muted); font-size: 0.85rem; padding: 4px 8px; }
.cal-nav:hover { color: var(--text-primary); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-day-name {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0;
}
.cal-day {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 5px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.cal-day:hover { background: var(--bg-elevated); color: var(--text-primary); }
.cal-day.today { background: var(--amber); color: #000; font-weight: 700; }
.cal-day.has-event::after {
  content: '·';
  display: block;
  color: var(--amber);
  font-size: 1rem;
  line-height: 0.5;
}
.cal-day.other-month { opacity: 0.25; }

/* ================================================
   TASKS VIEW
   ================================================ */

.tasks-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tasks-toolbar .filter-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: none;
  cursor: pointer;
  transition: all var(--transition);
}
.tasks-toolbar .filter-btn.active,
.tasks-toolbar .filter-btn:hover { border-color: var(--amber); color: var(--amber); }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all var(--transition);
  cursor: pointer;
}
.task-item:hover { border-color: var(--border-bright); }
.task-item.done { opacity: 0.5; }
.task-item.done .task-title { text-decoration: line-through; }
.task-checkbox {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 2px solid var(--border-bright);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}
.task-checkbox.checked { background: var(--green); border-color: var(--green); color: #fff; font-size: 0.75rem; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.task-priority {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-priority.high   { background: var(--red); }
.task-priority.medium { background: var(--amber); }
.task-priority.low    { background: var(--green); }
.task-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.task-item:hover .task-actions { opacity: 1; }

/* ================================================
   POMODORO VIEW
   ================================================ */

.pomodoro-center {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 20px 0;
}
.pomodoro-ring {
  width: 240px; height: 240px;
  margin: 0 auto 28px;
  position: relative;
}
.pomodoro-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.ring-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-progress {
  fill: none;
  stroke: var(--amber);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 8px var(--amber));
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-time {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  color: var(--text-primary);
  letter-spacing: 4px;
}
.ring-phase {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 4px;
}

.pomodoro-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 28px; }
.pomo-btn {
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-elevated);
}
.pomo-btn.start { background: var(--amber); color: #000; border-color: var(--amber); font-size: 1rem; padding: 12px 40px; }
.pomo-btn.start:hover { background: #ffc145; }
.pomo-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }

.pomodoro-settings { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.pomo-setting {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.pomo-setting label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px; }
.pomo-setting input { text-align: center; padding: 6px; font-family: var(--font-mono); font-size: 1.1rem; }

.pomodoro-log { text-align: left; }
.pomo-log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.pomo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ================================================
   HABITS VIEW
   ================================================ */

.habits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.habit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition);
}
.habit-card:hover { border-color: var(--border-bright); }
.habit-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.habit-emoji { font-size: 1.5rem; }
.habit-name { font-weight: 700; font-size: 0.95rem; }
.habit-freq { font-size: 0.7rem; color: var(--text-muted); }
.habit-streak {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--amber);
  margin-left: auto;
}
.habit-week { display: flex; gap: 4px; margin-bottom: 14px; }
.habit-day {
  flex: 1;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.habit-day.done { background: rgba(46,204,113,0.15); border-color: var(--green); color: var(--green); }
.habit-day.today-mark { border-color: var(--amber); }
.habit-day:hover { border-color: var(--border-bright); }
.habit-progress-wrap { display: flex; align-items: center; gap: 10px; }
.habit-prog-bar { flex: 1; height: 4px; background: var(--bg-elevated); border-radius: 99px; }
.habit-prog-fill { height: 100%; border-radius: 99px; background: var(--green); transition: width 0.5s ease; }
.habit-prog-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* ================================================
   FOCUS VIEW
   ================================================ */

.focus-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .focus-layout { grid-template-columns: 1fr; } }

.eisenhower-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.matrix-cell {
  background: var(--bg-card);
  padding: 14px;
  position: relative;
  min-height: 160px;
}
.matrix-cell .cell-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.matrix-cell.q1 { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.matrix-cell.q1 .cell-label { color: var(--red); }
.matrix-cell.q2 { border-bottom: 1px solid var(--border); }
.matrix-cell.q2 .cell-label { color: var(--amber); }
.matrix-cell.q3 { border-right: 1px solid var(--border); }
.matrix-cell.q3 .cell-label { color: var(--blue); }
.matrix-cell.q4 .cell-label { color: var(--text-muted); }
.matrix-item {
  font-size: 0.75rem;
  padding: 5px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  color: var(--text-secondary);
  cursor: default;
  transition: color var(--transition);
}
.matrix-item:hover { color: var(--text-primary); }

/* Time blocks */
.time-block-list { display: flex; flex-direction: column; gap: 6px; }
.time-block {
  display: flex; align-items: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.block-time {
  background: var(--bg-elevated);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex; flex-direction: column; justify-content: center;
  min-width: 90px;
  border-right: 1px solid var(--border);
}
.block-content {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
}
.block-title { font-size: 0.85rem; font-weight: 600; }
.block-type { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.block-bar {
  width: 4px;
  flex-shrink: 0;
}

/* ================================================
   ANALYTICS VIEW
   ================================================ */

.analytics-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .analytics-charts { grid-template-columns: 1fr; } }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar {
  width: 100%;
  background: var(--amber-dim);
  border-radius: 3px 3px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1), background var(--transition);
  cursor: pointer;
  position: relative;
}
.bar:hover { background: var(--amber); }
.bar.today { background: var(--amber); }
.bar-label { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); }

.category-breakdown { display: flex; flex-direction: column; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-name { font-size: 0.8rem; width: 90px; color: var(--text-secondary); }
.cat-bar-wrap { flex: 1; height: 6px; background: var(--bg-elevated); border-radius: 99px; overflow: hidden; }
.cat-bar { height: 100%; border-radius: 99px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.cat-pct { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); width: 36px; text-align: right; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex !important; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .focus-layout { grid-template-columns: 1fr; }
  .analytics-charts { grid-template-columns: 1fr; }
  .view { padding: 16px; }
}

.hamburger {
  display: none;
  background: none; border: none;
  flex-direction: column; gap: 5px; cursor: pointer; padding: 6px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 99px; }

.mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.mobile-overlay.show { display: block; }
