:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-deep: #eaf1f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #eefaf7;
  --ink: #0f172a;
  --muted: #64748b;
  --muted-strong: #475569;
  --line: #dbe4ee;
  --line-strong: #c7d2df;
  --brand: #0f9f8f;
  --brand-dark: #0b6f63;
  --blue: #2563eb;
  --amber: #d97706;
  --rose: #e11d48;
  --cyan: #0891b2;
  --good: #15803d;
  --bad: #b42318;
  --warn: #b7791f;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --control: 44px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 0 0, rgba(15, 159, 143, 0.14), transparent 360px),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 58%, #eef3f8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 15% 8%, rgba(15, 159, 143, 0.16), transparent 320px),
    rgba(244, 247, 251, 0.96);
  backdrop-filter: blur(10px);
}

.login-box {
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.primary-btn,
.primary-mini,
.ghost-btn,
.icon-btn {
  min-height: var(--control);
  border-radius: var(--radius);
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.primary-btn,
.primary-mini {
  border: 0;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 159, 143, 0.22);
}

.primary-btn:hover,
.primary-mini:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.primary-mini {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.ghost-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 0.82rem;
}

.ghost-btn:hover {
  border-color: rgba(15, 159, 143, 0.45);
  color: var(--brand-dark);
  background: #f0fdfa;
}

.login-error {
  min-height: 20px;
  color: var(--bad);
  font-size: 0.86rem;
}

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -18px 14px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  background: linear-gradient(135deg, #06142b 0%, #0b2240 58%, #073c43 100%);
  color: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #35d2c2;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.25;
}

.topbar-subtitle,
.panel-caption,
.filter-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.topbar .topbar-subtitle {
  color: #b7c4d7;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 850;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
}

.role-badge[data-role="employee"] {
  background: linear-gradient(135deg, #93c5fd, #3b82f6);
  color: #fff;
}

.role-badge[data-role="employee"][data-group="Galaxy"] {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
}

.role-badge[data-role="employee"][data-group="Supra"] {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
}

.login-hint {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
  margin: 8px 0 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border-left: 3px solid #facc15;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(203, 213, 225, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: var(--shadow-soft);
}

.sync-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--good);
}

.sync-badge.loading::before {
  background: var(--amber);
}

