/* ==========================================================================
   App shell + view layouts
   ========================================================================== */

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: 22px 14px 14px; background: var(--surface); color: var(--text-2); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .logo { display: block; height: 38px; width: auto; max-width: 100%; }
.brand .mark { display: none; width: 38px; height: 38px; border-radius: 11px; }

/* logo variants: .logo-l for light surfaces, .logo-d for dark ones */
.logo-d { display: none !important; }
[data-theme='dark'] .logo-l, .force-dark .logo-l { display: none !important; }
[data-theme='dark'] .logo-d, .force-dark .logo-d { display: block !important; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding-right: 2px; }
.nav-label { margin: 18px 12px 6px; font-size: 10.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 11px;
  color: var(--text-2); font-size: 14px; font-weight: 550; text-decoration: none; border: 0; background: none; width: 100%; text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--on-accent); }

.side-foot { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.me-card { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border-radius: 12px; border: 0; background: none; text-align: left; color: inherit; }
.me-card:hover { background: var(--surface-3); }
.me-card .avatar { --size: 36px; }
.me-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.me-role { font-size: 11.5px; color: var(--text-3); }
.live { display: flex; align-items: center; gap: 7px; padding: 10px 10px 0; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #7FA06C; box-shadow: 0 0 0 0 rgba(127, 160, 108, .6); animation: live-ping 2.2s infinite; }
.live[data-state='connecting'] i { background: #D9A441; animation: none; }
.live[data-state='offline'] i { background: #D2685A; animation: none; }
@keyframes live-ping { 70% { box-shadow: 0 0 0 7px rgba(127, 160, 108, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 160, 108, 0); } }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.tb-brand { display: none; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; }
.tb-brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.search-btn {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; min-width: 280px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-size: 13.5px; box-shadow: var(--shadow-sm);
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-btn .kbd { margin-left: auto; }
.tb-spacer { flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 0; background: none; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .pip { position: absolute; top: 8px; right: 9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger-solid); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); box-sizing: content-box; }
.tb-avatar { padding: 0; border: 0; background: none; border-radius: 50%; }

.view { padding: 8px 32px 64px; width: 100%; max-width: 1240px; margin: 0 auto; animation: view-in .28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

.offline-bar { background: var(--warning-soft); color: var(--warning); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 12px; }

/* tablet: icon rail */
@media (max-width: 1080px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 18px 10px 12px; align-items: stretch; }
  .brand { justify-content: center; padding: 0 0 18px; }
  .brand .logo-wrap { display: none; } .brand .mark { display: block; }
  .brand > div, .nav-label, .nav-item span.t, .me-card > div, .live span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: -10px; }
  .nav-badge { position: absolute; top: 4px; right: 6px; margin: 0; min-width: 17px; height: 17px; font-size: 10px; }
  .me-card { justify-content: center; padding: 6px 0; }
  .live { justify-content: center; padding: 10px 0 0; }
  .search-btn { min-width: 0; }
}

/* phone: bottom tab bar */
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 58px; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
  .tb-brand { display: flex; }
  .search-btn { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn .kbd { display: none; }
  .view { padding: 4px 16px 40px; }
  #toasts { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
}

.tabbar {
  display: none; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-top: 1px solid var(--border);
  grid-template-columns: repeat(5, 1fr); align-items: center;
}
@media (max-width: 720px) { .tabbar { display: grid; } }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 52px; border: 0; background: none; color: var(--text-3); font-size: 10.5px; font-weight: 650; text-decoration: none; border-radius: 14px; position: relative; }
.tab:hover { text-decoration: none; }
.tab.active { color: var(--accent-text); }
.tab .tab-ico { position: relative; }
.tab .nav-badge { position: absolute; top: -5px; right: -9px; min-width: 16px; height: 16px; font-size: 9.5px; margin: 0; }
.tab.fab .fab-ico { width: 50px; height: 50px; margin-top: -22px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent); border: 4px solid var(--bg); box-sizing: content-box; }
.tab.fab { color: var(--text-2); }
.tab.fab.active { color: var(--accent-text); }
.tab.working .fab-ico { background: var(--success-solid); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--success-solid) 70%, transparent); }

/* ---------- page scaffolding ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 18px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; letter-spacing: -.02em; }
.page-head .sub { color: var(--text-2); margin-top: 6px; font-size: 14.5px; max-width: 640px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) { .page-head { padding: 10px 0 16px; } .page-head h1 { font-size: 28px; } }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.grid > .span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .grid > .span-2 { grid-column: auto; } .field-row, .field-row.three { grid-template-columns: 1fr; } .grid { gap: 14px; } .stack { gap: 14px; } .card { padding: 18px; } }
.grid-3.keep-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-4 { gap: 12px; } .grid-3.keep-3 { gap: 10px; } .grid-3.keep-3 .card { padding: 14px; } .grid-3.keep-3 .stat-value { font-size: 26px; } }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-input { position: relative; flex: 1 1 240px; max-width: 360px; }
.search-input svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input input { padding-left: 38px; }

/* ---------- clock hero (always dark; the brand moment) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 30px; color: var(--hero-text);
  background:
    radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--brand-2) 24%, transparent), transparent 60%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--brand) 38%, transparent), transparent 60%),
    linear-gradient(150deg, var(--hero-1), var(--hero-2));
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 34px; align-items: center; box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, .06);
}
.hero::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .05); pointer-events: none; box-shadow: 0 0 0 36px rgba(255, 255, 255, .015), 0 0 0 72px rgba(255, 255, 255, .012); }
.hero-ring { position: relative; width: 208px; height: 208px; flex-shrink: 0; }
.hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { stroke: rgba(255, 255, 255, .09); }
.ring-bar { stroke: var(--hero-glow); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease), stroke .3s; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--hero-glow) 45%, transparent)); }
.ring-bar.ot { stroke: var(--hero-brand); filter: drop-shadow(0 0 8px rgba(229, 141, 127, .5)); }
.ring-bar.pause { stroke: #A9ABBA; filter: none; }
.hero-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.hero-time { font-family: var(--font-display); font-size: 42px; font-weight: 500; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-time small { font-size: 18px; color: var(--hero-dim); font-family: var(--font-ui); font-weight: 500; letter-spacing: 0; }
.hero-cap { margin-top: 8px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--hero-dim); font-weight: 600; }
.hero-body { min-width: 0; position: relative; z-index: 1; }
.hero-eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--hero-dim); font-weight: 650; }
.hero-title { font-family: var(--font-display); font-size: 30px; font-weight: 500; letter-spacing: -.015em; margin: 6px 0 4px; line-height: 1.15; }
.hero-line { color: var(--hero-dim); font-size: 14px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.hero .badge { background: rgba(255, 255, 255, .09); color: #E9E5D8; }
.hero .badge.b-warning { background: rgba(217, 164, 65, .2); color: #F1CD8A; }
.hero .badge.b-danger { background: rgba(229, 141, 127, .2); color: #F2B1A6; }
.hero .badge.b-success { background: rgba(127, 160, 108, .22); color: #B9D8A6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn-hero { --_bg: #F6F3EF; --_fg: #231F20; --_bd: transparent; height: 46px; padding: 0 22px; border-radius: 14px; }
.btn-hero:hover { background: #fff; }
.btn-hero.go { --_bg: var(--brand); --_fg: var(--on-brand); }
.btn-hero.go:hover { background: color-mix(in srgb, var(--brand) 85%, #fff); }
.btn-hero.stop { --_bg: var(--hero-brand); --_fg: #1b1414; }
.btn-hero.stop:hover { background: color-mix(in srgb, var(--hero-brand) 85%, #fff); }
.btn-hero-ghost { --_bg: rgba(255, 255, 255, .08); --_fg: #F2EEE2; --_bd: rgba(255, 255, 255, .12); height: 46px; padding: 0 20px; border-radius: 14px; box-shadow: none; }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, .14); }
.hero-note { margin-top: 18px; display: flex; gap: 8px; }
.hero-note input { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); color: #F6F2E8; height: 40px; }
.hero-note input::placeholder { color: #8F8A86; }
.hero-note input:focus { border-color: var(--hero-glow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hero-glow) 28%, transparent); }
.hero-note .btn-hero-ghost { height: 40px; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 24px 20px; gap: 22px; justify-items: center; text-align: center; }
  .hero-body { width: 100%; }
  .hero-tags, .hero-actions { justify-content: center; }
  .hero-ring { width: 188px; height: 188px; }
  .hero-actions .btn { flex: 1 1 140px; }
}

/* ---------- charts ---------- */
.bars { --plot: 132px; position: relative; padding-top: 6px; }
.bars-plot { position: relative; display: flex; align-items: flex-end; gap: 10px; height: calc(var(--plot) + 22px); }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar { width: 100%; max-width: 40px; height: max(4px, calc(var(--plot) * var(--k, 0))); border-radius: 9px 9px 4px 4px; background: color-mix(in srgb, var(--accent) 38%, var(--surface-3)); transition: height .6s var(--ease); }
.bar.today { background: var(--accent); }
.bar.ot { background: linear-gradient(to top, var(--accent) var(--base, 100%), var(--warning-solid) var(--base, 100%)); }
.bar.empty { background: var(--surface-3); }
.bar-val { font-size: 11px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; height: 16px; line-height: 16px; white-space: nowrap; }
.bars-axis { display: flex; gap: 10px; margin-top: 8px; }
.bars-axis .bar-lbl { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.bars-axis .bar-lbl.today { color: var(--accent-text); }
.bar-target { position: absolute; left: 0; right: 0; bottom: calc(var(--plot) * var(--tk, 0)); border-top: 1.5px dashed var(--border-strong); pointer-events: none; z-index: 1; }
.bar-target span { position: absolute; right: 0; top: -17px; font-size: 10.5px; color: var(--text-3); background: var(--surface); padding-left: 5px; }
.bars.dense .bars-plot, .bars.dense .bars-axis { gap: 3px; }
.bars.dense .bar { max-width: none; border-radius: 4px 4px 2px 2px; }
.bars.dense .bars-axis .bar-lbl { font-size: 9.5px; }
.bars.dense .bar-val { display: none; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1; }
.donut-center span { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 160px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: var(--c); }
.legend-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .v { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text-2); }

.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.hbar .progress { grid-column: 1 / -1; height: 7px; }
.hbar .nm { font-size: 13.5px; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: var(--c); flex-shrink: 0; }

/* ---------- week strip (timesheet) ---------- */
.wstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { position: relative; padding: 12px 8px 10px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 3px; transition: all .15s var(--ease); cursor: pointer; }
.wday:hover { border-color: var(--border-strong); }
.wday.today { border-color: var(--accent); background: var(--accent-soft); }
.wday.sel { border-color: var(--accent); box-shadow: var(--ring); }
.wday.off { background: var(--surface-2); opacity: .7; }
.wday .d { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.wday .n { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.wday .h { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-2); }
.wday .att { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wday .gauge { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.wday .gauge i { display: block; height: 100%; background: var(--accent); width: var(--p, 0%); }
@media (max-width: 720px) { .wstrip { gap: 5px; } .wday { padding: 9px 2px 8px; } .wday .n { font-size: 18px; } .wday .att { display: none; } }

.entry { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.entry:last-child { border-bottom: 0; }
.entry .hrs { font-family: var(--font-display); font-size: 20px; width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.day-head:first-child { padding-top: 0; }
.chips-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- calendars ---------- */
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .ttl { font-family: var(--font-display); font-size: 19px; min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); text-align: center; padding: 4px 0 8px; }
.cal-d { position: relative; min-height: 78px; padding: 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-d.out { opacity: .35; }
.cal-d.off { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--surface-3) 6px, var(--surface-3) 7px); }
.cal-d.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-d .n { font-size: 12px; font-weight: 650; color: var(--text-2); }
.cal-d.today .n { color: var(--accent-text); }
.cal-ev { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
@media (max-width: 720px) { .cal-d { min-height: 54px; padding: 4px; } .cal-ev { font-size: 0; padding: 0; height: 6px; width: 6px; border-radius: 50%; background: var(--c); } .cal-d { flex-direction: row; flex-wrap: wrap; align-content: flex-start; } .cal-d .n { width: 100%; } }

.mcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mcal .h { font-size: 10.5px; font-weight: 650; text-align: center; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.md { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text-3); position: relative; font-variant-numeric: tabular-nums; }
.md.ok { background: var(--success-soft); color: var(--success); }
.md.late { background: var(--warning-soft); color: var(--warning); }
.md.leave { background: var(--info-soft); color: var(--info); }
.md.miss { background: var(--danger-soft); color: var(--danger); }
.md.off { background: transparent; color: var(--text-3); opacity: .55; }
.md.future { background: transparent; border: 1px dashed var(--border); }
.md.today { box-shadow: 0 0 0 2px var(--accent); }
.md.blank { visibility: hidden; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 14px; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- presence ---------- */
.presence { display: flex; flex-direction: column; }
.presence-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.presence-row:last-child { border-bottom: 0; padding-bottom: 0; }
.presence-row:first-child { padding-top: 0; }
.presence-row .who { min-width: 0; flex: 1; }
.presence-row .nm { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.presence-row .st { font-size: 12.5px; color: var(--text-2); }

/* ---------- projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; gap: 14px; padding: 20px; position: relative; border-top: 4px solid var(--c, var(--accent)); }
.proj-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; }
.proj-name { font-size: 17px; font-weight: 650; line-height: 1.3; margin-top: 2px; letter-spacing: -.005em; }
.proj-client { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.proj-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.due { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.due.soon { color: var(--warning); } .due.over { color: var(--danger); }
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.brief-item { padding: 9px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.brief-item .v { font-size: 14.5px; margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.brief-item.full { grid-column: 1 / -1; }
.brief-item ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 560px) { .brief-grid { grid-template-columns: 1fr; } }
.assign-list { max-height: 188px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 6px; }
.form-section { font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; }

/* ---------- leave ---------- */
.ring-stat { display: flex; align-items: center; gap: 16px; }
.ring-stat .r { position: relative; width: 74px; height: 74px; flex-shrink: 0; }
.ring-stat svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-stat .r b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.ring-stat .trk { stroke: var(--surface-3); } .ring-stat .val { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.leave-preview { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13.5px; margin-bottom: 14px; }
.leave-preview.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.leave-preview.good { background: var(--success-soft); border-color: transparent; color: var(--success); }

/* ---------- team ---------- */
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-cell .nm { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.person-cell .sub { font-size: 12.5px; color: var(--text-2); }
.summary-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.sum-chip { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.sum-chip b { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.sum-chip .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- notifications popover ---------- */
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; position: relative; }
.notif:hover { background: var(--surface-3); }
.notif.unread::after { content: ''; position: absolute; right: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.notif .n-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.notif .n-t { font-weight: 600; font-size: 13.5px; padding-right: 16px; }
.notif .n-b { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.notif .n-time { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.popover { position: fixed; z-index: 100; width: min(380px, calc(100vw - 20px)); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: menu-in .16s var(--ease); display: flex; flex-direction: column; max-height: min(70vh, 560px); }
.popover-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.popover-body { overflow-y: auto; padding: 4px 6px 8px; }

/* ---------- command palette ---------- */
dialog.palette { width: min(600px, calc(100vw - 24px)); margin: 12vh auto auto; border-radius: 20px; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.pal-input input { border: 0 !important; box-shadow: none !important; height: 58px; font-size: 16px; padding: 0; background: transparent; }
.pal-list { max-height: min(50vh, 420px); overflow-y: auto; padding: 8px; }
.pal-group { padding: 10px 12px 4px; font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 11px; border: 0; background: none; text-align: left; font-size: 14.5px; font-weight: 550; color: var(--text); }
.pal-item svg { color: var(--text-3); }
.pal-item[aria-selected='true'] { background: var(--accent-soft); color: var(--accent-text); }
.pal-item[aria-selected='true'] svg { color: var(--accent-text); }
.pal-item .hint { margin-left: auto; }
.pal-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* ---------- auth screen ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; padding: 48px; color: #F4EEDF; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 20% 0%, color-mix(in srgb, var(--brand-2) 26%, transparent), transparent 60%), radial-gradient(70% 70% at 100% 100%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%), linear-gradient(160deg, #2E2929, #141010);
}
.auth-art .brand { padding: 0; }
.auth-art .brand .logo { height: 46px; }
.auth-quote { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -.02em; max-width: 520px; position: relative; z-index: 1; }
.auth-quote em { color: var(--hero-glow); }
.auth-points { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; color: #BDB8B3; position: relative; z-index: 1; }
.auth-points div { display: flex; gap: 10px; align-items: center; } .auth-points svg { color: var(--hero-glow); flex-shrink: 0; }
.auth-waves { position: absolute; left: 0; right: 0; bottom: 70px; opacity: .5; pointer-events: none; }
.auth-waves path { fill: none; stroke: var(--hero-glow); stroke-width: 2; stroke-linecap: round; }
.auth-waves path:nth-child(2) { stroke: var(--hero-brand); opacity: .8; transform: translateY(22px); }
.auth-waves path:nth-child(3) { stroke: #fff; opacity: .15; transform: translateY(44px); }
.auth-pane { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h2 { font-size: 32px; margin-bottom: 8px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 26px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 13.5px; color: var(--text-2); }
.auth-foot button { background: none; border: 0; color: var(--accent-text); font-weight: 650; padding: 0; }
.auth-foot button:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-pane { padding-top: 48px; align-items: start; } .auth-mobile-brand { display: flex !important; } }
.auth-mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-mobile-brand .logo { height: 40px; width: auto; }
.auth-mobile-brand { padding: 0; }
.pending-art { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin: 0 auto 18px; }

/* ---------- print (project brief) ---------- */
#print-root { display: none; }
@media print {
  body { background: #fff !important; color: #111 !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; font-family: Georgia, 'Noto Sans Bengali', serif; max-width: 720px; margin: 0 auto; padding: 24px; color: #1c1f2e; }
  #print-root h1 { font-size: 26px; margin-bottom: 4px; }
  #print-root .p-meta { font-family: monospace; font-size: 12px; color: #666; margin-bottom: 22px; }
  #print-root h2 { font-family: Arial, sans-serif; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); border-bottom: 2px solid #7A4B54; padding-bottom: 5px; margin: 24px 0 10px; }
  #print-root table { width: 100%; border-collapse: collapse; }
  #print-root td { padding: 7px 8px; border-bottom: 1px solid #e5e0d0; font-size: 13.5px; vertical-align: top; }
  #print-root td.l { width: 180px; font: 700 10.5px Arial, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: #555; }
  #print-root p, #print-root li { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }
  #print-root .sig-row { display: flex; gap: 24px; margin-top: 56px; }
  #print-root .sig { flex: 1; text-align: center; border-top: 1px solid #1c1f2e; padding-top: 6px; font-size: 12px; }
}

/* ---- phone refinements ---- */
.icon-btn .pip { box-sizing: border-box; min-width: 18px; height: 18px; line-height: 1; top: 5px; right: 4px; border-width: 2px; padding: 0 3px; }
@media (max-width: 720px) {
  .grid.keep-3 { gap: 8px; }
  .grid.keep-3 > .card { padding: 12px 8px; }
  .grid.keep-3 .ring-stat { flex-direction: column; text-align: center; gap: 8px; align-items: center; }
  .grid.keep-3 .ring-stat .small, .grid.keep-3 .ring-stat .xs { display: block; }
  .wrap-sm { flex-wrap: wrap; }
  .wrap-sm > .grow { flex-basis: calc(100% - 56px); }
  .lv-actions { width: 100%; padding-left: 54px; }
}


/* ---------- edit-text mode (admins) ---------- */
body.edit-text .tx { cursor: text; outline: 1.5px dashed color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; border-radius: 4px; transition: background .15s; }
body.edit-text .tx:hover, body.edit-text .tx:focus-visible { background: var(--accent-soft); outline-style: solid; }
.edit-banner { position: fixed; z-index: 60; left: 50%; bottom: 18px; transform: translateX(-50%); display: none; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); }
body.edit-text .edit-banner { display: flex; }
.edit-banner button { border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 650; background: #fff; color: #231F20; }
@media (max-width: 720px) { .edit-banner { bottom: calc(var(--tabbar-h) + 14px); } }

/* ---------- branding page ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .asset-grid { grid-template-columns: 1fr; } }
.asset { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.asset .plate { height: 112px; border-radius: var(--r-md); display: grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--border); overflow: hidden; }
.asset .plate.dark { background: #1b1818; border-color: #1b1818; }
.asset .plate img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.asset .plate.icon img { width: 72px; height: 72px; border-radius: 18px; }
.asset .a-title { font-weight: 650; font-size: 14px; }
.asset .a-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { display: flex; align-items: center; gap: 9px; padding: 7px 12px 7px 8px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; }
.preset:hover { background: var(--surface-3); }
.preset[aria-pressed='true'] { border-color: var(--accent); box-shadow: var(--ring); }
.preset .sw { display: flex; } .preset .sw i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface); } .preset .sw i + i { margin-left: -7px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 46px; height: 46px; padding: 3px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.color-field input[type=text] { font-family: var(--font-mono); text-transform: uppercase; max-width: 130px; }
.theme-preview { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.copy-group { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.copy-group + .copy-group { margin-top: 10px; }
.copy-group > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: 650; }
.copy-group > summary::-webkit-details-marker { display: none; }
.copy-group > summary .chev { margin-left: auto; transition: transform .2s; color: var(--text-3); }
.copy-group[open] > summary .chev { transform: rotate(180deg); }
.copy-group .copy-rows { padding: 4px 18px 18px; display: grid; gap: 14px; }
.copy-row label { display: flex; justify-content: space-between; gap: 8px; }
.copy-row .mod { color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.copy-row textarea { min-height: 64px; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 16px; margin-top: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); }
.color-field input[type=color] { width: 46px; min-width: 46px; max-width: 46px; flex: none; }
.color-field input[type=text] { flex: 0 0 130px; width: 130px; }
.brand .logo { height: 44px; }
.asset label.btn { position: relative; overflow: hidden; }
.save-bar { flex-wrap: wrap; }

/* ---- Saturday roster ---- */
.roster-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 14px 2px; border-top: 1px solid var(--border); }
.roster-row:first-child { border-top: 0; padding-top: 2px; }
.roster-date { text-align: center; border-radius: 12px; background: var(--surface-2); padding: 7px 0; line-height: 1.1; }
.roster-date .d { font-size: 20px; font-weight: 700; }
.roster-date .m { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.roster-main { min-width: 0; }
.roster-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.roster-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 4px 3px 4px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; max-width: 100%; }
.roster-chip .x { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.roster-chip .x:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.roster-side { display: flex; align-items: center; gap: 12px; }
.roster-pick { max-height: 260px; margin-bottom: 14px; }
.cal-ev.roster { background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
@media (max-width: 720px) {
  .roster-row { grid-template-columns: 48px 1fr; gap: 12px; }
  .roster-side { grid-column: 1 / -1; justify-content: space-between; }
}

/* ---- public holidays ---- */
.holiday-list { display: flex; flex-direction: column; }
.holiday-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.holiday-row:first-child { border-top: 0; }
.holiday-row.past { opacity: .55; }
.cal-ev.holiday { --c: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--surface)); box-shadow: inset 3px 0 0 var(--success); overflow: hidden; text-overflow: ellipsis; }
.cal-d.holiday { background: color-mix(in srgb, var(--success) 6%, var(--surface-3)); }

.imp-list { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md, 12px); }
.imp-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.imp-row:first-child { border-top: 0; }
.imp-row.dup { opacity: .55; cursor: default; }
.note-warn { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-radius: 10px; padding: 8px 12px; }
