/* ================================================================
   Tracto — Main Stylesheet
   Dark mode default, light mode via [data-theme="light"]
   ================================================================ */

/* ----------------------------------------------------------------
   CSS Variables
   ---------------------------------------------------------------- */
:root {
  --bg-primary:    #0F1117;
  --bg-secondary:  #1A1D27;
  --bg-tertiary:   #22263A;
  --text-primary:  #F0F0F0;
  --text-secondary:#A0A3B1;
  --text-muted:    #606370;
  --accent:        #00BFA5;
  --accent-hover:  #00A896;
  --border:        #2E3248;
  --border-subtle: #1E2135;
  --danger:        #EF5350;
  --success:       #66BB6A;
  --warning:       #FFA726;

  --radius:       4px;
  --radius-lg:    8px;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow:       0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6);
  --transition:   150ms ease;
}

[data-theme="light"] {
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F4F5F7;
  --bg-tertiary:   #E8EAED;
  --text-primary:  #111111;
  --text-secondary:#555555;
  --text-muted:    #999999;
  --border:        #DCDFE6;
  --border-subtle: #EEEFF2;
  --shadow:        0 2px 12px rgba(0,0,0,0.1);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.15);
}

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

html { height: 100%; font-size: 14px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button { cursor: pointer; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

select option { background: var(--bg-secondary); }

textarea { resize: vertical; min-height: 60px; }

/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 48px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
  z-index: 100;
}

.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
  display: none;
}
@media (min-width: 900px) { .logo-tagline { display: block; } }

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: 16px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

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

.btn-icon {
  padding: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-icon.danger:hover { color: var(--danger); }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ----------------------------------------------------------------
   Theme Toggle
   ---------------------------------------------------------------- */
#theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  padding: 5px 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
#theme-toggle:hover { color: var(--text-primary); background: var(--border); }

/* ----------------------------------------------------------------
   Horizontal Day Bar
   ---------------------------------------------------------------- */
.daybar-wrap {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 6px;
  user-select: none;
}

.daybar-track {
  position: relative;
  height: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: crosshair;
}

.daybar-hours {
  position: relative;
  height: 14px;
  margin-bottom: 3px;
}

.daybar-hour-tick {
  position: absolute;
  top: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Entry segments inside the bar */
.daybar-segment {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: filter var(--transition);
  opacity: 0.88;
  border-left: 2px solid rgba(0,0,0,0.25);
}
.daybar-segment:hover {
  opacity: 1;
  filter: brightness(1.15);
  z-index: 5;
}

/* Drag selection */
.daybar-drag-sel {
  position: absolute;
  top: 2px;
  bottom: 2px;
  background: rgba(0,191,165,0.25);
  border: 1px dashed var(--accent);
  border-radius: 3px;
  pointer-events: none;
  z-index: 8;
}

/* Current time line */
.daybar-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  z-index: 10;
  pointer-events: none;
}
.daybar-now::before {
  content: '';
  position: absolute;
  top: 3px;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
}

/* Tooltip for daybar */
.daybar-time-tip {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
}

/* ----------------------------------------------------------------
   Main Layout
   ---------------------------------------------------------------- */
.app-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.main-columns {
  display: grid;
  grid-template-columns: 300px 1fr 240px;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* ----------------------------------------------------------------
   Left Column — Form + Entries
   ---------------------------------------------------------------- */
.col-left {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.col-left-inner {
  overflow-y: auto;
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Date navigation */
.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-nav .date-label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.date-nav .btn-icon { padding: 4px 8px; }
.btn-today {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-today:hover { color: var(--accent); border-color: var(--accent); }

/* Form */
.entry-form { display: flex; flex-direction: column; gap: 10px; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

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

.time-input-group {
  position: relative;
}
.time-input-group input[type="time"] {
  font-family: var(--font-mono);
  font-size: 15px;
  text-align: center;
}

.duration-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-align: center;
  min-height: 16px;
}

/* Client select with color dot */
.select-with-dot { position: relative; }
.select-with-dot select { padding-left: 28px; }
.select-dot {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}

/* Billable toggle */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle-label { font-size: 13px; color: var(--text-secondary); }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #000;
}

/* Form actions */
.form-actions { display: flex; gap: 8px; }
.form-actions .btn { flex: 1; justify-content: center; }

/* Today's entry list */
.entries-section { display: flex; flex-direction: column; gap: 8px; }

.entries-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.entries-header h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.entry-list { display: flex; flex-direction: column; gap: 4px; }

.entry-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.entry-item:hover { border-color: var(--border); background: var(--bg-primary); }
.entry-item.active { border-color: var(--accent); }

.entry-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.entry-info { flex: 1; min-width: 0; }
.entry-desc {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.entry-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--font-mono);
}

.entry-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }
.entry-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition); }
.entry-item:hover .entry-actions { opacity: 1; }

.no-entries {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ----------------------------------------------------------------
   Center Column — Timeline
   ---------------------------------------------------------------- */
.col-center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.timeline-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.timeline-header h2 { font-size: 14px; font-weight: 600; color: var(--text-secondary); }

.timeline-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: 0;
}

