:root {
  --bg: #f4f2ed;
  --surface: #fffefb;
  --surface-strong: #ffffff;
  --ink: #171714;
  --muted: #77746c;
  --line: #dedbd2;
  --line-soft: #e9e6df;
  --accent: #ff5a36;
  --accent-soft: #ffe2d9;
  --active: #171714;
  --radius: 22px;
  --shadow: 0 16px 50px rgba(23, 23, 20, 0.06);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input { font: inherit; }
button { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 36px;
}

.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(23px, 2.6vw, 31px);
  letter-spacing: -0.055em;
  font-weight: 560;
  display: inline-flex;
  align-items: baseline;
}
.brand strong { font-weight: 880; letter-spacing: -0.08em; }
.brand-dot { width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--accent); align-self: center; }

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.45);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: .18s ease;
}
.icon-button:hover { background: var(--surface); transform: translateY(-1px); }
.icon-button:active { transform: translateY(0) scale(.97); }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-button.small { width: 38px; height: 38px; }

main { padding-top: 34px; }
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 28px;
  align-items: end;
  padding: 14px 0 38px;
}
.eyebrow { margin: 0 0 7px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 760; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(39px, 6vw, 68px); line-height: .98; letter-spacing: -.055em; font-weight: 700; }
h2 { margin-bottom: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; line-height: 1; }
h3 { letter-spacing: -.03em; }
.workday-time { font-variant-numeric: tabular-nums; font-size: clamp(18px, 2vw, 24px); font-weight: 650; letter-spacing: -.035em; padding-bottom: 7px; }
.workday-time span { color: var(--muted); padding: 0 8px; }
.progress-track { grid-column: 1 / -1; height: 5px; background: #dedbd3; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-value { height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .5s ease; }
.progress-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.people-section, .summary-section { padding: 34px 0 42px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; gap: 20px; }
.live-indicator { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .09em; display: flex; align-items: center; gap: 7px; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #79ad65; box-shadow: 0 0 0 4px rgba(121,173,101,.12); }

.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  min-height: 206px;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.person-card:hover { transform: translateY(-2px); }
.person-card.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.person-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 14px; background: #ece9e1; display: grid; place-items: center; font-weight: 760; letter-spacing: -.03em; }
.is-active .avatar { background: rgba(255,255,255,.13); }
.person-menu { border: 0; background: transparent; color: var(--muted); padding: 4px; cursor: pointer; border-radius: 8px; font-size: 21px; line-height: 1; }
.is-active .person-menu { color: rgba(255,255,255,.45); }
.person-name { font-size: 22px; margin: 18px 0 3px; letter-spacing: -.04em; font-weight: 680; overflow-wrap: anywhere; }
.person-meta { font-size: 13px; color: var(--muted); margin: 0; }
.is-active .person-meta { color: rgba(255,255,255,.58); }
.person-bottom { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 18px; }
.active-clock { font-size: 28px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-weight: 650; line-height: 1; }
.active-label { color: rgba(255,255,255,.55); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.action-button { border: 0; min-height: 42px; border-radius: 13px; padding: 0 15px; font-weight: 700; cursor: pointer; transition: transform .15s ease, opacity .15s ease; white-space: nowrap; }
.action-button:active { transform: scale(.97); }
.action-button.start { background: var(--ink); color: #fff; }
.action-button.stop { background: var(--accent); color: #fff; }
.action-button:disabled { opacity: .55; cursor: wait; }

.empty-state { border: 1px dashed #cbc7bd; border-radius: var(--radius); text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 7px; font-size: 23px; }
.empty-state p { margin: 0 auto 22px; max-width: 420px; line-height: 1.5; }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); margin: 0 auto 18px; font-size: 25px; }
.secondary-button, .primary-button { border: 0; border-radius: 14px; min-height: 46px; padding: 0 18px; font-weight: 750; cursor: pointer; }
.secondary-button { background: var(--surface-strong); border: 1px solid var(--line); }
.primary-button { background: var(--ink); color: #fff; width: 100%; }

.summary-total { font-size: 26px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.summary-card { overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,.42); border-radius: var(--radius); }
.summary-table-header, .summary-row { display: grid; grid-template-columns: minmax(0, 1.8fr) .55fr .75fr .65fr; gap: 14px; align-items: center; }
.summary-table-header { color: var(--muted); font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .1em; padding: 14px 18px 10px; }
.summary-row { min-height: 57px; padding: 0 18px; border-top: 1px solid var(--line-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.summary-row:first-child { border-top: 0; }
.summary-name { font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-row span:not(:first-child), .summary-table-header span:not(:first-child) { text-align: right; }
.summary-empty { color: var(--muted); text-align: center; padding: 28px 18px; font-size: 14px; }

footer { border-top: 1px solid var(--line); padding: 22px 0 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; }
.dialog::backdrop { background: rgba(23,23,20,.28); backdrop-filter: blur(6px); }
.dialog-card { width: min(430px, calc(100vw - 28px)); border-radius: 25px; background: var(--surface-strong); padding: 22px; box-shadow: 0 30px 100px rgba(0,0,0,.18); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.dialog-head h2 { font-size: 28px; }
.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.dialog input { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; outline: none; background: #faf9f6; font-size: 17px; }
.dialog input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,23,20,.06); }
.form-error { min-height: 18px; margin: 8px 0 12px; color: #b63722; font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: 99px; padding: 11px 16px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 10; box-shadow: 0 12px 40px rgba(0,0,0,.16); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 1180px); padding-bottom: 26px; }
  .topbar { height: 72px; }
  main { padding-top: 24px; }
  .hero { grid-template-columns: 1fr; gap: 9px; padding-bottom: 31px; }
  .workday-time { padding: 6px 0 0; }
  .people-section, .summary-section { padding: 28px 0 34px; }
  .people-grid { grid-template-columns: 1fr; gap: 10px; }
  .person-card { min-height: 176px; padding: 18px; }
  .person-name { margin-top: 14px; }
  .summary-card { border-radius: 18px; }
  .summary-table-header, .summary-row { grid-template-columns: minmax(0, 1.55fr) .45fr .67fr .63fr; gap: 8px; padding-left: 14px; padding-right: 14px; }
  .summary-table-header { font-size: 9px; }
  .summary-row { font-size: 13px; }
  footer { padding-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
