﻿:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #60706c;
  --line: #dce5e2;
  --surface: #ffffff;
  --surface-2: #f4f8f7;
  --accent: #0f6b5f;
  --accent-2: #1c7c9e;
  --warn: #b96d16;
  --ok: #16824f;
  --shadow: 0 18px 50px rgba(28, 54, 49, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface-2);
}

button, input, select, textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #10231f;
  color: #eef8f5;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand span,
.brand small {
  display: block;
  color: #b7d4ce;
  font-size: 0.9rem;
}

.brand small {
  color: #eef8f5;
  font-size: 0.78rem;
  margin-top: 3px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 5px;
}

.nav {
  display: grid;
  gap: 8px;
}

body.auth-required .nav,
body.auth-required .main,
body.auth-required #userCard {
  display: none;
}

body.auth-required .sidebar {
  min-height: 100vh;
}

body.auth-required #loginForm {
  margin-top: 0;
}

.nav-item, .ghost, .primary {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item {
  text-align: left;
  padding: 12px;
  color: #eef8f5;
  background: transparent;
}

.nav-item.active, .nav-item:hover { background: rgba(255, 255, 255, 0.12); }

.session-card {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.session-card select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  background: #18342f;
  border-radius: 8px;
  padding: 10px;
}

.session-card input {
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  background: #18342f;
}

.login-fields {
  display: grid;
  gap: 8px;
}

.session-card small { color: #bed8d3; }

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 2vw, 2.35rem); }
h2 { margin-bottom: 0; font-size: 1.1rem; }

.top-actions, .filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view { display: none; }
.view.active { display: block; }

.split-grid, .two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 980px);
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.notice {
  border: 1px solid #c9ded8;
  background: #edf7f4;
  color: #24453f;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.notice.warn {
  border-color: #e2c99e;
  background: #fff7e8;
  color: #6d4513;
}

.inline-status {
  border: 1px solid #b9ded2;
  background: #e9f7f2;
  color: #176048;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.inline-status.warn {
  border-color: #e2c99e;
  background: #fff7e8;
  color: #6d4513;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-row input {
  width: 20px;
  height: 20px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; }

.primary {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
}

.primary:disabled {
  cursor: progress;
  opacity: 0.72;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
}

.hidden { display: none; }

.chip, .status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e6f3f0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge { background: #eaf3fb; color: var(--accent-2); }

.roster-list, .activity-list, .compact-list, .report {
  display: grid;
  gap: 10px;
}

.roster-card, .activity-card, .compact-row, .metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.roster-card strong, .activity-card strong { display: block; }

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.activity-card {
  display: grid;
  gap: 8px;
}

.activity-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.readers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reader-dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf1f0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.reader-dot.read {
  color: #fff;
  background: var(--ok);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.day-card {
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.day-card h3 { font-size: 0.9rem; margin-bottom: 8px; }

.shift-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shift-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.shift-table th,
.shift-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px;
  text-align: center;
  vertical-align: middle;
}

.shift-table thead th {
  background: #dce9f7;
  color: #17324c;
  font-weight: 800;
}

.shift-table tbody th {
  text-align: left;
  min-width: 190px;
  background: #fbfdfc;
}

.shift-table tbody th span,
.shift-table tbody th small {
  display: block;
}

.shift-table tbody th small {
  color: var(--muted);
  margin-top: 3px;
}

.shift-table td strong {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 30px;
  border-radius: 6px;
}

.shift-M1 strong { background: #d9f1d8; color: #1d6b2f; }
.shift-M2 strong { background: #ffe6bd; color: #80520e; }
.shift-M3 strong { background: #ffd26d; color: #684b00; }
.shift-T2 strong { background: #cfe2ff; color: #174d91; }
.shift-B1 strong { background: #d9f1d8; color: #1d6b2f; }
.shift-B2 strong { background: #ffc794; color: #753800; }
.shift-B3 strong { background: #3f7fc6; color: #fff; }
.shift-D strong { background: #f0f2f1; color: #65736f; }
.shift-A strong { background: #f7b8b8; color: #8c1f1f; }
.shift-P strong { background: #f3d0ff; color: #6a267b; }
.shift-V strong { background: #c7f0e2; color: #116149; }

.subsection-title {
  margin-top: 26px;
}

.shift-note {
  margin: 12px 0 0;
}

.holiday-controls {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.holiday-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.holiday-day + .holiday-day {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.holiday-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.compact-check {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.incident-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.incident-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.incident-table th,
.incident-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.incident-table thead th {
  background: #eef4f2;
  color: var(--ink);
}

.academy-pane {
  display: none;
}

.academy-pane.active {
  display: block;
}

.academy-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nested-panel {
  box-shadow: none;
}

.academy-list {
  display: grid;
  gap: 10px;
}

.academy-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.academy-training {
  margin-top: 16px;
}

.academy-materials,
.academy-exam {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.academy-material,
.academy-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfefd;
}

.academy-question {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.academy-question legend {
  font-weight: 700;
  margin-bottom: 8px;
}

.academy-question label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  width: 100%;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}

.academy-question input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin-top: 3px;
  flex: 0 0 18px;
}

.academy-question span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.academy-attempt-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.link-button {
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
}

.academy-checklist {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.academy-worker {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.academy-worker input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.academy-worker span,
.academy-worker small {
  display: block;
}

.academy-worker small {
  color: var(--muted);
  margin-top: 2px;
}

.academy-worker.already-assigned {
  opacity: 0.62;
  background: #f3f7f6;
}

.shift-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.shift-legend span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.shift-legend strong {
  color: var(--ink);
  margin-right: 6px;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.compact-row button, .activity-card button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}

.photo-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-preview img, .activity-card img {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong { font-size: 1.45rem; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px;
  }
  .brand { align-items: center; }
  .nav {
    grid-template-columns: repeat(5, minmax(96px, 1fr));
    overflow-x: auto;
  }
  .session-card { margin-top: 0; }
  .split-grid, .two-column { grid-template-columns: 1fr; }
  .single-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .report-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .shift-legend { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .nav, .top-actions, .filter-row, #registro, #supervision, #turnos, #admin { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .view { display: block; }
  .panel { box-shadow: none; border: 0; }
}
