/* ============================================================
     DASH — editorial, calm, warm. Instrument Serif + Inter Tight.
     ============================================================ */
  :root {
    --bg: #f6f1e8;           /* warm paper */
    --bg-elev: #fbf7ef;      /* card */
    --bg-sink: #efe7d8;      /* recessed */
    --ink: #1d1a16;          /* primary text */
    --ink-2: #4a443b;        /* secondary */
    --ink-3: #8a8073;        /* tertiary */
    --rule: #e4dccd;         /* hairline */
    --rule-2: #d6cbb5;       /* stronger */
    --accent: #d97757;       /* terracotta */
    --accent-ink: #8a3d24;
    --accent-wash: #f3dccf;
    --pos: #5a7a3b;          /* olive green for positive */
    --pos-wash: #e3e9d4;
    --neg: #a94a3a;
    --neg-wash: #f1d8d1;
    --shadow: 0 1px 0 rgba(29,26,22,.04), 0 1px 2px rgba(29,26,22,.04);
    --shadow-hover: 0 1px 0 rgba(29,26,22,.04), 0 6px 18px -8px rgba(29,26,22,.18);
    --radius: 14px;
    --radius-sm: 8px;
    --pad: 22px;
    --gap: 18px;
    --font-serif: 'Instrument Serif', 'Fraunces', Georgia, serif;
    --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  }

  /* Density modes */
  html[data-density="compact"] { --pad: 16px; --gap: 12px; --radius: 12px; }
  html[data-density="comfortable"] { --pad: 22px; --gap: 18px; }
  html[data-density="spacious"] { --pad: 28px; --gap: 24px; }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
  body { min-height: 100vh; }

  .serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
  .mono { font-family: var(--font-mono); }
  .muted { color: var(--ink-3); }
  .sec  { color: var(--ink-2); }

  button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
  a { color: inherit; text-decoration: none; }

  /* ===== App shell ===== */
  .app { max-width: 1400px; margin: 0 auto; padding: 28px 36px 80px; }

  header.top {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 18px; border-bottom: 1px solid var(--rule);
  }
  .brand { display: flex; align-items: baseline; gap: 12px; }
  .brand .wordmark { font-family: var(--font-serif); font-size: 34px; letter-spacing: -0.02em; line-height: 1; }
  .brand .wordmark .dot { color: var(--accent); }
  .brand .sub { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em; }

  .top-right { display: flex; align-items: center; gap: 14px; }
  .date-pill { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: var(--ink-2); }
  .search {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-elev); border: 1px solid var(--rule);
    padding: 7px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-3);
    min-width: 220px;
  }
  .search kbd {
    font-family: var(--font-mono); font-size: 11px;
    background: var(--bg); border: 1px solid var(--rule); padding: 1px 6px; border-radius: 4px;
    margin-left: auto; color: var(--ink-3);
  }
  .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-wash); color: var(--accent-ink);
    display: grid; place-items: center; font-weight: 600; font-size: 12px;
    border: 1px solid var(--rule-2);
  }

  /* ===== Tabs ===== */
  .tabs { display: flex; gap: 4px; margin: 20px 0 28px; border-bottom: 1px solid var(--rule); position: relative; }
  .tab {
    padding: 12px 18px 14px; font-size: 14px; color: var(--ink-3);
    position: relative; display: flex; align-items: center; gap: 8px;
    transition: color .18s ease;
  }
  .tab:hover { color: var(--ink-2); }
  .tab[aria-selected="true"] { color: var(--ink); }
  .tab[aria-selected="true"]::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent);
  }
  .tab .count {
    font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border-radius: 4px;
    background: var(--bg-sink); color: var(--ink-3);
  }
  .tab[aria-selected="true"] .count { background: var(--accent-wash); color: var(--accent-ink); }

  /* ===== Grid ===== */
  /* Layout A: magazine (default) */
  .grid-a {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: minmax(160px, auto);
    gap: var(--gap);
  }
  .grid-a .w-revenue   { grid-column: span 2; grid-row: span 2; }
  .grid-a .w-quickadd  { grid-column: span 1; grid-row: span 1; }
  .grid-a .w-notes     { grid-column: span 1; grid-row: span 1; }
  .grid-a .w-tasks     { grid-column: span 1; grid-row: span 2; }
  .grid-a .w-meetings  { grid-column: span 1; grid-row: span 2; }
  .grid-a .w-issues    { grid-column: span 1; grid-row: span 2; }

  /* Layout B: balanced */
  .grid-b {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
  }
  .grid-b .w-revenue  { grid-column: span 3; }
  .grid-b .w-tasks    { grid-column: span 1; grid-row: span 2; }
  .grid-b .w-meetings { grid-column: span 1; grid-row: span 2; }
  .grid-b .w-issues   { grid-column: span 1; }
  .grid-b .w-notes    { grid-column: span 1; }
  .grid-b .w-quickadd { grid-column: span 3; }

  /* Layout C: column */
  .grid-c {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: var(--gap);
  }
  .grid-c .w-revenue  { grid-column: span 2; }
  .grid-c .w-tasks    { grid-column: 1; }
  .grid-c .w-meetings { grid-column: 2; }
  .grid-c .w-issues   { grid-column: span 2; }
  .grid-c .w-notes    { grid-column: 1; }
  .grid-c .w-quickadd { grid-column: 2; }

  /* ===== Card ===== */
  .card {
    background: var(--bg-elev);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: var(--pad);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
    position: relative;
    min-height: 0;
  }
  .card.clickable { cursor: pointer; }
  .card.clickable:hover { box-shadow: var(--shadow-hover); border-color: var(--rule-2); }
  .card.clickable:hover .card-arrow { opacity: 1; transform: translate(2px, -2px); }

  .card-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 14px;
  }
  .card-title {
    font-family: var(--font-serif); font-size: 22px; line-height: 1; color: var(--ink);
    letter-spacing: -0.01em;
  }
  .card-kicker {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--ink-3); margin-bottom: 6px;
  }
  .card-arrow {
    width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center;
    color: var(--ink-3);
    opacity: .4; transition: opacity .2s ease, transform .2s ease;
  }
  .card-arrow svg { width: 14px; height: 14px; }

  /* ===== Revenue widget ===== */
  /* Parent grid: columns aligned; shared rows so sparklines land on the same baseline */
  .rev-grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    grid-template-rows: auto auto auto 1fr auto;
    column-gap: 28px;
    row-gap: 0;
    min-height: 100%;
    flex: 1;
  }
  .rev-grid > .rev-l { grid-column: 1; }
  .rev-grid > .rev-r { grid-column: 3; }
  .rev-grid > .r-row1 { grid-row: 1; }
  .rev-grid > .r-row2 { grid-row: 2; margin-top: 10px; }
  .rev-grid > .r-row3 { grid-row: 3; }
  .rev-grid > .r-row5 { grid-row: 5; align-self: end; }

  .rev-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-3); display: flex; align-items: center; gap: 8px; min-height: 18px; }
  .rev-label .tag { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--bg-sink); color: var(--ink-2); letter-spacing: 0; text-transform: none; }
  .rev-big { font-family: var(--font-serif); font-size: 58px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
  .rev-big .unit { font-family: var(--font-sans); font-size: 16px; color: var(--ink-3); font-weight: 400; letter-spacing: 0; }
  .rev-delta {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 12px;
    padding: 4px 10px; border-radius: 999px;
    margin-top: 12px;
    align-self: start;
    width: fit-content;
    white-space: nowrap;
  }
  .rev-delta.pos { background: var(--pos-wash); color: var(--pos); }
  .rev-delta.neg { background: var(--neg-wash); color: var(--neg); }
  .rev-arrow svg { width: 10px; height: 10px; }

  .spark { padding-top: 18px; }
  .spark svg { width: 100%; height: 72px; display: block; }
  .spark .axis { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); display: flex; justify-content: space-between; margin-top: 6px; }

  .rev-divider { grid-column: 2; grid-row: 1 / -1; width: 1px; background: var(--rule); }

  /* ===== List items (tasks/meetings/issues/notes) ===== */
  .list { display: flex; flex-direction: column; gap: 2px; flex: 1; margin: 0; padding: 0; list-style: none; min-height: 0; }
  .list-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
  }
  .list-item:last-child { border-bottom: 0; }
  .list-item:hover .item-title { color: var(--accent-ink); }

  /* Task */
  .task-check {
    width: 18px; height: 18px; border: 1.5px solid var(--rule-2); border-radius: 5px;
    flex-shrink: 0; margin-top: 1px; cursor: pointer; position: relative;
    background: var(--bg-elev); transition: all .15s ease;
  }
  .task-check:hover { border-color: var(--accent); }
  .task-check.done { background: var(--accent); border-color: var(--accent); }
  .task-check.done::after {
    content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
    border: solid #fbf7ef; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .item-title { font-size: 14px; color: var(--ink); line-height: 1.35; transition: color .15s ease; }
  .item-title.done { color: var(--ink-3); text-decoration: line-through; }
  .item-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
  .tag-pill {
    font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: 4px;
    background: var(--bg-sink); color: var(--ink-2); letter-spacing: 0;
  }
  .tag-pill.accent { background: var(--accent-wash); color: var(--accent-ink); }
  .tag-pill.pos { background: var(--pos-wash); color: var(--pos); }
  .tag-pill.warn { background: #f4e3c3; color: #7a5a1a; }

  /* Meeting */
  .time-col {
    font-family: var(--font-serif); font-size: 18px; color: var(--ink);
    width: 52px; flex-shrink: 0; line-height: 1.1;
  }
  .time-col .ampm { font-family: var(--font-sans); font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; display: block; }
  .meeting-body { flex: 1; }
  .meeting-attendees { display: flex; margin-top: 6px; }
  .att {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg-elev);
    margin-left: -6px; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff;
  }
  .att:first-child { margin-left: 0; }

  /* Issue */
  .issue-num {
    font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
    flex-shrink: 0; width: 44px;
  }
  .issue-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
  }
  .issue-dot.bug { background: var(--neg); }
  .issue-dot.feat { background: var(--accent); }
  .issue-dot.chore { background: var(--ink-3); }

  /* Notes widget */
  .note-preview {
    display: flex; flex-direction: column; gap: 8px; flex: 1;
  }
  .note-input {
    background: var(--bg); border: 1px dashed var(--rule-2); border-radius: var(--radius-sm);
    padding: 12px 14px; font-family: var(--font-serif); font-size: 16px; color: var(--ink);
    width: 100%; resize: none; min-height: 72px; outline: 0;
    transition: border-color .15s ease, background .15s ease;
    font-style: italic;
  }
  .note-input:focus { border-color: var(--accent); border-style: solid; background: var(--bg-elev); }
  .note-input::placeholder { color: var(--ink-3); font-style: italic; }
  .note-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
  .note-recent { font-size: 12px; color: var(--ink-3); font-style: italic; font-family: var(--font-serif); }
  .btn {
    font-size: 12px; padding: 6px 12px; border-radius: 999px;
    background: var(--ink); color: var(--bg); font-weight: 500;
    border: 0; cursor: pointer; transition: background .15s ease, transform .1s ease;
  }
  .btn:hover { background: var(--accent-ink); }
  .btn:active { transform: scale(0.97); }
  .btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule-2); }
  .btn.ghost:hover { background: var(--bg-sink); color: var(--ink); }
  .btn.accent { background: var(--accent); }
  .btn.accent:hover { background: var(--accent-ink); }

  /* Quick add widget */
  .qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
  .qa-btn {
    background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-sm);
    padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    text-align: left; transition: all .15s ease; cursor: pointer;
  }
  .qa-btn:hover { border-color: var(--accent); background: var(--bg-elev); transform: translateY(-1px); }
  .qa-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-wash); color: var(--accent-ink); display: grid; place-items: center; }
  .qa-icon svg { width: 14px; height: 14px; }
  .qa-label { font-size: 13px; color: var(--ink); font-weight: 500; }
  .qa-hint { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }


  /* ===== Quick-add Composer (modal) ===== */
  .scrim {
    position: fixed; inset: 0; background: rgba(29,26,22,.32); backdrop-filter: blur(4px);
    z-index: 80; display: none; align-items: flex-start; justify-content: center; padding-top: 14vh;
    animation: fade .2s ease;
  }
  .scrim.open { display: flex; }
  @keyframes fade { from { opacity: 0 } to { opacity: 1 } }
  @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: translateY(0) scale(1) } }

  .composer {
    background: var(--bg-elev); border: 1px solid var(--rule); border-radius: 16px;
    width: min(560px, 92vw); padding: 0; overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(29,26,22,.3), 0 8px 20px rgba(29,26,22,.1);
    animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
  }
  .comp-tabs { display: flex; border-bottom: 1px solid var(--rule); padding: 0 8px; }
  .comp-tab { padding: 14px 16px; font-size: 13px; color: var(--ink-3); position: relative; display: flex; align-items: center; gap: 8px; }
  .comp-tab[aria-selected="true"] { color: var(--ink); }
  .comp-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--accent); }
  .comp-body { padding: 20px 22px; }
  .comp-input {
    width: 100%; border: 0; outline: 0; background: transparent;
    font-family: var(--font-serif); font-size: 26px; color: var(--ink);
    padding: 6px 0;
  }
  .comp-input::placeholder { color: var(--ink-3); font-style: italic; }
  .comp-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 11px; color: var(--ink-2);
    padding: 5px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--rule);
    cursor: pointer;
  }
  .chip:hover { border-color: var(--accent); color: var(--accent-ink); }
  .chip.active { background: var(--accent-wash); border-color: var(--accent-wash); color: var(--accent-ink); }
  .comp-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 22px; border-top: 1px solid var(--rule); background: var(--bg);
    font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  }

  /* ===== Tweaks panel ===== */
  .tweaks {
    position: fixed; right: 28px; top: 28px; z-index: 60;
    width: 300px; background: var(--bg-elev); border: 1px solid var(--rule);
    border-radius: 14px; box-shadow: var(--shadow-hover);
    padding: 18px; display: none;
    animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
  }
  .tweaks.open { display: block; }
  .tweaks h4 { margin: 0 0 4px; font-family: var(--font-serif); font-size: 22px; font-weight: 400; }
  .tweaks .tw-sub { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 14px; }
  .tw-group { margin-bottom: 16px; }
  .tw-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 8px; }
  .tw-swatches { display: flex; gap: 8px; }
  .sw { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-2); cursor: pointer; position: relative; }
  .sw.sel::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--ink); }
  .tw-seg { display: flex; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 3px; }
  .tw-seg button { flex: 1; font-size: 12px; padding: 6px 8px; border-radius: 6px; color: var(--ink-3); }
  .tw-seg button.sel { background: var(--bg-elev); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.05); }

  /* ===== Detail views ===== */
  .detail-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
  .detail-head h1 { font-family: var(--font-serif); font-size: 54px; line-height: 1; margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 400; }
  .detail-head .lede { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: var(--ink-2); }
  .detail-grid { display: grid; gap: var(--gap); }

  .kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
  .kpi { background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
  .kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 8px; }
  .kpi .k-value { font-family: var(--font-serif); font-size: 36px; line-height: 1; letter-spacing: -0.01em; }
  .kpi .k-delta { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
  .kpi .k-delta.pos { color: var(--pos); }
  .kpi .k-delta.neg { color: var(--neg); }

  .chart-card { background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
  .chart-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
  .chart-head h3 { font-family: var(--font-serif); font-size: 26px; margin: 0; font-weight: 400; }
  .chart-tabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 3px; }
  .chart-tabs button { font-size: 11px; padding: 5px 10px; border-radius: 5px; font-family: var(--font-mono); color: var(--ink-3); }
  .chart-tabs button.sel { background: var(--bg-elev); color: var(--ink); }

  .table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .table th { text-align: left; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--rule); }
  .table td { padding: 14px 12px; border-bottom: 1px solid var(--rule); }
  .table tr:last-child td { border-bottom: 0; }
  .table tr:hover td { background: var(--bg); }

  .back-link {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3);
    margin-bottom: 10px; cursor: pointer;
    font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em;
  }
  .back-link:hover { color: var(--ink); }

  /* Meetings detail */
  .cal-grid { display: grid; grid-template-columns: 80px 1fr; gap: 0; }
  .cal-hour { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); padding: 18px 10px 0 0; text-align: right; border-top: 1px solid var(--rule); height: 80px; box-sizing: border-box; }
  .cal-slot { border-top: 1px solid var(--rule); height: 80px; position: relative; }
  .cal-event {
    position: absolute; left: 8px; right: 12px;
    background: var(--accent-wash); border-left: 3px solid var(--accent);
    border-radius: 6px; padding: 8px 10px;
    font-size: 12px; color: var(--ink);
    cursor: pointer; transition: transform .15s, box-shadow .15s;
  }
  .cal-event:hover { transform: translateX(2px); box-shadow: var(--shadow-hover); }
  .cal-event .ce-time { font-family: var(--font-mono); font-size: 10px; color: var(--accent-ink); margin-bottom: 2px; }
  .cal-event .ce-title { font-weight: 500; }

  /* Delete button on list rows */
  .row-delete { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 18px; line-height: 1; color: var(--ink-3); transition: background .1s, color .1s; }
  .row-delete:hover { background: var(--bg-sink); color: var(--ink); }

  /* View controls */
  .cal-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
  .chart-nav-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 20px; line-height: 1; color: var(--ink-2); background: var(--bg); border: 1px solid var(--rule); cursor: pointer; transition: background .1s, color .1s; }
  .chart-nav-btn:hover { background: var(--bg-sink); color: var(--ink); }

  /* Week view */
  .cal-week-wrap { overflow-x: auto; }
  .cal-week-header { display: grid; grid-template-columns: 64px repeat(7, 1fr); border-bottom: 2px solid var(--rule); margin-bottom: 0; }
  .cal-week-gutter {}
  .cal-week-day-head { text-align: center; padding: 6px 4px 8px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); line-height: 1.4; }
  .cal-week-day-head.today { color: var(--accent); }
  .cal-week-day-num { font-size: 16px; font-weight: 600; }
  .cal-week-day-head.today .cal-week-day-num { color: var(--accent); }
  .cal-week-row { display: grid; grid-template-columns: 64px repeat(7, 1fr); }
  .cal-week-hour { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-align: right; padding: 4px 8px 0 0; border-top: 1px solid var(--rule); height: 60px; box-sizing: border-box; }
  .cal-week-slot { border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); height: 60px; position: relative; }
  .cal-event-week { padding: 3px 5px; font-size: 10px; }
  .cal-event-week .ce-title { font-size: 10px; }
  .cal-event-week .ce-time { font-size: 9px; margin-bottom: 0; }

  /* Month view */
  .cal-month-wrap {}
  .cal-month-header { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
  .cal-month-day-name { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-align: center; padding: 4px 0 6px; }
  .cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--rule); border-radius: 8px; overflow: hidden; }
  .cal-month-cell { background: var(--bg-elev); min-height: 80px; padding: 6px 7px; cursor: pointer; transition: background .1s; }
  .cal-month-cell:hover { background: var(--bg-sink); }
  .cal-month-cell.empty { background: var(--bg-sink); cursor: default; }
  .cal-month-cell.today .cal-month-num { background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
  .cal-month-num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); margin-bottom: 4px; line-height: 1; }
  .cal-month-event { font-size: 10px; background: var(--accent-wash); color: var(--accent-ink); border-radius: 3px; padding: 1px 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-month-more { font-size: 10px; color: var(--ink-3); font-family: var(--font-mono); }

  /* Transitions between pages */
  .page { animation: slideIn .35s cubic-bezier(.2,.7,.3,1); }
  @keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

  /* Misc utilities */
  .row { display: flex; align-items: center; gap: 8px; }
  .spread { display: flex; justify-content: space-between; align-items: center; }
  .sm-ghost { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; }
  .sm-ghost:hover { color: var(--accent-ink); }

  .divider-h { height: 1px; background: var(--rule); margin: 12px 0; }

  /* Responsive squeeze */
  @media (max-width: 1100px) {
    .grid-a { grid-template-columns: 1fr 1fr; }
    .grid-a .w-revenue { grid-column: span 2; grid-row: span 1; }
    .grid-a .w-tasks, .grid-a .w-meetings, .grid-a .w-issues { grid-row: span 1; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
  }