.timeline-inner {
  position: relative;
  width: 100%;
  /* 24 hours, 60px each = 1440px */
  height: 1440px;
}

.timeline-hour-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: flex-start;
  border-top: 1px solid var(--border-subtle);
}
.timeline-hour-row:nth-child(even) { background: rgba(255,255,255,0.01); }

.hour-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  width: 36px;
  padding: 3px 6px;
  flex-shrink: 0;
  user-select: none;
}

.timeline-lane {
  flex: 1;
  position: relative;
  height: 100%;
}

/* Time entry blocks on timeline */
.tl-entry {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--radius);
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
  transition: filter var(--transition), box-shadow var(--transition);
  border-left: 3px solid rgba(0,0,0,0.3);
  z-index: 2;
}
.tl-entry:hover {
  filter: brightness(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 5;
}
.tl-entry-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(0,0,0,0.85);
}
.tl-entry-sub {
  color: rgba(0,0,0,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Current time indicator */
.tl-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 10;
  pointer-events: none;
}
.tl-now-line::before {
  content: '';
  position: absolute;
  left: 36px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

/* Drag selection */
.tl-drag-selection {
  position: absolute;
  left: 4px;
  right: 4px;
  background: rgba(0,191,165,0.2);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  z-index: 8;
  pointer-events: none;
}

/* Tooltip */
.tl-tooltip {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 12px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  max-width: 220px;
  line-height: 1.5;
}
.tl-tooltip strong { color: var(--text-primary); display: block; margin-bottom: 2px; }
.tl-tooltip .tt-time { font-family: var(--font-mono); color: var(--accent); }
.tl-tooltip .tt-project { color: var(--text-secondary); }
.tl-tooltip .tt-ticket { color: var(--text-muted); font-size: 11px; }

/* ----------------------------------------------------------------
   Right Column — Summary
   ---------------------------------------------------------------- */
.col-right {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-card h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.stat-label { color: var(--text-secondary); }
.stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}
.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.muted { color: var(--text-muted); }

/* Progress bar */
.progress-bar-wrap {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease, background 0.4s ease;
  min-width: 2px;
}
.progress-bar-fill.complete { background: var(--success); }

/* Billable breakdown */
.bill-split { display: flex; gap: 4px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.bill-split-billable { background: var(--accent); }
.bill-split-nonbill { background: var(--text-muted); }

/* ----------------------------------------------------------------
   Favorites Bar
   ---------------------------------------------------------------- */
.favorites-bar {
  height: 56px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.favorites-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.favorite-chip:hover { border-color: var(--accent); color: var(--text-primary); background: var(--bg-primary); }

.fav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Modal
   ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(680px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(-12px);
  transition: transform 200ms ease;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; flex: 1; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Client management */
.client-add-form {
  display: grid;
  grid-template-columns: 1fr 80px auto auto;
  gap: 8px;
  align-items: end;
}

.client-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.client-row:not(:last-child) { margin-bottom: 4px; }

.client-color-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}

.client-name-inline { flex: 1; font-size: 13px; }
.client-name-input { font-size: 13px; }

.project-list {
  padding: 8px 12px 8px 28px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.project-row span { flex: 1; }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Color input */
input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  cursor: pointer;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}

/* ----------------------------------------------------------------
   Toast Notifications
   ---------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease forwards;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  pointer-events: auto;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}
.toast.removing { animation: toast-out 200ms ease forwards; }

/* ----------------------------------------------------------------
   Month View
   ---------------------------------------------------------------- */
.month-page {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.month-nav h1 {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
}

.month-export-btns { display: flex; gap: 8px; }

.month-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.month-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.month-stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.month-stat-card .value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 4px;
}
.calendar-cell {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 8px;
  min-height: 90px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calendar-cell:hover { border-color: var(--accent); background: var(--bg-tertiary); }
.calendar-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.calendar-cell.today { border-color: var(--accent); }

.cal-day-nr {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.calendar-cell.today .cal-day-nr { color: var(--accent); }
.calendar-cell.weekend .cal-day-nr { color: var(--text-muted); }

.cal-total {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.cal-billable {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
}
.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

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

/* ----------------------------------------------------------------
   Utility
   ---------------------------------------------------------------- */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted  { color: var(--text-muted); }
.text-mono   { font-family: var(--font-mono); }

/* ----------------------------------------------------------------
   Mobile (< 768px)
   ---------------------------------------------------------------- */
@media (max-width: 767px) {
  body { overflow: auto; }

  .main-columns {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    overflow: visible;
  }

  .col-center {
    height: 340px;
    border-top: 1px solid var(--border);
  }

  .col-right {
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .summary-card { flex: 1; min-width: 140px; }

  .favorites-bar { height: auto; min-height: 48px; flex-wrap: wrap; padding: 8px 16px; }

  .app-body { overflow: auto; }
}

/* ----------------------------------------------------------------
   Inline edit state
   ---------------------------------------------------------------- */
.editing-indicator {
  font-size: 11px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.editing-indicator::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
