/* Timeployee — one small design system. Light + dark, phone to desktop. */
:root {
  --bg: #f6f7fb; --panel: #ffffff; --panel-2: #f1f3f9; --line: #e4e7f0; --text: #0f172a; --muted: #64748b;
  --primary: #4f46e5; --primary-2: #6366f1; --primary-soft: #eef2ff; --accent: #14b8a6; --accent-soft: #e6fffa;
  --good: #16a34a; --good-soft: #dcfce7; --mid: #d97706; --mid-soft: #fef3c7; --low: #dc2626; --low-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 24px rgba(15, 23, 42, .06); --radius: 14px;
  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --panel: #121933; --panel-2: #182143; --line: #243058; --text: #e5e9f5; --muted: #93a0c3;
    --primary: #818cf8; --primary-2: #a5b4fc; --primary-soft: #1e2654; --accent: #2dd4bf; --accent-soft: #0f3b39;
    --good: #4ade80; --good-soft: #12351f; --mid: #fbbf24; --mid-soft: #3a2c0a; --low: #f87171; --low-soft: #3d1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.icon { width: 18px; height: 18px; stroke-width: 2; vertical-align: -4px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -3px; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 8px 16px;
  color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted);
  font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--primary-soft); color: var(--primary); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }
.nav .count { margin-left: auto; background: var(--low); color: #fff; font-size: 11px; border-radius: 999px;
  padding: 0 7px; }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.main { padding: 24px 28px 60px; min-width: 0; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px; }
