:root {
  color-scheme: light;
  --bg: #eef3f6;
  --bg-2: #f8fbfc;
  --surface: #ffffff;
  --surface-soft: #f5f8fa;
  --surface-strong: #eef4f7;
  --text: #17212b;
  --muted: #667684;
  --line: #d7e1e8;
  --line-strong: #bfced8;
  --green: #148247;
  --green-soft: #ddf6e9;
  --green-line: #9bdfb8;
  --yellow: #a06400;
  --yellow-soft: #fff1ca;
  --yellow-line: #f0ce78;
  --orange: #c05621;
  --orange-soft: #ffeadb;
  --orange-line: #f5b27f;
  --red: #b42318;
  --red-soft: #fee5e2;
  --red-line: #efaaa2;
  --blue: #256fb3;
  --blue-soft: #e4f0fb;
  --blue-line: #a9ceee;
  --gray: #62717f;
  --gray-soft: #edf1f4;
  --gray-line: #c8d1d9;
  --teal: #0f766e;
  --teal-2: #15908a;
  --indigo: #4457a8;
  --purple: #6d3fb2;
  --purple-soft: #efe7ff;
  --purple-line: #c8aff5;
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --shadow-sm: 0 4px 14px rgba(26, 38, 50, 0.07);
  --shadow-md: 0 14px 38px rgba(26, 38, 50, 0.11);
  --shadow-lg: 0 22px 58px rgba(26, 38, 50, 0.15);
  --transition: 170ms ease;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
}

body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(225deg, rgba(68, 87, 168, 0.10), transparent 32%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
}

body.login-body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.22), transparent 30%),
    linear-gradient(225deg, rgba(68, 87, 168, 0.18), transparent 34%),
    #0f1f2e;
}

a {
  color: inherit;
}

.login-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px 14px;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(191, 206, 216, 0.82);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(2, 8, 23, 0.28);
  margin: 0 auto;
  padding: 24px;
  width: min(100%, 390px);
}

.login-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.login-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--teal), var(--indigo));
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.25);
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.login-brand h1 {
  font-size: 24px;
  line-height: 1.05;
  margin: 0 0 4px;
}

.login-brand p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  margin: 0;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form button {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  min-height: 42px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.login-form button:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.login-form button:active {
  box-shadow: none;
  transform: translateY(1px);
}

.login-error,
.login-message {
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.login-error {
  background: var(--red-soft);
  color: var(--red);
}

.login-message {
  background: var(--green-soft);
  color: var(--green);
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(191, 206, 216, 0.72);
  display: flex;
  gap: var(--space-6);
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--teal), var(--indigo));
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.24);
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav {
  background: rgba(238, 244, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: var(--space-1);
  max-width: 100%;
  overflow-x: auto;
  padding: var(--space-1);
  scrollbar-width: thin;
}

.nav a {
  border-radius: 6px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 13px;
  position: relative;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition), transform var(--transition);
}

.nav-label-short {
  display: none;
}

.nav a.active,
.nav a:hover {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--teal);
  transform: translateY(-1px);
}

.nav a.active::after {
  background: linear-gradient(90deg, var(--teal), var(--blue));
  border-radius: 999px;
  content: "";
  height: 3px;
  inset: auto 10px 5px;
  position: absolute;
}

.page {
  margin: 0 auto;
  max-width: 1440px;
  padding: 16px 18px 34px;
}

.page-title {
  align-items: flex-start;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.dashboard-hero {
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(68, 87, 168, 0.90)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  color: #fff;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  margin-bottom: var(--space-5);
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.dashboard-hero::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
  content: "";
  height: 100%;
  inset: 0 auto 0 0;
  pointer-events: none;
  position: absolute;
  width: 46%;
}

.dashboard-hero > * {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.dashboard-hero .eyebrow,
.dashboard-hero .hero-copy {
  color: rgba(255, 255, 255, 0.82);
}

.hero-copy {
  font-size: 14px;
  font-weight: 800;
  margin: 10px 0 0;
  max-width: 620px;
}

.compact-hero {
  align-items: center;
  margin-bottom: 10px;
  min-height: 0;
  padding: 11px 14px;
}

.compact-hero h1 {
  font-size: 22px;
}

.compact-hero .hero-copy {
  margin-top: 5px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
  line-height: 1.15;
}

.actions,
.form-actions,
.toolbar-panel {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 100%;
}

.actions form {
  min-width: 0;
}

.weekly-title-actions {
  align-items: stretch;
}

.range-navigation {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mobile-week-nav {
  display: none;
}

.mobile-week-arrow,
.mobile-week-today {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition), transform var(--transition);
}

.mobile-week-arrow:active,
.mobile-week-today:active,
.day-card:active {
  transform: translateY(1px);
}

.sync-action {
  display: flex;
  margin: 0;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.button:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.button:active {
  box-shadow: none;
  transform: translateY(1px);
}

.button:focus-visible,
.nav a:focus-visible,
.preset-link:focus-visible,
input:focus-visible,
.login-form button:focus-visible {
  outline: 3px solid rgba(37, 111, 179, 0.28);
  outline-offset: 2px;
}

.button.primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--blue);
}

.button.danger {
  background: #fff;
  border-color: var(--red-line);
  color: var(--red);
}

.nav-arrow {
  font-size: 17px;
  min-width: 42px;
  padding: 0 11px;
}

.current-week-link {
  min-width: 150px;
}

.range-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 8px 0 0;
}

.metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(204px, 1fr));
  margin-bottom: var(--space-4);
}

.executive-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1.15fr 1fr 1.25fr;
  margin-bottom: var(--space-4);
}

.priority-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 10px;
}

.metric-card {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.92)),
    var(--surface);
  border: 1px solid rgba(215, 225, 232, 0.94);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 52px;
  overflow: hidden;
  padding: 9px 10px 8px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.metric-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.metric-card::before {
  content: "";
  height: 4px;
  inset: 0 0 auto 0;
  position: absolute;
}

.metric-card span {
  color: var(--muted);
  display: block;
  flex: 1 1 auto;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 7px;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-card strong {
  display: block;
  flex: 0 0 auto;
  font-size: 21px;
  line-height: 1;
  white-space: nowrap;
}

.metric-card.expected::before {
  background: var(--gray);
}

.metric-card.worked::before,
.metric-card.compliance::before {
  background: var(--green);
}

.metric-card.debt {
  background: linear-gradient(180deg, #fff, #fff1ef);
  border-color: var(--red-line);
}

.metric-card.debt::before,
.metric-card.balance.negative::before {
  background: var(--red);
}

.metric-card.surplus::before,
.metric-card.balance.positive::before {
  background: var(--green);
}

.metric-card.balance.negative strong,
.metric-card.debt strong {
  color: var(--red);
}

.metric-card.balance.positive strong,
.metric-card.surplus strong {
  color: var(--green);
}

.debt-hero {
  background:
    linear-gradient(135deg, rgba(23, 33, 43, 0.96), rgba(37, 111, 179, 0.86)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent);
}

.dashboard-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  margin-bottom: 10px;
}

.insight-card,
.dashboard-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.94)),
    var(--surface);
  border: 1px solid rgba(215, 225, 232, 0.94);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.insight-card:hover,
