/* ==========================================================================
   Krio Workforce OS — dashboard, KPIs, live workforce, timelines, galleries
   ========================================================================== */

/* ---------- page header ---------- */
.page-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px }
.page-head .ph-left h2{ font-size:20px; margin:0 }
.page-head .ph-left p{ margin:4px 0 0; font-size:12.5px; color:var(--muted) }
.page-head .ph-right{ display:flex; align-items:center; gap:8px; flex-wrap:wrap }
.live-stamp{ display:inline-flex; align-items:center; gap:7px; font-size:11.5px; color:var(--muted); font-family:var(--mono) }

/* ---------- KPI grid ---------- */
.kpi-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px }
.kpi-grid.cols-8{ grid-template-columns:repeat(4,minmax(0,1fr)) }
.kpi-grid.cols-5{ grid-template-columns:repeat(5,minmax(0,1fr)) }
.kpi-grid.cols-6{ grid-template-columns:repeat(6,minmax(0,1fr)) }
.kpi-grid.cols-7{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px; max-width:100% }
.kpi-grid.cols-7 .kpi{ padding:10px 13px; border-radius:12px; }
.kpi-grid.cols-7 .kpi-top{ margin-bottom:3px; }
.kpi-grid.cols-7 .kpi-ic{ width:22px; height:22px; font-size:12px; border-radius:6px; }
.kpi-grid.cols-7 .kpi-label{ font-size:11px; font-weight:600; }
.kpi-grid.cols-7 .kpi-value{ font-size:19px; font-weight:700; line-height:1.1; }
.kpi-grid.cols-3{ grid-template-columns:repeat(3,minmax(0,1fr)) }

.kpi{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:14px 15px; position:relative; overflow:hidden; box-shadow:var(--shadow-1);
  transition:border-color .15s, transform .15s;
}
.kpi:hover{ border-color:var(--line-strong) }
a.kpi:hover{ transform:translateY(-1px) }
.kpi-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px }
.kpi-label{ font-size:11.5px; color:var(--muted); font-weight:550; letter-spacing:.01em }
.kpi-ic{ width:28px; height:28px; border-radius:9px; display:grid; place-items:center; font-size:14px; flex:none }
.kpi-value{ font-family:var(--mono); font-size:26px; font-weight:600; line-height:1.05; letter-spacing:-.03em; color:var(--ink) }
.kpi-value small{ font-size:14px; color:var(--muted); font-weight:500 }
.kpi-sub{ margin-top:7px; font-size:11.5px; color:var(--muted); display:flex; align-items:center; gap:6px }
.kpi-trend{ font-weight:650; display:inline-flex; align-items:center; gap:3px }
.kpi-trend.up{ color:var(--ok) } .kpi-trend.down{ color:var(--danger) }
.kpi .spark{ position:absolute; right:0; bottom:0; width:88px; height:34px; opacity:.5; pointer-events:none }

.tone-brand{ background:var(--brand-soft); color:var(--brand) }
.tone-ok{ background:var(--ok-soft); color:var(--ok) }
.tone-warn{ background:var(--warn-soft); color:var(--warn) }
.tone-danger{ background:var(--danger-soft); color:var(--danger) }
.tone-info{ background:var(--info-soft); color:var(--info) }
.tone-idle{ background:var(--idle-soft); color:var(--idle) }
.tone-mute{ background:var(--surface-3); color:var(--muted) }
html[data-theme="dark"] .tone-brand{ color:#B9A6FF }

/* ---------- generic layout grids ---------- */
.grid-2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px }
.grid-3{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px }
.grid-8-4{ display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:16px }
.grid-7-5{ display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:16px }
.mt-gap{ margin-top:16px }

.chart-box{ position:relative; height:290px }
.chart-box.sm{ height:210px }
.chart-box.md{ height:320px }
.chart-box.lg{ height:340px }

/* ---------- live workforce ---------- */
.live-list{ display:flex; flex-direction:column }
.live-row{
  display:grid; grid-template-columns:minmax(190px,1.6fr) 110px 1fr 130px 96px;
  gap:12px; align-items:center; padding:11px 18px; border-bottom:1px solid var(--line); cursor:pointer;
}
.live-row:last-child{ border-bottom:0 }
.live-row:hover{ background:var(--surface-2) }
.live-emp{ display:flex; align-items:center; gap:10px; min-width:0 }
.live-emp strong{ font-size:13px; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.live-emp small{ font-size:11px; color:var(--muted); display:block }
.live-app{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--ink-2); min-width:0 }
.live-app span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.live-times{ font-family:var(--mono); font-size:11.5px; color:var(--muted); white-space:nowrap }
.live-times b{ color:var(--ink); font-weight:600 }

