:root {
  --accent: #6366f1;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 80%, #000);
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #f1f3f8;
  --line: #e6e8ef;
  --text: #121826;
  --muted: #667085;
  --faint: #98a2b3;
  --danger: #e5484d;
  --danger-soft: color-mix(in srgb, var(--danger) 10%, transparent);
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .25);
  --radius: 14px;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent-text: color-mix(in srgb, var(--accent) 70%, #fff);
    --bg: #0c1017;
    --panel: #141a23;
    --panel-2: #1b2230;
    --line: rgba(255, 255, 255, .07);
    --text: #e8ecf3;
    --muted: #98a2b3;
    --faint: #667085;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.lg { gap: 20px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; padding: 18px 12px;
  background: var(--panel); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none;
}
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; cursor: pointer;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item .badge { margin-left: auto; }
.sidebar .spacer { flex: 1; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; }
.me-chip:hover { background: var(--panel-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; position: sticky; top: 0; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); align-items: center; gap: 10px;
}
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 32px 64px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow p { margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); }

.bottomnav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
  font-size: 11px; font-weight: 500; color: var(--faint); border-radius: 10px;
}
.bottomnav a.active { color: var(--accent); }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .bottomnav { display: flex; }
  .page { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  .page-head { align-items: center; }
  .page-head > .grow { flex-basis: 100%; }
}

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-head h2 { flex: 1; }
.card-body { padding: 14px 18px 18px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 860px) { .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); } }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
a.list-item:hover, .list-item.clickable:hover { background: var(--panel-2); cursor: pointer; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ic { margin: 0 auto 10px; color: var(--faint); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }
.btn.lg { padding: 12px 18px; font-size: 15px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); outline: none; transition: border-color .12s, box-shadow .12s; font-size: 15px;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { background: var(--panel-2); color: var(--muted); }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 38px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 0; }
.form-error:empty { display: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap;
}
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.pill.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.role-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- avatars ---------- */
.avatar {
  --size: 38px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: calc(var(--size) * .38);
  position: relative; user-select: none;
}
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 10px; min-height: 10px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--panel);
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--panel); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- home ---------- */
.home-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.hello { margin-bottom: 22px; }
.hello h1 { font-size: 26px; }
.stat { padding: 16px 18px; }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.progress { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; }
.nudge { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.nudge-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.lead-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.attention-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.checklist .list-item .num-circle {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted); flex: none;
}
.checklist .list-item.done .num-circle { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .list-item.done .grow { color: var(--muted); text-decoration: line-through; }

/* ---------- people ---------- */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters .search { flex: 1; min-width: 220px; }
.filters select.input { width: auto; min-width: 150px; }
.person-head { display: flex; gap: 20px; align-items: center; padding: 24px; }
.person-head .avatar { --size: 84px; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) {
  .person-head { flex-direction: column; text-align: center; }
  .person-head .row { justify-content: center; }
  .person-actions { justify-content: center; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
}

/* ---------- contacts ---------- */
.contact-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.contact-card.emergency { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 4%, var(--panel)); }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 26px 0 10px; }
.section-title:first-child { margin-top: 0; }

/* ---------- roles ---------- */
.roles-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .roles-layout { grid-template-columns: minmax(0, 1fr); } }
.role-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; cursor: pointer; }
.role-item:hover { background: var(--panel-2); }
.role-item.active { background: var(--accent-soft); }
.perm-group { border-top: 1px solid var(--line); padding: 14px 18px; }
.perm-group h3 { margin-bottom: 6px; }
.perm-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.perm-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.perm-row .lbl { font-weight: 600; font-size: 14.5px; }
.perm-row .desc { color: var(--muted); font-size: 13px; }
.perm-row.locked { opacity: .65; cursor: default; }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card .brand { padding: 0 0 24px; justify-content: center; font-size: 18px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.invite-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: -8px 0 20px; }