.dashboard-section:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.insight-card {
  min-height: 126px;
  overflow: hidden;
  padding: 12px;
  position: relative;
}

.insight-card::before,
.dashboard-section::before {
  background: linear-gradient(90deg, var(--teal), transparent);
  content: "";
  height: 4px;
  inset: 0 0 auto 0;
  position: absolute;
}

.dashboard-section {
  overflow: hidden;
  padding: 12px;
  position: relative;
}

.section-heading {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.compliance-card {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
}

.compliance-card h2 {
  font-size: 44px;
  line-height: 1;
}

.compliance-ring {
  align-items: center;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 56%),
    conic-gradient(var(--green) var(--value), var(--surface-strong) 0);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 104px;
  justify-content: center;
  width: 104px;
}

.compliance-ring strong {
  font-size: 20px;
}

.debt-card::before {
  background: linear-gradient(90deg, var(--red), var(--yellow));
}

.debt-card.positive::before {
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.debt-grid,
.quality-grid {
  display: grid;
  gap: 8px;
  margin-top: var(--space-3);
}

.debt-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quality-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.debt-grid div,
.quality-grid div {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(215, 225, 232, 0.86);
  border-radius: var(--radius);
  min-width: 0;
  padding: 10px;
}

.debt-grid span,
.quality-grid span,
.comparison-stats span,
.trend-week span,
.heatmap-cell span,
.heatmap-cell small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
}

.debt-grid strong,
.quality-grid strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  margin-top: 5px;
}

.quality-card::before {
  background: linear-gradient(90deg, var(--indigo), var(--purple));
}

.debt-employees-section,
.pending-section {
  margin-bottom: 10px;
}

.debt-employees-section::before {
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
}

.debt-employee-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.debt-employee-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 10px;
  position: relative;
}

.debt-employee-card.debt {
  background: linear-gradient(180deg, #fff, var(--red-soft));
  border-color: var(--red-line);
}

.debt-employee-card.surplus {
  background: linear-gradient(180deg, #fff, var(--green-soft));
  border-color: var(--green-line);
}

.debt-employee-head {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.debt-employee-head h3 {
  font-size: 17px;
  line-height: 1.1;
  margin: 0;
}

.debt-bar {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  height: 8px;
  margin: 9px 0;
  overflow: hidden;
}

.debt-bar span {
  background: linear-gradient(90deg, var(--teal), var(--green));
  display: block;
  height: 100%;
}

.debt-employee-card.debt .debt-bar span {
  background: linear-gradient(90deg, var(--red), var(--yellow));
}

.debt-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.debt-stats div {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(215, 225, 232, 0.84);
  border-radius: var(--radius);
  padding: 6px;
}

.debt-stats span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  margin-bottom: 4px;
}

.debt-stats strong {
  display: block;
  font-size: 13px;
  line-height: 1;
}

.badge.debt-badge {
  background: var(--red);
  color: #fff;
}

.badge.fulfilled {
  background: var(--green);
  color: #fff;
}

.badge.review {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.badge.neutral {
  background: var(--gray-soft);
  border: 1px solid var(--gray-line);
  color: var(--gray);
}

.pending-section::before {
  background: linear-gradient(90deg, var(--red), var(--purple));
}

.pending-count {
  align-items: center;
  background: var(--red);
  border-radius: var(--radius);
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  min-width: 38px;
  padding: 0 11px;
}

.pending-filters {
  background: rgba(238, 244, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 0.75fr) minmax(360px, 1.5fr) minmax(180px, 0.55fr);
  margin-bottom: 10px;
  padding: 8px;
}

.pending-filters fieldset {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.pending-filters legend {
  color: var(--muted);
  flex: 0 0 100%;
  font-size: 10px;
  font-weight: 900;
  margin-bottom: 1px;
  text-transform: uppercase;
}

.filter-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  min-height: 30px;
  padding: 0 9px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition), transform var(--transition);
}

.filter-chip:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transform: translateY(-1px);
}

.filter-chip:active {
  transform: translateY(0);
}

.filter-chip:focus-visible {
  outline: 3px solid rgba(37, 111, 179, 0.28);
  outline-offset: 2px;
}

.filter-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.pending-list {
  display: grid;
  gap: 7px;
}

.secondary-analysis {
  margin-bottom: 14px;
}

.secondary-analysis-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-analysis-links a {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding: 7px 10px;
  text-decoration: none;
}

.secondary-analysis-links a:hover {
  border-color: var(--line-strong);
  color: var(--teal);
}

.pending-row {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.9));
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange-line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 0.9fr) minmax(150px, 0.9fr) auto;
  padding: 8px;
}

.pending-row.conflict {
  background: linear-gradient(180deg, #fff, var(--red-soft));
  border-color: var(--red-line);
  border-left-color: var(--red);
}

.pending-main strong,
.pending-main span,
.pending-times span,
.pending-hours span {
  display: block;
}

.pending-main strong {
  font-size: 14px;
}

.pending-main span,
.pending-times span,
.pending-hours span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.pending-times,
.pending-hours {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pending-times strong,
.pending-hours strong {
  color: var(--text);
}

.comparison-section::before {
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.comparison-list {
  display: grid;
  gap: 10px;
}

.comparison-row {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 244, 247, 0.74));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 0.85fr) minmax(0, 1.6fr) auto;
  padding: 12px;
}

.comparison-name strong,
.comparison-percent {
  font-size: 20px;
}

.comparison-name span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-top: 4px;
}

.bar-track {
  background: var(--surface-strong);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.bar-track span {
  background: linear-gradient(90deg, var(--teal), var(--green));
  display: block;
  height: 100%;
}

.comparison-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 8px;
}

.trend-section::before {
  background: linear-gradient(90deg, var(--green), var(--red));
}

.trend-chart {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 196px;
}

