:root {
  --ink: #1f2933;
  --muted: #667085;
  --line: #d9e0e8;
  --surface: #ffffff;
  --bg: #f4f6f8;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.app-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.navbar-brand {
  font-weight: 700;
}

.demo-mode-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 8px;
  border: 1px solid #f0cf63;
  border-radius: 999px;
  background: #fff4c7;
  color: #5c4700;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.nav-link.active {
  color: #0d6efd !important;
  font-weight: 600;
}

.app-main {
  padding: 24px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.page-heading h1 {
  font-size: 28px;
  margin: 0 0 4px;
}

.page-heading p,
.muted {
  color: var(--muted);
  margin: 0;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.surface h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.demo-alert {
  border-color: #f4d675;
  background: #fff8dd;
  color: #6f5600;
}

.subtle-alert {
  border-color: #b9d9ff;
  background: #eef6ff;
  color: #244a73;
}

.system-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.system-status div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.system-status span,
.system-status strong {
  display: block;
}

.system-status span {
  color: var(--muted);
  font-size: 13px;
}

.form-narrow {
  max-width: 920px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.actions {
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stats-grid.compact {
  margin: 16px 0;
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.compact-actions {
  margin-top: 0;
}

.import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.version-list,
.list-line {
  display: grid;
  gap: 10px;
}

.week-preview {
  display: grid;
  gap: 8px;
}

.week-preview div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.week-preview span {
  color: var(--muted);
}

.version-item,
.list-line {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.version-item span,
.list-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.schedule-days {
  display: grid;
  gap: 12px;
}

.schedule-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.day-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.rest-label {
  color: var(--muted);
  font-size: 13px;
  display: none;
}

.schedule-day.is-rest .rest-label {
  display: inline;
}

.schedule-day.is-rest .day-fields {
  opacity: .35;
  pointer-events: none;
}

.time-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}

.quick-filters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.legend-verde { background: #edf7ee; border: 1px solid #4caf50; }
.legend-amarillo { background: #fff8df; border: 1px solid #d6a700; }
.legend-rojo { background: #fff0f1; border: 1px solid #dc3545; }
.legend-gris { background: #f2f4f7; border: 1px solid #98a2b3; }
.legend-azul { background: #eef5ff; border: 1px solid #2f80ed; }

.filter-action {
  display: flex;
}

.report-table {
  padding: 0;
  overflow-x: auto;
}

.report-table table {
  min-width: 980px;
  margin: 0;
}

.report-table th {
  background: #f8fafc;
}

.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.report-table thead th span,
.report-table thead th strong {
  display: block;
}

.employee-col {
  min-width: 180px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.report-table tbody .employee-col {
  background: #fff;
}

.day-cell {
  min-width: 150px;
  display: grid;
  gap: 6px;
}

.point {
  border-left: 4px solid #d0d5dd;
  background: #f9fafb;
  border-radius: 6px;
  padding: 6px 7px;
}

.point span,
.point em {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}

.point strong {
  display: block;
  font-size: 15px;
}

.point-verde { border-color: #4caf50; background: #edf7ee; }
.point-amarillo { border-color: #d6a700; background: #fff8df; }
.point-rojo { border-color: #dc3545; background: #fff0f1; }
.point-azul,
.status-vacaciones,
.status-permiso,
.status-incidencia { border-left: 4px solid #2f80ed; background: #eef5ff; border-radius: 6px; padding: 8px; }
.status-descanso { border-left: 4px solid #98a2b3; background: #f2f4f7; border-radius: 6px; padding: 8px; }

@media (max-width: 800px) {
  .app-main {
    padding: 16px;
  }

  .page-heading,
  .report-filters {
    grid-template-columns: 1fr;
    display: grid;
    align-items: stretch;
  }

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