:root {
  --bg-top: #091114;
  --bg-bottom: #14191b;
  --surface: rgba(12, 18, 22, 0.96);
  --surface-2: rgba(17, 24, 29, 0.98);
  --surface-3: rgba(22, 32, 37, 0.98);
  --line: rgba(120, 182, 168, 0.12);
  --line-strong: rgba(120, 182, 168, 0.2);
  --text: #ebf3f0;
  --muted: #8da19b;
  --muted-strong: #c7d5d0;
  --red: #de6955;
  --red-soft: rgba(222, 105, 85, 0.16);
  --amber: #d09b58;
  --green: #68c6b4;
  --green-soft: rgba(104, 198, 180, 0.16);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.24);
  --radius-lg: 22px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(104, 198, 180, 0.1), transparent 22%),
    radial-gradient(circle at 82% 8%, rgba(208, 155, 88, 0.08), transparent 18%),
    linear-gradient(180deg, var(--bg-top) 0%, #101619 34%, var(--bg-bottom) 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(104, 198, 180, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 198, 180, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.42;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.48), transparent 92%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(11, 18, 22, 0.98), rgba(12, 19, 24, 0.96)),
    rgba(13, 24, 36, 0.94);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(104, 198, 180, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(104, 198, 180, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(25, 38, 44, 0.98), rgba(13, 22, 27, 0.98));
  border: 1px solid rgba(104, 198, 180, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 30px rgba(0, 0, 0, 0.24),
    0 0 22px rgba(104, 198, 180, 0.1);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(104, 198, 180, 0.16), transparent 40%),
    linear-gradient(135deg, rgba(28, 45, 54, 0.98), rgba(12, 24, 30, 0.98));
  border: 1px solid rgba(104, 198, 180, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(104, 198, 180, 0.18);
  overflow: hidden;
}

.brand-orbit {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(104, 198, 180, 0.38);
}

.brand-ring {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(214, 255, 249, 0.98);
  box-shadow: 0 0 16px rgba(104, 198, 180, 0.2);
}

.brand-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: left center;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(214, 255, 249, 0.98), rgba(104, 198, 180, 0.82));
}

.brand-hand-long {
  width: 13px;
  transform: translateY(-50%) rotate(-24deg);
}

.brand-hand-short {
  width: 9px;
  transform: translateY(-50%) rotate(42deg);
}

.brand-center {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9fffa;
  box-shadow: 0 0 12px rgba(104, 198, 180, 0.42);
}

.brand-streak {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(104, 198, 180, 0), rgba(104, 198, 180, 0.82));
}

.brand-streak-one {
  width: 15px;
  left: 6px;
  top: 18px;
}

.brand-streak-two {
  width: 11px;
  left: 9px;
  top: 31px;
}

.brand h1,
.section-title-row h3,
.intake-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #7f938f;
}

.brand-kicker {
  margin-bottom: 4px;
}

.brand-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glass-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(13, 20, 25, 0.98), rgba(12, 18, 22, 0.94)),
    rgba(14, 26, 39, 0.92);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(104, 198, 180, 0.03);
}

.topbar-actions,
.toolbar,
.timeline-legend {
  display: flex;
  gap: 12px;
}

.secure-pill,
.mini-label,
.filter-chip,
.status-chip {
  border-radius: 999px;
}

.secure-pill,
.mini-label {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(235, 243, 240, 0.84);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(104, 198, 180, 0.1);
}

.intake-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.intake-action-row {
  margin-top: 10px;
}

.upload-control {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 104px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(104, 198, 180, 0.28);
  background:
    linear-gradient(180deg, rgba(15, 29, 35, 0.4), rgba(11, 18, 23, 0.98)),
    rgba(10, 22, 33, 0.96);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.upload-control-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  border-radius: 8px;
  background: rgba(104, 198, 180, 0.16);
  color: #d4fff8;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.upload-control:hover {
  transform: translateY(-1px);
  border-color: rgba(104, 198, 180, 0.52);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22), 0 0 20px rgba(104, 198, 180, 0.08);
}

.upload-control input {
  display: none;
}

.upload-control-title {
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.04rem;
}