.topline p { margin: 4px 0 0; color: var(--muted); }
.embed .main { padding: 14px 16px 40px; }
.embed-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.embed-tabs a { padding: 7px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.embed-tabs a.on { background: var(--primary-soft); color: var(--primary); }
.embed-tabs a:hover { text-decoration: none; background: var(--panel-2); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.up { color: var(--good); } .down { color: var(--low); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); padding: 8px 14px; border-radius: 10px; font: 600 13px var(--font); cursor: pointer;
  text-decoration: none; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-danger { color: var(--low); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 18px; font-size: 15px; border-radius: 12px; }
input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; width: 100%; }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 2px; height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check label { margin: 0; }
.check .help { color: var(--muted); font-size: 12px; font-weight: 400; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > * { flex: 1 1 140px; }
.inline-form .btn { flex: 0 0 auto; }
.errorlist { color: var(--low); margin: 4px 0 0; padding-left: 18px; font-size: 12px; }

/* pills, badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.working, .pill.good, .pill.approved, .pill.present, .pill.paid { background: var(--good-soft); color: var(--good); }
.pill.break, .pill.mid, .pill.pending, .pill.late, .pill.sent { background: var(--mid-soft); color: var(--mid); }
.pill.low, .pill.rejected, .pill.absent { background: var(--low-soft); color: var(--low); }
.pill.info, .pill.leave { background: var(--primary-soft); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.working { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.break { background: var(--mid); box-shadow: 0 0 0 3px var(--mid-soft); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }

/* people */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; position: relative; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; border: 2px solid var(--panel); width: 11px; height: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.person .who { min-width: 0; }
.person .name { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.person .meta { color: var(--muted); font-size: 12px; }
.thumb { width: 84px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block;
  background: var(--panel-2); }

/* meters & charts */
.meter { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.meter.good > span { background: var(--good); } .meter.mid > span { background: var(--mid); }
.meter.low > span { background: var(--low); }
.pct { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pct b { width: 36px; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; gap: 6px; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; min-height: 3px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary)); position: relative; }
.bars .bar i.mid { background: linear-gradient(180deg, #fbbf24, #d97706); }
.bars .bar i.low { background: linear-gradient(180deg, #f87171, #dc2626); }
.bars .bar i.good { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.bars .bar small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.bars .bar em { font-style: normal; font-size: 11px; color: var(--muted); }
.list-bars .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 7px 0; }
.list-bars .item .meter { grid-column: 1 / -1; height: 6px; }
.list-bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-productive .meter > span { background: var(--good); }
.label-unproductive .meter > span { background: var(--low); }
.label-neutral .meter > span { background: #94a3b8; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: grid; grid-template-columns: 52px repeat(6, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.tl-row .h { color: var(--muted); font-size: 12px; padding-top: 6px; }
.tl-cell { background: var(--panel-2); border-radius: 10px; min-height: 64px; padding: 4px; display: flex;
  flex-direction: column; gap: 4px; position: relative; overflow: hidden; border: 1px solid transparent; }
.tl-cell .act { height: 5px; border-radius: 999px; background: var(--line); }
.tl-cell.good .act { background: var(--good); } .tl-cell.mid .act { background: var(--mid); }
.tl-cell.low .act { background: var(--low); }
.tl-cell.idle { background: repeating-linear-gradient(45deg, var(--panel-2), var(--panel-2) 6px, var(--line) 6px,
  var(--line) 8px); }
.tl-cell img { width: 100%; height: 48px; object-fit: cover; border-radius: 7px; cursor: zoom-in; }
.tl-cell .t { font-size: 10px; color: var(--muted); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.shot { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; cursor: zoom-in; background: var(--panel-2); }
.shot .cap { padding: 9px 11px; font-size: 12px; }
.shot .cap .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, .86); display: none; align-items: center;
  justify-content: center; z-index: 50; padding: 24px; flex-direction: column; gap: 10px; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox .cap { color: #e2e8f0; font-size: 13px; text-align: center; }
.events { list-style: none; padding: 0; margin: 0; }
.events li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.events li:last-child { border-bottom: 0; }
.events .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* attendance grid */
.att { border-collapse: separate; border-spacing: 3px; }
.att td, .att th { border: 0; padding: 0; text-align: center; }
.att th { font-size: 10px; padding: 2px; }
.att .c { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 10px;
  font-weight: 700; background: var(--panel-2); color: var(--muted); }
.att .present { background: var(--good-soft); color: var(--good); }
.att .late { background: var(--mid-soft); color: var(--mid); }
.att .absent { background: var(--low-soft); color: var(--low); }
.att .leave, .att .holiday { background: var(--primary-soft); color: var(--primary); }
.att .off, .att .future { background: transparent; color: var(--line); }
.att td.who { text-align: left; padding-right: 10px; white-space: nowrap; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; }
.datebar { display: flex; align-items: center; gap: 6px; }
.datebar input { width: auto; }

/* messages */
.msgs { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.msg.success { background: var(--good-soft); color: var(--good); }
.msg.error { background: var(--low-soft); color: var(--low); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }
.notice { border-left: 4px solid var(--primary); background: var(--primary-soft); padding: 12px 14px; border-radius: 10px; }
.code { font-family: ui-monospace, Consolas, monospace; background: var(--panel-2); padding: 2px 6px; border-radius: 6px;
  word-break: break-all; }
.bigcode { font: 700 34px ui-monospace, Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 16px;
  background: var(--panel-2); border-radius: 12px; }

/* auth / landing */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent), radial-gradient(900px 500px at 110% 110%, var(--accent-soft), transparent), var(--bg); }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth .brand { justify-content: center; font-size: 22px; padding-bottom: 6px; }
.sso { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.sso .btn { justify-content: center; padding: 11px; font-size: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hero { max-width: 1080px; margin: 0 auto; padding: 56px 20px; }
.hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.03em; max-width: 760px; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 640px; margin: 16px 0 26px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.features .card h3 { display: flex; gap: 8px; align-items: center; }

@media print {
  .side, .embed-tabs, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 8px 10px;
    border-right: 0; border-bottom: 1px solid var(--line); align-items: center; }
  .side .brand { padding: 0 8px 0 0; }
  .side .brand span { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .nav .sep, .side-foot { display: none; }
  .main { padding: 16px 16px 50px; }
  .g2, .g3, .features { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 36px repeat(6, minmax(0, 1fr)); gap: 3px; }
  .tl-cell img { height: 30px; }
  .hero h1 { font-size: 32px; }
  .hide-sm { display: none; }
}
