/* TimeTrace shared UI — Solubard dark theme
   Brand: teal #00b8ac / #009e94, blue #3a7ab5 / #245989, graphite #0a0f1a / #111827 */
:root {
  --tt-bg: #0a0f1a;
  --tt-card: #111827;
  --tt-card2: #0d1420;
  --tt-border: #1f2937;
  --tt-border2: #374151;
  --tt-ink: #e5e7eb;
  --tt-ink2: #9ca3af;
  --tt-ink3: #6b7280;
  --tt-accent: #00b8ac;
  --tt-accent-dark: #009e94;
  --tt-accent-ink: #04211f;
  --tt-blue: #3a7ab5;
  --tt-navy: #245989;
  --tt-active: #10b981;   /* computer usage: active */
  --tt-away: #a92222;     /* computer usage: away (darker for CVD lightness contrast) */
  --tt-danger: #ef4444;
  --tt-now: #ef4444;
  --tt-track: #151d2b;
}
.tt-body { margin: 0; font: 13px/1.45 "Segoe UI", system-ui, sans-serif; background: var(--tt-bg); color: var(--tt-ink); }
.tt-card { background: var(--tt-card); border: 1px solid var(--tt-border); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.tt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tt-muted { color: var(--tt-ink2); } .tt-small { font-size: 11.5px; color: var(--tt-ink3); }
.tt-spacer { flex: 1; }

.tt-btn { font: inherit; border: 1px solid var(--tt-border2); background: #1c2536; color: var(--tt-ink); border-radius: 5px; padding: 5px 11px; cursor: pointer; }
.tt-btn:hover { border-color: var(--tt-accent); }
.tt-btn.primary { background: var(--tt-accent); border-color: var(--tt-accent); color: var(--tt-accent-ink); font-weight: 600; }
.tt-btn.primary:hover { background: var(--tt-accent-dark); }
.tt-btn.danger { color: #f87171; }
.tt-btn:disabled { opacity: .45; cursor: default; }

.tt-input, .tt-select { font: inherit; border: 1px solid var(--tt-border2); border-radius: 5px; padding: 5px 8px; background: #0d1524; color: var(--tt-ink); }
.tt-input::placeholder { color: var(--tt-ink3); }
.tt-input:focus, .tt-select:focus { outline: 2px solid var(--tt-accent); outline-offset: -1px; }
input[type="date"].tt-input::-webkit-calendar-picker-indicator { filter: invert(0.7); }
input[type="checkbox"] { accent-color: var(--tt-accent); }

.tt-table { border-collapse: collapse; width: 100%; }
.tt-table th { text-align: left; font-weight: 600; color: var(--tt-ink2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--tt-border2); position: sticky; top: 0; background: var(--tt-card); }
.tt-table td { padding: 5px 8px; border-bottom: 1px solid var(--tt-border); }
.tt-table tr:last-child td { border-bottom: none; }
.tt-table tr:hover td { background: rgba(0, 184, 172, 0.05); }

/* header / chrome */
.tt-header { display: flex; align-items: center; gap: 14px; background: var(--tt-card); border-bottom: 1px solid var(--tt-border); padding: 8px 16px; position: sticky; top: 0; z-index: 5; }
.tt-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.tt-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tt-accent); }
.tt-nav { display: flex; gap: 2px; margin-left: 8px; }
.tt-nav a, .tt-nav button { border: none; background: none; color: var(--tt-ink2); padding: 6px 11px; border-radius: 5px; cursor: pointer; font: inherit; text-decoration: none; border-bottom: 2px solid transparent; border-radius: 5px 5px 0 0; }
.tt-nav a.active, .tt-nav button.active { color: var(--tt-accent); border-bottom-color: var(--tt-accent); font-weight: 600; }
.tt-main { max-width: 1500px; margin: 12px auto; padding: 0 14px; }

/* toolbar badges (tagged / untagged counters) */
.tt-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.tt-badge.ok { background: rgba(16, 185, 129, .15); color: #34d399; border-color: rgba(16, 185, 129, .4); }
.tt-badge.bad { background: rgba(239, 68, 68, .12); color: #f87171; border-color: rgba(239, 68, 68, .4); }

/* day stats (right of toolbar) */
.tt-daystats { display: flex; gap: 16px; font-size: 12.5px; color: var(--tt-ink2); }
.tt-daystats b { color: var(--tt-ink); font-size: 13.5px; }

/* timeline lanes */
.tt-daytl { user-select: none; }
.tt-lane-grid { display: grid; grid-template-columns: 110px 1fr; }
.tt-lane-label { display: flex; align-items: center; font-size: 12px; color: var(--tt-ink2); padding: 0 8px; border-right: 1px solid var(--tt-border); }
.tt-lanes-svg { width: 100%; display: block; background: var(--tt-card2); }
.tt-minimap { width: 100%; display: block; margin-top: 4px; background: var(--tt-card2); border-radius: 3px; cursor: pointer; }

/* app summary panel */
.tt-appsum { display: flex; flex-direction: column; height: 100%; }
.tt-appsum-rows { flex: 1; overflow-y: auto; }
.tt-appsum-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; }
.tt-appsum-row:hover { background: rgba(0, 184, 172, 0.06); }
.tt-appsum-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-appsum-bar-wrap { width: 90px; height: 12px; background: #0d1524; border: 1px solid var(--tt-border); border-radius: 3px; position: relative; flex-shrink: 0; }
.tt-appsum-bar { display: block; height: 100%; border-radius: 2px; }
.tt-appsum-pct { position: absolute; left: 4px; top: -1px; font-size: 9.5px; color: #fff; text-shadow: 0 0 3px #000; }
.tt-appsum-dur { width: 62px; text-align: right; color: var(--tt-ink2); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.tt-appsum-total { border-top: 1px solid var(--tt-border2); margin-top: 6px; padding: 6px; text-align: right; font-weight: 600; }

/* app "icon" substitute: colored rounded square with initial */
.tt-appicon { display: inline-flex; width: 16px; height: 16px; border-radius: 3px; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.6); flex-shrink: 0; }

/* day view split */
.tt-day-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 10px; align-items: start; }
.tt-day-tablewrap { max-height: 430px; overflow: auto; }

/* bottom filter bar */
.tt-filterbar { display: flex; align-items: center; gap: 8px; background: var(--tt-card); border: 1px solid var(--tt-border); border-radius: 8px; padding: 8px 12px; position: sticky; bottom: 8px; }
.tt-filterbar input { flex: 1; }

/* right-click context menu on the timeline */
.tt-ctxmenu { position: absolute; z-index: 30; background: var(--tt-card); border: 1px solid var(--tt-border2); border-radius: 8px; padding: 6px; min-width: 220px; max-width: 420px; max-height: 340px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.tt-ctxmenu-head { font-size: 11px; color: var(--tt-ink3); padding: 4px 8px; border-bottom: 1px solid var(--tt-border); margin-bottom: 4px; }
.tt-ctxmenu-item { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: none; color: var(--tt-ink); padding: 6px 8px; border-radius: 5px; cursor: pointer; font: inherit; }
.tt-ctxmenu-item:hover { background: rgba(0, 184, 172, .12); }
.tt-ctxmenu-new { display: flex; gap: 6px; padding: 6px 8px; align-items: center; }

.tt-keybox { background: rgba(0, 184, 172, .08); border: 1px solid var(--tt-accent); border-radius: 8px; padding: 12px; margin-top: 12px; overflow-wrap: anywhere; }
.tt-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.tt-bar { height: 10px; border-radius: 2px; background: var(--tt-accent); display: inline-block; min-width: 2px; vertical-align: middle; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--tt-border2); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }
