@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --ink: #18202c;
  --ink-2: #263244;
  --muted: #768398;
  --muted-2: #a1adbd;
  --line: #e6ebf1;
  --soft: #f5f7fa;
  --white: #ffffff;
  --amber: #efaa3c;
  --amber-soft: #fff3dd;
  --teal: #16a697;
  --teal-soft: #e7f8f5;
  --red: #dc5c68;
  --red-soft: #fcebed;
  --blue: #447ee8;
  --blue-soft: #edf3ff;
  --purple: #8c69d8;
  --purple-soft: #f2edff;
  --shadow: 0 12px 28px rgba(29, 42, 58, .06);
  --radius: 14px;
  --sidebar-width: 252px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--soft); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(68, 126, 232, .23); outline-offset: 2px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; transition: .18s ease; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
.sidebar .icon-button:hover { background: rgba(255,255,255,.08); color: #fff; }

#root { min-height: 100vh; display: flex; }
#root[hidden] { display: none; }
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--sidebar-width);
  background: var(--ink);
  color: #dce4ef;
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; padding: 0 10px 25px; gap: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #1c2532; background: var(--amber); font: 700 21px/1 'Space Grotesk', sans-serif; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.04; }
.brand-copy strong { color: #fff; font: 700 19px/1 'Space Grotesk', sans-serif; letter-spacing: .02em; }
.brand-copy span { margin-top: 4px; color: #9ba8ba; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-close { display: none; margin-left: auto; }
.branch-switcher { padding: 12px 11px; margin-bottom: 23px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.045); }
.branch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(22,166,151,.13); }
.branch-switcher > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.branch-switcher small { color: #8795a8; font-size: 11px; }
.branch-switcher strong { color: #eef3f8; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branch-switcher .chevron { width: 14px; height: 14px; color: #77869b; transform: rotate(90deg); }
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 0 10px 8px; color: #718095; font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.nav-label-lower { margin-top: 22px; }
.nav-item { width: 100%; min-height: 45px; padding: 0 11px; border: 0; border-radius: 10px; display: flex; align-items: center; gap: 12px; color: #9eacbd; background: transparent; text-align: left; transition: .18s ease; }
.nav-item span { flex: 1; font-size: 14px; }
.nav-item em { font-style: normal; font-size: 11px; color: #728096; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: #2a3546; box-shadow: inset 3px 0 var(--amber); }
.nav-item.active .icon { color: var(--amber); }
.nav-item .nav-badge { min-width: 22px; padding: 2px 6px; border-radius: 20px; color: #422f0d; background: var(--amber); font-weight: 700; text-align: center; }
.nav-live { color: #5dbea9 !important; font-size: 10px !important; }
.sidebar-footer { margin-top: auto; }
.wifi-card { padding: 10px; margin: 0 3px 17px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; }
.wifi-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--teal); background: rgba(22,166,151,.12); }
.wifi-icon .icon { width: 15px; height: 15px; }
.wifi-card div:nth-child(2) { display: flex; flex-direction: column; flex: 1; gap: 1px; }
.wifi-card strong { color: #dbe4ec; font-size: 12px; font-weight: 600; }
.wifi-card span:not(.status-dot) { color: #7c899a; font-size: 11px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.status-dot.online { background: var(--teal); box-shadow: 0 0 0 3px rgba(22,166,151,.13); }
.profile-mini { padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; }
.profile-mini > div:nth-child(2) { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.profile-mini strong { color: #e9eef5; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-mini span { color: #7c899a; font-size: 11px; }
.profile-mini .icon-button { width: 28px; height: 28px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.avatar-amber { background: linear-gradient(135deg, #f3bd66, #db8730); }
.avatar-blue { background: linear-gradient(135deg, #769cf4, #486ccf); }
.avatar-teal { background: linear-gradient(135deg, #58cabb, #148d83); }
.avatar-purple { background: linear-gradient(135deg, #bb9bef, #7c59cc); }
.avatar-rose { background: linear-gradient(135deg, #eb91a1, #c8526e); }
.avatar-slate { background: linear-gradient(135deg, #99a9bd, #617188); }

.main-shell { min-width: 0; flex: 1; }
.topbar { min-height: 72px; padding: 0 34px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,255,255,.8); }
.menu-toggle { display: none; }
.topbar-context { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.eyebrow { color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.topbar-separator { color: #d0d6df; }
#topbar-view { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.search-box { height: 37px; width: 196px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 8px; color: var(--muted-2); background: #fff; }
.search-box:focus-within { border-color: #adc5f8; box-shadow: 0 0 0 3px rgba(68,126,232,.1); }
.search-box .icon { width: 16px; height: 16px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #a5afbd; }
.notification-button { position: relative; }
.notification-button > span { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1.5px solid #fff; border-radius: 50%; background: var(--red); }
.topbar-date { padding-left: 15px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; text-align: right; line-height: 1.2; }
.topbar-date span { color: var(--muted); font-size: 11px; }
.topbar-date strong { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.app-content { max-width: 1480px; padding: 31px 34px 44px; margin: 0 auto; }
.page-heading { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading .kicker { margin: 0 0 6px; color: var(--amber); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-heading h1 { margin: 0; color: var(--ink); font: 700 28px/1.15 'Space Grotesk', sans-serif; letter-spacing: -.025em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: #fff; font-size: 13px; font-weight: 600; transition: .18s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(29,42,58,.08); }
.button .icon { width: 16px; height: 16px; }
.button-primary { color: #34230a; background: var(--amber); border-color: var(--amber); }
.button-primary:hover { background: #f3b552; }
.button-secondary { color: var(--ink-2); border-color: var(--line); }
.button-quiet { color: var(--muted); border-color: transparent; background: transparent; }
.button-danger { color: var(--red); border-color: #f5ccd1; background: #fff; }
.button-small { min-height: 31px; padding: 0 10px; font-size: 12px; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.pill { padding: 4px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill-success { color: #0f8b7f; background: var(--teal-soft); }
.pill-warning { color: #b47815; background: var(--amber-soft); }
.pill-danger { color: #c84d5d; background: var(--red-soft); }
.pill-info { color: #3568c7; background: var(--blue-soft); }
.pill-neutral { color: #68778b; background: #eef1f5; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 21px; }
.metric-card { padding: 17px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius); position: relative; overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.metric-card::after { content: ''; position: absolute; width: 70px; height: 70px; right: -27px; bottom: -33px; border-radius: 50%; background: var(--metric-color, var(--amber)); opacity: .08; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--metric-color, var(--amber)); background: var(--metric-bg, var(--amber-soft)); }
.metric-icon .icon { width: 16px; height: 16px; }
.metric-number { margin: 14px 0 9px; color: var(--ink); font: 700 27px/1 'Space Grotesk', sans-serif; letter-spacing: -.03em; }
.metric-foot { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.metric-foot .trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.trend.up { color: var(--teal); }
.trend.down { color: var(--red); }
.metric-foot .icon { width: 13px; height: 13px; }
.metric-amber { --metric-color: #d68d1c; --metric-bg: var(--amber-soft); }
.metric-teal { --metric-color: var(--teal); --metric-bg: var(--teal-soft); }
.metric-blue { --metric-color: var(--blue); --metric-bg: var(--blue-soft); }
.metric-purple { --metric-color: var(--purple); --metric-bg: var(--purple-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(290px, .87fr); gap: 20px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.panel-header { min-height: 64px; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-title { display: flex; flex-direction: column; gap: 2px; }
.panel-title h2 { margin: 0; color: var(--ink); font: 600 16px/1.2 'Space Grotesk', sans-serif; letter-spacing: -.015em; }
.panel-title p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-link { padding: 3px 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 600; }
.panel-link:hover { color: var(--ink); }
.panel-body { padding: 17px 18px; }
.dashboard-left, .dashboard-right { display: flex; flex-direction: column; gap: 20px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.data-table th { padding: 0 12px 11px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.data-table th:last-child, .data-table td:last-child { padding-right: 0; text-align: right; }
.data-table td { padding: 12px; border-top: 1px solid #f0f2f5; color: var(--ink-2); font-size: 13px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fcfdfe; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 155px; }
.person-cell > div:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.person-cell strong { color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.person-cell span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.time-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-cell.late { color: #c17b17; font-weight: 600; }
.table-foot { padding-top: 14px; margin-top: 2px; border-top: 1px solid #f0f2f5; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.request-list { display: flex; flex-direction: column; }
.request-row { padding: 14px 0; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; gap: 10px; }
.request-row:first-child { padding-top: 0; }
.request-row:last-child { border-bottom: 0; padding-bottom: 0; }
.request-type { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.request-type .icon { width: 15px; height: 15px; }
.request-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.request-info strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.request-info span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-actions { display: flex; gap: 3px; }
.request-actions .icon-button { width: 28px; height: 28px; }
.request-actions .approve:hover { color: var(--teal); background: var(--teal-soft); }
.request-actions .reject:hover { color: var(--red); background: var(--red-soft); }
.mini-chart { padding-top: 5px; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 10px; }
.bar-chart { height: 129px; padding: 12px 0 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, transparent 24%, #f4f6f8 25%, transparent 25.5%, transparent 49%, #f4f6f8 50%, transparent 50.5%, transparent 74%, #f4f6f8 75%, transparent 75.5%); }
.bar-column { height: 100%; display: flex; flex: 1; align-items: flex-end; justify-content: center; gap: 3px; position: relative; }
.bar { width: 7px; min-height: 5px; border-radius: 4px 4px 2px 2px; background: #dbe5f5; transition: .2s ease; }
.bar.highlight { background: var(--amber); }
.bar-column:hover .bar { filter: brightness(.94); transform: translateY(-2px); }
.chart-days { display: flex; justify-content: space-between; padding-top: 7px; color: var(--muted-2); font-size: 10px; }
.summary-list { display: flex; flex-direction: column; gap: 13px; }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.summary-line strong { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.summary-line.total { padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); }
.summary-line.total strong { font-size: 17px; color: var(--teal); font-family: 'Space Grotesk', sans-serif; }

.view-toolbar { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-box, .select-box { height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: #fff; font-size: 12px; }
.filter-box input { width: 165px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.select-box select { min-width: 100px; border: 0; outline: 0; color: var(--ink-2); background: transparent; font-size: 12px; }
.segmented { padding: 3px; border-radius: 8px; display: inline-flex; gap: 2px; background: var(--soft); }
.segment { padding: 6px 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.segment.active { color: var(--ink-2); background: #fff; box-shadow: 0 1px 4px rgba(29,42,58,.08); }
.table-panel-body { padding: 0 18px 16px; }
.table-panel-body .data-table { min-width: 760px; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--ink); }

.employee-table .data-table td { padding-top: 15px; padding-bottom: 15px; }
.employee-role { color: var(--muted); font-size: 12px; }
.inline-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.attendance-hero { padding: 19px; border: 1px solid #ead9b7; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(120deg, #fffaf0, #fffdf8); }
.attendance-hero-copy { display: flex; flex-direction: column; gap: 3px; }
.attendance-hero-copy .kicker { color: #b98220; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.attendance-hero-copy strong { color: var(--ink); font: 600 17px/1.2 'Space Grotesk', sans-serif; }
.attendance-hero-copy span { color: var(--muted); font-size: 12px; }
.attendance-hero .button { flex: 0 0 auto; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 20px; }
.small-stat { padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.small-stat span { display: block; color: var(--muted); font-size: 11px; }
.small-stat strong { display: block; margin-top: 7px; color: var(--ink); font: 600 21px/1 'Space Grotesk', sans-serif; }
.small-stat.teal strong { color: var(--teal); }
.small-stat.amber strong { color: #c9881b; }
.small-stat.red strong { color: var(--red); }
.date-input { height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: #fff; font-size: 12px; }
.camera-layout { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(290px, .72fr); gap: 20px; }
.camera-card { padding: 20px; border: 1px solid #cde9e5; border-radius: var(--radius); background: linear-gradient(130deg, #f3fcfa, #fff); }
.camera-card h3 { margin: 0 0 5px; color: var(--ink); font: 600 18px/1.2 'Space Grotesk', sans-serif; }
.camera-card p { margin: 0 0 17px; color: var(--muted); font-size: 13px; }
.camera-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 19px; }
.camera-benefit { padding: 10px; border: 1px solid rgba(22,166,151,.16); border-radius: 9px; background: rgba(255,255,255,.7); }
.camera-benefit strong { display: block; margin-bottom: 2px; color: var(--ink-2); font-size: 12px; }
.camera-benefit span { color: var(--muted); font-size: 11px; }
.checkin-preview { min-height: 177px; padding: 16px; border: 1px dashed #b7d8d2; border-radius: 12px; display: grid; place-items: center; text-align: center; background: rgba(255,255,255,.76); }
.checkin-preview .preview-icon { width: 46px; height: 46px; margin: 0 auto 9px; border-radius: 13px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); }
.checkin-preview .preview-icon .icon { width: 24px; height: 24px; }
.checkin-preview strong { display: block; color: var(--ink-2); font-size: 13px; }
.checkin-preview span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-row { padding: 12px 0; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; gap: 11px; }
.timeline-row:last-child { border-bottom: 0; }
.timeline-time { width: 42px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.timeline-line { width: 1px; height: 31px; position: relative; background: #dfe6ee; }
.timeline-line::before { content: ''; position: absolute; top: 10px; left: -4px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.timeline-copy { display: flex; flex-direction: column; gap: 1px; }
.timeline-copy strong { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.timeline-copy span { color: var(--muted); font-size: 11px; }

.payroll-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 20px; }
.payroll-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.payroll-card .label { color: var(--muted); font-size: 12px; }
.payroll-card .value { margin: 9px 0 5px; color: var(--ink); font: 700 23px/1 'Space Grotesk', sans-serif; }
.payroll-card .note { color: var(--muted); font-size: 11px; }
.payroll-card .value.teal { color: var(--teal); }
.formula-grid { display: grid; grid-template-columns: 1.14fr .86fr; gap: 20px; margin-top: 20px; }
.formula-box { padding: 18px; border: 1px solid #dae4f3; border-radius: var(--radius); background: #f7faff; }
.formula-box h3 { margin: 0 0 8px; color: var(--ink); font: 600 16px/1.2 'Space Grotesk', sans-serif; }
.formula { padding: 14px; border-radius: 9px; color: #365282; background: #edf3ff; font-size: 13px; line-height: 1.7; }
.formula strong { color: #1e4ea6; }
.formula-note { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.month-summary { display: flex; flex-direction: column; gap: 10px; }
.month-summary .summary-line { padding-bottom: 10px; border-bottom: 1px solid #f0f2f5; }

.request-tabs { display: flex; align-items: center; gap: 6px; }
.request-tab { padding: 7px 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.request-tab.active { color: var(--ink-2); background: var(--soft); }
.request-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.request-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.request-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.request-card-type { width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.request-card-type .icon { width: 17px; height: 17px; }
.request-card h3 { margin: 0; color: var(--ink); font: 600 15px/1.2 'Space Grotesk', sans-serif; }
.request-card .meta { margin: 5px 0 13px; color: var(--muted); font-size: 12px; }
.request-card-detail { padding: 9px 10px; margin-bottom: 13px; border-radius: 8px; color: var(--muted); background: var(--soft); font-size: 12px; }
.request-card-detail strong { color: var(--ink-2); }
.request-card-actions { display: flex; gap: 7px; }
.request-card-actions .button { flex: 1; }

.reward-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; }
.reward-form { padding: 19px; border: 1px solid #efdfbf; border-radius: var(--radius); background: linear-gradient(140deg, #fffaf0, #fff); }
.reward-form h3 { margin: 0 0 5px; color: var(--ink); font: 600 17px/1.2 'Space Grotesk', sans-serif; }
.reward-form p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink-2); background: #fff; font-size: 13px; }
.field textarea { min-height: 75px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #aac4f4; box-shadow: 0 0 0 3px rgba(68,126,232,.1); }
.form-actions { margin-top: 15px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.reward-list { display: flex; flex-direction: column; }
.reward-row { padding: 12px 0; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; gap: 10px; }
.reward-row:first-child { padding-top: 0; }
.reward-row:last-child { padding-bottom: 0; border-bottom: 0; }
.reward-row-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.reward-row-copy strong { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.reward-row-copy span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reward-amount { font-size: 12px; font-weight: 700; white-space: nowrap; }
.reward-amount.plus { color: var(--teal); }
.reward-amount.minus { color: var(--red); }

.report-hero { padding: 21px; margin-bottom: 20px; border: 1px solid #d9e8e7; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(110deg, #f2fbfa, #fff); }
.report-hero-copy { display: flex; flex-direction: column; gap: 3px; }
.report-hero-copy span { color: var(--muted); font-size: 12px; }
.report-hero-copy strong { color: var(--teal); font: 700 31px/1.1 'Space Grotesk', sans-serif; letter-spacing: -.03em; }
.report-hero-copy small { margin-top: 4px; color: #0f8b7f; font-size: 11px; }
.report-hero-actions { display: flex; gap: 8px; }
.report-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 20px; }
.report-bars { height: 205px; padding: 17px 4px 0; display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; background: linear-gradient(to bottom, transparent 24%, #f2f5f8 25%, transparent 25.8%, transparent 49%, #f2f5f8 50%, transparent 50.8%, transparent 74%, #f2f5f8 75%, transparent 75.8%); }
.report-bar-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; flex: 1; }
.report-bar-col .bar-value { color: var(--muted); font-size: 10px; }
.report-bar-col .bar-fill { width: min(28px, 70%); min-height: 5px; border-radius: 5px 5px 2px 2px; background: #c6d6ee; }
.report-bar-col.active .bar-fill { background: var(--teal); }
.report-bar-col .bar-day { color: var(--muted-2); font-size: 10px; }
.report-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.report-kpi { padding: 13px; border-radius: 10px; background: var(--soft); }
.report-kpi span { color: var(--muted); font-size: 11px; }
.report-kpi strong { display: block; margin-top: 7px; color: var(--ink); font: 600 18px/1 'Space Grotesk', sans-serif; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-row { padding: 15px 0; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-row:first-child { padding-top: 0; }
.settings-row:last-child { padding-bottom: 0; border-bottom: 0; }
.settings-copy { display: flex; flex-direction: column; gap: 2px; }
.settings-copy strong { color: var(--ink-2); font-size: 13px; }
.settings-copy span { color: var(--muted); font-size: 11px; }
.switch { width: 38px; height: 22px; padding: 2px; border: 0; border-radius: 22px; background: #cad3df; transition: .18s ease; }
.switch::after { content: ''; width: 18px; height: 18px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .18s ease; }
.switch.on { background: var(--teal); }
.switch.on::after { transform: translateX(16px); }

.modal-layer { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; }
.modal-layer.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 18, 28, .56); backdrop-filter: blur(2px); }
.modal { width: min(560px, 100%); max-height: min(720px, calc(100vh - 40px)); padding: 21px; border-radius: 15px; position: relative; overflow-y: auto; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.22); animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { margin: -2px -2px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-header h2 { margin: 0; color: var(--ink); font: 600 19px/1.2 'Space Grotesk', sans-serif; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-camera { width: min(720px, 100%); }
.camera-stage { min-height: 290px; border-radius: 12px; position: relative; overflow: hidden; display: grid; place-items: center; color: #cbd4e0; background: #101925; }
.camera-stage video, .camera-stage img { width: 100%; max-height: 390px; display: none; object-fit: cover; }
.camera-stage.ready video { display: block; }
.camera-stage.captured video { display: none; }
.camera-stage.captured img { display: block; }
.camera-stage .camera-empty { padding: 35px; text-align: center; }
.camera-stage.ready .camera-empty, .camera-stage.captured .camera-empty { display: none; }
.camera-empty .icon { width: 34px; height: 34px; margin-bottom: 8px; color: #6d829c; }
.camera-empty strong { display: block; color: #dbe4ee; font-size: 14px; }
.camera-empty span { display: block; margin-top: 3px; color: #8191a5; font-size: 12px; }
.camera-actions { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.camera-actions .camera-right { display: flex; gap: 8px; }
.modal-note { padding: 10px 12px; margin-top: 13px; border-radius: 8px; color: #64748a; background: var(--soft); font-size: 11px; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 600; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
[hidden], #login-form[hidden], .login-error[hidden] { display: none !important; }
.login-error { color: #a51d2d; background: #fff0f1; padding: 12px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.toast { min-width: 260px; max-width: min(390px, calc(100vw - 40px)); padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 9px; color: var(--ink-2); background: #fff; box-shadow: 0 12px 28px rgba(29,42,58,.16); font-size: 12px; animation: toast-in .22s ease-out; }
.toast.warning { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 1180px) {
  :root { --sidebar-width: 226px; }
  .topbar { padding: 0 25px; }
  .app-content { padding-left: 25px; padding-right: 25px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .camera-layout, .reward-layout, .report-grid { grid-template-columns: 1fr; }
  .dashboard-right { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-right > .panel:last-child { grid-column: span 2; }
}
@media (max-width: 850px) {
  .sidebar { position: fixed; top: 0; left: 0; transform: translateX(-101%); transition: transform .22s ease; box-shadow: 15px 0 35px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 15; display: none; background: rgba(12,18,28,.45); }
  .mobile-overlay.open { display: block; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .topbar-context { flex: 1; }
  .topbar-context .eyebrow, .topbar-separator { display: none; }
  .topbar-date { display: none; }
  .app-content { padding: 24px 18px 35px; }
}
@media (max-width: 650px) {
  .topbar-actions { gap: 4px; }
  .search-box { width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .search-box input { display: none; }
  .page-heading { display: block; margin-bottom: 21px; }
  .page-heading h1 { font-size: 25px; }
  .heading-actions { margin-top: 15px; }
  .heading-actions .button { flex: 1; }
  .metric-grid { gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-number { font-size: 23px; }
  .dashboard-right { display: flex; }
  .dashboard-right > .panel:last-child { grid-column: auto; }
  .panel-header { padding-left: 14px; padding-right: 14px; }
  .panel-body { padding: 15px 14px; }
  .table-panel-body { padding-left: 14px; padding-right: 14px; }
  .stat-strip, .payroll-cards { grid-template-columns: repeat(2, 1fr); }
  .attendance-hero { align-items: flex-start; flex-direction: column; }
  .attendance-hero .button { width: 100%; }
  .camera-benefits { grid-template-columns: 1fr; }
  .request-cards { grid-template-columns: 1fr; }
  .form-grid, .formula-grid, .settings-grid { grid-template-columns: 1fr; }
  .report-hero { align-items: flex-start; flex-direction: column; }
  .report-hero-actions { width: 100%; }
  .report-hero-actions .button { flex: 1; }
  .view-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right { justify-content: flex-end; }
  .filter-box { flex: 1; }
  .filter-box input { width: 100%; }
}
@media (max-width: 430px) {
  .metric-grid, .stat-strip, .payroll-cards { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 11px; }
  .metric-number { font-size: 21px; }
  .metric-foot { display: block; }
  .metric-foot .trend { display: inline-flex; margin-bottom: 3px; }
  .request-tabs { max-width: 100%; overflow-x: auto; }
  .request-tab { white-space: nowrap; }
}

.login-screen { position: fixed; inset: 0; z-index: 500; padding: 24px; display: grid; place-items: center; overflow-y: auto; background: #eef2f6; }
.login-card { width: min(980px, 100%); min-height: 590px; display: grid; grid-template-columns: .9fr 1.1fr; border: 1px solid #dce3eb; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 25px 80px rgba(24,32,44,.14); }
.login-visual { padding: 42px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 80% 18%, rgba(239,170,60,.26), transparent 28%), linear-gradient(145deg, #17202d 0%, #253449 100%); }
.login-brand { display: flex; align-items: center; gap: 11px; }
.login-brand .brand-mark { color: #1b2430; }
.login-brand strong { display: block; font: 700 18px/1 'Space Grotesk', sans-serif; letter-spacing: .04em; }
.login-brand span { display: block; margin-top: 4px; color: #99a9bc; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.login-visual-copy { margin-top: auto; padding-top: 80px; }
.login-visual-copy .eyebrow { color: var(--amber); }
.login-visual-copy h2 { max-width: 330px; margin: 11px 0 12px; font: 600 31px/1.08 'Space Grotesk', sans-serif; letter-spacing: -.035em; }
.login-visual-copy p { max-width: 315px; margin: 0; color: #aebaca; font-size: 13px; line-height: 1.7; }
.login-quick-stats { padding-top: 25px; display: flex; gap: 23px; }
.login-quick-stats div { display: flex; flex-direction: column; gap: 2px; }
.login-quick-stats strong { color: #fff; font: 600 20px/1 'Space Grotesk', sans-serif; }
.login-quick-stats span { color: #8d9db0; font-size: 11px; }
.login-form-wrap { padding: 52px 58px; display: flex; flex-direction: column; justify-content: center; }
.login-form-wrap .kicker { margin: 0 0 8px; color: var(--amber); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.login-form-wrap h1 { margin: 0; color: var(--ink); font: 600 26px/1.15 'Space Grotesk', sans-serif; letter-spacing: -.025em; }
.login-form-wrap > p { margin: 9px 0 25px; color: var(--muted); font-size: 13px; }
.login-option { padding: 17px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.login-option.featured { border-color: #ead6ac; background: linear-gradient(145deg, #fffbf2, #fff); }
.login-option-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-option-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.login-option.featured .login-option-icon { color: #b77810; background: var(--amber-soft); }
.login-option-icon .icon { width: 16px; height: 16px; }
.login-option h3 { margin: 0; color: var(--ink-2); font: 600 14px/1.2 'Space Grotesk', sans-serif; }
.login-option p { margin: 0 0 12px 41px; color: var(--muted); font-size: 11px; }
.login-option .button { width: 100%; }
.login-option .field { margin-bottom: 10px; }
.login-option .field label { font-size: 11px; }
.login-option .field input { min-height: 37px; font-size: 12px; }
.login-note { padding: 11px 12px; margin-top: 9px; border-radius: 8px; color: #6b798b; background: var(--soft); font-size: 11px; line-height: 1.55; }
.login-footer { margin-top: 17px; color: var(--muted-2); font-size: 10px; text-align: center; }
@media (max-width: 760px) {
  .login-screen { padding: 14px; }
  .login-card { min-height: 0; grid-template-columns: 1fr; }
  .login-visual { min-height: 230px; padding: 26px; }
  .login-visual-copy { padding-top: 46px; }
  .login-visual-copy h2 { max-width: 100%; margin-top: 8px; font-size: 25px; }
  .login-visual-copy p { display: none; }
  .login-quick-stats { padding-top: 20px; }
  .login-form-wrap { padding: 30px 23px 25px; }
  .login-form-wrap h1 { font-size: 23px; }
}
@media print {
  .sidebar, .topbar, .heading-actions, .view-toolbar, .button, .login-screen { display: none !important; }
  .app-content { padding: 0; max-width: none; }
  .panel { box-shadow: none; }
}

.shift-chip { display: inline-flex; flex-direction: column; gap: 1px; color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.shift-chip small { color: var(--muted); font-size: 10px; font-weight: 400; }
.late-value { color: #bd7814; font-size: 12px; font-weight: 700; }
.overtime-value { color: var(--teal); font-size: 12px; font-weight: 700; }
.on-time { color: var(--teal); font-size: 12px; font-weight: 600; }
.username { color: var(--blue); font-size: 13px; font-weight: 600; }
.last-login { color: var(--muted); font-size: 12px; white-space: nowrap; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.inline-select { min-width: 152px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: #fff; font-size: 12px; }
.toolbar-hint { color: var(--muted); font-size: 11px; }
.salary-items-panel { margin-top: 20px; }
.account-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.account-stat { padding: 16px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.account-stat span { display: block; color: var(--muted); font-size: 12px; }
.account-stat strong { display: block; margin: 9px 0 4px; color: var(--ink); font: 700 24px/1 'Space Grotesk', sans-serif; }
.account-stat small { color: var(--muted); font-size: 11px; }
.account-stat.teal strong { color: var(--teal); }
.account-stat.amber strong { color: #c9881b; }
.account-stat.blue strong { color: var(--blue); }
.shift-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.shift-card { padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--shift-color, var(--teal)); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.shift-card.amber { --shift-color: var(--amber); }
.shift-card.teal { --shift-color: var(--teal); }
.shift-card.purple { --shift-color: var(--purple); }
.shift-card.blue { --shift-color: var(--blue); }
.shift-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shift-bullet { width: 10px; height: 10px; border-radius: 50%; background: var(--shift-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--shift-color) 14%, transparent); }
.shift-card h3 { margin: 14px 0 7px; color: var(--ink); font: 600 15px/1.2 'Space Grotesk', sans-serif; }
.shift-time { color: var(--ink-2); font: 600 20px/1 'Space Grotesk', sans-serif; letter-spacing: -.02em; }
.shift-time span { color: var(--muted-2); font-size: 15px; }
.shift-card p { min-height: 34px; margin: 9px 0 13px; color: var(--muted); font-size: 11px; }
.shift-card .panel-link { display: inline-flex; align-items: center; gap: 5px; }
.shift-card .panel-link .icon { width: 13px; height: 13px; }
@media (max-width: 1180px) {
  .shift-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shift-card-grid, .account-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .shift-card, .account-stat { padding: 13px; }
  .shift-time { font-size: 17px; }
  .toolbar-hint { width: 100%; }
}

.salary-cell, .role-inline, .permission-name { display: inline-flex; flex-direction: column; gap: 2px; }
.salary-cell strong, .role-inline strong, .permission-name strong { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.salary-cell small, .role-inline small, .permission-name small { color: var(--muted); font-size: 10px; }
.rules-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.rules-form-grid { margin-top: 15px; }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.4; }
.form-divider { align-items: baseline; border-top: 1px solid var(--line); display: flex; gap: 10px; grid-column: 1 / -1; justify-content: space-between; padding-top: 10px; }
.form-divider span { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.form-divider small { color: var(--muted); font-size: 10px; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { min-width: 0; flex: 1; }
.input-suffix span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.check-field { min-height: 42px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: flex-start; gap: 9px; cursor: pointer; background: #fbfcfd; }
.check-field input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--teal); }
.check-field span { display: flex; flex-direction: column; gap: 3px; }
.check-field strong { color: var(--ink-2); font-size: 12px; }
.check-field small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.toggle-check { width: 38px; height: 22px; position: relative; flex: 0 0 auto; cursor: pointer; }
.toggle-check input { position: absolute; opacity: 0; }
.toggle-check span { width: 38px; height: 22px; padding: 2px; border-radius: 22px; display: block; background: #cad3df; transition: .18s ease; }
.toggle-check span::after { content: ''; width: 18px; height: 18px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .18s ease; }
.toggle-check input:checked + span { background: var(--teal); }
.toggle-check input:checked + span::after { transform: translateX(16px); }
.rule-explain { padding: 12px 0; border-top: 1px solid #f0f2f5; display: flex; align-items: flex-start; gap: 10px; }
.rule-explain:first-of-type { margin-top: 15px; }
.rule-explain-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); }
.rule-explain-icon .icon { width: 14px; height: 14px; }
.rule-explain strong { color: var(--ink-2); font-size: 12px; }
.rule-explain p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.rules-actions { justify-content: space-between; padding: 0 2px 2px; }
.wifi-panel { margin-bottom: 20px; }
.wifi-status-card { padding: 13px 14px; margin-bottom: 17px; border: 1px solid #cce9e4; border-radius: 11px; display: flex; align-items: center; gap: 11px; background: linear-gradient(110deg, #f1fbf9, #fff); }
.wifi-status-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); }
.wifi-status-icon .icon { width: 18px; height: 18px; }
.wifi-status-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.wifi-status-card strong { color: var(--ink); font-size: 13px; }
.wifi-status-card span { color: var(--muted); font-size: 11px; }
.wifi-form-grid { margin-top: 4px; }
.network-status { padding: 5px 8px; border-radius: 7px; color: #6d7b8e; background: #eef1f5; font-size: 11px; font-weight: 600; white-space: nowrap; }
.network-status.online { color: #0f8b7f; background: var(--teal-soft); }
.network-status .status-dot { margin-right: 5px; }
.role-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.role-card { padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--role-color, var(--teal)); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.role-card.amber { --role-color: var(--amber); }
.role-card.teal { --role-color: var(--teal); }
.role-card.purple { --role-color: var(--purple); }
.role-card.blue { --role-color: var(--blue); }
.role-card-top, .role-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.role-bullet { width: 10px; height: 10px; border-radius: 50%; background: var(--role-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--role-color) 14%, transparent); }
.role-card h3 { margin: 15px 0 6px; color: var(--ink); font: 600 16px/1.2 'Space Grotesk', sans-serif; }
.role-card p { min-height: 32px; margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.role-card-foot { padding-top: 11px; border-top: 1px solid #f0f2f5; color: var(--muted); font-size: 11px; }
.role-card-foot .panel-link { display: inline-flex; align-items: center; gap: 4px; }
.role-card-foot .panel-link .icon { width: 13px; height: 13px; }
.permissions-table { min-width: 780px; }
.permissions-table td:not(:first-child), .permissions-table th:not(:first-child) { text-align: center; }
.matrix-check { width: 22px; height: 22px; margin: 0 auto; border-radius: 7px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); font-weight: 700; }
.matrix-empty { color: #c0c8d3; }
.permission-picker { padding: 14px; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.permission-picker-head { margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.permission-picker-head strong { color: var(--ink-2); font-size: 13px; }
.permission-picker-head span { color: var(--muted); font-size: 11px; }
.permission-group { padding: 11px 0; border-top: 1px solid #edf0f4; }
.permission-group:first-of-type { padding-top: 0; border-top: 0; }
.permission-group-title { display: block; margin-bottom: 7px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.permission-row { min-height: 31px; padding: 5px 7px; border-radius: 7px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.permission-row:hover { background: #f0f5f7; }
.permission-row input { width: 15px; height: 15px; accent-color: var(--teal); }
.permission-row strong { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.modal-attendance-detail { width: min(820px, 100%); }
.attendance-detail { display: grid; grid-template-columns: minmax(240px, .78fr) minmax(0, 1.22fr); gap: 18px; }
.photo-frame { min-height: 275px; border: 1px dashed #b9d2d0; border-radius: 12px; overflow: hidden; display: grid; place-items: center; color: var(--muted); background: #eef8f6; }
.photo-frame.has-photo { border-style: solid; background: #121b27; }
.photo-frame img { width: 100%; height: 100%; min-height: 275px; object-fit: cover; }
.photo-placeholder { padding: 25px; text-align: center; }
.photo-placeholder .icon { width: 31px; height: 31px; margin-bottom: 8px; color: var(--teal); }
.photo-placeholder strong { display: block; color: var(--ink-2); font-size: 13px; }
.photo-placeholder span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.attendance-detail-copy { min-width: 0; }
.detail-person { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-person .person-cell { min-width: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 15px 0; }
.detail-grid > div { min-width: 0; }
.detail-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.detail-grid strong { color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.detail-status { padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.detail-status > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-meta-grid { padding: 13px 0 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.camera-meta-grid .field { margin: 0; }
.shift-schedule { white-space: normal; line-height: 1.35; }
@media (max-width: 1180px) {
  .role-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .rules-layout, .attendance-detail { grid-template-columns: 1fr; }
  .camera-meta-grid { grid-template-columns: 1fr; }
  .role-card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .role-card { padding: 13px; }
  .wifi-status-card { align-items: flex-start; flex-wrap: wrap; }
  .wifi-status-card .button { margin-left: 46px; }
  .rules-actions { align-items: stretch; flex-direction: column; }
  .detail-grid { gap: 10px; }
}

.field-hint { display: block; margin: 6px 0 8px; color: var(--muted, #7a8494); font-size: 12px; line-height: 1.45; }
.field label .pill { margin-left: 6px; vertical-align: middle; }
.excuse-note { display: block; color: #3568c7; font-size: 11px; }
.late-days .pill { margin: 2px 2px 2px 0; }
.late-summary { margin-top: 18px; }
.week-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.schedule-table select { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; }
.schedule-table tr.is-past { opacity: .55; }
.schedule-actions { padding: 14px 18px; gap: 10px; flex-wrap: wrap; }
.schedule-note { flex: 1; min-width: 200px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.schedule-grid td.schedule-cell { min-width: 110px; vertical-align: top; }
.schedule-cell strong { display: block; font-size: 12px; margin-bottom: 4px; }
.schedule-cell small { display: block; color: #7a8494; font-size: 11px; margin-top: 3px; }
.schedule-cell.empty { color: #b5bcc7; }
.schedule-cell-actions { display: flex; gap: 4px; margin-top: 6px; }
.task-card.overdue { border-color: #f0b4a8; }
.task-proof img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-top: 10px; display: block; }
.task-note { font-size: 13px; color: #4a5260; margin: 6px 0 0; }
.task-timeline { font-size: 11px; color: #8a93a1; margin: 10px 0 0; }
.assignee-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.assignee-option { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 4px; cursor: pointer; }
.assignee-option small { display: block; color: #8a93a1; font-size: 11px; }
.task-complete { padding: 4px 0 8px; display: grid; gap: 14px; }
.task-photo-picker { display: flex; align-items: center; justify-content: center; min-height: 220px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; overflow: hidden; background: #f8f9fb; }
.task-photo-picker span { display: grid; gap: 6px; justify-items: center; color: #6b7482; }
.task-photo-picker img { width: 100%; max-height: 360px; object-fit: contain; }
.schedule-day-note { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
/* Attendance dates, monthly stats, owner-added punches, recurring task list */
.date-chip { display: inline-flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.date-chip strong { font-size: 14px; color: var(--ink); }
.date-chip small { font-size: 11px; color: var(--muted); }
.toolbar-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.toolbar-left, .toolbar-right { flex-wrap: wrap; gap: 8px; }
.month-stats, .task-templates { margin-top: 20px; }
.task-templates { margin-top: 0; margin-bottom: 20px; }
.stat-number { font-size: 16px; }
.empty-cell { text-align: center; color: var(--muted); padding: 22px 12px !important; }
.punch-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.punch-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.punch-item small { color: var(--muted); flex: 1 1 160px; }
.punch-item.manual { border-color: var(--blue); background: var(--blue-soft); }
.modal-wide { width: min(860px, 100%); }
.muted-row td { opacity: .55; }
.cell-note { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 320px; }
.row-actions { white-space: nowrap; }
.row-actions .button { margin: 2px; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.weekday-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.weekday-pick label { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.task-repeat { margin-left: 6px; }
@media (max-width: 720px) {
  .row-actions { white-space: normal; }
  .toolbar-field input { max-width: 150px; }
}
/* Daily assignment from the registered schedule */
.daily-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.daily-heading { font-size: 14px; margin: 16px 0 8px; }
.worker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.worker-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.worker-chip strong { display: block; font-size: 13px; }
.worker-chip small { color: var(--muted); font-size: 11px; }
.worker-chip.unavailable { background: var(--red-soft); border-color: #f3c4c9; }
.assign-list { display: grid; gap: 8px; }
.assign-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; align-items: start; }
.assign-title strong { display: block; }
.assign-title small { color: var(--muted); font-size: 12px; }
.assign-options { display: flex; flex-wrap: wrap; gap: 6px; }
.assign-option { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.assign-option:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.assign-option small { color: var(--muted); }
.assign-option.unavailable { opacity: .5; text-decoration: line-through; }
.assign-option.other-shift { border-style: dashed; }
.muted { color: var(--muted); }
@media (max-width: 720px) { .assign-row { grid-template-columns: 1fr; } }
.field-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.link-button { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
.empty-cell { text-align: center !important; }
td.row-actions { white-space: normal; min-width: 120px; }
td.row-actions .button { display: inline-flex; }
/* Phone notifications */
.push-panel { margin-bottom: 20px; }
.push-panel h2 { display: flex; align-items: center; gap: 8px; }
.push-panel h2 .icon { width: 18px; height: 18px; }
.push-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.push-note { margin: 0; padding: 0 20px 16px; font-size: 12px; color: var(--muted); }
.cron-box { margin-top: 12px; font-size: 13px; }
.cron-box summary { cursor: pointer; font-weight: 600; }
.cron-box p { color: var(--muted); }
.cron-url { width: 100%; font: 12px ui-monospace, monospace; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
/* Table bookings */
.booking-list { display: grid; gap: 12px; }
.booking-card { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.booking-card.is-arrived { border-color: var(--teal); background: var(--teal-soft); }
.booking-card.is-cancelled { opacity: .55; }
.booking-time strong { display: block; font-size: 22px; font-family: 'Space Grotesk', sans-serif; }
.booking-time small { color: var(--muted); font-size: 12px; }
.booking-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.booking-head h3 { margin: 0; font-size: 16px; }
.booking-meta { margin: 6px 0; font-size: 13px; color: var(--ink-2); }
.booking-meta a { color: var(--blue); font-weight: 600; text-decoration: none; }
.booking-meta .deposit { color: var(--teal); }
.booking-block { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--soft); font-size: 13px; }
.booking-block span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.booking-block p { margin: 2px 0 0; white-space: pre-line; }
.booking-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-top: 8px; }
.booking-table-form { display: flex; align-items: flex-end; gap: 6px; }
.booking-table-form label { display: grid; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); }
.booking-table-form input { width: 120px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; }
.booking-arrived { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.booking-arrived input { width: 20px; height: 20px; accent-color: var(--teal); }
.booking-foot { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.booking-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .booking-card { grid-template-columns: 1fr; gap: 6px; } .booking-time { display: flex; align-items: baseline; gap: 8px; } }
/* Booking search */
.booking-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 12px; }
.booking-search input[type=search] { flex: 1 1 260px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; }
/* Month attendance grid */
.month-grid-wrap { overflow-x: auto; }
.month-grid { border-collapse: separate; border-spacing: 0; font-size: 11px; min-width: 100%; }
.month-grid th, .month-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 3px 4px; text-align: center; vertical-align: middle; }
.month-grid thead th { background: var(--soft); position: sticky; top: 0; z-index: 1; }
.month-grid .grid-name { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; min-width: 130px; max-width: 160px; font-size: 13px; font-weight: 600; padding: 6px 10px; }
.month-grid thead .grid-name { background: var(--soft); z-index: 3; }
.month-grid .grid-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.month-grid .grid-day strong { display: block; font-size: 12px; }
.month-grid .grid-day small { color: var(--muted); font-weight: 500; }
.month-grid .grid-day.sunday { color: var(--red); }
.month-grid .grid-day.today { background: var(--amber-soft); }
.grid-cell { min-width: 44px; cursor: pointer; }
.grid-cell.empty { background: #fcfcfd; cursor: default; }
.grid-cell.leave { background: var(--blue-soft); cursor: default; }
.grid-leave { color: var(--blue); font-weight: 700; }
.grid-pair { display: block; line-height: 1.25; }
.grid-pair + .grid-pair { border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 2px; }
.grid-pair b { display: block; font-weight: 700; color: var(--ink); }
.grid-pair i { display: block; font-style: normal; color: var(--muted); }
.grid-cell.late b { color: var(--red); }
.grid-cell.missing { background: var(--amber-soft); }
.grid-cell.manual { box-shadow: inset 0 0 0 2px var(--blue); }
.grid-cell:hover { background: var(--teal-soft); }
.grid-total { min-width: 70px; font-size: 12px; }
.grid-total small { display: block; color: var(--muted); }
/* Owner-set shifts, request evidence */
.schedule-cell { position: relative; }
.schedule-edit { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.schedule-edit .icon { width: 13px; height: 13px; }
.schedule-edit:hover { background: var(--soft); color: var(--ink); }
.schedule-cell .custom-hours { color: var(--blue); font-weight: 600; }
.task-photo-picker.small { min-height: 90px; }

/* v14: several photos, task dates, profiles, chat, reject reasons */
.task-date-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.task-description { white-space: pre-line; color: var(--ink-2); }
.gallery-label { margin: 10px 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.photo-gallery a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--soft); }
.photo-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-picker { display: grid; gap: 8px; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-strip:empty { display: none; }
.photo-thumb { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.photo-picker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.photo-picker-actions small { color: var(--muted); font-size: 11px; }
.photo-picker-actions label.button { cursor: pointer; }
.decision-note { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--red-soft); color: #9b2f3a; font-size: 12px; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reason-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.reason-chip:hover { border-color: var(--teal); color: var(--teal); }
.form-section { margin: 16px 0 6px; font-size: 13px; color: var(--ink-2); }
.ok-note { background: var(--teal-soft); color: #0f7a6f; }
.profile-reminder { border-left: 4px solid #f0b54a; }
.phone-link { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.chat-panel { overflow: hidden; }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; height: calc(100vh - 230px); min-height: 440px; }
.chat-rooms { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.chat-room { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.chat-room:hover { background: var(--soft); }
.chat-room.active { background: var(--teal-soft); }
.chat-room .avatar { flex: none; width: 34px; height: 34px; font-size: 12px; }
.chat-room-name { flex: 1; min-width: 0; }
.chat-room-name strong, .chat-room-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room-name small { color: var(--muted); font-size: 11px; }
.chat-room .nav-badge { min-width: 22px; padding: 2px 6px; border-radius: 20px; color: #422f0d; background: var(--amber); font-weight: 700; font-style: normal; font-size: 11px; text-align: center; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-head strong, .chat-head small { display: block; }
.chat-head small { color: var(--muted); font-size: 11px; }
.chat-back { display: none; font-size: 22px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: #f7f9fb; }
.chat-day { align-self: center; margin: 8px 0 2px; padding: 2px 10px; border-radius: 999px; background: #e9eef3; color: var(--muted); font-size: 11px; }
.chat-msg { max-width: 78%; align-self: flex-start; display: flex; flex-direction: column; gap: 2px; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-from { color: var(--muted); font-size: 11px; padding-left: 4px; }
.chat-bubble { padding: 8px 11px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-bubble p { margin: 0; }
.chat-bubble .photo-gallery { margin-top: 4px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); min-width: 180px; }
.chat-msg.mine .chat-bubble { background: var(--teal); border-color: var(--teal); color: #fff; }
.chat-msg.mine .chat-bubble a { color: #fff; }
.chat-time { color: var(--muted-2); font-size: 10px; padding: 0 4px; }
.chat-older { align-self: center; }
.chat-compose { border-top: 1px solid var(--line); padding: 8px 10px; background: #fff; display: grid; gap: 6px; }
.chat-input-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-input-row label.icon-button { cursor: pointer; flex: none; }
.chat-input-row textarea { flex: 1; resize: none; min-height: 38px; max-height: 140px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 15px; }
@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 190px); height: calc(100dvh - 190px); }
  .chat-layout.in-room .chat-rooms { display: none; }
  .chat-layout:not(.in-room) .chat-main { display: none; }
  .chat-rooms { border-right: 0; }
  .chat-back { display: inline-flex; }
  .chat-msg { max-width: 88%; }
  .task-date-bar { width: 100%; }
}

/* v15: task groups, review board, request filters, chat groups */
.pill-review { background: #fff3dc; color: #8a5a00; }
.group-pill { font-weight: 700; }
.grp-kitchen.group-pill, .group-chip.grp-kitchen.active { background: #fde8e1; color: #a2401f; }
.grp-media.group-pill, .group-chip.grp-media.active { background: #ece7fd; color: #5b3fc4; }
.grp-service.group-pill, .group-chip.grp-service.active { background: #e2f6f3; color: #0f7a6f; }
.grp-manage.group-pill, .group-chip.grp-manage.active { background: #e6eefc; color: #2d5bb8; }
.request-card-top { gap: 6px; }
.request-card-top .group-pill { margin-left: auto; }
.sub-toolbar { border-top: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.group-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.group-chip span { margin-left: 4px; color: var(--muted); font-weight: 500; }
.group-chip.active { border-color: transparent; background: var(--ink); color: #fff; }
.group-chip.active span { color: inherit; opacity: .75; }
.task-card.needs-review { border-color: #f0c66b; box-shadow: 0 0 0 2px #fff3dc; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 18px; padding: 8px 12px; border-radius: 10px; background: #fff8e8; font-size: 13px; color: #8a5a00; }
.request-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chat-rooms { display: flex; flex-direction: column; gap: 6px; }
.chat-rooms-tools { display: grid; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.chat-rooms-tools .filter-box { width: 100%; }
.chat-rooms-tools .filter-box input { width: 100%; }
#chat-rooms { overflow-y: auto; flex: 1; }
.chat-section { margin: 10px 8px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chat-hint { margin: 10px 8px; font-size: 12px; color: var(--muted-2); }
.chat-system { align-self: center; max-width: 90%; text-align: center; font-size: 12px; color: var(--muted); padding: 2px 10px; }
.chat-head-title { flex: 1; min-width: 0; }
.chat-head-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-list { max-height: 280px; overflow-y: auto; margin-top: 6px; }
.member-list .assignee-option[hidden] { display: none; }
.chat-layout .chat-rooms { overflow: hidden; }
@media (max-width: 760px) {
  .sub-toolbar { flex-direction: column; align-items: stretch; }
  .bulk-bar { margin: 0 12px; }
}

/* v16: mobile checkboxes, red unread counts, daily list cards */
.field .assignee-option input, .field .weekday-pick input, .check-line input, .field input[type="checkbox"], .field input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; margin: 2px 0 0; accent-color: var(--teal); }
.field .filter-box input { border: 0; min-height: 0; padding: 0; box-shadow: none; background: transparent; }
.assignee-option span { flex: 1; min-width: 0; color: var(--ink-2); }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400; cursor: pointer; }
.check-line span { color: var(--muted); }
.check-line strong { color: var(--ink-2); }
.unread-badge, #chat-badge { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: #e5484d !important; color: #fff !important; font-style: normal; font-weight: 700; font-size: 11px; text-align: center; line-height: 1.3; }
.chat-room.unread strong { font-weight: 800; color: var(--ink); }
.chat-room.unread small { color: var(--ink-2); font-weight: 600; }
.menu-toggle { position: relative; }
.menu-toggle.has-unread::after { content: attr(data-unread); position: absolute; top: 1px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.board-modes { margin-bottom: 14px; }
.board-modes .segment { font-size: 13px; padding: 8px 14px; }
.board-modes .segment.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tpl-card.paused { opacity: .6; }
@media (max-width: 760px) {
  .field input, .field select, .field textarea, .chat-input-row textarea, #chat-search { font-size: 16px; }
  .assignee-list { grid-template-columns: 1fr; max-height: 46vh; }
  .assignee-option { padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .board-modes { display: flex; }
  .board-modes .segment { flex: 1; }
  .modal .form-actions { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .task-templates .panel-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .task-templates .panel-header .button { white-space: nowrap; }
  .task-templates .panel-header > :last-child { display: flex; gap: 8px; flex-wrap: wrap; }
  .page-heading .button { white-space: nowrap; }
}

/* v17: bulk approve, task stats, bell inbox, quick chat */
.notification-button > span { display: none; }
.topbar-chat, .notification-button { position: relative; }
.topbar-badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; font-style: normal; line-height: 17px; text-align: center; }
.topbar-badge[hidden] { display: none; }
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 360px; max-height: 70vh; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(16,24,40,.18); z-index: 60; overflow: hidden; }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; }
.notif-item { width: 100%; display: grid; gap: 2px; text-align: left; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: var(--ink-2); }
.notif-item:hover { background: var(--soft); }
.notif-item strong { font-size: 13px; color: var(--ink); }
.notif-item span { font-size: 12px; color: var(--muted); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item small { font-size: 11px; color: var(--muted-2); }
.notif-item.unread { background: #fff7f7; box-shadow: inset 3px 0 0 #e5484d; }
.pick-box { display: inline-flex; align-items: center; margin-right: 4px; }
.pick-box input { width: 20px; height: 20px; accent-color: var(--teal); }
.request-card.picked { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.request-bulk { margin: 10px 18px 0; background: var(--teal-soft); color: #0f7a6f; }
.request-bulk .check-line span { color: #0f7a6f; font-weight: 600; }
.stats-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 0 18px 18px; }
.stat-tile { padding: 10px 12px; border-radius: 10px; background: var(--soft); display: grid; gap: 4px; }
.stat-tile span { font-size: 11px; color: var(--muted); }
.stat-tile strong { font-size: 20px; color: var(--ink); }
.stat-tile.good strong { color: #0f7a6f; }
.stat-tile.mid strong { color: #b07400; }
.stat-tile.low strong { color: #c4323a; }
.stat-tile.rate { grid-column: span 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stat-tile.rate span:first-child { width: 100%; }
.rate-bar { display: inline-block; width: 110px; height: 8px; border-radius: 99px; background: #e8edf2; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.rate-bar > span { display: block; height: 100%; border-radius: 99px; }
.rate-bar .good { background: #16a697; } .rate-bar .mid { background: #f0b54a; } .rate-bar .low { background: #e5484d; }
.rate-cell { white-space: nowrap; }
.my-stats .panel-header { flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) {
  .notif-panel { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; }
  .topbar-actions { gap: 4px; }
  .stat-tile.rate { grid-column: 1 / -1; }
  .stat-tiles { grid-template-columns: repeat(3, 1fr); padding: 0 12px 14px; }
  .request-bulk { margin: 10px 12px 0; flex-wrap: wrap; }
}

/* v18: payments, schedule lock, departments */
.pay-amount { margin: 2px 0 6px; font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.pay-card.pay-approved { border-color: #f0c66b; }
.pay-card.pay-paid { opacity: .92; }
.pay-card .request-card-top { gap: 6px; }
.pay-card .request-card-top .pill:first-of-type { margin-left: auto; }
.paid-note { margin: 4px 0; padding: 8px 10px; border-radius: 8px; background: var(--teal-soft); color: #0f7a6f; font-size: 12px; }
.link-button { border: 0; background: none; padding: 0 2px; color: #2d6fd6; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.lock-note { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.schedule-change { margin-top: 4px; }
.schedule-table select:disabled { background: var(--soft); color: var(--ink-2); opacity: 1; }

/* v19: payroll explanation, daily assign by department, mobile overflow fixes */
html, body { max-width: 100%; overflow-x: hidden; }
.main-shell, .app-content { min-width: 0; max-width: 100%; }
.pay-line { padding: 2px 0; border-bottom: 1px dashed var(--line); }
.pay-line .summary-line { border: 0; }
.pay-how { display: block; margin: -2px 0 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.formula-line { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--soft); }
.pay-notes { margin: 4px 0 0; padding-left: 18px; color: #8a5a00; font-size: 13px; }
.pay-notes li { margin: 3px 0; }
.pay-days td { font-size: 12px; white-space: nowrap; }
.pay-days tr.weekend td:first-child { color: #c4323a; }
.net-link { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.daily-dept { display: grid; gap: 6px; margin: 10px 0 4px; }
@media (max-width: 760px) {
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .heading-actions .button { width: 100%; min-width: 0; white-space: normal; justify-content: center; text-align: center; line-height: 1.25; padding-left: 8px; padding-right: 8px; }
  .heading-actions .button-primary:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .page-heading h1 { overflow-wrap: anywhere; }
  .panel-header { flex-wrap: wrap; gap: 10px; }
  .panel-header > .button, .panel-header > .button-small { white-space: nowrap; }
  .profile-reminder .panel-header { flex-direction: column; align-items: stretch; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .summary-line { gap: 10px; }
  .summary-line strong { text-align: right; overflow-wrap: anywhere; }
  .topbar { max-width: 100vw; }
}
@media (max-width: 760px) {
  .request-tabs { flex-wrap: wrap; overflow: visible; }
  .request-tab { flex: 0 0 auto; }
}
.pay-lines .summary-line strong { white-space: nowrap; }

/* v20: missed daily tasks, priority people */
.pill-missed { background: #fdecee; color: #b4232f; }
.pref-star { color: #e09b00; font-weight: 700; }
.pref-list { max-height: 200px; }