.sync-badge.error::before {
  background: var(--bad);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(203, 213, 225, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #5eead4;
  font-size: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.icon-btn:hover {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(15, 159, 143, 0.2);
  transform: translateY(-1px);
}

.tabs {
  position: sticky;
  top: 82px;
  z-index: 9;
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.24);
}

.filter-shell {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.filter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-actions,
.table-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-toggle {
  display: none;
}

.filter-body {
  display: grid;
  gap: 10px;
}

.sheet-actions {
  display: none;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-filters {
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 850;
}

select,
input {
  width: 100%;
  min-height: var(--control);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.employee-combobox {
  position: relative;
  display: grid;
}

.employee-combobox input {
  padding-right: 46px;
}

.combo-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 42px;
  height: calc(var(--control) - 2px);
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.combo-btn:hover,
.employee-combobox.open .combo-btn {
  background: #f0fdfa;
  color: var(--brand-dark);
}

.combo-list {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(340px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
  padding: 6px;
}

.combo-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.combo-option:hover,
.combo-option.active {
  background: #eefaf7;
}

.combo-option strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.combo-option span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.combo-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

select:focus,
input:focus,
button:focus-visible {
  border-color: rgba(15, 159, 143, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.14);
  outline: none;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 28px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.filter-chip.neutral {
  background: #f1f5f9;
  color: var(--muted-strong);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 8px 0 14px;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.4;
}

.status.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #cdd6e1;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.status.error {
  color: var(--bad);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.kpi-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-grid.attendance-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 14px 13px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.kpi-card:nth-child(2)::before {
  background: var(--blue);
}

.kpi-card:nth-child(3)::before {
  background: var(--amber);
}

.kpi-card:nth-child(4)::before {
  background: var(--rose);
}

.kpi-card:nth-child(5)::before {
  background: #7c3aed;
}

.kpi-card:nth-child(6)::before {
  background: var(--cyan);
}

.kpi-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--brand-dark);
  font-size: 0.95rem;
  font-weight: 900;
}

.kpi-title {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.kpi-value {
  margin-top: 9px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  font-weight: 900;
  line-height: 1;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
}

.delta.good {
  color: var(--good);
}

.delta.bad {
  color: var(--bad);
}

.delta.neutral {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--brand-dark);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.warn {
  background: #fff7ed;
  color: var(--warn);
}

.badge.neutral {
  background: #eef2f7;
  color: #405064;
}

.rank-list {
  display: grid;
  gap: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.rank-item:hover {
  border-color: rgba(15, 159, 143, 0.3);
  background: #ffffff;
  transform: translateX(2px);
}

.rank-name {
  font-weight: 900;
}

.rank-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.rank-score {
  min-width: 70px;
  text-align: center;
  font-weight: 900;
  color: var(--brand-dark);
  padding: 7px 8px;
  border-radius: var(--radius);
  background: #effaf8;
}

.rank-score.low {
  background: #fee2e2;
  color: #b42318;
}

.rank-score.mid {
  background: #fef3c7;
  color: #a16207;
}

.rank-score.high {
  background: #dcfce7;
  color: #15803d;
}

.table-search {
  width: min(260px, 42vw);
  min-height: 36px;
  font-size: 0.84rem;
}

.table-select {
  width: 150px;
  min-height: 36px;
  font-size: 0.82rem;
  padding: 0 10px;
}

.quick-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
}

.quick-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.quick-filter:hover,
.quick-filter.active {
  border-color: rgba(15, 159, 143, 0.34);
  background: #ecfdf5;
  color: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.12);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(140px, 160px) minmax(220px, 1fr) minmax(180px, 220px);
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-search-combo {
  position: relative;
}

.calendar-search-combo .combo-list {
  top: calc(100% + 6px);
}

.absence-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.absence-chip,
.absence-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 900;
}

.absence-chip {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.76rem;
  background: #eef2f7;
  color: var(--muted-strong);
}

.absence-chip.present {
  background: #dcfce7;
  color: #15803d;
}

.absence-chip.unpaid_leave,
.absence-dot.unpaid_leave,
.day-employee.reason-unpaid_leave {
  background: #fff7ed;
  color: #c2410c;
}

.absence-chip.annual_leave,
.absence-dot.annual_leave,
.day-employee.reason-annual_leave {
  background: #e0f2fe;
  color: #0369a1;
}

.absence-chip.unknown_absence,
.absence-dot.unknown_absence,
.day-employee.reason-unknown_absence {
  background: #fee2e2;
  color: #b42318;
}

.absence-chip.maternity_leave,
.absence-dot.maternity_leave,
.day-employee.reason-maternity_leave {
  background: #f3e8ff;
  color: #7e22ce;
}

.attendance-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.calendar-weekdays,
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.calendar-day.empty {
  visibility: hidden;
  pointer-events: none;
}

.calendar-day:hover,
.calendar-day.active {
  border-color: rgba(15, 159, 143, 0.4);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.calendar-date {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 900;
}

.calendar-day.active .calendar-date {
  background: var(--brand);
  color: #ffffff;
}

.calendar-day strong {
  font-size: 1rem;
}

.calendar-day span:not(.calendar-date):not(.absence-dots):not(.absence-dot) {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.absence-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.absence-dot {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.68rem;
}

.day-detail {
  position: sticky;
  top: 136px;
  max-height: calc(100vh - 156px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
}

.day-detail h3 {
  margin: 0;
  font-size: 1rem;
}

.day-detail p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.day-employee-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.day-employee {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(160px, 0.8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.day-employee strong,
.day-employee span {
  display: block;
}

.day-employee span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.work-hours {
  min-width: 54px;
  border-radius: 999px;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 900;
}

.work-hours.present {
  background: #dcfce7;
  color: #15803d;
}

.work-hours.absent {
  background: #f1f5f9;
  color: var(--muted-strong);
}

.reason-select {
  min-height: 34px;
  font-size: 0.78rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

.metric-row span,
.metric-row strong {
  position: relative;
  z-index: 1;
}

.metric-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.metric-row strong {
  color: var(--ink);
}

.metric-row i {
  position: absolute;
  inset: auto auto 0 0;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.supra-view {
  display: flex;
  justify-content: center;
  color: #f8fafc;
}

.supra-shell {
  display: grid;
  gap: 14px;
  width: min(100%, 430px);
  border: 1px solid #263246;
  border-radius: 14px;
  background: #111722;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 14px;
}

.supra-head,
.supra-section-head,
.supra-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supra-eyebrow {
  margin: 0 0 3px;
  color: #facc15;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.supra-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

.supra-status {
  margin: 4px 0 0;
  color: #dbeafe;
  font-size: 0.84rem;
  font-weight: 800;
}

.supra-refresh-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
}

.supra-refresh-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.supra-refresh-label > span {
  flex-shrink: 0;
}

.supra-status-select {
  flex: 1 1 auto;
  min-width: 0;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  min-height: 32px;
}

.supra-status-select:focus {
  outline: none;
  border-color: #facc15;
}

.supra-snapshot-meta {
  flex: 1 1 100%;
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.supra-snapshot-meta:empty {
  display: none;
}

.supra-refresh {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #facc15;
  color: #111827;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.supra-refresh:disabled {
  cursor: wait;
  opacity: 0.76;
}

.supra-section-head {
  margin-top: 4px;
  border-top: 1px solid #263246;
  padding-top: 12px;
  justify-content: flex-start;
}

.supra-section-head span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.supra-section-head.active span {
  background: #facc15;
}

.supra-section-head.done span {
  background: #34d399;
}

.supra-section-head strong {
  color: #facc15;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.supra-section-head.done strong {
  color: #34d399;
}

.supra-section-head small {
  color: #ffffff;
  font-weight: 900;
}

.supra-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.supra-kpi,
.supra-group-cards span {
  min-height: 82px;
  border-radius: 8px;
  background: #171d2a;
  border-left: 3px solid #facc15;
  padding: 12px 12px 10px;
}

.supra-kpi strong,
.supra-group-cards b {
  display: block;
  color: #facc15;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  line-height: 1.1;
}

.supra-kpi span,
.supra-group-cards span {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.supra-kpi.blue,
.supra-group-cards span:nth-child(3) {
  border-left-color: #38bdf8;
}

.supra-kpi.blue strong,
.supra-group-cards span:nth-child(3) b {
  color: #38bdf8;
}

.supra-kpi.purple {
  border-left-color: #a78bfa;
}

.supra-kpi.purple strong {
  color: #a78bfa;
}

.supra-kpi.orange,
.supra-group-cards span:nth-child(4) {
  border-left-color: #fb923c;
}

.supra-kpi.orange strong,
.supra-group-cards span:nth-child(4) b,
.supra-flow.orange .supra-flow-top strong,
.supra-flow.orange .supra-flow-top b {
  color: #fb923c;
}

.supra-kpi.green {
  border-left-color: #34d399;
}

.supra-kpi.green strong,
.supra-flow.green .supra-flow-top strong,
.supra-flow.green .supra-flow-top b {
  color: #34d399;
}

.supra-panel {
  border-top: 1px solid #263246;
  padding-top: 14px;
}

.supra-panel-title,
.supra-table-head strong {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.supra-flow-list,
.supra-group-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.supra-flow,
.supra-group {
  display: grid;
  gap: 8px;
}

.supra-flow-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.supra-flow-top strong,
.supra-flow-top b,
.supra-group h3 {
  color: #38bdf8;
  margin: 0;
}

.supra-mini-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.supra-mini-tags span {
  border-radius: 6px;
  background: #1e3a8a;
  color: #7dd3fc;
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

.supra-mini-tags span:nth-child(2) {
  background: #3b2174;
  color: #c4b5fd;
}

.supra-progress {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #252c3e;
}

.supra-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #0f766e);
}

.supra-flow.orange .supra-progress i {
  background: #fb923c;
}

.supra-flow-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.supra-status-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.supra-status-cards span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #161c2b;
  border-left: 3px solid #34d399;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.supra-status-cards span:nth-child(2) {
  border-left-color: #fb923c;
}

.supra-status-cards b {
  color: #34d399;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1;
}

.supra-status-cards span:nth-child(2) b {
  color: #fb923c;
}

.supra-group h3 {
  font-size: 0.9rem;
}

.supra-group-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.supra-table-head {
  border-top: 1px solid #263246;
  padding-top: 12px;
}

.supra-table-head span {
  color: #cbd5e1;
  font-weight: 900;
}

.supra-table-wrap {
  border-color: #263246;
  background: #0b1018;
}

.supra-table-wrap table {
  min-width: 820px;
}

.supra-table-wrap th {
  background: #020617;
  color: #ffffff;
}

.supra-table-wrap td {
  border-bottom-color: #263246;
  color: #e5e7eb;
}

.supra-status-pill {
  display: inline-flex;
  border: 1px solid #93c5fd;
  border-radius: 2px;
  padding: 4px 8px;
  color: #e0f2fe;
  font-weight: 900;
}

.supra-status-pill.processing {
  border-color: #facc15;
  color: #facc15;
}

.supra-status-pill.finished {
  border-color: #22c55e;
  color: #22c55e;
}

.supra-empty {
  margin: 0;
  color: #cbd5e1;
  font-weight: 800;
}

.chart-panel canvas {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: var(--radius);
}

.data-fresh {
  color: var(--good);
  font-weight: 900;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

td.num {
  font-weight: 900;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  padding: 28px 16px;
  text-align: center;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.inline-reset {
  min-height: 34px;
  border: 1px solid rgba(15, 159, 143, 0.26);
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--brand-dark);
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.eff-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.8rem;
  font-weight: 900;
}

.eff-pill.low {
  background: #fee2e2;
  color: #b42318;
}

.eff-pill.mid {
  background: #fef3c7;
  color: #a16207;
}

.eff-pill.high {
  background: #dcfce7;
  color: #15803d;
}

@media (max-width: 1040px) {
  .kpi-grid,
  .kpi-grid.attendance-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px 14px 32px;
  }

  .topbar {
    align-items: flex-start;
    top: 0;
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .topbar-subtitle,
  .sync-badge {
    display: none;
  }

  .tabs {
    top: 76px;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab {
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .filter-head,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions,
  .table-tools {
    justify-content: flex-start;
  }

  .filters,
  .detail-filters {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-grid,
  .kpi-grid.compact,
  .kpi-grid.attendance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .supra-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .supra-group-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }

  .table-search {
    width: min(100%, 320px);
  }

  .table-select {
    width: min(100%, 180px);
  }

  .calendar-toolbar,
  .attendance-calendar-layout {
    grid-template-columns: 1fr;
  }

  .day-detail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 500px) {
  .app-shell {
    padding: 12px 14px 28px;
  }

  h1 {
    font-size: 1.52rem;
  }

  .topbar {
    gap: 10px;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
  }

  .tabs {
    top: 70px;
  }

  .tab {
    min-height: 42px;
    white-space: normal;
    line-height: 1.15;
  }

  .supra-shell {
    border-radius: 12px;
    padding: 12px;
  }

  .supra-head,
  .supra-flow-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .supra-refresh {
    width: 100%;
  }

  .filters,
  .detail-filters {
    grid-template-columns: 1fr;
  }

  #overviewFilterShell .filter-head {
    margin-bottom: 0;
  }

  #overviewFilterShell.open .filter-head {
    margin-bottom: 12px;
  }

  .filter-toggle {
    display: inline-flex;
  }

  #overviewFilterBody {
    display: none;
  }

  #overviewFilterShell.open #overviewFilterBody {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    max-height: min(78vh, 620px);
    overflow: auto;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.22);
  }

  .sheet-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), #ffffff 34%);
  }

  .kpi-grid,
  .kpi-grid.compact,
  .kpi-grid.attendance-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .supra-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card {
    min-height: 124px;
    padding: 12px;
  }

  .kpi-value {
    font-size: 1.45rem;
  }

  .panel,
  .filter-shell {
    padding: 12px;
  }

  .table-tools {
    width: 100%;
  }

  .table-search,
  .table-select {
    width: 100%;
  }

  .quick-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-filter:first-child {
    grid-column: 1 / -1;
  }

  .attendance-calendar-panel {
    padding: 12px;
  }

  .calendar-weekdays,
  .attendance-calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 82px;
    padding: 6px;
  }

  .calendar-day strong {
    font-size: 0.86rem;
  }

  .calendar-day span:not(.calendar-date):not(.absence-dots):not(.absence-dot) {
    display: none;
  }

  .calendar-date {
    width: 24px;
    height: 24px;
    font-size: 0.76rem;
  }

  .day-employee {
    grid-template-columns: 1fr;
  }

  .reason-select {
    width: 100%;
  }

  .combo-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    bottom: auto;
    max-height: 44vh;
  }
}