.trend-week {
  display: grid;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.trend-bars {
  align-items: end;
  background: var(--surface-strong);
  border: 1px solid rgba(215, 225, 232, 0.85);
  border-radius: var(--radius);
  display: flex;
  gap: 3px;
  height: 136px;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.trend-bars span {
  border-radius: 999px 999px 0 0;
  display: block;
  min-height: 2px;
  width: 11px;
}

.trend-compliance {
  background: linear-gradient(180deg, var(--green), var(--teal));
}

.trend-missing {
  background: linear-gradient(180deg, var(--red), var(--yellow));
}

.trend-balance.debt {
  background: linear-gradient(180deg, var(--red), #e35a4f);
}

.trend-balance.surplus {
  background: linear-gradient(180deg, var(--green), #54bd7a);
}

.trend-week strong {
  font-size: 12px;
}

.trend-week small {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
}

.trend-legend,
.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.trend-legend {
  margin-top: var(--space-3);
}

.trend-legend span,
.heatmap-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 6px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-flex;
  height: 10px;
  width: 10px;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.yellow {
  background: var(--yellow);
}

.legend-dot.red {
  background: var(--red);
}

.legend-dot.blue {
  background: var(--blue);
}

.legend-dot.purple {
  background: var(--purple);
}

.heatmap-section {
  margin-bottom: 10px;
}

.heatmap-section::before {
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red), var(--blue), var(--purple));
}

.heatmap-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(31, minmax(34px, 1fr));
}

.heatmap-grid-30 {
  grid-template-columns: repeat(30, minmax(34px, 1fr));
}

.heatmap-cell {
  background: var(--gray-soft);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  color: var(--text);
  display: grid;
  font: inherit;
  gap: 3px;
  min-height: 54px;
  min-width: 0;
  padding: 5px 4px;
  position: relative;
  text-align: center;
  text-decoration: none;
}

button.heatmap-cell {
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

button.heatmap-cell:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.heatmap-cell strong {
  font-size: 13px;
  line-height: 1;
}

.heatmap-cell.complete {
  background: linear-gradient(180deg, #fff, var(--green-soft));
  border-color: var(--green-line);
}

.heatmap-cell.incomplete {
  background: linear-gradient(180deg, #fff, var(--yellow-soft));
  border-color: var(--yellow-line);
}

.heatmap-cell.absent,
.heatmap-cell.missing {
  background: linear-gradient(180deg, #fff, var(--red-soft));
  border-color: var(--red-line);
}

.heatmap-cell.rest {
  background: linear-gradient(180deg, #fff, var(--blue-soft));
  border-color: var(--blue-line);
}

.heatmap-cell.manual {
  background: linear-gradient(180deg, #fff, var(--purple-soft));
  border-color: var(--purple-line);
}

.heatmap-cell.conflict {
  background: linear-gradient(180deg, var(--purple-soft), var(--red-soft));
  border-color: var(--red-line);
}

.heatmap-cell.manual strong,
.heatmap-cell.manual small,
.heatmap-cell.conflict strong,
.heatmap-cell.conflict small {
  color: var(--purple);
}

.heatmap-cell.has-conflict {
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.22);
}

.metric,
.panel,
.employee-card,
.week-card,
.toolbar-panel,
.range-panel,
.details-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(215, 225, 232, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.metric {
  align-items: center;
  column-gap: 8px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  overflow: hidden;
  padding: 10px 10px 10px 13px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.dashboard-metrics .metric {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.92)),
    var(--surface);
}

.metric::before {
  background: var(--teal);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 5px;
}

.metric:hover,
.panel:hover,
.employee-card:hover,
.week-card:hover,
.day-card:hover,
.range-panel:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.metric-icon {
  align-items: center;
  background: var(--surface-strong);
  border-radius: var(--radius);
  color: var(--teal);
  display: inline-flex;
  font-weight: 900;
  grid-column: 1;
  grid-row: 1 / span 2;
  height: 24px;
  justify-content: center;
  margin-bottom: 0;
  width: 24px;
}

.metric span:not(.metric-icon),
.stat-grid span,
.week-total span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.metric span:not(.metric-icon) {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  display: block;
  font-size: 23px;
  grid-column: 2;
  grid-row: 2;
  line-height: 1;
  white-space: nowrap;
}

.accent-green::before {
  background: var(--green);
}

.accent-green .metric-icon {
  background: var(--green-soft);
  color: var(--green);
}

.accent-blue::before {
  background: var(--blue);
}

.accent-blue .metric-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.accent-red::before {
  background: var(--red);
}

.accent-red .metric-icon {
  background: var(--red-soft);
  color: var(--red);
}

.accent-yellow::before {
  background: var(--yellow);
}

.accent-yellow .metric-icon {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.accent-gray::before {
  background: var(--gray);
}

.accent-gray .metric-icon {
  background: var(--gray-soft);
  color: var(--gray);
}

.panel,
.toolbar-panel,
.range-panel {
  margin-bottom: var(--space-4);
  padding: 14px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.range-panel {
  animation: fade-in-up 260ms ease both;
  display: grid;
  gap: 10px;
}

.range-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 210px) minmax(150px, 210px) auto;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.preset-link {
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gray);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.preset-link:hover {
  background: var(--blue-soft);
  border-color: var(--blue-line);
  color: var(--blue);
  transform: translateY(-1px);
}

.employee-cards,
.week-cards {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.employee-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.employee-card,
.week-card {
  animation: fade-in-up 280ms ease both;
  overflow: hidden;
  padding: 15px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.week-card::before,
.employee-card::before {
  background: linear-gradient(90deg, var(--teal), transparent);
  content: "";
  height: 4px;
  inset: 0 0 auto 0;
  position: absolute;
}

.week-card.danger::before,
.employee-card.danger::before {
  background: linear-gradient(90deg, var(--red), transparent);
}

.week-card.warning::before,
.employee-card.warning::before {
  background: linear-gradient(90deg, var(--orange), transparent);
}

.employee-card-head,
.week-card-head,
.day-top {
  align-items: flex-start;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
}

.employee-status {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  text-align: right;
}

.status-dot {
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(20, 130, 71, 0.12);
  display: inline-flex;
  height: 12px;
  width: 12px;
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.risk {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.12);
}

.week-total strong {
  display: block;
  font-size: 23px;
  line-height: 1;
}

.week-total-short {
  display: none;
}

.progress {
  background: var(--surface-strong);
  border-radius: 999px;
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  position: relative;
}

.progress span {
  animation: fill-bar 620ms ease both;
  background: linear-gradient(90deg, var(--green), #54bd7a);
  display: block;
  height: 100%;
  position: relative;
  transition: width 280ms ease;
}

.progress span::after {
  animation: shimmer 2.8s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.employee-card.danger .progress span,
.week-card.danger .progress span {
  background: linear-gradient(90deg, var(--red), #e35a4f);
}

.employee-card.warning .progress span,
.week-card.warning .progress span {
  background: linear-gradient(90deg, var(--orange), var(--yellow));
}

.stat-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid.employee-summary {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-bottom: 12px;
}

.stat-grid.dashboard-summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.stat-grid div {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 9px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

.stat-grid strong {
  font-size: 16px;
}

.week-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 10px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.day-card::before {
  background: var(--gray);
  border-radius: 999px;
  content: "";
  height: 3px;
  inset: 0 10px auto 10px;
  position: absolute;
}

.day-card-header {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.day-card--complete {
  background: linear-gradient(180deg, #ffffff, var(--green-soft));
  border-color: var(--green-line);
}

.day-card--complete::before {
  background: var(--green);
}

.day-card--incomplete {
  background: linear-gradient(180deg, #ffffff, var(--yellow-soft));
  border-color: var(--yellow-line);
}

.day-card.manual-day {
  box-shadow: 0 10px 24px rgba(160, 100, 0, 0.12);
}

.day-card.conflict-day {
  border-color: var(--red-line);
  box-shadow: 0 12px 28px rgba(180, 35, 24, 0.16);
}

.day-card--incomplete::before {
  background: var(--yellow);
}

.day-card--absent {
  background: linear-gradient(180deg, #ffffff, var(--red-soft));
  border-color: var(--red-line);
}

.day-card--absent::before {
  background: var(--red);
}

.day-card--holiday,
.day-card--rest {
  background: linear-gradient(180deg, #ffffff, var(--blue-soft));
  border-color: var(--blue-line);
}

.day-card--holiday::before,
.day-card--rest::before {
  background: var(--blue);
}

.day-card--empty {
  background: linear-gradient(180deg, #ffffff, var(--gray-soft));
  border-color: var(--gray-line);
}

.day-top {
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  padding-top: 5px;
}

.day-top strong {
  display: block;
  font-size: 16px;
}

.day-top span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.holiday-name {
  color: var(--blue);
  display: block;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.punch-pair {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 8px;
}

.punch-pair div {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(191, 206, 216, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 7px;
}

.punch-pair span {
  color: #516272;
  display: block;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.punch-pair strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-detail {
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr;
  margin-bottom: 8px;
}

.day-detail span {
  align-items: center;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(215, 225, 232, 0.58);
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  font-size: 10.5px;
  font-weight: 800;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) max-content;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: normal;
  padding: 3px 5px;
  white-space: nowrap;
}

.day-detail strong {
  color: var(--text);
  font-size: 11px;
  justify-self: end;
  line-height: 1.05;
  white-space: nowrap;
}

.day-footer {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  height: 5px;
  margin-top: auto;
  overflow: hidden;
}

.day-footer span {
  background: linear-gradient(90deg, var(--teal), var(--green));
  display: block;
  height: 100%;
}

.day-adjust-button {
  margin-top: 8px;
  min-height: 34px;
  width: 100%;
}

.day-card--absent .day-footer span,
.day-card--incomplete .day-footer span {
  background: linear-gradient(90deg, var(--yellow), var(--red));
}

.today-list {
  display: grid;
  gap: var(--space-3);
}

.today-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.today-row {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  padding: var(--space-3);
}

.today-card {
  align-items: stretch;
  flex-direction: column;
  min-height: 156px;
}

.today-card-main {
  align-items: flex-start;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
}

.today-card.needs-correction {
  background: linear-gradient(180deg, #fff, var(--yellow-soft));
}

.today-row.completo {
  border-left: 5px solid var(--green);
}

.today-row.incompleto {
  border-left: 5px solid var(--yellow);
}

.today-row.ausente {
  border-left: 5px solid var(--red);
}

.today-row.festivo,
.today-row.descanso {
  border-left: 5px solid var(--blue);
}

.today-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

.compact-table {
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td strong,
.muted {
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.right {
  text-align: right;
}

.action-cell {
  min-width: 184px;
}

.row-action {
  display: inline-flex;
  margin-left: 6px;
}

.empty,
.empty-panel {
  color: var(--muted);
  padding: 28px 10px;
  text-align: center;
}

.badge {
  border-radius: var(--radius);
  display: inline-flex;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  text-transform: capitalize;
}

.badge-stack {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.employee-state-label {
  display: none;
}

.badge.completo {
  background: var(--green-soft);
  color: var(--green);
}

.badge.incompleto {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.badge.ausente {
  background: var(--red-soft);
  color: var(--red);
}

.badge.festivo,
.badge.descanso {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.sin-datos {
  background: var(--gray-soft);
  color: var(--gray);
}

.badge.manual {
  background: #14253a;
  color: #fff;
}

.badge.conflict {
  background: var(--red);
  color: #fff;
}

.notice {
  border-radius: var(--radius);
  font-weight: 900;
  margin-bottom: var(--space-4);
  padding: 12px 14px;
}

.notice.ok {
  background: var(--green-soft);
  color: var(--green);
}

.notice.error {
  background: var(--red-soft);
  color: var(--red);
}

input,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 8px 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue-line);
  box-shadow: 0 0 0 4px rgba(37, 111, 179, 0.12);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 900;
  gap: 6px;
}

.settings-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-grid .form-actions {
  grid-column: 1 / -1;
}

.inline-form {
  align-items: end;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(120px, 180px) minmax(180px, 1fr) auto auto;
}

.holiday-form {
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
}

.check,
.switch-label {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: var(--space-2);
  min-height: 40px;
}

.check input,
.switch-label input,
td input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.details-panel {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
}

.details-panel summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
}

.details-panel summary::-webkit-details-marker {
  display: none;
}

.details-panel[open] summary {
  margin-bottom: var(--space-4);
}

.holiday-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.holiday-row {
  align-items: center;
  background: var(--blue-soft);
  border-radius: var(--radius);
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  padding: 10px 12px;
}

.adjustment-dialog {
  background: transparent;
  border: 0;
  margin: auto;
  max-width: min(520px, calc(100vw - 24px));
  padding: 0;
  width: 100%;
}

.adjustment-dialog::backdrop {
  backdrop-filter: blur(5px);
  background: rgba(23, 33, 43, 0.52);
}

.dialog-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.98)),
    var(--surface);
  border: 1px solid rgba(215, 225, 232, 0.94);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(23, 33, 43, 0.28);
  padding: 18px;
}

.dialog-head {
  align-items: flex-start;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.icon-button {
  align-items: center;
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gray);
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
  width: 34px;
}

.icon-button:hover {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
  transform: translateY(-1px);
}

.adjustment-form,
.adjustment-delete-form {
  display: grid;
  gap: var(--space-3);
}

.adjustment-fields {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.adjustment-delete-form {
  border-top: 1px solid var(--line);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fill-bar {
  from {
    width: 0;
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1366px) {
  .page {
    max-width: 1320px;
    padding: 22px 18px 40px;
  }

  .week-strip {
    grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
  }

  .week-card {
    padding: 14px;
  }

  .heatmap-grid {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  }

  .priority-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .pending-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .page-title,
  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .weekly-title-actions,
  .toolbar-panel,
  .today-metrics {
    justify-content: flex-start;
  }

  .stat-grid.employee-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .week-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .executive-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .debt-employee-grid {
    grid-template-columns: 1fr;
  }

  .quality-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pending-row {
    grid-template-columns: minmax(150px, 1fr) auto;
  }

  .priority-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pending-times,
  .pending-hours {
    grid-column: 1 / -1;
  }

  .pending-filters {
    padding: 7px;
  }
}

@media (max-width: 768px) {
  .topbar,
  .today-row,
  .today-card-main {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: var(--space-3);
    padding: 12px 14px;
  }

  .brand {
    min-width: max-content;
  }

  .nav {
    margin: 0 -2px;
    padding: 4px;
  }

  .mobile-week-nav {
    align-items: center;
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(191, 206, 216, 0.88);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(26, 38, 50, 0.14);
    display: grid;
    gap: 8px;
    grid-template-columns: 40px minmax(0, 1fr) 40px 52px;
    margin: 0 0 12px;
    padding: 7px;
    position: sticky;
    top: 112px;
    z-index: 9;
  }

  .mobile-week-range {
    background: linear-gradient(180deg, #fff, var(--surface-soft));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    min-width: 0;
    overflow: hidden;
    padding: 9px 8px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-week-arrow {
    background: var(--blue-soft);
    color: var(--blue);
    min-width: 0;
  }

  .mobile-week-today {
    background: linear-gradient(135deg, var(--teal), var(--teal-2));
    border-color: transparent;
    color: #fff;
    min-width: 0;
  }

  .mobile-week-arrow:hover,
  .mobile-week-today:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }

  .page-title .range-navigation {
    display: none !important;
  }

  .employee-cards,
  .comparison-row,
  .debt-stats,
  .settings-grid,
  .inline-form,
  .holiday-form,
  .range-form,
  .adjustment-fields,
  .stat-grid,
  .stat-grid.employee-summary {
    grid-template-columns: 1fr;
  }

  .priority-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .range-navigation {
    display: grid !important;
    flex: 0 0 100%;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .range-navigation a:nth-child(1) {
    grid-column: 1;
  }

  .range-navigation a:nth-child(2) {
    grid-column: 2;
  }

  .range-navigation a:nth-child(3) {
    grid-column: 3;
  }

  .range-navigation .button {
    min-width: 0;
    width: 100%;
  }

  .range-navigation .nav-arrow {
    padding: 0;
  }

  .range-navigation .current-week-link {
    min-width: 0;
    padding: 0 8px;
  }

  .weekly-title-actions,
  .sync-action,
  .sync-action .button,
  .toolbar-panel .button,
  .toolbar-panel form,
  .card-actions .button {
    width: 100%;
  }

  .page {
    padding: 18px 12px 34px;
  }

  .section-heading,
  .compliance-card {
    align-items: stretch;
    flex-direction: column;
  }

  .compliance-ring {
    height: 88px;
    width: 88px;
  }

  .debt-grid,
  .quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .pending-filters fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-filters legend {
    grid-column: 1 / -1;
  }

  .filter-chip {
    width: 100%;
  }

  .pending-row .button {
    width: 100%;
  }

  .trend-chart {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  h1 {
    font-size: 26px;
  }

  .day-card-header {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(191, 206, 216, 0.7);
    border-radius: var(--radius);
    margin-bottom: 8px;
    padding: 8px;
  }

  .day-top {
    margin-bottom: 0;
    padding-top: 0;
  }

  .punch-pair {
    gap: 8px;
    margin-bottom: 0;
  }

  .punch-pair div {
    background: #fff;
    border-color: var(--line-strong);
    padding: 8px;
  }

  .punch-pair strong {
    font-size: 15px;
  }

  .day-detail span {
    background: rgba(255, 255, 255, 0.66);
    border-color: rgba(191, 206, 216, 0.82);
    font-size: 11px;
  }

  .day-detail strong {
    font-size: 11.5px;
  }
}

@media (max-width: 480px) {
  .metrics,
  .week-strip,
  .priority-metrics,
  .debt-stats,
  .debt-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 11px 12px 11px 14px;
  }

  .metric strong {
    grid-column: 2;
    margin-top: 2px;
  }

  .employee-card,
  .week-card,
  .insight-card,
  .dashboard-section,
  .range-panel,
  .toolbar-panel {
    padding: 12px;
  }

  .mobile-week-nav {
    grid-template-columns: 38px minmax(0, 1fr) 38px 48px;
    top: 108px;
  }

  .week-card-head,
  .employee-card-head,
  .today-row {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-status {
    justify-content: space-between;
    text-align: left;
  }

  .button,
  .preset-link {
    width: 100%;
  }

  .current-week-link {
    min-width: 0;
  }

  .day-card {
    min-height: 0;
    padding: 9px;
  }

  .trend-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-actions .button,
  .adjustment-delete-form .button {
    width: 100%;
  }

  .pending-filters fieldset {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .page {
    padding: 14px 10px 28px;
  }

  h1 {
    font-size: 23px;
  }

  .punch-pair {
    grid-template-columns: 1fr;
  }

  .day-detail span {
    font-size: 10px;
    padding: 3px 4px;
  }

  .day-detail strong {
    font-size: 10.5px;
  }

  .nav a {
    font-size: 13px;
    padding: 9px 11px;
  }

  .range-navigation {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .mobile-week-nav {
    gap: 6px;
    grid-template-columns: 36px minmax(0, 1fr) 36px 44px;
    padding: 6px;
    top: 106px;
  }

  .mobile-week-range {
    font-size: 14px;
    padding: 9px 6px;
  }

  .nav-arrow {
    min-width: 38px;
    padding: 0 8px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
    overflow-x: clip;
    width: 100%;
  }

  body {
    background:
      linear-gradient(180deg, var(--bg-2), var(--bg));
  }

  .topbar {
    align-items: center;
    background: #0f1f2e;
    border-bottom: 1px solid #06111d;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.26);
    display: grid;
    gap: 6px;
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 46px;
    padding: 5px 7px;
    width: 100%;
  }

  .brand {
    font-size: 0;
    justify-content: center;
    max-width: 30px;
    min-width: 0;
    width: 30px;
  }

  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    border-radius: 6px;
    font-size: 14px;
    height: 28px;
    width: 28px;
  }

  .nav {
    background: #13283a;
    border-color: rgba(45, 212, 191, 0.26);
    display: grid;
    gap: 3px;
    grid-column: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
    padding: 3px;
    width: 100%;
  }

  .nav a {
    align-items: center;
    display: inline-flex;
    color: #cfe3ea;
    font-size: 10.5px;
    justify-content: center;
    min-height: 30px;
    min-width: 0;
    overflow: hidden;
    padding: 6px 2px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .page {
    max-width: 100%;
    overflow-x: visible;
    padding: 8px 8px 24px;
    width: 100%;
  }

  .mobile-week-nav {
    background: #0f1f2e;
    border-color: rgba(45, 212, 191, 0.28);
    border-bottom: 3px solid var(--teal);
    box-shadow: 0 12px 26px rgba(2, 8, 23, 0.28);
    gap: 5px;
    grid-template-columns: 34px minmax(0, 1fr) 34px 42px;
    margin: 0 0 6px;
    padding: 5px;
    top: 46px;
    z-index: 9;
  }

  .mobile-week-arrow,
  .mobile-week-today {
    min-height: 32px;
  }

  .mobile-week-range {
    background: #f7fbfc;
    border-color: rgba(45, 212, 191, 0.42);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
    font-size: 12px;
    min-height: 32px;
    padding: 7px 5px;
  }

  .weekly-page-title {
    display: block;
    margin-bottom: 6px;
  }

  .weekly-page-title > div:first-child {
    display: none;
  }

  .weekly-page-title .weekly-title-actions,
  .weekly-page-title .sync-action,
  .weekly-page-title .sync-action .button {
    width: 100%;
  }

  .weekly-page-title .sync-action .button {
    min-height: 32px;
  }

  .range-panel {
    gap: 0;
    margin-bottom: 8px;
    padding: 8px;
  }

  .range-form {
    align-items: end;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .range-form label {
    font-size: 11px;
    min-width: 0;
  }

  .range-form input {
    font-size: 12px;
    min-height: 34px;
    min-width: 0;
    padding: 7px 6px;
    width: 100%;
  }

  .range-form .button {
    grid-column: 1 / -1;
    min-height: 32px;
    width: 100%;
  }

  .weekly-summary-metrics {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 6px;
  }

  .weekly-summary-metrics .metric {
    align-items: center;
    column-gap: 3px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    min-height: 32px;
    padding: 6px 4px 6px 7px;
  }

  .weekly-summary-metrics .metric-icon {
    display: none;
  }

  .weekly-summary-metrics .metric span:not(.metric-icon) {
    font-size: 9.2px;
    grid-column: 1;
    grid-row: 1;
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
    padding-right: 0;
    text-transform: none;
  }

  .weekly-summary-metrics .metric span:not(.metric-icon)::after {
    content: ":";
  }

  .weekly-summary-metrics .metric strong {
    font-size: 14px;
    grid-column: 2;
    grid-row: 1;
    line-height: 1;
    margin: 0;
    text-align: right;
  }

  .week-card .stat-grid.employee-summary {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 8px;
  }

  .week-card .stat-grid.employee-summary div {
    align-items: baseline;
    display: flex;
    gap: 4px;
    justify-content: space-between;
    min-width: 0;
    padding: 5px 6px;
  }

  .week-card .stat-grid.employee-summary span {
    font-size: 9px;
    line-height: 1;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .week-card .stat-grid.employee-summary strong {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }

  .week-cards {
    gap: 8px;
    margin-bottom: 8px;
  }

  .week-card {
    overflow: visible;
    padding: 8px;
  }

  .week-card-head {
    align-items: center;
    backdrop-filter: none;
    background: #102538;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-bottom: 2px solid rgba(45, 212, 191, 0.56);
    border-top: 4px solid var(--teal);
    border-radius: var(--radius);
    box-shadow: 0 14px 28px rgba(2, 8, 23, 0.30);
    display: grid;
    gap: 2px 6px;
    grid-template-areas:
      "employee-name employee-state"
      "employee-hours employee-hours";
    grid-template-columns: minmax(0, 1fr) auto;
    box-sizing: border-box;
    margin: -1px -9px 7px;
    outline: none;
    padding: 4px 5px;
    position: sticky;
    right: 0;
    top: 94px;
    width: auto;
    z-index: 8;
  }

  .week-card.danger .week-card-head {
    border-top-color: var(--teal);
  }

  .week-card.warning .week-card-head {
    border-top-color: var(--teal);
  }

  .week-card-head > div:first-child {
    align-items: baseline;
    display: flex;
    gap: 4px;
    grid-area: employee-name;
    min-width: 0;
  }

  .week-card-head .eyebrow {
    color: #64748b;
    display: none;
  }

  .week-card-head h2 {
    color: #f8fbfc;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .employee-status {
    display: contents;
  }

  .employee-status .badge-stack {
    display: none;
  }

  .employee-status .badge-stack:empty,
  .employee-status .badge-stack .badge.manual {
    display: none;
  }

  .employee-state-label {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    grid-area: employee-state;
    justify-self: end;
    line-height: 1;
    padding: 5px 8px;
    text-transform: none;
    white-space: nowrap;
  }

  .employee-state-label::before {
    background: currentColor;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72);
    content: "";
    display: inline-flex;
    height: 5px;
    width: 5px;
  }

  .employee-status .badge {
    border-radius: 5px;
    font-size: 9.5px;
    padding: 5px 8px;
  }

  .employee-state-label.debt-badge {
    background: #b91c1c;
    color: #fff;
  }

  .employee-state-label.fulfilled {
    background: #15803d;
    color: #fff;
  }

  .employee-state-label.manual {
    background: #4338ca;
    color: #fff;
  }

  .status-dot {
    display: none;
  }

  .status-dot.risk {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.10);
  }

  .week-total {
    align-items: center;
    background: rgba(226, 245, 249, 0.10);
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 5px;
    display: flex;
    grid-area: employee-hours;
    justify-self: stretch;
    line-height: 1;
    min-width: 0;
    padding: 4px 6px;
  }

  .week-total strong,
  .week-total > span:not(.week-total-short) {
    display: none;
  }

  .week-total .week-total-short {
    color: #e8f6f8;
    display: inline;
    font-size: 11.5px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .week-card .progress {
    height: 6px;
    margin: 7px 0;
  }

  .week-strip.range-strip {
    gap: 6px;
    grid-template-columns: 1fr;
  }

  .day-card {
    min-height: 0;
    padding: 7px;
  }

  .day-card::before {
    inset: 0 7px auto 7px;
  }

  .day-card-header {
    gap: 5px;
    margin-bottom: 6px;
    padding: 6px;
  }

  .day-top {
    gap: 6px;
  }

  .day-top strong {
    font-size: 14px;
  }

  .day-top span {
    font-size: 10px;
  }

  .holiday-name {
    margin-bottom: 4px;
  }

  .punch-pair {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 4px;
  }

  .punch-pair div {
    background: linear-gradient(180deg, #ffffff, #f3f8fa);
    border-color: rgba(91, 122, 142, 0.58);
    border-left: 3px solid rgba(15, 118, 110, 0.78);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.86) inset,
      0 4px 12px rgba(15, 31, 46, 0.06);
    gap: 3px;
    padding: 7px 8px;
  }

  .punch-pair .punch-box-exit {
    border-left-color: rgba(37, 99, 235, 0.72);
  }

  .punch-pair span {
    color: #425466;
    font-size: 8.8px;
    letter-spacing: 0;
    line-height: 1;
  }

  .punch-pair strong {
    color: #102538;
    font-size: 16px;
    line-height: 1;
  }

  .day-detail {
    gap: 4px;
    margin-bottom: 6px;
  }

  .day-detail span {
    background: rgba(255, 255, 255, 0.52);
    border-color: rgba(191, 206, 216, 0.68);
    font-size: 10px;
    padding: 4px 6px;
  }

  .day-detail .day-detail-plant {
    background: linear-gradient(180deg, #e8f7f6, #dff3f0);
    border-color: rgba(15, 118, 110, 0.34);
    color: #0f766e;
    font-weight: 900;
  }

  .day-detail .day-detail-plant strong {
    color: #0b4f4a;
    font-size: 12.5px;
    font-weight: 900;
  }

  .day-detail .day-detail-lunch,
  .day-detail .day-detail-net {
    color: #5f6f7d;
  }

  .day-detail-expected,
  .day-detail-late {
    display: none !important;
  }

  .day-detail strong {
    font-size: 10.5px;
  }

  .day-adjust-button {
    margin-top: 6px;
    min-height: 32px;
  }

  .dashboard-hero.compact-hero {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 7px;
    padding: 8px;
  }

  .dashboard-hero.compact-hero::after {
    width: 34%;
  }

  .compact-hero .eyebrow {
    font-size: 10px;
    margin-bottom: 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .compact-hero h1 {
    font-size: 19px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .compact-hero .hero-copy {
    display: none;
  }

  .compact-hero .actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .compact-hero .actions form,
  .compact-hero .actions .button {
    width: 100%;
  }

  .compact-hero .actions .button {
    font-size: 12px;
    line-height: 1.05;
    min-height: 34px;
    min-width: 0;
    padding: 0 6px;
    text-align: center;
    white-space: normal;
  }

  .priority-metrics {
    gap: 4px;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 7px;
  }

  .metric-card {
    align-items: center;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 34px;
    padding: 6px 8px 6px 10px;
  }

  .metric-card::before {
    height: auto;
    inset: 0 auto 0 0;
    width: 3px;
  }

  .metric-card span {
    font-size: 10px;
    line-height: 1.1;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-card strong {
    font-size: 18px;
    line-height: 1;
    min-width: max-content;
    text-align: right;
    white-space: nowrap;
  }

  .dashboard-section {
    padding: 9px;
  }

  .debt-employees-section,
  .pending-section,
  .dashboard-grid {
    margin-bottom: 7px;
  }

  .section-heading {
    gap: 6px;
    margin-bottom: 7px;
  }

  .pending-section .section-heading {
    align-items: center;
    flex-direction: row;
  }

  .debt-employees-section .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: 16px;
  }

  .section-heading .muted {
    font-size: 11px;
  }

  .pending-count {
    flex: 0 0 auto;
    font-size: 14px;
    height: 28px;
    min-width: 32px;
    padding: 0 8px;
  }

  .debt-employee-grid {
    gap: 7px;
  }

  .debt-employee-card {
    padding: 8px;
  }

  .debt-employee-head {
    align-items: flex-start;
    gap: 6px;
  }

  .debt-employee-head > div:first-child {
    min-width: 0;
  }

  .debt-employee-head h3 {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .badge-stack {
    flex: 0 1 auto;
    max-width: 45%;
  }

  .badge {
    border-radius: 4px;
    font-size: 9.5px;
    padding: 4px 5px;
  }

  .debt-bar {
    height: 6px;
    margin: 7px 0;
  }

  .debt-stats {
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .debt-stats div {
    padding: 5px;
  }

  .debt-stats span {
    font-size: 9px;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .debt-stats strong {
    font-size: 12px;
  }

  .card-actions {
    display: grid;
    gap: 5px;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 7px;
  }

  .card-actions .button,
  .card-actions .badge {
    min-width: 0;
    white-space: normal;
    width: 100%;
  }

  .button {
    border-radius: 4px;
    font-size: 12.5px;
    min-height: 32px;
    padding: 0 8px;
  }

  .pending-filters {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 7px;
    padding: 6px;
  }

  .pending-filters fieldset {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: 1px;
  }

  .pending-filters legend {
    font-size: 9px;
    grid-column: 1 / -1;
    line-height: 28px;
    margin: 0;
  }

  .filter-chip {
    font-size: 11px;
    min-height: 28px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 0 8px;
    white-space: normal;
    width: 100%;
  }

  .pending-list {
    gap: 5px;
  }

  .pending-row {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    padding: 7px;
  }

  .pending-main {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    min-width: 0;
  }

  .pending-main strong,
  .pending-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pending-main strong {
    font-size: 13px;
    min-width: 0;
  }

  .pending-main span {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .pending-row > .badge {
    justify-self: start;
    line-height: 1.1;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-transform: none;
  }

  .pending-times,
  .pending-hours {
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-times span,
  .pending-hours span {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 10px;
    padding: 5px;
  }

  .pending-times strong,
  .pending-hours strong {
    display: block;
    font-size: 12px;
    margin-top: 2px;
  }

  .pending-row .button {
    min-height: 32px;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .page {
    padding-left: 6px;
    padding-right: 6px;
  }

  .compact-hero .actions {
    gap: 5px;
  }

  .compact-hero .actions .button {
    font-size: 11.5px;
    padding: 0 4px;
  }

  .metric-card strong {
    font-size: 16px;
  }

  .filter-chip {
    font-size: 10.5px;
    padding: 0 7px;
  }
}

.ops-hub {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 14px;
}

.ops-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 14px;
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition);
}

.ops-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.ops-card span,
.ops-card small,
.trust-strip span,
.period-status-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-card strong {
  font-size: 20px;
  line-height: 1.1;
}

.ops-card.audit {
  border-left-color: var(--blue);
}

.ops-card.recovery {
  border-left-color: var(--orange);
}

.ops-card.wallboard {
  border-left-color: var(--indigo);
}

.trust-strip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 0.7fr 0.7fr 1.5fr auto;
  margin: 0 0 14px;
  padding: 12px;
}

.trust-strip strong {
  display: block;
  font-size: 15px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.trust-strip.success {
  border-left: 4px solid var(--green);
}

.trust-strip.warning {
  border-left: 4px solid var(--yellow);
}

.trust-strip.danger {
  border-left: 4px solid var(--red);
}

.comparison-grid,
.audit-metrics,
.recovery-scenarios,
.wallboard-kpis,
.cockpit-focus-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-card,
.audit-metrics article,
.recovery-scenarios article,
.wallboard-kpis article,
.cockpit-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.comparison-card {
  display: grid;
  gap: 12px;
}

.comparison-balance {
  align-items: end;
  display: flex;
  justify-content: space-between;
}

.comparison-balance span,
.mini-stat-row span,
.audit-card-times span,
.cockpit-stats span,
.recovery-employee span,
.debt-week-list span,
.wallboard-alerts span,
.wallboard-employee-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.comparison-balance strong {
  color: var(--red);
  font-size: 28px;
}

.comparison-card.surplus .comparison-balance strong,
.comparison-card.even .comparison-balance strong {
  color: var(--green);
}

.mini-stat-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-stat-row strong {
  color: var(--text);
  display: block;
  font-size: 14px;
}

.audit-metrics,
.recovery-scenarios,
.wallboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.audit-metrics article,
.recovery-scenarios article,
.wallboard-kpis article {
  border-top: 4px solid var(--blue);
  display: grid;
  gap: 5px;
}

.audit-metrics article.success,
.recovery-scenarios article.success {
  border-top-color: var(--green);
}

.audit-metrics article.warning,
.recovery-scenarios article.warning {
  border-top-color: var(--yellow);
}

.audit-metrics article.danger,
.recovery-scenarios article.danger {
  border-top-color: var(--red);
}

.audit-metrics span,
.recovery-scenarios span,
.wallboard-kpis span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-metrics strong,
.recovery-scenarios strong,
.wallboard-kpis strong {
  font-size: 24px;
}

.mobile-audit-layout,
.period-grid,
.recovery-layout,
.trust-grid,
.wallboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.audit-queue,
.period-table-wrap {
  min-width: 0;
}

.audit-card,
.period-pending-list article,
.debt-week-list article,
.recovery-employee,
.sync-run-list article,
.wallboard-alerts article,
.audit-priority-row,
.pending-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 9px;
  margin-bottom: 8px;
  padding: 12px;
  text-decoration: none;
}

.audit-card {
  border-left: 4px solid var(--blue);
}

.audit-card.conflict {
  border-left-color: var(--red);
}

.audit-card-head,
.period-pending-list article,
.wallboard-employee-head,
.cockpit-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.audit-card-head strong,
.period-pending-list strong,
.audit-priority-row strong,
.recovery-employee strong,
.debt-week-list strong,
.wallboard-alerts strong {
  display: block;
  font-size: 15px;
}

.audit-card-head span,
.period-pending-list span,
.audit-priority-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.audit-card-times,
.cockpit-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.audit-card-times span,
.cockpit-stats div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.audit-card-times strong,
.cockpit-stats strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  margin-top: 3px;
}

.audit-priority-list {
  display: grid;
  gap: 8px;
}

.audit-priority-row {
  margin: 0;
}

.audit-priority-row.debt,
.recovery-employee.debt,
.comparison-card.debt {
  border-left: 4px solid var(--red);
}

.audit-priority-row.surplus,
.recovery-employee.surplus,
.comparison-card.surplus {
  border-left: 4px solid var(--green);
}

.period-status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  min-width: 220px;
  padding: 14px;
}

.period-status-card strong {
  color: var(--text);
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.period-status-card.success,
.period-hero.success {
  border-left: 4px solid var(--green);
}

.period-status-card.warning,
.period-hero.warning {
  border-left: 4px solid var(--yellow);
}

.period-status-card.danger,
.period-hero.danger {
  border-left: 4px solid var(--red);
}

.period-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.close-checklist {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.close-checklist div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gray);
  border-radius: 8px;
  padding: 12px;
}

.close-checklist div.ok {
  border-left-color: var(--green);
}

.close-checklist div.warning {
  border-left-color: var(--yellow);
}

.close-checklist div.danger {
  border-left-color: var(--red);
}

.close-checklist div.manual {
  border-left-color: var(--purple);
}

.close-checklist strong {
  display: block;
  font-size: 26px;
}

.close-checklist span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-table-wrap {
  overflow-x: auto;
}

.period-table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

.period-table th,
.period-table td {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

.period-table thead th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
  position: sticky;
  top: 0;
}

.period-table tbody th {
  font-size: 13px;
  position: sticky;
  left: 0;
  z-index: 1;
}

.period-table td strong,
.period-table td span {
  display: block;
}

.period-table td.completo {
  background: var(--green-soft);
}

.period-table td.incompleto,
.period-table td.ausente {
  background: var(--red-soft);
}

.period-table td.descanso,
.period-table td.festivo {
  background: var(--blue-soft);
}

.period-table td.manual {
  box-shadow: inset 0 0 0 2px var(--purple-line);
}

.period-table td.conflict {
  box-shadow: inset 0 0 0 2px var(--red);
}

.recovery-employee {
  margin-bottom: 8px;
}

.recovery-bars,
.wallboard-strip {
  background: var(--surface-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.recovery-bars span {
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
  display: block;
  height: 100%;
}

.wallboard-page {
  background: #111827;
  border-radius: 8px;
  color: #f8fafc;
  min-height: calc(100vh - 110px);
  padding: 18px;
}

.wallboard-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.wallboard-head h1 {
  font-size: 42px;
  margin: 0;
}

.wallboard-head .eyebrow,
.wallboard-head span,
.wallboard-page .mini-stat-row span,
.wallboard-page .mini-stat-row strong,
.wallboard-alerts strong,
.wallboard-alerts span,
.wallboard-alerts h2 {
  color: #cbd5e1;
}

.wallboard-alerts strong,
.wallboard-page .mini-stat-row strong {
  color: #f8fafc;
}

.wallboard-kpis article,
.wallboard-employee,
.wallboard-alerts {
  background: #1f2937;
  border-color: #334155;
  color: #f8fafc;
}

.wallboard-kpis article {
  border-top-color: var(--teal);
}

.wallboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.35fr);
}

.wallboard-team {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallboard-employee {
  border-radius: 8px;
  padding: 12px;
}

.wallboard-employee-head strong {
  display: block;
  font-size: 18px;
}

.wallboard-employee-head b {
  font-size: 26px;
}

.wallboard-strip {
  border-radius: 6px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  height: auto;
  margin: 10px 0;
  padding: 3px;
}

.wallboard-strip span {
  background: #475569;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  min-height: 28px;
  padding: 7px 2px;
  text-align: center;
}

.wallboard-strip span.completo {
  background: var(--green);
}

.wallboard-strip span.ausente,
.wallboard-strip span.incompleto,
.wallboard-strip span.conflict {
  background: var(--red);
}

.wallboard-strip span.descanso,
.wallboard-strip span.festivo {
  background: var(--blue);
}

.wallboard-strip span.manual {
  outline: 2px solid var(--purple-line);
}

.wallboard-alerts {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px;
}

.wallboard-alerts h2 {
  margin-top: 0;
}

.wallboard-alerts article {
  background: #111827;
  border-color: #334155;
}

.wallboard-alerts article.conflict {
  border-left: 4px solid var(--red);
}

.cockpit-focus-grid {
  margin-bottom: 14px;
}

.cockpit-card {
  border-left: 4px solid var(--blue);
  display: grid;
  gap: 12px;
}

.cockpit-card.debt {
  border-left-color: var(--red);
}

.cockpit-card.surplus {
  border-left-color: var(--green);
}

.cockpit-trend {
  align-items: end;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 88px;
  padding: 8px;
}

.cockpit-trend span {
  align-items: end;
  display: flex;
  height: 100%;
}

.cockpit-trend i {
  background: var(--green);
  border-radius: 999px 999px 2px 2px;
  display: block;
  min-height: 5px;
  width: 100%;
}

.cockpit-trend i.debt {
  background: var(--red);
}

.cockpit-pending-list {
  display: grid;
  gap: 8px;
}

.pending-mini {
  cursor: pointer;
  margin: 0;
  text-align: left;
}

.pending-mini strong,
.pending-mini span {
  display: block;
}

.trust-grid .button {
  margin-top: 12px;
}

.sync-run-list article {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sync-run-list article.ok {
  border-left: 4px solid var(--green);
}

.sync-run-list article.danger {
  border-left: 4px solid var(--red);
}

@media (max-width: 1100px) {
  .ops-hub,
  .audit-metrics,
  .recovery-scenarios,
  .wallboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-audit-layout,
  .period-grid,
  .recovery-layout,
  .trust-grid,
  .wallboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wallboard-team {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .ops-hub,
  .trust-strip,
  .comparison-grid,
  .audit-metrics,
  .recovery-scenarios,
  .wallboard-kpis,
  .cockpit-focus-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ops-card {
    min-height: 0;
  }

  .audit-card-head,
  .period-pending-list article,
  .wallboard-head,
  .wallboard-employee-head,
  .cockpit-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-card-times,
  .cockpit-stats,
  .mini-stat-row,
  .close-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-status-card {
    min-width: 0;
    width: 100%;
  }

  .wallboard-page {
    margin-left: -6px;
    margin-right: -6px;
    min-height: auto;
    padding: 12px;
  }

  .wallboard-head h1 {
    font-size: 32px;
  }

  .wallboard-strip {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .sync-run-list article {
    align-items: stretch;
    display: grid;
  }
}

@media (max-width: 390px) {
  .ops-card,
  .trust-strip,
  .comparison-card,
  .audit-metrics article,
  .recovery-scenarios article,
  .wallboard-kpis article,
  .cockpit-card,
  .audit-card {
    padding: 10px;
  }

  .audit-card-times,
  .cockpit-stats,
  .mini-stat-row,
  .close-checklist {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-metrics strong,
  .recovery-scenarios strong,
  .wallboard-kpis strong,
  .comparison-balance strong {
    font-size: 20px;
  }
}
