/* VIBRIYOGN Clockin — same brand tokens as Ops: ink + paper + signal yellow, VIBGYOR stripe. */
:root {
  --ink: #0a0a0a; --ink-2: #1c1c1c; --ink-3: #2c2c2c;
  --paper: #ffffff; --ground: #eceef0; --line: #d9dce0; --line-2: #e7e9ec;
  --text: #16181b; --muted: #5b6168; --faint: #8a9097;
  --accent: #ffd400; --accent-ink: #0a0a0a;
  --good: #1fa85a; --warn: #ff8a00; --bad: #e63b2e; --info: #1e7fd8;
  --s1: #7b3fbf; --s2: #3b3fb5; --s3: #1e7fd8; --s4: #1fa85a; --s5: #e8b900; --s6: #ff8a00; --s7: #e63b2e;
  --spectrum: linear-gradient(90deg, var(--s1), var(--s2), var(--s3), var(--s4), var(--s5), var(--s6), var(--s7));
  /* Project colors: validated categorical order (8 slots), --c0 = no project / other */
  --c0: #a3a8ae; --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --head: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px; --r-sm: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ground); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, .kpi b, .dur, .clock { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.signin-card { width: min(420px, 100%); background: var(--paper); border-radius: 18px; overflow: hidden; }
.signin-card .stripe { height: 6px; background: var(--spectrum); }
.signin-card .inner { padding: 28px; }
.brandline { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.brandline img { width: 34px; height: 34px; }
.brandline span { font-family: var(--head); font-weight: 800; font-size: 18px; }
.signin-card p { color: var(--muted); margin: 6px 0 18px; }
.code-input { font-size: 26px; letter-spacing: .3em; text-indent: .3em; text-align: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #eee; }
.top .stripe { height: 4px; background: var(--spectrum); }
.top .bar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; max-width: 1280px; margin: 0 auto; }
.top .brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #fff; flex: none; }
.top .brand img { width: 26px; height: 26px; }
.top .brand b { font-family: var(--head); font-size: 16px; font-weight: 800; }
.top select.biz { background: var(--ink-3); border: 1px solid #3b3b3b; color: #fff; border-radius: var(--r-sm); padding: 6px 8px; max-width: 200px; }
.top nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: var(--r-sm); text-decoration: none; color: #c9c9c9; font-weight: 600; font-size: 14px; white-space: nowrap; }
.top nav a:hover { color: #fff; background: var(--ink-2); }
.top nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.top nav svg { width: 16px; height: 16px; }
.top .pill { display: inline-flex; align-items: center; gap: 8px; background: var(--ink-3); border: 1px solid #3b3b3b; color: #fff; border-radius: 99px; padding: 5px 6px 5px 12px; font-size: 13px; text-decoration: none; flex: none; }
.top .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s infinite; }
.top .pill button { background: var(--bad); border: 0; color: #fff; border-radius: 99px; padding: 3px 10px; font-weight: 700; cursor: pointer; font-size: 12px; }
@keyframes pulse { 50% { opacity: .35; } }
.top .who { flex: none; }
.top .who button { background: none; border: 1px solid #3b3b3b; color: #ddd; border-radius: 99px; padding: 5px 11px; cursor: pointer; font-size: 13px; }
main { max-width: 1280px; margin: 0 auto; padding: 22px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--paper); padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9bec4; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.signal { background: var(--accent); border-color: #e6bf00; color: var(--accent-ink); }
.btn.stop { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.icon { padding: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--ground); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], input:not([type]), select, textarea {
  border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea, label.f > .row { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: none; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.bill { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 800; color: var(--faint); flex: none; }
.bill[aria-pressed="true"] { color: var(--good); border-color: var(--good); background: #e3f6ea; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.dotc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c0); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--ground); color: var(--ink-3); white-space: nowrap; }
.tag.good { background: #e3f6ea; color: #136c3a; } .tag.warn { background: #fff1de; color: #9a5300; } .tag.bad { background: #ffe9e6; color: #b3261b; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-family: var(--head); font-size: 17px; margin-bottom: 4px; }

/* Tracker */
.timerbar { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 230px) minmax(120px, 190px) auto auto auto; gap: 8px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.timerbar .desc { font-size: 16px; border-color: transparent; background: var(--ground); }
.timerbar .clock { font-family: var(--head); font-size: 22px; font-weight: 800; min-width: 104px; text-align: right; }
.timerbar.manual { grid-template-columns: minmax(180px, 1fr) minmax(150px, 230px) minmax(120px, 190px) auto; }
.timerbar .manualrow { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timerbar .manualrow input[type=date] { width: 150px; } .timerbar .manualrow input[type=time] { width: 112px; } .timerbar .manualrow input.durin { width: 90px; }
.weekline { display: flex; gap: 18px; align-items: baseline; margin: 18px 2px 8px; flex-wrap: wrap; }
.weekline b { font-family: var(--head); font-size: 18px; }
.day { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; overflow: hidden; }
.day-head { display: flex; justify-content: space-between; padding: 9px 16px; background: #f6f7f8; border-bottom: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--muted); }
.day-head .dur { color: var(--text); }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 9px 12px 9px 16px; border-top: 1px solid var(--line-2); }
.entry:first-of-type { border-top: 0; }
.entry .what { min-width: 0; cursor: pointer; }
.entry .what .d { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .what .d.none { color: var(--faint); font-weight: 500; }
.entry .proj { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.entry .span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.entry .dur { font-weight: 700; min-width: 58px; text-align: right; }
.entry .acts { display: flex; gap: 2px; }
.entry.running { background: #fffbe0; }
.entry .who { font-size: 12px; color: var(--faint); }
.bill-mark { color: var(--good); font-weight: 800; font-size: 13px; }

/* Timesheet */
.ts { width: 100%; border-collapse: collapse; }
.ts th, .ts td { border-bottom: 1px solid var(--line-2); padding: 6px; text-align: center; }
.ts th { font-size: 12px; color: var(--muted); font-weight: 700; }
.ts th.today { color: var(--ink); background: #fff7c2; border-radius: 6px 6px 0 0; }
.ts td.lbl { text-align: left; min-width: 200px; }
.ts td.lbl .proj { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.ts td.lbl small { color: var(--muted); display: block; padding-left: 16px; }
.ts input { width: 70px; text-align: center; padding: 6px 4px; }
.ts input.has { font-weight: 700; background: #f6f7f8; }
.ts td.tot, .ts tfoot td { font-weight: 800; font-variant-numeric: tabular-nums; }
.ts tfoot td { border-bottom: 0; }

/* Calendar */
.cal { display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .ch { position: sticky; top: 0; background: #f6f7f8; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cal .ch b { display: block; color: var(--text); font-size: 15px; }
.cal .ch.today { background: #fff7c2; }
.cal .scroll { grid-column: 1 / -1; display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(0, 1fr)); max-height: 68vh; overflow-y: auto; }
.cal .hours div { height: 48px; font-size: 11px; color: var(--faint); text-align: right; padding: 0 6px; transform: translateY(-7px); }
.cal .col { position: relative; border-left: 1px solid var(--line-2); background: repeating-linear-gradient(to bottom, transparent 0 47px, var(--line-2) 47px 48px); cursor: copy; }
.cal .blk { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.25; color: #fff; overflow: hidden; cursor: pointer; border: 2px solid var(--paper); }
.cal .blk b { display: block; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal .blk.run { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); }
.cal .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }

/* Reports */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 16px; }
.filters label.f { min-width: 112px; flex: 1 1 112px; max-width: 210px; }
.filters .dates { display: flex; gap: 6px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.kpi { padding: 14px 18px; border-left: 1px solid var(--line-2); }
.kpi:first-child { border-left: 0; }
.kpi span { display: block; color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-family: var(--head); font-size: 26px; font-weight: 800; }
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.charts .panel + .panel { margin-top: 0; }
.charts.two { grid-template-columns: 1fr 1fr; } .charts.one { grid-template-columns: 1fr; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { font-size: 11px; fill: var(--muted); }
.chart .grid line { stroke: var(--line-2); }
.chart .base { stroke: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.hbars { display: grid; gap: 10px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hbar .lbl span:first-child { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.hbar .lbl span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .track { height: 10px; background: var(--ground); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.4; max-width: 260px; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.tip b { font-weight: 700; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 8px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line-2); padding: 8px; vertical-align: top; }
.tbl th.n, .tbl td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.sub td { color: var(--muted); font-size: 13px; }
.tbl tr.sub td:first-child { padding-left: 30px; }
.tbl tr.total td { font-weight: 800; border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f8f9fa; }
.table-wrap { overflow-x: auto; }
.pbar { height: 6px; background: var(--ground); border-radius: 4px; overflow: hidden; margin-top: 4px; width: 140px; }
.pbar i { display: block; height: 100%; background: var(--good); }
.pbar i.over { background: var(--bad); }

/* Projects */
.proj-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.proj-row:first-child { border-top: 0; }
.proj-row .nm { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.proj-row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-row.subp { padding-left: 22px; } .proj-row.subp .nm { font-weight: 600; }
.proj-row.archived { opacity: .55; }
.tasks { padding: 2px 0 8px 40px; display: flex; flex-wrap: wrap; gap: 6px; }
.tasks .tag { cursor: pointer; } .tasks .tag.done { text-decoration: line-through; opacity: .6; }
.client-h { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }

/* Dialog + toast */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100% - 24px)); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,10,10,.5); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
dialog .db { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
dialog .df { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
dialog .df .left { margin-right: auto; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100% - 32px); text-align: center; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px; z-index: 70; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }
.loading { color: var(--muted); padding: 30px 0; }

@media (max-width: 900px) {
  .timerbar, .timerbar.manual { grid-template-columns: 1fr 1fr; }
  .timerbar .desc { grid-column: 1 / -1; }
  .timerbar .clock { text-align: left; }
  .charts, .charts.two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 640px) {
  .top .bar { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .top nav { order: 3; flex-basis: 100%; }
  .top select.biz { max-width: 140px; }
  main { padding: 16px 16px 80px; }
  .entry { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 2px; }
  .entry .what { grid-column: 1 / -1; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .proj-row { grid-template-columns: minmax(0, 1fr) auto; }
  .proj-row .hide-sm { display: none; }
  .filters label.f { max-width: none; }
}
@media print {
  .top, .filters, .no-print { display: none !important; }
  body { background: #fff; } main { padding: 0; }
  .panel, .kpis { border-color: #ccc; }
}