/* ---------- Live Workforce Cards V2 ---------- */
.live-cards{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1700px) { .live-cards{ grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1360px) { .live-cards{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 992px)  { .live-cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px)  { .live-cards{ grid-template-columns: 1fr; } }

.live-card-v2{
  background:var(--surface); border:1px solid var(--line); border-radius:18px; overflow:hidden;
  box-shadow:0 4px 18px rgba(0,0,0,0.04); padding:14px 12px; display:flex; flex-direction:column; position:relative;
  cursor:pointer; transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.live-card-v2:hover{ transform:translateY(-3px); box-shadow:0 10px 24px rgba(0,0,0,0.08); border-color:var(--line-strong) }

/* Header & Status Gradients */
.lc2-header{
  display:flex; align-items:center; gap:9px; position:relative;
  margin:-14px -12px 0 -12px; padding:14px 12px 10px 12px;
  border-top-left-radius:18px; border-top-right-radius:18px;
}
.lc2-header.st-active{ background:linear-gradient(135deg, var(--surface) 50%, rgba(16,185,129,0.14) 100%) }
.lc2-header.st-idle{ background:linear-gradient(135deg, var(--surface) 50%, rgba(245,158,11,0.18) 100%) }
.lc2-header.st-break, .lc2-header.st-lunch{ background:linear-gradient(135deg, var(--surface) 50%, rgba(59,130,246,0.14) 100%) }
.lc2-header.st-offline, .lc2-header.st-absent{ background:linear-gradient(135deg, var(--surface) 50%, rgba(148,163,184,0.12) 100%) }

/* Avatar Ring & Dot */
.lc2-avatar-wrap{ position:relative; flex:none }
.lc2-ring{
  width:42px; height:42px; border-radius:50%; padding:2px; display:flex; align-items:center; justify-content:center; position:relative;
}
.st-active .lc2-ring{ border:2px solid #10B981 }
.st-idle .lc2-ring{ border:2px solid #F59E0B }
.st-break .lc2-ring, .st-lunch .lc2-ring{ border:2px solid #3B82F6 }
.st-offline .lc2-ring, .st-absent .lc2-ring{ border:2px solid #94A3B8 }

.lc2-avatar-initial{
  width:100%; height:100%; border-radius:50%; display:grid; place-items:center;
  font-weight:700; font-size:15.5px; color:#ffffff;
}
.st-active .lc2-avatar-initial{ background:#10B981 }
.st-idle .lc2-avatar-initial{ background:#F59E0B }
.st-break .lc2-avatar-initial, .st-lunch .lc2-avatar-initial{ background:#3B82F6 }
.st-offline .lc2-avatar-initial, .st-absent .lc2-avatar-initial{ background:#94A3B8 }

.lc2-status-dot{
  position:absolute; right:0; bottom:0; width:10px; height:10px; border-radius:50%; border:2px solid var(--surface);
}
.st-active .lc2-status-dot{ background:#10B981 }
.st-idle .lc2-status-dot{ background:#F59E0B }
.st-break .lc2-status-dot, .st-lunch .lc2-status-dot{ background:#3B82F6 }
.st-offline .lc2-status-dot, .st-absent .lc2-status-dot{ background:#94A3B8 }

/* User Info */
.lc2-user-info{ display:flex; flex-direction:column; gap:1px; min-width:0; flex:1 }
.lc2-name{ font-size:14.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.lc2-sub-row{ display:flex; align-items:center; gap:6px }
.lc2-dept{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.lc2-agent-pill{
  display:inline-flex; align-items:center; gap:4px; background:#E6F7ED; color:#059669;
  font-size:10px; font-weight:600; padding:1px 5px; border-radius:5px; flex:none;
}
html[data-theme="dark"] .lc2-agent-pill{ background:rgba(16,185,129,0.2); color:#34D399 }
.lc2-green-dot{ width:4px; height:4px; border-radius:50%; background:#10B981 }

/* Top Right Status Badge */
.lc2-status-badge{
  margin-left:auto; display:inline-flex; align-items:center; gap:5px;
  padding:4px 9px; border-radius:18px; font-size:11px; font-weight:600; white-space:nowrap; flex:none;
}
.lc2-status-badge.st-active{ background:#DCFCE7; color:#15803D }
.lc2-status-badge.st-idle{ background:#FEF3C7; color:#D97706 }
.lc2-status-badge.st-break, .lc2-status-badge.st-lunch{ background:#DBEAFE; color:#1E40AF }
.lc2-status-badge.st-offline, .lc2-status-badge.st-absent{ background:#F1F5F9; color:#64748B }

html[data-theme="dark"] .lc2-status-badge.st-active{ background:rgba(21,128,61,0.3); color:#4ADE80 }
html[data-theme="dark"] .lc2-status-badge.st-idle{ background:rgba(217,119,6,0.3); color:#FBBF24 }
html[data-theme="dark"] .lc2-status-badge.st-break, html[data-theme="dark"] .lc2-status-badge.st-lunch{ background:rgba(30,64,175,0.3); color:#60A5FA }
html[data-theme="dark"] .lc2-status-badge.st-offline, html[data-theme="dark"] .lc2-status-badge.st-absent{ background:rgba(100,116,139,0.3); color:#94A3B8 }

.lc2-badge-dot{ width:5px; height:5px; border-radius:50%; background:currentColor }

/* Shift Completion Box */
.lc2-shift-box{
  background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  padding:10px 11px; margin-top:10px; display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.lc2-shift-left{ display:flex; flex-direction:column }
.lc2-shift-title{ font-size:9.5px; font-weight:700; letter-spacing:0.06em; color:var(--muted-2); text-transform:uppercase }

/* Shift percent & progress bar colors derived from status */
.lc2-shift-percent{ font-size:22px; font-weight:800; line-height:1.1; margin-top:1px }
.st-active .lc2-shift-percent{ color:#10B981 }
.st-idle .lc2-shift-percent{ color:#F59E0B }
.st-break .lc2-shift-percent, .st-lunch .lc2-shift-percent{ color:#3B82F6 }
.st-offline .lc2-shift-percent, .st-absent .lc2-shift-percent{ color:#94A3B8 }

.lc2-shift-right{ flex:1; display:flex; flex-direction:column; gap:5px; min-width:0 }
.lc2-progress-track{ width:100%; height:7px; background:var(--line-strong); border-radius:99px; overflow:hidden }
.lc2-progress-fill{ height:100%; border-radius:99px; transition:width 0.3s ease }
.st-active .lc2-progress-fill{ background:#10B981 }
.st-idle .lc2-progress-fill{ background:#F59E0B }
.st-break .lc2-progress-fill, .st-lunch .lc2-progress-fill{ background:#3B82F6 }
.st-offline .lc2-progress-fill, .st-absent .lc2-progress-fill{ background:#94A3B8 }

.lc2-shift-meta{ font-size:10.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }

/* 6 Metric Grid (2 cols x 3 rows) */
.lc2-metrics-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px }
.lc2-m-box{
  background:var(--surface-2); border:1px solid var(--line); border-radius:10px;
  padding:7px 9px; display:flex; flex-direction:column; gap:2px; min-width:0;
}
.lc2-m-head{ font-size:10.5px; font-weight:500; color:var(--muted); display:flex; align-items:center; gap:5px }
.lc2-m-head .lc2-dot{ width:6px; height:6px; border-radius:50%; flex:none }
.lc2-m-head .lc2-dot.purple{ background:#6366F1 }
.lc2-m-head .lc2-dot.green{ background:#10B981 }
.lc2-m-head .lc2-dot.blue{ background:#3B82F6 }
.lc2-m-head .lc2-dot.orange{ background:#F59E0B }
.lc2-m-head .lc2-dot.purple-soft{ background:#8B5CF6 }
.lc2-m-head .lc2-dot.teal{ background:#0EA5E9 }

.lc2-m-val{ font-family:var(--mono); font-size:13px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.lc2-m-val small{ font-weight:500; font-size:11px }
.lc2-m-val.green{ color:#10B981 }
.lc2-m-val.blue{ color:#3B82F6 }
.lc2-m-val.orange{ color:#D97706 }
.lc2-m-val.danger{ color:#EF4444 }
.lc2-m-val .sep{ color:var(--muted-2); margin:0 1px; font-weight:400 }

/* Footer Row */
.lc2-foot-row{
  display:flex; justify-content:space-between; align-items:center;
  margin-top:10px; padding-top:8px; border-top:1px solid var(--line);
  font-size:10.5px; color:var(--muted);
}
.lc2-foot-row strong{ color:var(--ink); font-weight:700 }
.lc2-foot-row strong.blue{ color:#3B82F6 }
.lc2-foot-row strong.danger{ color:#EF4444 }

/* ---------- timeline ---------- */
.timeline{ position:relative; padding-left:26px }
.timeline::before{ content:""; position:absolute; left:8px; top:6px; bottom:6px; width:2px; background:var(--line) }
.tl-item{ position:relative; padding:0 0 18px }
.tl-item:last-child{ padding-bottom:0 }
.tl-dot{
  position:absolute; left:-24px; top:3px; width:11px; height:11px; border-radius:50%;
  background:var(--brand); border:2px solid var(--surface); box-shadow:0 0 0 2px var(--line);
}
.tl-dot.ok{ background:var(--ok) } .tl-dot.idle{ background:var(--idle) }
.tl-dot.warn{ background:var(--warn) } .tl-dot.info{ background:var(--info) }
.tl-dot.mute{ background:var(--muted-2) }
.tl-time{ font-family:var(--mono); font-size:11px; color:var(--muted) }
.tl-title{ font-size:12.8px; font-weight:600; margin:1px 0 1px }
.tl-desc{ font-size:11.5px; color:var(--muted) }

/* session strip */
.session-strip{ display:flex; height:30px; border-radius:8px; overflow:hidden; border:1px solid var(--line) }
.session-strip > i{ display:block; height:100%; position:relative }
.seg-active{ background:var(--ok) } .seg-idle{ background:var(--idle) }
.seg-break{ background:var(--warn) } .seg-lunch{ background:var(--info) }
.strip-legend{ display:flex; gap:14px; flex-wrap:wrap; margin-top:10px; font-size:11.5px; color:var(--muted) }
.strip-legend i{ width:9px; height:9px; border-radius:3px; display:inline-block; margin-right:5px }

/* ---------- screenshots ---------- */
.shot-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(232px,1fr)); gap:14px }
.shot-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
  cursor:pointer; transition:.15s; box-shadow:var(--shadow-1);
}
.shot-card:hover{ border-color:var(--brand); box-shadow:var(--shadow-2); transform:translateY(-2px) }
.shot-thumb{ position:relative; background:var(--surface-3) }
.shot-thumb img{ width:100%; aspect-ratio:16/10; object-fit:cover; display:block }
.shot-thumb .shot-state{ position:absolute; top:8px; right:8px }
.shot-meta{ padding:10px 12px }
.shot-meta strong{ font-size:12.5px; display:block }
.shot-meta small{ font-size:11px; color:var(--muted); display:flex; align-items:center; gap:6px; margin-top:3px }
.shot-modal-img{ width:100%; border-radius:10px; border:1px solid var(--line); display:block }

/* ---------- employee profile ---------- */
.profile-head{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:20px; display:flex; gap:18px; flex-wrap:wrap; align-items:flex-start; box-shadow:var(--shadow-1);
}
.profile-id{ flex:1 1 280px; min-width:0 }
.profile-id h2{ font-size:19px; margin:0 0 3px }
.profile-id .p-sub{ font-size:12.5px; color:var(--muted) }
.profile-tags{ display:flex; gap:7px; flex-wrap:wrap; margin-top:11px }
.profile-actions{ display:flex; gap:8px; flex-wrap:wrap; align-items:flex-start }
.profile-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; margin-top:16px }
.pstat{ background:var(--surface); padding:12px 14px }
.pstat small{ display:block; font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted-2) }
.pstat b{ font-family:var(--mono); font-size:17px; font-weight:600 }

/* ---------- department / matrix ---------- */
.dept-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px }
.dept-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:16px; box-shadow:var(--shadow-1) }
.dept-card h4{ font-size:14px; margin:0 0 2px }
.dept-card .dc-sub{ font-size:11.5px; color:var(--muted); margin-bottom:14px }
.dc-row{ display:flex; justify-content:space-between; font-size:12px; margin-bottom:7px }
.dc-row span{ color:var(--muted) }
.dc-row b{ font-family:var(--mono); font-weight:600 }

/* ---------- task board ---------- */
.board{ display:grid; grid-auto-flow:column; grid-auto-columns:minmax(280px,320px); gap:14px; overflow-x:auto; padding:2px 2px 12px; scroll-snap-type:x proximity; max-width:100%; width:100%; min-width:0 }
.board-col{ background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-lg); display:flex; flex-direction:column; min-height:240px; scroll-snap-align:start }
.board-col-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:1; background:var(--surface-2); border-radius:var(--r-lg) var(--r-lg) 0 0 }
.board-col-head strong{ font-size:12.5px }
.board-col-body{ padding:10px; display:grid; gap:10px; align-content:start; max-height:640px; overflow:auto }
.task-card{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,0.03); transition:all .2s cubic-bezier(0.16,1,0.3,1) }
.task-card:hover,.task-card:focus-visible{ border-color:rgba(76,42,250,0.4); box-shadow:0 10px 28px rgba(76,42,250,0.12); transform:translateY(-3px); outline:0 }
.task-card .tc-id{ font-family:var(--mono); font-size:10.5px; color:var(--muted-2) }
.task-card h5{ font-size:12.8px; margin:4px 0 8px; line-height:1.35 }
.task-card .tc-meta{ display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:11px; margin:-2px 0 8px }
.task-card .tc-meta span:first-child{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.task-card .tc-foot{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px }
.task-card .tc-actions{ display:flex; gap:8px; margin-top:10px }
.task-card .tc-actions .btn{ flex:1 1 0; padding-left:8px; padding-right:8px }
.prio{ font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase }
.prio.high{ color:var(--danger) } .prio.medium{ color:var(--warn) } .prio.low{ color:var(--muted) }

/* ---------- policy cards ---------- */
.policy-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:15px 16px;
  display:flex; gap:13px; align-items:flex-start; box-shadow:var(--shadow-1);
}
.policy-card .pc-body{ flex:1; min-width:0 }
.policy-card h4{ font-size:13.5px; margin:0 0 3px }
.policy-card p{ font-size:11.5px; color:var(--muted); margin:0 }
.notice{
  border:1px solid var(--brand-soft-2); background:var(--brand-soft); border-radius:var(--r);
  padding:14px 16px; display:flex; gap:12px; align-items:flex-start;
}
.notice i{ color:var(--brand); font-size:17px; flex:none }
.notice h4{ font-size:13px; margin:0 0 4px }
.notice p{ font-size:12px; margin:0; color:var(--ink-2) }
html[data-theme="dark"] .notice i{ color:#B9A6FF }

/* report cards */
.report-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px }
.report-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:16px; box-shadow:var(--shadow-1); display:flex; flex-direction:column }
.report-card .rc-ic{ width:36px; height:36px; border-radius:11px; display:grid; place-items:center; font-size:16px; margin-bottom:12px }
.report-card h4{ font-size:13.5px; margin:0 0 4px }
.report-card p{ font-size:11.5px; color:var(--muted); flex:1; margin-bottom:14px }
.report-card .rc-actions{ display:flex; gap:6px; flex-wrap:wrap }

/* scoring weights */
.weight-row{ display:grid; grid-template-columns:190px 1fr 66px; gap:14px; align-items:center; margin-bottom:14px }
.weight-row input[type=range]{ accent-color:var(--brand); width:100% }
.score-ring{ display:grid; place-items:center; text-align:center }
.score-ring .ring-val{ font-family:var(--mono); font-size:32px; font-weight:700; letter-spacing:-.04em }

/* calendar */
.cal{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px }
.cal-dow{ font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--muted-2); text-align:center; font-weight:700; padding-bottom:4px }
.cal-day{
  aspect-ratio:1; border:1px solid var(--line); border-radius:9px; background:var(--surface-2);
  padding:6px; display:flex; flex-direction:column; justify-content:space-between; font-size:11px; cursor:default;
}
.cal-day .cd-n{ font-family:var(--mono); color:var(--muted); font-size:11px }
.cal-day.pres{ background:var(--ok-soft); border-color:color-mix(in srgb,var(--ok) 24%,transparent) }
.cal-day.late{ background:var(--warn-soft); border-color:color-mix(in srgb,var(--warn) 24%,transparent) }
.cal-day.abs{ background:var(--danger-soft); border-color:color-mix(in srgb,var(--danger) 24%,transparent) }
.cal-day.wfh{ background:var(--info-soft); border-color:color-mix(in srgb,var(--info) 24%,transparent) }
.cal-day.off{ opacity:.42 }
.cal-day .cd-tag{ font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em }

/* matrix */
.matrix-cell{ text-align:center }
.matrix-cell .form-check{ display:flex; justify-content:center; margin:0 }

/* ---------- Attendance UI/UX V2 ---------- */
.att-kpi-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px }
@media (max-width:992px){ .att-kpi-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:576px){ .att-kpi-grid{ grid-template-columns:1fr; } }

.att-kpi-card{
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  padding:14px 16px; display:flex; align-items:center; gap:14px;
  box-shadow:0 2px 10px rgba(0,0,0,0.02); transition:transform .2s ease, box-shadow .2s ease;
}
.att-kpi-card:hover{ transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.06); border-color:var(--line-strong) }
.att-kpi-icon{
  width:42px; height:42px; border-radius:12px; display:grid; place-items:center;
  font-size:20px; flex:none;
}
.att-kpi-icon.green{ background:#DCFCE7; color:#16A34A }
.att-kpi-icon.amber{ background:#FEF3C7; color:#D97706 }
.att-kpi-icon.blue{ background:#DBEAFE; color:#2563EB }
.att-kpi-icon.rose{ background:#FEE2E2; color:#DC2626 }

html[data-theme="dark"] .att-kpi-icon.green{ background:rgba(22,163,74,0.2); color:#4ADE80 }
html[data-theme="dark"] .att-kpi-icon.amber{ background:rgba(217,119,6,0.2); color:#FBBF24 }
html[data-theme="dark"] .att-kpi-icon.blue{ background:rgba(37,99,235,0.2); color:#60A5FA }
html[data-theme="dark"] .att-kpi-icon.rose{ background:rgba(220,38,38,0.2); color:#F87171 }

.att-kpi-info{ display:flex; flex-direction:column; min-width:0 }
.att-kpi-label{ font-size:11px; font-weight:700; color:var(--muted-2); text-transform:uppercase; letter-spacing:0.06em }
.att-kpi-val{ font-family:var(--mono); font-size:22px; font-weight:800; color:var(--ink); line-height:1.2 }
.att-kpi-sub{ font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }

.cal-container{ display:flex; flex-direction:column; gap:12px }
.cal-head-bar{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px }
.cal-title-wrap{ display:flex; align-items:center; gap:8px }
.cal-title-wrap h3{ margin:0; font-size:15px; font-weight:700 }
.cal-nav-btn{
  width:36px; height:36px; border-radius:10px; border:1px solid var(--line);
  background:var(--surface); display:grid; place-items:center; color:var(--ink);
  cursor:pointer; transition:all .15s ease; font-size:14px;
}
.cal-nav-btn:hover{ background:var(--surface-3); border-color:var(--brand); color:var(--brand); transform:translateY(-1px) }

.cal-grid-v2{ display:grid; grid-template-columns:repeat(7,1fr); gap:8px }
.cal-dow-v2{
  font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted-2);
  text-align:center; font-weight:700; padding-bottom:8px; border-bottom:1px solid var(--line); margin-bottom:4px;
}
.cal-day-v2{
  min-height:64px; border:1px solid var(--line); border-radius:12px; background:var(--surface);
  padding:8px 9px; display:flex; flex-direction:column; justify-content:space-between; font-size:11px; position:relative;
  transition:all 0.18s ease; cursor:pointer; box-shadow:0 1px 3px rgba(0,0,0,0.02);
}
.cal-day-v2:hover{ transform:translateY(-2px); z-index:5; box-shadow:0 6px 18px rgba(0,0,0,0.08); border-color:var(--line-strong) }
.cal-day-v2 .cd-num{ font-family:var(--mono); color:var(--ink); font-size:13px; font-weight:700 }

.cal-day-v2.pres{ background:linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(16,185,129,0.02) 100%); border-color:rgba(16,185,129,0.28) }
.cal-day-v2.late{ background:linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(245,158,11,0.03) 100%); border-color:rgba(245,158,11,0.32) }
.cal-day-v2.wfh{ background:linear-gradient(135deg, rgba(59,130,246,0.09) 0%, rgba(59,130,246,0.03) 100%); border-color:rgba(59,130,246,0.3) }
.cal-day-v2.leave{ background:linear-gradient(135deg, rgba(168,85,247,0.1) 0%, rgba(168,85,247,0.03) 100%); border-color:rgba(168,85,247,0.35) }
.cal-day-v2.abs{ background:linear-gradient(135deg, rgba(239,68,68,0.09) 0%, rgba(239,68,68,0.03) 100%); border-color:rgba(239,68,68,0.3) }
.cal-day-v2.off{ opacity:0.65; background:var(--surface-3); border-color:var(--line) }
.cal-day-v2.off .cd-num{ color:var(--muted) }

.cal-day-v2 .cd-badge{
  display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:700;
  padding:3px 8px; border-radius:99px; text-transform:uppercase; letter-spacing:0.03em; margin-top:4px; width:fit-content;
}
.cal-day-v2.pres .cd-badge{ background:#DCFCE7; color:#15803D; box-shadow:0 1px 3px rgba(16,185,129,0.18) }
.cal-day-v2.late .cd-badge{ background:#FEF3C7; color:#B45309; box-shadow:0 1px 3px rgba(245,158,11,0.18) }
.cal-day-v2.wfh .cd-badge{ background:#DBEAFE; color:#1E40AF; box-shadow:0 1px 3px rgba(59,130,246,0.18) }
.cal-day-v2.leave .cd-badge{ background:#F3E8FF; color:#7E22CE; box-shadow:0 1px 3px rgba(168,85,247,0.18) }
.cal-day-v2.abs .cd-badge{ background:#FEE2E2; color:#B91C1C; box-shadow:0 1px 3px rgba(239,68,68,0.18) }
.cal-day-v2.off .cd-badge{ background:var(--surface-2); color:var(--muted); border:1px solid var(--line) }

html[data-theme="dark"] .cal-day-v2.pres .cd-badge{ background:rgba(21,128,61,0.3); color:#4ADE80 }
html[data-theme="dark"] .cal-day-v2.late .cd-badge{ background:rgba(180,83,9,0.3); color:#FBBF24 }
html[data-theme="dark"] .cal-day-v2.wfh .cd-badge{ background:rgba(30,64,175,0.3); color:#60A5FA }
html[data-theme="dark"] .cal-day-v2.leave .cd-badge{ background:rgba(126,34,206,0.3); color:#C084FC }
html[data-theme="dark"] .cal-day-v2.abs .cd-badge{ background:rgba(185,28,28,0.3); color:#F87171 }

/* ---------- Shift & Arrival Insights Card ---------- */
.shift-insights-wrap{ display:flex; flex-direction:column; gap:14px; height:100% }
.shift-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:2px }
.shift-head-title{ display:flex; flex-direction:column }
.shift-head-title h3{ font-size:16px; font-weight:700; color:var(--ink); margin:0; display:flex; align-items:center; gap:8px }
.shift-head-title p{ font-size:12px; color:var(--muted); margin:2px 0 0 0 }
.shift-score-badge{
  display:inline-flex; align-items:center; gap:5px; background:#DCFCE7; color:#15803D;
  font-size:12px; font-weight:700; padding:4px 10px; border-radius:20px; flex:none;
}
html[data-theme="dark"] .shift-score-badge{ background:rgba(21,128,61,0.25); color:#4ADE80 }

.shift-stats-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px }
.shift-stat-box{
  background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  padding:10px 11px; display:flex; flex-direction:column; gap:2px; min-width:0;
}
.shift-stat-box .ss-label{ font-size:10px; font-weight:700; color:var(--muted-2); text-transform:uppercase; letter-spacing:0.04em }
.shift-stat-box .ss-val{ font-family:var(--mono); font-size:13.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.shift-stat-box .ss-sub{ font-size:10.5px; color:var(--muted) }

.shift-meters-stack{ display:flex; flex-direction:column; gap:14px; background:var(--surface-2); border:1px solid var(--line); border-radius:14px; padding:14px }
.shift-meter-item{ display:flex; flex-direction:column; gap:6px }
.shift-meter-head{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px }
.shift-meter-head span{ font-weight:600; color:var(--ink) }
.shift-meter-head strong{ font-family:var(--mono); font-weight:700; color:var(--ink) }

.punct-breakdown-box{
  background:var(--surface-2); border:1px solid var(--line); border-radius:14px;
  padding:12px 14px; display:flex; flex-direction:column; gap:8px; margin-top:auto;
}
.punct-breakdown-title{ font-size:10.5px; font-weight:700; color:var(--muted-2); text-transform:uppercase; letter-spacing:0.06em }
.punct-rows{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px }
.punct-item{ display:flex; flex-direction:column; gap:2px }
.punct-item .p-lbl{ font-size:11px; color:var(--muted); display:flex; align-items:center; gap:5px }
.punct-item .p-lbl .p-dot{ width:6px; height:6px; border-radius:50%; flex:none }
.punct-item .p-lbl .p-dot.green{ background:#10B981 }
.punct-item .p-lbl .p-dot.amber{ background:#F59E0B }
.punct-item .p-lbl .p-dot.red{ background:#EF4444 }
.punct-item .p-cnt{ font-family:var(--mono); font-size:14px; font-weight:700; color:var(--ink) }

/* ---------- Time-Wise Keyboard & Mouse Tracker ---------- */
.input-kpi-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px }
@media (max-width:992px){ .input-kpi-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:576px){ .input-kpi-grid{ grid-template-columns:1fr; } }

.input-kpi-card{
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  padding:14px 16px; display:flex; align-items:center; gap:14px;
  box-shadow:0 2px 10px rgba(0,0,0,0.02); transition:transform .2s ease, box-shadow .2s ease;
}
.input-kpi-card:hover{ transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.06); border-color:var(--line-strong) }
.input-kpi-icon{
  width:42px; height:42px; border-radius:12px; display:grid; place-items:center;
  font-size:20px; flex:none;
}
.input-kpi-icon.purple{ background:#EEF2FF; color:#6366F1 }
.input-kpi-icon.teal{ background:#E0F2FE; color:#0284C7 }
.input-kpi-icon.emerald{ background:#DCFCE7; color:#16A34A }
.input-kpi-icon.amber{ background:#FEF3C7; color:#D97706 }

html[data-theme="dark"] .input-kpi-icon.purple{ background:rgba(99,102,241,0.2); color:#818CF8 }
html[data-theme="dark"] .input-kpi-icon.teal{ background:rgba(2,132,199,0.2); color:#38BDF8 }
html[data-theme="dark"] .input-kpi-icon.emerald{ background:rgba(22,163,74,0.2); color:#4ADE80 }
html[data-theme="dark"] .input-kpi-icon.amber{ background:rgba(217,119,6,0.2); color:#FBBF24 }

.input-kpi-info{ display:flex; flex-direction:column; min-width:0 }
.input-kpi-label{ font-size:11px; font-weight:700; color:var(--muted-2); text-transform:uppercase; letter-spacing:0.06em }
.input-kpi-val{ font-family:var(--mono); font-size:20px; font-weight:800; color:var(--ink); line-height:1.2 }
.input-kpi-sub{ font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }

/* ---------- Activity Barcode Timeline & Real-Time Log Table ---------- */
.act-timeline-card{
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  padding:20px; margin-bottom:20px; box-shadow:0 2px 10px rgba(0,0,0,0.02);
}
.act-timeline-head{ font-size:16px; font-weight:700; color:var(--ink); margin-bottom:14px }

.act-barcode-strip{
  display:flex; height:28px; width:100%; gap:1.5px; border-radius:6px; overflow:hidden;
  background:var(--surface-3); padding:2px; margin-bottom:12px;
}
.act-tick{ flex:1; height:100%; border-radius:1px; transition:opacity .15s ease }
.act-tick.active{ background:#10B981 }
.act-tick.idle{ background:#F59E0B }
.act-tick.break{ background:#3B82F6 }

.act-legend{ display:flex; align-items:center; gap:16px; font-size:12.5px; color:var(--muted) }
.act-leg-item{ display:flex; align-items:center; gap:6px; font-size:12px; font-weight:500 }
.act-leg-item i{ width:9px; height:9px; border-radius:2px; display:inline-block }

/* State Badges */
.badge-state{
  display:inline-flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600; padding:2px 10px; border-radius:12px;
}
.badge-state.active{ background:#DCFCE7; color:#15803D }
.badge-state.idle{ background:#FEF3C7; color:#B45309 }
.badge-state.break{ background:#DBEAFE; color:#1E40AF }

html[data-theme="dark"] .badge-state.active{ background:rgba(21,128,61,0.25); color:#4ADE80 }
html[data-theme="dark"] .badge-state.idle{ background:rgba(180,83,9,0.25); color:#FBBF24 }
html[data-theme="dark"] .badge-state.break{ background:rgba(30,64,175,0.25); color:#60A5FA }

/* ---------- Enhanced Overview Tab ---------- */
.overview-stats-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:16px }
.overview-stat-item{
  background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  padding:10px 12px; display:flex; flex-direction:column; gap:2px;
}
.overview-stat-item .os-label{ font-size:10.5px; font-weight:700; color:var(--muted-2); text-transform:uppercase; letter-spacing:0.04em }
.overview-stat-item .os-val{ font-family:var(--mono); font-size:14px; font-weight:700; color:var(--ink) }
.overview-stat-item .os-sub{ font-size:11px; color:var(--muted) }

.allowance-box{
  background:var(--surface-2); border:1px solid var(--line); border-radius:14px;
  padding:14px; display:flex; flex-direction:column; gap:12px;
}
.allowance-item{ display:flex; flex-direction:column; gap:6px }
.allowance-head{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px }
.allowance-head span{ font-weight:600; color:var(--ink) }
.allowance-head strong{ font-family:var(--mono); font-weight:700; color:var(--ink) }

.pulse-dot{ width:8px; height:8px; border-radius:50%; display:inline-block }
.pulse-dot.green{ background:#10B981; box-shadow:0 0 0 3px rgba(16,185,129,0.2) }

.btn-preset-pill{ color:var(--muted); transition:all .15s ease; border:0; background:transparent }
.btn-preset-pill:hover{ color:var(--ink); background:var(--surface-3) }
.btn-preset-pill.active{ background:var(--brand) !important; color:#fff !important; box-shadow:0 2px 8px rgba(76,42,250,0.3) }

/* ---- employee form: photograph ------------------------------------------
   The preview keeps a fixed square whether it holds an image or the initials
   fallback, so swapping one for the other does not reflow the card. */
.ef-photo-row{ display:flex; gap:14px; align-items:flex-start }
.ef-photo{
  width:96px; height:96px; flex:none; border-radius:16px; object-fit:cover;
  border:1px solid var(--line); background:var(--surface-2);
}
.ef-photo-empty{
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:30px; letter-spacing:0.02em; border:0;
}
.ef-photo-actions{ flex:1; min-width:0 }

/* Warning-toned variant of the existing notice block. */
.notice.tone-warn{ border-color:rgba(245,159,0,0.35); background:rgba(245,159,0,0.07) }
.notice.tone-warn i{ color:var(--warn) }

/* A capture whose metadata arrived before its image. The row is real; the
   file is not there yet, and the endpoint correctly answers 404. The
   placeholder only appears once the <img> has actually failed, so a capture
   that loads normally never shows it. */
.shot-thumb{ position:relative }
.shot-thumb .shot-pending{ display:none }
.shot-thumb.is-pending{ min-height:120px; background:var(--surface-2) }
.shot-thumb.is-pending .shot-pending{
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:6px;
  color:var(--muted); font-size:11.5px; font-weight:600; text-align:center;
}
.shot-thumb.is-pending .shot-pending i{ font-size:18px; opacity:.7 }

/* Handing over credentials: shown once, so it must be readable and copyable. */
.cred-handover{ display:flex; flex-direction:column; gap:10px }
.cred-handover > div{
  background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px;
}
.cred-handover small{
  display:block; font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:.05em; color:var(--muted); margin-bottom:3px;
}
.cred-handover strong{ font-size:16px; font-weight:700; color:var(--ink); user-select:all; word-break:break-all }

/* ==========================================================================
   The employee's own dashboard
   Its own components rather than the management tiles: the question here is
   "how is my day going", not "how is the workforce doing".
   ========================================================================== */

.emp-today{ padding:20px 22px }
.emp-today-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; flex-wrap:wrap; margin-bottom:18px;
}
.emp-today-head h3{ font-size:16px; font-weight:700; margin:0 0 2px; color:var(--ink) }
.emp-today-head p{ margin:0; font-size:12.5px; color:var(--muted) }

/* ---- KPI Tile Grid (reference-style cards) ---- */
.emp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 992px) {
  .emp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .emp-kpi-grid { grid-template-columns: 1fr; }
}

.emp-kpi-tile {
  background: var(--surface-2, #F1F5F9);
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.emp-kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.emp-kpi-icon {
  font-size: 16px;
  margin-bottom: 6px;
  display: block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
}

.emp-kpi-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.emp-kpi-label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted, #94A3B8);
  margin-top: 2px;
}

/* Tone variants */
.kpi-tone-brand {
  background: rgba(76, 42, 250, 0.06);
  border-color: rgba(76, 42, 250, 0.14);
}
.kpi-tone-brand .emp-kpi-icon { color: var(--brand, #4C2AFA); }
.kpi-tone-brand .emp-kpi-value { color: var(--brand, #4C2AFA); }

.kpi-tone-ink {
  background: var(--surface-2, #F1F5F9);
  border-color: var(--line, #E2E8F0);
}
.kpi-tone-ink .emp-kpi-icon { color: var(--ink-2, #475569); }
.kpi-tone-ink .emp-kpi-value { color: var(--ink, #1E293B); }

.kpi-tone-green {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.16);
}
.kpi-tone-green .emp-kpi-icon { color: var(--ok, #10B981); }
.kpi-tone-green .emp-kpi-value { color: var(--ok, #10B981); }

.kpi-tone-amber {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.16);
}
.kpi-tone-amber .emp-kpi-icon { color: var(--warn, #F59E0B); }
.kpi-tone-amber .emp-kpi-value { color: var(--warn, #F59E0B); }

.kpi-tone-purple {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.16);
}
.kpi-tone-purple .emp-kpi-icon { color: #8B5CF6; }
.kpi-tone-purple .emp-kpi-value { color: #8B5CF6; }


.emp-stat-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:14px }
.emp-stat small,
.emp-leave small{
  display:block; font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:.05em; color:var(--muted); margin-bottom:3px;
}
.emp-stat strong{ display:block; font-size:18px; font-weight:700; color:var(--ink) }
.emp-stat span{ font-size:11.5px; color:var(--muted) }

.emp-score{ display:flex; align-items:baseline; gap:10px }
.emp-score strong{ font-size:40px; font-weight:700; line-height:1; color:var(--ink) }
.emp-score span{ font-size:13px; font-weight:600; color:var(--muted) }

.emp-part-head{
  display:flex; justify-content:space-between; align-items:baseline;
  font-size:12.5px; margin-bottom:5px; color:var(--ink);
}
.emp-part-head small{ color:var(--muted); font-weight:400 }
/* .progress-kw is an inline span elsewhere, which collapses to zero height
   here and let the bar sit on top of its own label. */
.emp-part .progress-kw{ display:block; width:100% }

.emp-leave-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:14px }
.emp-leave strong{ display:block; font-size:20px; font-weight:700; color:var(--ink); margin-bottom:5px }
.emp-leave strong span{ font-size:13px; font-weight:600; color:var(--muted) }
.emp-leave > span{ display:block; font-size:11px; color:var(--muted); margin-top:5px }

.emp-activity{ display:flex; align-items:center; gap:11px }
.emp-activity i{ font-size:15px; color:var(--muted); flex:none; width:20px; text-align:center }
.emp-activity > div{ flex:1; min-width:0 }
.emp-activity strong{ display:block; font-size:13px; font-weight:600; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.emp-activity small{ font-size:11px; color:var(--muted) }
.emp-activity > span{ font-size:12.5px; font-weight:600; color:var(--ink); flex:none }

/* ==========================================================================
   Employee Dashboard Enhancements (Smart Banner, Timeline, Goals, Wellness)
   ========================================================================== */
.emp-nudge-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(76, 42, 250, 0.08) 0%, rgba(26, 159, 255, 0.06) 100%);
  border: 1px solid rgba(76, 42, 250, 0.2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.emp-nudge-banner .nudge-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand, #4C2AFA);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: none;
}
.emp-nudge-banner .nudge-body { flex: 1; min-width: 0; }
.emp-nudge-banner .nudge-body h4 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 2px 0; }
.emp-nudge-banner .nudge-body p { font-size: 12.5px; color: var(--muted); margin: 0; }
.emp-nudge-banner .nudge-badge {
  background: rgba(76, 42, 250, 0.12);
  color: var(--brand, #4C2AFA);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.emp-timeline-container {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line, #EEF0F6);
}
.emp-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.emp-timeline-header small {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.emp-timeline-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2, #EEF0F6);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.emp-timeline-seg {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}
.emp-timeline-seg.seg-active { background: var(--brand, #4C2AFA); }
.emp-timeline-seg.seg-break { background: var(--ok, #10B981); }
.emp-timeline-seg.seg-idle { background: var(--warn, #F59E0B); }
.emp-timeline-seg.seg-remaining { background: var(--surface-3, #E2E8F0); }

.emp-timeline-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.emp-timeline-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-timeline-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.emp-goals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emp-goal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 8px;
  transition: background 0.2s;
}
.emp-goal-item:hover { background: var(--surface-1, #FFFFFF); }
.emp-goal-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand, #4C2AFA);
}
.emp-goal-item span.goal-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}
.emp-goal-item.is-done span.goal-text {
  text-decoration: line-through;
  color: var(--muted);
}
.emp-goal-item .goal-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
  color: var(--muted);
}

.emp-wellness-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.emp-streak-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
}
.emp-streak-box i { font-size: 24px; color: #F59E0B; }
.emp-streak-box strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.emp-streak-box small { font-size: 11.5px; color: var(--muted); }

/* Card & Widget Layout Spacing */
.emp-today {
  margin-bottom: 0;
}
.card-kw + .card-kw {
  margin-top: 24px;
}
.board-col-body .card-kw + .card-kw,
.task-card + .task-card,
.task-card {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.chart-box {
  padding-top: 8px;
}




.emp-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--ink);
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--line, #EEF0F6);
}
.emp-legend-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.emp-legend-pill.pill-active .dot { background: var(--brand, #4C2AFA); }
.emp-legend-pill.pill-break .dot { background: var(--ok, #10B981); }
.emp-legend-pill.pill-idle .dot { background: var(--warn, #F59E0B); }
.emp-legend-pill.pill-remaining .dot { background: var(--surface-3, #CBD5E1); }

/* ==========================================================================
   My Tasks — Card-based Task List
   ========================================================================== */

.emp-tasks-card .card-kw-head h3 i {
  color: var(--brand, #4C2AFA);
}

/* Status counter pills row */
.emp-task-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.emp-task-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line, #EEF0F6);
  background: var(--surface-2, #F8FAFC);
  color: var(--ink-2, #475569);
  transition: all 0.2s ease;
}
.emp-task-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.emp-task-pill.pill-open {
  background: rgba(76, 42, 250, 0.06);
  border-color: rgba(76, 42, 250, 0.18);
  color: var(--brand, #4C2AFA);
}
.emp-task-pill.pill-review {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
  color: #B45309;
}
.emp-task-pill.pill-done {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
  color: #047857;
}
.emp-task-pill.pill-overdue {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
  color: #DC2626;
}

/* Task list container */
.emp-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual task row card */
.emp-task-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--line, #EEF0F6);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.emp-task-row:hover {
  background: var(--surface-1, #FFF);
  border-color: rgba(76, 42, 250, 0.2);
  box-shadow: 0 4px 16px rgba(76, 42, 250, 0.06);
  transform: translateY(-1px);
}

/* Task icon */
.emp-task-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(76, 42, 250, 0.08);
  color: var(--brand, #4C2AFA);
  font-size: 16px;
  flex: none;
}

/* Task info (title + meta) */
.emp-task-info {
  flex: 1;
  min-width: 0;
}
.emp-task-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink, #1E293B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted, #94A3B8);
}
.emp-task-meta .mono {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.emp-task-type {
  font-size: 11px;
  color: var(--ink-2, #475569);
}

/* Task progress */
.emp-task-progress {
  width: 120px;
  flex: none;
}
.emp-task-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.emp-task-progress-label small {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.emp-task-progress-label strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--mono);
}
.emp-task-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3, #E2E8F0);
  overflow: hidden;
}
.emp-task-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand, #4C2AFA), #7C5CFC);
  transition: width 0.4s ease;
}

/* Task due date */
.emp-task-due {
  width: 110px;
  flex: none;
  text-align: center;
}
.emp-task-due small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 2px;
}
.emp-task-due span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: var(--mono);
}
.emp-task-due.is-overdue span {
  color: #DC2626;
  font-weight: 700;
}

/* Task status badge */
.emp-task-status {
  width: 100px;
  flex: none;
  text-align: right;
}
.emp-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.emp-status-badge.status-open {
  background: rgba(76, 42, 250, 0.08);
  color: var(--brand, #4C2AFA);
}
.emp-status-badge.status-submitted {
  background: rgba(245, 158, 11, 0.1);
  color: #B45309;
}
.emp-status-badge.status-review {
  background: rgba(59, 130, 246, 0.1);
  color: #1D4ED8;
}
.emp-status-badge.status-done {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

/* Responsive stacking */
@media (max-width: 768px) {
  .emp-task-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .emp-task-info {
    flex: 1 1 calc(100% - 56px);
  }
  .emp-task-progress,
  .emp-task-due,
  .emp-task-status {
    width: auto;
    flex: 1;
    text-align: left;
  }
}

/* ==========================================================================
   Employee Personal Attendance Calendar Component
   ========================================================================== */
.emp-attendance-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emp-cal-legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.emp-cal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line, #EEF0F6);
  background: var(--surface-2, #F8FAFC);
  color: var(--ink-2, #475569);
}
.emp-cal-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.emp-cal-pill.pill-present .dot { background: var(--ok, #10B981); }
.emp-cal-pill.pill-late .dot { background: var(--warn, #F59E0B); }
.emp-cal-pill.pill-leave .dot { background: #8B5CF6; }
.emp-cal-pill.pill-absent .dot { background: #EF4444; }

.emp-calendar-card {
  background: var(--surface-1, #FFFFFF);
  border: 1px solid var(--line, #EEF0F6);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.emp-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #EEF0F6);
}
.emp-cal-month-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #1E293B);
}
.emp-cal-subtitle {
  font-size: 11.5px;
  color: var(--muted, #94A3B8);
}

.emp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.emp-cal-day-head {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted, #94A3B8);
  padding-bottom: 6px;
}
.emp-cal-cell {
  aspect-ratio: 1.1;
  min-height: 60px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--line, #EEF0F6);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.18s ease;
  cursor: default;
}
.emp-cal-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.emp-cal-cell.is-empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.emp-cal-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.emp-cal-num {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #1E293B);
}
.style-today-tag {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 4px;
}
.emp-cal-cell-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.emp-cal-status-badge {
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.2;
}
.emp-cal-time-sub {
  font-size: 10px;
  color: var(--muted, #94A3B8);
  font-family: var(--mono);
}

/* Calendar status colors */
.emp-cal-cell.status-present {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}
.emp-cal-cell.status-present .emp-cal-status-badge { color: #047857; }
.emp-cal-cell.status-present .emp-cal-num { color: #065F46; }

.emp-cal-cell.status-late {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.25);
}
.emp-cal-cell.status-late .emp-cal-status-badge { color: #B45309; }
.emp-cal-cell.status-late .emp-cal-num { color: #92400E; }

.emp-cal-cell.status-leave {
  background: rgba(139, 92, 246, 0.09);
  border-color: rgba(139, 92, 246, 0.25);
}
.emp-cal-cell.status-leave .emp-cal-status-badge { color: #6D28D9; }

.emp-cal-cell.status-absent {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.25);
}
.emp-cal-cell.status-absent .emp-cal-status-badge { color: #DC2626; }

.emp-cal-cell.status-off {
  background: var(--surface-2, #F8FAFC);
  border-color: var(--line, #EEF0F6);
  opacity: 0.7;
}
.emp-cal-cell.status-off .emp-cal-status-badge { color: var(--muted, #94A3B8); }

.emp-cal-cell.is-today {
  border: 2px solid var(--brand, #4C2AFA) !important;
  box-shadow: 0 0 0 3px rgba(76, 42, 250, 0.12);
}

@media (max-width: 768px) {
  .emp-cal-grid {
    gap: 4px;
  }
  .emp-cal-cell {
    min-height: 50px;
    padding: 4px;
  }
  .emp-cal-time-sub {
    display: none;
  }
}

/* ==========================================================================
   Module Access Control Overrides UI Components
   ========================================================================== */
.emp-mod-override-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.emp-mod-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--line, #EEF0F6);
  border-radius: 12px;
  transition: all 0.18s ease;
}
.emp-mod-row:hover {
  background: var(--surface-1, #FFFFFF);
  border-color: rgba(76, 42, 250, 0.2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
}

.emp-mod-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.emp-mod-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex: none;
}
.emp-mod-icon.tone-brand { background: rgba(76, 42, 250, 0.1); color: var(--brand, #4C2AFA); }
.emp-mod-icon.tone-green { background: rgba(16, 185, 129, 0.1); color: var(--ok, #10B981); }
.emp-mod-icon.tone-blue { background: rgba(59, 130, 246, 0.1); color: #2563EB; }
.emp-mod-icon.tone-purple { background: rgba(139, 92, 246, 0.1); color: #7C3AED; }
.emp-mod-icon.tone-amber { background: rgba(245, 158, 11, 0.1); color: #D97706; }
.emp-mod-icon.tone-red { background: rgba(239, 68, 68, 0.1); color: #DC2626; }

.emp-mod-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.emp-mod-info strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink, #1E293B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-mod-desc {
  font-size: 11px;
  color: var(--muted, #94A3B8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.style-mod-tag {
  font-size: 9.5px;
  width: fit-content;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 4px;
}

.emp-mod-btn-group {
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.emp-mod-btn-group .btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
}

.style-form-lbl {
  font-size: 11px;
  letter-spacing: .05em;
}

@media (max-width: 768px) {
  .emp-mod-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .emp-mod-right {
    width: 100%;
  }
  .emp-mod-btn-group {
    width: 100%;
  }
  .emp-mod-btn-group .btn {
    flex: 1;
  }
}




/* A module row whose grant cannot take effect at this account's scope. Dimmed
   rather than hidden: the setting is real and stored, it simply does nothing
   until the role widens. */
.table-kw tr.is-muted td strong{ color:var(--muted) }

/* The published policy's capture list. */
.policy-captures{ display:flex; flex-wrap:wrap; gap:6px }
.policy-capture-group{ margin-top:12px }
.policy-capture-group h4{ font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.05em; color:var(--muted); margin:0 0 6px }
.chip.chip-on{ background:rgba(12,166,120,.10); color:var(--ok) }
.chip.chip-off{ background:var(--surface-2); color:var(--muted) }