.upload-control-copy,
.upload-hint,
.detail-copy,
.employee-cell small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.kpi-strip {
  display: grid;
  grid-template-columns: 0.95fr 1.45fr 0.8fr 0.8fr;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kpi-card {
  min-width: 0;
  padding: 12px 16px 10px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.kpi-card:not(:first-child) {
  padding-left: 16px;
}

.kpi-card:last-child {
  border-right: none;
}

.kpi-label,
.detail-label {
  display: block;
  margin: 0 0 8px;
  color: rgba(176, 200, 194, 0.78);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-value {
  display: block;
  color: #f7fbff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  line-height: 1.25;
}

.kpi-card-report .kpi-value {
  font-size: 1.08rem;
}

.kpi-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.kpi-card-flagged .kpi-value {
  color: #efb29b;
  font-size: 1.6rem;
}

.matrix-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-chip {
  border: 1px solid rgba(104, 198, 180, 0.08);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
  font-size: 0.88rem;
}

.filter-chip:hover {
  transform: translateY(-1px);
}

.filter-chip.active {
  background: rgba(104, 198, 180, 0.12);
  color: #e8fffa;
  box-shadow: inset 0 0 0 1px rgba(104, 198, 180, 0.48), 0 0 16px rgba(104, 198, 180, 0.08);
}

.action-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  max-width: 760px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(222, 105, 85, 0.2);
  background: rgba(222, 105, 85, 0.08);
  color: var(--muted-strong);
  font-size: 0.9rem;
  line-height: 1.4;
}

.action-banner-label {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(222, 105, 85, 0.16);
  color: #efb29b;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-banner-text {
  color: #dce5ed;
}

.table-shell {
  margin-top: 10px;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 27, 33, 0.98), rgba(13, 20, 24, 0.98));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.table-shell-wide {
  width: 100%;
}

.table-header,
.row-main {
  display: grid;
  grid-template-columns: 1.22fr 0.9fr 0.84fr 1fr 0.7fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
}

.table-header {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(176, 200, 194, 0.78);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-row {
  position: relative;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 27, 33, 0.98), rgba(14, 21, 26, 0.98));
  transition: background 180ms ease;
}

.table-row:hover {
  background: linear-gradient(180deg, rgba(21, 33, 39, 1), rgba(16, 25, 30, 0.98));
}

.table-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.table-row.expanded::before {
  background: linear-gradient(180deg, var(--green), #8fdfd0);
  box-shadow: 0 0 18px rgba(104, 198, 180, 0.24);
}

.row-main {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.employee-cell strong,
.cell {
  display: block;
}

.cell-summary {
  min-width: 0;
}

.summary-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(104, 198, 180, 0.14);
  color: #edf5fb;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.summary-chip-more {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  flex-shrink: 0;
}

.employee-cell strong {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

.cell {
  color: #edf5fb;
  font-size: 1rem;
}

.row-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms ease;
}

.table-row.expanded .row-detail {
  max-height: 360px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 0 20px 22px;
}

.timeline-bar {
  display: flex;
  overflow: hidden;
  min-height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.timeline-legend {
  flex-wrap: wrap;
  margin-top: 10px;
  color: rgba(214, 224, 232, 0.82);
  font-size: 0.85rem;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-swatch.work {
  background: #5d8dd4;
}

.legend-swatch.meal {
  background: #68c6b4;
}

.legend-swatch.issue {
  background: var(--red);
  box-shadow: 0 0 10px rgba(240, 93, 82, 0.5);
}

.segment {
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  color: #ffffff;
  font-weight: 600;
}

.segment.work {
  background: linear-gradient(135deg, #203745, #395969);
}

.segment.meal {
  background: linear-gradient(135deg, #256157, #4ba090);
}

.segment.break-missed,
.segment.meal-late {
  min-width: 86px;
  padding: 0 12px;
  background: linear-gradient(135deg, #a04f42, #d47b5f);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-chip.ok,
.status-chip.clean,
.status-chip.processing {
  background: var(--green-soft);
  color: #b2f7e7;
}

.status-chip.high,
.status-chip.flagged {
  background: var(--red-soft);
  color: #f0ad98;
}

.status-chip.review {
  background: rgba(208, 155, 88, 0.14);
  color: #e3c08f;
}

@media (max-width: 1120px) {
  .intake-header,
  .matrix-header,
  .kpi-strip,
  .intake-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .kpi-card,
  .kpi-card:not(:first-child) {
    padding-left: 0;
  }

  .kpi-card {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
  }

  .kpi-card:last-child {
    border-bottom: none;
  }

  .table-header,
  .row-main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 14px;
  }

  .topbar,
  .brand,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .glass-card {
    padding: 16px;
  }

  .table-header {
    display: none;
  }

  .row-main {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
