/* Soft lavender look: white cards on a light violet background, one violet accent. Always light. */
:root {
  --accent: #7c5cff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, #fff);
  --accent-text: color-mix(in srgb, var(--accent) 82%, #1a1033);
  --bg: #f5f3fd;
  --panel: #ffffff;
  --panel-2: #f6f4fe;
  --line: #ebe7f7;
  --text: #1c1733;
  --muted: #6e6a86;
  --faint: #a6a2bc;
  --danger: #e5484d;
  --danger-soft: color-mix(in srgb, var(--danger) 10%, #fff);
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(60, 40, 140, .04), 0 10px 28px -12px rgba(60, 40, 140, .14);
  --shadow-lg: 0 24px 48px -12px rgba(60, 40, 140, .28);
  --radius: 20px;
  --sidebar: 248px;
  color-scheme: light;
}

* { 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; }

/* Days off: card under the clock, wish calendar, schedule markers */
.chips.wrap { flex-wrap: wrap; overflow: visible; margin-bottom: 0; }
.pattern-link { display: block; border: 0; background: none; padding: 0; margin-top: 2px; font: inherit; font-size: 12px; color: var(--accent-text); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pattern-link:hover { text-decoration: underline; }
.shift .off-tag { font-weight: 600; color: var(--ok); }
.shift .wish-tag { display: block; font-weight: 600; color: var(--warn); }
.off-row .btn { flex-shrink: 0; }
@media (max-width: 600px) { .off-row { flex-wrap: wrap; } .off-row .grow { flex-basis: 100%; } }

/* Stats on Home: segmented period switch, stat tiles, chatter ranking */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); flex-shrink: 0; }
.seg button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 7px; cursor: pointer; min-height: 30px; }
.seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 18px 18px; }
@media (min-width: 700px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.stat-tile .num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-tile .lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stats-note { padding: 0 18px 16px; margin-top: -6px; display: flex; align-items: center; gap: 6px; }
.stats-sum { padding: 10px 18px 6px; }
.rank-row { gap: 10px; }
.rank-num { width: 18px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.rank-bar { height: 4px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.rank-val { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.stats-card > .btn.block { margin: 4px 0 12px; }
@media (max-width: 420px) { .stats-card .card-head { flex-wrap: wrap; } .stats-card .card-head .seg { margin-left: auto; } }

/* ===== Soft lavender look: components ===== */
body { background: linear-gradient(180deg, #efeafe 0, var(--bg) 360px) no-repeat, var(--bg); }
.card { border-color: rgba(124, 92, 255, .08); }
.sidebar { background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px); border-right-color: var(--line); }
.brand-mark { border-radius: 11px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #c084fc)); box-shadow: 0 6px 14px -6px var(--accent); }
.nav-item { border-radius: 12px; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.topbar { background: rgba(245, 243, 253, .82); border-bottom-color: transparent; }
.bottomnav { background: rgba(255, 255, 255, .9); border-top-color: var(--line); box-shadow: 0 -8px 24px -16px rgba(60, 40, 140, .25); }
.bottomnav a.active { color: var(--accent); font-weight: 600; }

/* buttons: one clear violet action, soft everything else */
.btn { border-radius: 12px; font-weight: 600; transition: background .12s, box-shadow .12s, transform .06s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 90%, #000); }
.btn.sm { border-radius: 10px; }
.btn.lg { padding: 14px 20px; border-radius: 14px; }
.clock-btn { border-radius: 16px; padding: 16px 18px; }
.clock-btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 75%, #a78bfa)); }

/* fields: soft, roomy */
.input, select.input, textarea.input { border-radius: 12px; background: #fbfaff; border-color: var(--line); padding: 11px 13px; }
.input:focus { background: #fff; }

/* tabs look like a segmented switch instead of an underline */
.tabs { border-bottom: 0; background: rgba(124, 92, 255, .07); padding: 4px; border-radius: 14px; gap: 2px; width: fit-content; max-width: 100%; }
.tabs a { border-bottom: 0; margin: 0; border-radius: 10px; padding: 7px 14px; }
.tabs a.active { background: #fff; color: var(--accent-text); box-shadow: var(--shadow); }
.seg { background: rgba(124, 92, 255, .07); border-color: transparent; }
.seg button.active { color: var(--accent-text); }

/* chips (shift types, reasons, filters) */
.chip { border-color: var(--line); background: #fff; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.accent { background: var(--accent-soft); }

/* home clock: calm white card, violet accent bar */
.clock-card::before { height: 5px; background: linear-gradient(90deg, var(--accent), #c084fc); opacity: .35; }
.clock-card.status-working::before { background: var(--ok); opacity: 1; }
.clock-card.status-break::before { background: var(--warn); opacity: 1; }
.home-clock .now-clock { color: var(--text); }
.stat-tile { background: var(--panel-2); border-color: transparent; border-radius: 14px; }
.modal { border-radius: 22px; }
.modal-backdrop { background: rgba(28, 23, 51, .35); backdrop-filter: blur(3px); }
.toast { background: var(--text); color: #fff; border-radius: 14px; }
.hello h1 { letter-spacing: -.025em; }

/* progress (endowed: you're already on your way) */
.progress-card { padding: 18px; }
.progress-top { display: flex; align-items: baseline; gap: 10px; }
.progress-top h2 { flex: 1; }
.progress-pct { font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--panel-2); margin: 12px 0 14px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #c084fc); transition: width .4s ease; }
.progress-steps { display: flex; flex-direction: row; justify-content: space-between; gap: 4px; margin: 0 0 14px; padding: 0; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); text-align: center; min-width: 0; }
.step i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--faint); font-style: normal; font-weight: 700; font-size: 12px; }
.step.done { color: var(--accent-text); }
.step.done i { background: var(--accent); color: #fff; }
.step.next i { box-shadow: 0 0 0 2px var(--accent); color: var(--accent-text); background: #fff; }
.step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }

/* Days off: month calendar on Home */
.cal-nav { display: flex; align-items: center; gap: 2px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.cal-nav span { min-width: 118px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; padding: 14px 18px 4px; }
.cal-head { font-size: 11.5px; font-weight: 600; color: var(--faint); text-align: center; padding-bottom: 2px; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 48px; padding: 4px 1px;
  border-radius: 12px; border: 1px solid transparent; background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; min-width: 0; transition: transform .06s, background .12s; }
.cal-day b { font-size: 15px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cal-day small { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 12px; }
.cal-day:not(:disabled):active { transform: scale(.94); }
.cal-day.work { background: #fff; border-color: var(--line); box-shadow: 0 1px 2px rgba(60, 40, 140, .06); }
.cal-day.work:not(:disabled):hover { border-color: var(--accent); }
.cal-day.free { background: transparent; border: 1px dashed var(--line); color: var(--faint); }
.cal-day.free small { color: var(--faint); }
.cal-day.open { background: transparent; }
.cal-day.wished { background: color-mix(in srgb, var(--warn) 14%, #fff); border-color: color-mix(in srgb, var(--warn) 45%, #fff); }
.cal-day.wished small { color: var(--warn); font-weight: 600; }
.cal-day.approved { background: var(--accent); color: #fff; }
.cal-day.approved small { color: rgba(255, 255, 255, .9); font-weight: 600; }
.cal-day.declined { border-color: color-mix(in srgb, var(--danger) 45%, #fff); }
.cal-day.today b { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cal-day.past { opacity: .4; cursor: default; }
.cal-day:disabled { cursor: default; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 18px 0; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-legend i.work { background: #fff; border: 1px solid var(--line); }
.cal-legend i.free { border: 1px dashed var(--faint); }
.cal-legend i.wished { background: color-mix(in srgb, var(--warn) 30%, #fff); }
.cal-legend i.approved { background: var(--accent); }
.cal-hint { padding: 8px 18px 18px; }
@media (max-width: 420px) { .cal { gap: 4px; padding: 12px 12px 4px; } .cal-day { min-height: 44px; border-radius: 10px; } .days-off .card-head { flex-wrap: wrap; } .cal-nav { margin-left: auto; } }

/* Messages: two clear choices, calm list, chat-style conversation */
.to-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.to-choice.big { margin-bottom: 18px; }
.to-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 14px; border-radius: 16px;
  border: 1.5px solid var(--line); background: #fff; font: inherit; color: var(--text); cursor: pointer; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.to-card:not(:disabled):hover { border-color: color-mix(in srgb, var(--accent) 50%, #fff); }
.to-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.to-card:disabled { opacity: .5; cursor: default; }
.to-card b { font-size: 15px; }
.to-card small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.to-card .to-hint { font-size: 12px; color: var(--faint); }
.to-ic, .msg-to-ic, .msg-topic-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; margin-bottom: 4px; }
.msg-to-ic { margin: 0; width: 38px; height: 38px; }
.msg-row.unread b { color: var(--text); }
.msg-row .msg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.msg-thread { overflow: hidden; }
.msg-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.msg-head .msg-topic-ic { margin: 0; }
.msg-list { display: flex; flex-direction: column; gap: 12px; padding: 18px; max-height: 58vh; overflow-y: auto; background: var(--panel-2); }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 6px; padding: 9px 13px; min-width: 0; box-shadow: 0 1px 2px rgba(60, 40, 140, .05); }
.msg.mine .msg-bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 16px 16px 6px 16px; }
.msg-by { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.msg.mine .msg-by { color: rgba(255, 255, 255, .8); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg-event { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px dashed var(--line); padding: 4px 12px; border-radius: 99px; text-align: center; }
.msg-reply { display: flex; gap: 8px; align-items: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.msg-reply textarea { min-height: 44px; resize: none; }
.msg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 18px 14px; }
.msg-actions .tiny { display: inline-flex; align-items: center; gap: 4px; }
.help-card .btn { text-decoration: none; }
@media (max-width: 480px) { .to-choice { grid-template-columns: minmax(0, 1fr); } .msg { max-width: 94%; } }
