/* Lotus O'clock prototype. Colours and layout follow the Figma designs (docs/requirements.md, "Designed"). */

:root {
  --sidebar: #1d102c;
  --sidebar-text: #c9c2d6;
  --accent: #6a28c6;
  --accent-dark: #5520a3;
  --accent-soft: #f1eafb;
  --bg: #f8f7fa;
  --card: #ffffff;
  --border: #ebe8f0;
  --row-alt: #f6f4f9;
  --text: #1c1726;
  --muted: #8a8595;
  --label: #9a95a5;
  --danger: #e5484d;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(29, 16, 44, 0.06);
  font-family: "DM Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
.boot { padding: 2rem; color: var(--muted); }

/* Layout */
.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 20px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; font-size: 15px; padding: 0 8px 22px; }
.nav-group { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #8d83a0; padding: 14px 10px 8px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); }
.nav-link.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(106, 40, 198, 0.4); }
.nav-link .chev { margin-left: auto; opacity: 0.6; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user-card { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 14px 6px 4px; display: flex; align-items: center; gap: 10px; position: relative; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; text-align: left; width: 100%; }
.user-card .who { min-width: 0; flex: 1; }
.user-card .name { color: #fff; font-size: 13px; font-weight: 600; }
.user-card .email { font-size: 11px; color: #8d83a0; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #8b4fe0, var(--accent)); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; }
.avatar-btn { border: 0; padding: 0; cursor: pointer; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.topbar .workspace { font-weight: 600; font-size: 13px; }
.topbar .tools { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--muted); }
.icon-btn { background: none; border: 0; padding: 4px; color: var(--muted); display: inline-grid; place-items: center; border-radius: 6px; }
.icon-btn:hover { background: var(--row-alt); color: var(--text); }
.bell { position: relative; }
.bell::after { content: ""; position: absolute; top: 3px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.running-chip { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 12px; font-weight: 600; }
.running-chip .clock { font-variant-numeric: tabular-nums; }
.running-chip button { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.running-chip button.discard { background: none; color: inherit; padding: 4px; margin-left: -6px; }
.timer-long .running-chip button.discard { background: none; color: inherit; }
/* A timer past 8 hours (R-002): amber, and asking, on every page. Never stopped for the person (ADR 0006). */
.long-label, .long-notice { display: none; }
.timer-long .running-chip { background: var(--warn-soft); color: var(--warn); }
.timer-long .running-chip button { background: var(--warn); color: var(--card); }
.timer-long .running-chip .long-label { display: inline; }
.timer-long .long-notice { display: block; }
.long-notice { background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; padding: 10px 16px; border-radius: var(--radius) var(--radius) 0 0; }
.badge.warn { color: var(--warn); background: var(--warn-soft); margin-left: 6px; }
.page { padding: 26px 32px 48px; max-width: 1200px; width: 100%; }

/* Page header */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head .titles { flex: 1; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 8px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.subtitle { color: var(--muted); font-size: 12px; margin: 0; }
.week-total { display: flex; align-items: baseline; gap: 10px; }
.week-total .label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.week-total .value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { border: 1px solid var(--accent); background: var(--card); color: var(--accent); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(106, 40, 198, 0.3); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.quiet { border-color: var(--border); color: var(--text); font-weight: 500; }
.btn.quiet:hover { background: var(--row-alt); }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 4px 6px; text-decoration: underline; }

/* Cards and the entry bar */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.entry-bar { margin-bottom: 24px; }
.entry-bar .modes { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.segmented { display: inline-flex; background: var(--row-alt); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: none; border-radius: 6px; padding: 5px 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.segmented button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); font-weight: 600; }
.entry-fields { display: flex; align-items: stretch; }
.field { padding: 12px 14px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.field:last-of-type { border-right: 0; }
.field.grow { flex: 1; }
.field-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--label); white-space: nowrap; }
.field input, .field select { border: 0; outline: 0; background: none; padding: 0; font-size: 13px; min-width: 0; }
.field input::placeholder { color: #b9b4c3; }
.field input.underlined { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.field .time-range { display: flex; align-items: center; gap: 4px; }
.field .time-range input { width: 44px; }
.field input.duration { width: 70px; font-size: 15px; font-variant-numeric: tabular-nums; }
.field input[type="date"] { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.entry-action { padding: 12px 14px; display: flex; align-items: center; gap: 8px; }

/* Project picker */
.picker { position: relative; }
.picker-button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font-size: 13px; min-width: 170px; text-align: left; }
.picker-button .placeholder { color: #b9b4c3; }
.picker-button .chev { margin-left: auto; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dropdown { position: absolute; z-index: 55; /* above dialogs (.backdrop), which open pickers too */ background: var(--card); border: 1px solid var(--accent); border-radius: 8px; box-shadow: 0 8px 24px rgba(29, 16, 44, 0.14); min-width: 240px; max-height: 320px; overflow: auto; }
.dropdown .search { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--muted); position: sticky; top: 0; background: var(--card); }
.dropdown .search input { border: 0; outline: 0; flex: 1; font-size: 12px; }
.dropdown .option { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dropdown .option:last-child { border-bottom: 0; }
.dropdown .option:hover, .dropdown .option.active { background: var(--accent-soft); }
.dropdown .option .client { color: var(--muted); }
.dropdown .empty { padding: 12px; color: var(--muted); font-size: 12px; }

/* The tracker's list */
.list-head { display: flex; align-items: flex-end; margin-bottom: 12px; }
.list-head h2 { font-size: 15px; margin: 0 0 4px; font-weight: 600; }
.list-head .subtitle { font-size: 11px; }
.week-nav { margin-left: auto; display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--card); border-radius: 8px; }
.week-nav button { background: none; border: 0; padding: 7px 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.week-nav .range { color: var(--text); font-size: 12px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.day-group { border-bottom: 1px solid var(--border); }
.day-group:last-child { border-bottom: 0; }
.day-head { display: flex; align-items: center; padding: 10px 14px; background: var(--row-alt); font-size: 12px; font-weight: 600; }
.day-head .total { margin-left: auto; color: var(--muted); font-weight: 400; }
.day-head .total b { color: var(--text); margin-left: 8px; }
.entry-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); }
.entry-row:first-of-type { border-top: 0; }
.entry-row .round { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted); display: grid; place-items: center; padding: 0; }
.entry-row .what { flex: 1; min-width: 0; }
.entry-row .desc { font-size: 13px; font-weight: 500; }
.entry-row .desc.none { color: var(--muted); font-style: italic; font-weight: 400; }
.entry-row .proj { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.entry-row .range { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; width: 110px; text-align: right; }
.entry-row .dur { font-size: 13px; font-weight: 600; width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.entry-row.running { background: #fbf8ff; }
.entry-row.running .dur { color: var(--accent); }
.entry-row.editing { display: block; padding: 0; background: #fbf8ff; }
.entry-row.editing .entry-fields { border-bottom: 0; }
.empty-state { padding: 32px; text-align: center; color: var(--muted); }

/* Menus, modals, toasts */
.menu { position: absolute; z-index: 55; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(29, 16, 44, 0.14); min-width: 150px; padding: 4px 0; }
.menu button { display: flex; width: 100%; border: 0; background: none; text-align: left; padding: 8px 14px; font-size: 13px; gap: 8px; align-items: center; }
.menu button:hover { background: var(--row-alt); }
.menu button.danger { color: var(--danger); }
.backdrop { position: fixed; inset: 0; background: rgba(29, 16, 44, 0.35); display: grid; place-items: center; z-index: 50; }
.modal { background: var(--card); border-radius: 12px; border: 1px solid var(--accent); width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(29, 16, 44, 0.25); }
.modal-head { display: flex; align-items: center; padding: 22px 20px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.modal-row { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.modal-row.inline { flex-direction: row; align-items: center; justify-content: space-between; }
.modal-row input, .modal-row select { border: 0; outline: 0; padding: 2px 0; font-size: 13px; background: none; }
.modal-row .time-range { display: flex; gap: 6px; align-items: center; }
.modal-row .time-range input { width: 52px; }
.modal-message { padding: 26px 20px; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 20px; }
.modal-actions .btn { justify-content: center; }
.modal-error { color: var(--danger); font-size: 12px; padding: 0 20px 4px; min-height: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--card) inset; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--sidebar); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(29, 16, 44, 0.25); max-width: 380px; }
.toast.error { background: var(--danger); }

/* Tables: Projects, Clients, Team */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter { display: flex; align-items: center; gap: 6px; border: 1px solid var(--accent); border-radius: 8px; background: var(--card); padding: 0 10px; height: 34px; color: var(--muted); }
.filter input, .filter select { border: 0; outline: 0; background: none; font-size: 12px; min-width: 120px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); padding: 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--card); white-space: nowrap; }
.table th:last-child, .table td:last-child { border-right: 0; text-align: center; width: 110px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th .sort { color: var(--muted); margin-left: 6px; font-weight: 400; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 12px; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .name-cell { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.badge { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; }
.heart { color: var(--accent); display: inline-flex; }

/* Timesheet */
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sheet th { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; }
.sheet th .day-num { display: block; font-size: 13px; color: var(--text); letter-spacing: 0; margin-top: 2px; }
.sheet th.project { text-align: left; padding-left: 14px; font-size: 11px; color: var(--text); width: 220px; }
.sheet th.today { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 3px 0 var(--accent); }
.sheet th.today .day-num { color: var(--accent); }
.sheet td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 8px; text-align: center; }
.sheet td.today { background: #fbf8ff; }
.sheet td.proj-cell { text-align: left; padding-left: 14px; }
.sheet .proj-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.sheet .proj-client { font-size: 10px; color: var(--muted); margin-left: 15px; }
.sheet .cell { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--card); height: 30px; }
.sheet .cell input { border: 0; outline: 0; width: 100%; text-align: center; background: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.sheet .cell input::placeholder { color: #c3bfcc; }
.sheet .cell:focus-within { border-color: var(--accent); }
.sheet .cell .more { border: 0; background: none; color: var(--muted); padding: 0 4px; height: 100%; display: grid; place-items: center; }
.sheet td.total { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet td.remove button { border: 0; background: none; color: var(--muted); }
.sheet tfoot td { background: var(--row-alt); font-size: 12px; font-variant-numeric: tabular-nums; border-bottom: 0; padding: 14px 8px; }
.sheet tfoot td.today { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.sheet tfoot td.label { text-align: left; padding-left: 14px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sheet-actions { display: flex; gap: 10px; margin: 16px 0 32px; flex-wrap: wrap; position: relative; }
.favourites { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px; }
.fav-card { border: 1px solid; border-radius: 8px; background: var(--card); padding: 12px 14px; display: flex; align-items: center; gap: 8px; text-align: left; }
.fav-card .names { flex: 1; min-width: 0; }
.fav-card .p { font-size: 13px; font-weight: 500; }
.fav-card .c { font-size: 10px; color: var(--muted); }
.fav-card .heart-btn { border: 0; background: none; padding: 2px; display: inline-flex; }
h2.section { font-size: 15px; font-weight: 600; margin: 0 0 4px; }

/* Sign-in */
.signin { min-height: 100vh; background: radial-gradient(circle at 30% 20%, #3a1d5e, var(--sidebar) 60%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; padding: 24px; }
.signin .brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; margin-bottom: 28px; }
.signin-card { background: var(--card); color: var(--text); border-radius: 14px; padding: 32px; width: min(380px, 100%); text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.signin-card h2 { margin: 0 0 6px; font-size: 20px; }
.signin-card p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.google-btn { width: 100%; border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 11px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.google-btn:hover { background: var(--row-alt); }
.demo-users { text-align: left; margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.demo-users .note { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.demo-user { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 8px; border-radius: 8px; text-align: left; }
.demo-user:hover { background: var(--row-alt); }
.demo-user .role { margin-left: auto; font-size: 11px; color: var(--muted); }
.signin footer { margin-top: 28px; font-size: 11px; color: #8d83a0; }

.notice { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; color: var(--muted); }
.prototype-tag { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; margin-left: 10px; vertical-align: 1px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
  .nav-group, .user-card { display: none; }
  .entry-fields { flex-wrap: wrap; }
  .favourites { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 20px 16px; }
}
.signin-error { background: #fdecec; color: var(--danger); border-radius: 8px; padding: 10px 12px; font-size: 12px; margin: 0 0 16px; text-align: left; }
a.google-btn { color: var(--text); text-decoration: none; }

/* The weekly goal card in the sidebar (final designs) */
.goal-card { display: block; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 12px; color: var(--sidebar-text); }
.goal-card:hover { background: rgba(255, 255, 255, 0.04); }
.goal-head { display: flex; gap: 10px; align-items: center; }
.goal-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(155, 92, 240, 0.25); color: #c9a6ff; display: grid; place-items: center; }
.goal-title { color: #fff; font-size: 12px; font-weight: 600; }
.goal-text { font-size: 11px; color: #8d83a0; margin-top: 2px; }
.goal-bar { height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.goal-bar span { display: block; height: 100%; background: #9b5cf0; border-radius: 2px; }
.topbar .ws-name { font-weight: 600; font-size: 13px; }
.topbar .ws-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.week-total .goal-of { display: block; font-size: 10px; color: var(--muted); text-align: right; letter-spacing: 0; text-transform: none; }

/* Tabs inside a page (Reports, Settings) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a, .tabs button { padding: 10px 14px; font-size: 13px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Dark theme (R-020). The designs are light only; this keeps the same structure, darker. */
:root[data-theme="dark"] {
  --bg: #151020;
  --card: #1f1830;
  --border: #2f2645;
  --row-alt: #241c37;
  --text: #ece8f4;
  --muted: #a39cb3;
  --label: #8f879f;
  --accent-soft: #2c2048;
  --warn: #fbbf24;
  --warn-soft: #3a2a10;
  color-scheme: dark;
}
:root[data-theme="dark"] .entry-row.running, :root[data-theme="dark"] .entry-row.editing, :root[data-theme="dark"] .sheet td.today { background: #261d3d; }
:root[data-theme="dark"] .field input::placeholder { color: #6f6782; }
.entry-row .round.resume { color: var(--accent); border-color: #e3d6f7; }
.entry-row .range .range-day { font-size: 10px; color: var(--muted); margin-top: 3px; }
.day-head .day-date { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 8px; }

/* Calendar (U8) */
.cal { overflow: hidden; }
/* The header keeps the grid's scrollbar space too, so the day columns line up with the hours below. */
.cal-head { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--border); overflow-y: hidden; scrollbar-gutter: stable; }
.cal-head > div { padding: 10px 8px; text-align: center; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-left: 1px solid var(--border); }
.cal-head > div:first-child { border-left: 0; }
.cal-head b { display: block; font-size: 15px; color: var(--text); letter-spacing: 0; margin-top: 2px; }
.cal-head small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 500; margin-top: 2px; }
.cal-head .today { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 3px 0 var(--accent); }
.cal-head .today b { color: var(--accent); }
.cal-scroll { height: 620px; overflow-y: auto; scrollbar-gutter: stable; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, 1fr); }
.cal-gutter { border-right: 1px solid var(--border); }
.cal-hour { font-size: 10px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-6px); }
.cal-col { position: relative; border-left: 1px solid var(--border); cursor: pointer;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 48px); }
.cal-col:first-of-type { border-left: 0; }
.cal-col.today { background-color: #fbf8ff; }
:root[data-theme="dark"] .cal-col.today { background-color: #221a35; }
.cal-entry { position: absolute; margin: 0 2px; border: 0; border-left: 3px solid; border-radius: 6px; padding: 4px 6px; text-align: left; overflow: hidden; color: var(--text); font-size: 11px; }
.cal-entry:hover { filter: brightness(0.96); }
.cal-entry.running { outline: 1px dashed var(--accent); }
.cal-desc { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-meta { color: var(--muted); font-size: 10px; margin-top: 2px; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; }
.danger-link { color: var(--danger); }
.head-tools { display: flex; gap: 10px; align-items: center; }
.head-tools .filter select { min-width: 160px; }
.head-tools .filter span { font-size: 11px; color: var(--muted); }

/* Reports and the dashboard (R-018, R-019) */
.dash-head { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat { padding: 16px; }
.stat-value { font-size: 22px; font-weight: 600; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.chart-card { padding: 16px; }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .bar:hover { opacity: 0.85; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.bar-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.bar-label { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-track { height: 8px; background: var(--row-alt); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar-track span { display: block; height: 100%; border-radius: 4px; }
.table.detailed td:last-child { width: 48px; }
.table tfoot td { border-top: 1px solid var(--border); background: var(--row-alt); }
.proj-client { font-size: 10px; color: var(--muted); margin-left: 15px; }
@media print { .sidebar, .topbar, .head-tools, .tabs, .filters { display: none !important; } .app { display: block; } }

/* Settings */
.settings { padding: 4px 20px; max-width: 720px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-label { font-weight: 600; font-size: 13px; }
.setting .subtitle { margin-top: 3px; max-width: 380px; }
.setting input:not([type="checkbox"]), .setting select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); min-width: 220px; }
.setting input[type="number"] { min-width: 90px; width: 90px; }
.setting .inline { display: flex; align-items: center; gap: 6px; }
.setting input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.settings-actions { padding: 16px 0; display: flex; justify-content: flex-end; }
.table.activity td:first-child { white-space: nowrap; width: 160px; }
.table.activity td:nth-child(2) { width: 160px; }
.table.activity td:last-child { text-align: left; width: auto; }