/* ---------- modal & toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 22, .5);
  display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out;
}
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: pop .15s ease-out;
}
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
@media (max-width: 600px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.link-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.picker-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.picker-list .list-item { padding: 9px 12px; }
.audience-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.audience-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 8px; }
@media (max-width: 600px) { .audience-cols { grid-template-columns: minmax(0, 1fr); } }

#toast-root { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 860px) { #toast-root { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; }
.toast.error { background: var(--danger); color: #fff; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.boot { min-height: 100vh; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: var(--text); }
input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }

/* ---------- header, search, bell, preview ---------- */
.deskbar { display: flex; align-items: center; gap: 12px; padding: 14px 32px 0; max-width: 1144px; width: 100%; margin: 0 auto; }
@media (max-width: 860px) { .deskbar { display: none; } }
.searchbox {
  display: flex; align-items: center; gap: 10px; width: min(420px, 100%); padding: 9px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel); color: var(--faint); cursor: text; font-size: 14px; text-align: left;
}
.searchbox span { flex: 1; }
.searchbox:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
kbd { font: 600 11px/1 Inter, sans-serif; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.bell { position: relative; }
.bell .badge { position: absolute; top: 0; right: -2px; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
.preview-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--warn); color: #fff; font-size: 14px;
  position: sticky; top: 0; z-index: 25;
}
.preview-banner .btn { background: #fff; color: #111; border-color: #fff; }
.search.big .input { padding: 14px 14px 14px 44px; font-size: 17px; border-radius: 14px; }
.search.big .ic { left: 15px; }

/* ---------- avatars with photos ---------- */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-edit { position: relative; cursor: pointer; display: inline-block; }
.avatar-edit-badge {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* ---------- 2FA, tour, notifications ---------- */
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 190px; margin: 10px 0; }
.qr svg, .qr img { width: 100%; height: auto; display: block; }
.qr.big { width: min(280px, 100%); margin: 0 auto; }
code.key { font-size: 13px; background: var(--panel-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recovery code { background: var(--panel-2); padding: 8px; border-radius: 8px; text-align: center; font-size: 14px; letter-spacing: .05em; }
.modal.tour .modal-head { padding-bottom: 0; }
.tour-slide { text-align: center; padding: 8px 6px 4px; }
.tour-icon { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tour-slide h2 { font-size: 20px; margin-bottom: 8px; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--accent); width: 18px; border-radius: 99px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: flex-start; margin-top: 7px; background: transparent; }
.notif.unread .notif-dot { background: var(--accent); }
.notif.unread { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.privacy ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.privacy h2 { margin-top: 6px; }

/* ---------- time clock ---------- */
.time-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .time-grid { grid-template-columns: minmax(0, 1fr); } }
.clock-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; position: relative; }
.clock-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line); }
.clock-card.status-working::before { background: var(--ok); }
.clock-card.status-break::before { background: var(--warn); }
.clock-top { display: flex; align-items: center; gap: 10px; }
.clock-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.clock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.status-working .clock-dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); animation: pulse 2s infinite; }
.status-break .clock-dot { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 5%, transparent); } }
.clock-mid { text-align: center; padding: 4px 0; }
.clock-timer { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock-actions { display: flex; gap: 10px; }
.clock-btn { flex: 1; padding: 15px 18px; font-size: 16px; border-radius: 14px; }
.clock-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.money-input span { padding: 0 4px 0 12px; color: var(--muted); font-weight: 600; }
.money-input .input { border: 0; box-shadow: none; font-size: 20px; }
.status-pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; background: var(--panel-2); color: var(--muted); }
.status-pill.s-working { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status-pill.s-break { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.table.schedule th, .table.schedule td { padding: 8px; text-align: center; min-width: 92px; }
.table.schedule td.who, .table.schedule th:first-child { text-align: left; min-width: 150px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.table.schedule .today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.shift {
  width: 100%; min-height: 44px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font-size: 13px;
}
.shift:hover { border-color: var(--accent); color: var(--accent); }
.shift.set { border: 0; background: var(--accent-soft); color: var(--accent-text); }
.shift small { font-size: 11px; opacity: .8; }
.shift.ro { cursor: default; border-color: transparent; }
.date-field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.date-field .input { width: auto; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; font-size: 14px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.warn .ic { color: var(--warn); margin-top: 1px; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick { cursor: pointer; }
.day-pick input { display: none; }
.day-pick span { display: inline-block; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.day-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.today-row { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.m-only { display: none; }
details.tech summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
details.tech[open] summary { margin-bottom: 8px; }

/* ---------- phones: bigger tap targets, tables become cards, sticky save ---------- */
@media (max-width: 860px) {
  .btn.sm { min-height: 40px; padding: 8px 13px; }
  .btn.icon, .btn.sm.icon { min-width: 42px; min-height: 42px; }
  .m-only { display: inline; }
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody { display: block; }
  .table.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table.cards tr:last-child { border-bottom: 0; }
  .table.cards td { display: block; padding: 0; border: 0; }
  .table.cards td[data-label="Day"], .table.cards td[data-label="Name"], .table.cards td.actions { grid-column: 1 / -1; }
  .table.cards td[data-label]:not([data-label="Day"]):not([data-label="Name"])::before {
    content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint);
  }
  .table.cards td.actions:empty { display: none; }
  .table.cards td.empty { grid-column: 1 / -1; }
  #role-editor > .card-body:last-child { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--panel); border-radius: 0 0 var(--radius) var(--radius); z-index: 2; }
  .date-field { flex: 1; }
  .date-field .input { flex: 1; }
}

/* Simple home: one column, big live clock on top */
.home-simple { max-width: 640px; margin: 0 auto; }
.hello.small { margin-bottom: 14px; max-width: 640px; margin-left: auto; margin-right: auto; }
.hello.small h1 { font-size: 20px; }
.home-clock { text-align: center; gap: 12px; padding: 22px 18px 18px; }
.home-clock .now-clock { font-size: 64px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.home-clock .now-date { font-size: 14px; margin-top: -4px; }
.home-clock .clock-top { justify-content: center; text-align: left; padding-top: 4px; }
.home-clock .clock-top .grow { flex: 0 0 4px; }
.home-clock .clock-worked { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
.home-clock .clock-foot a { color: inherit; text-decoration: underline; }
@media (max-width: 600px) { .home-clock .now-clock { font-size: 56px; } }
.home-clock .clock-foot { justify-content: center; }
