@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
}
:root {
  --green: #10733d;
  --green-light: #1a9a52;
  --dark: #073b2a;
  --dark2: #052319;
  --yellow: #efbd36;
  --yellow-soft: #fff3d6;
  --bg: #f1f5f2;
  --ink: #16241d;
  --muted: #677a70;
  --line: #e2e8e3;
  --surface: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(7, 42, 27, 0.06);
  --shadow-md: 0 10px 30px -10px rgba(7, 42, 27, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(7, 42, 27, 0.28);
  font-family:
    "Plus Jakarta Sans",
    "Segoe UI",
    system-ui,
    -apple-system,
    Arial,
    sans-serif;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.005em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 15% -10%, #e4f1e8 0%, transparent 60%),
    var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 10px;
  background: var(--green);
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: #fff;
  padding: 10px 17px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(16, 115, 61, 0.25);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}
button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 115, 61, 0.3);
}
button:active {
  transform: translateY(0);
}
button.secondary {
  background: #eaf2ec;
  color: var(--dark);
  box-shadow: none;
}
button.secondary:hover {
  background: #dde9e0;
  box-shadow: none;
}
button.danger {
  background: linear-gradient(135deg, #c24b4b, #9f3434);
  box-shadow: 0 2px 8px rgba(159, 52, 52, 0.3);
}
button.primary {
  background: linear-gradient(135deg, var(--green-light), var(--dark));
}
button.mark-cta {
  background: linear-gradient(135deg, var(--yellow), #d9960f);
  color: var(--dark2);
  box-shadow: 0 4px 16px rgba(216, 150, 15, 0.4);
  font-weight: 700;
}
button.mark-cta:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 20px rgba(216, 150, 15, 0.45);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #d3ddd5;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(26, 154, 82, 0.15);
}
input[type="checkbox"] {
  width: auto;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #324940;
}
textarea {
  min-height: 85px;
}
header {
  background: linear-gradient(120deg, var(--dark2), var(--dark) 70%);
  border-bottom: 3px solid var(--yellow);
  color: white;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}
header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
header small {
  color: #a9ccb6;
  font-size: 12px;
}
.whoami {
  color: #d7e9dd;
  font-size: 13px;
  font-weight: 600;
  padding-right: 4px;
}
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}
nav {
  background: linear-gradient(185deg, #0d4632 0%, #0a3826 100%);
  padding: 18px 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}
nav button {
  text-align: left;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #d9e7de;
  padding: 10px 12px;
  border-radius: 9px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    padding-left 0.15s ease;
}
nav button:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: none;
  box-shadow: none;
  padding-left: 15px;
}
nav button.active {
  background: linear-gradient(90deg, rgba(239, 189, 54, 0.18), rgba(239, 189, 54, 0.04));
  color: #fff;
  font-weight: 700;
  border-left: 3px solid var(--yellow);
  padding-left: 10px;
}
.nav-group {
  color: #7fae92;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 16px 12px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 6px;
}
.nav-group:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 2px;
}
.content {
  padding: 28px 30px 60px;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.panel h2,
.panel h3 {
  margin-top: 0;
}
h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 16.5px;
  font-weight: 700;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.toolbar label {
  min-width: 150px;
  flex: 1;
  max-width: 250px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.kpi {
  position: relative;
  border: 1px solid var(--line);
  border-left: none;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--yellow), var(--green));
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.02em;
}
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  text-align: left;
  background: #eef4f0;
  color: #52675c;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
td,
th {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}
tbody tr {
  transition: background 0.1s ease;
}
tbody tr:hover {
  background: #f6faf7;
}
td button {
  font-size: 12px;
  padding: 6px 10px;
  margin: 2px;
  box-shadow: none;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  background: #e7f0e9;
  white-space: normal;
}
.badge.warn {
  background: var(--yellow-soft);
  color: #805b0a;
}
.badge.bad {
  background: #fde7e7;
  color: #9d3030;
}
.badge.good {
  background: #dcf3e4;
  color: #086a31;
}

/* Calendario operativo */
.cal-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #f6faf7;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.cal-legend-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11.5px;
  color: #44584c;
}
.cal-legend-label {
  font-weight: 700;
  color: #233c2e;
}
.cal-legend-desc {
  font-size: 10.5px;
  font-weight: 500;
  color: #70867a;
  line-height: 1.35;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 22px;
  border: 1px solid #c9d6cd;
  border-radius: var(--radius-sm);
  overflow: visible;
  background: #c9d6cd;
  box-shadow: inset 0 0 0 1px #c9d6cd;
}
.cal-dow {
  text-align: center;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 0;
  background: #eef4f0;
}
.cal-day {
  min-height: 118px;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  cursor: pointer;
  font-weight: 400;
  color: var(--ink);
  box-shadow: inset 0 -1px 0 rgba(7, 59, 42, 0.05);
  text-align: left;
  position: relative;
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease;
}
.cal-day:hover {
  background: #f6faf7;
  transform: none;
  box-shadow:
    inset 0 -1px 0 rgba(7, 59, 42, 0.05),
    inset 0 0 0 1px #d6e2d9;
  z-index: 1;
}
.cal-day.cal-outside {
  background: #fafbfa;
  color: #b6c0ba;
  min-height: 118px;
  box-shadow: inset 0 -1px 0 rgba(7, 59, 42, 0.03);
}
.cal-day.cal-outside .cal-num {
  color: #b6c0ba;
  font-weight: 600;
}
.cal-num {
  font-weight: 700;
  font-size: 12.5px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 3px;
}
.cal-day.cal-today {
  box-shadow: inset 0 -1px 0 rgba(7, 59, 42, 0.05);
}
.cal-day.cal-today .cal-num {
  background: var(--green-light);
  color: #fff;
  box-shadow: 0 1px 4px rgba(16, 115, 61, 0.4);
}
.cal-day.cal-selected {
  background: #eaf3ec;
  box-shadow:
    inset 0 0 0 1.5px var(--green-light),
    0 2px 6px rgba(16, 115, 61, 0.12);
  z-index: 2;
}
.cal-day.cal-selected:hover {
  background: #e2eee5;
}
.cal-ev {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  overflow: hidden;
}
.cal-ev-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: var(--green-light);
}
.cal-ev-holiday {
  background: #fff3d6;
  color: #8a600a;
  border-radius: 5px;
  padding: 2px 6px;
  font-weight: 700;
  margin-bottom: 2px;
}
.cal-ev-holiday .cal-dot {
  display: none;
}
.cal-ev-bday .cal-dot {
  background: #d23f85;
}
.cal-ev-anniv .cal-dot {
  background: #5457c7;
}
.cal-ev-turno .cal-dot {
  background: #7c8d84;
}
.cal-ev-approved .cal-dot {
  background: #1f9a4e;
}
.cal-ev-pending .cal-dot {
  background: #d9960f;
}
.cal-ev-bad .cal-dot {
  background: #c24b4b;
}
.cal-ev-warn .cal-dot {
  background: #dd8a2e;
}
.cal-more {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  padding-left: 12px;
  margin-top: 1px;
}
.cal-detail h4 {
  margin: 18px 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #3c5347;
}

/* Evidencia de marca (foto + GPS) */
.evidence-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: linear-gradient(160deg, #f6faf7, #eef5f0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 14px 0 6px;
}
.evidence-photo,
.evidence-gps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.evidence-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.evidence-status {
  font-size: 12.5px;
  color: var(--muted);
}
.evidence-status.good {
  color: #086a31;
  font-weight: 600;
}
.evidence-status.bad {
  color: #9d3030;
  font-weight: 600;
}
.evidence-status.warn {
  color: #a9760a;
  font-weight: 600;
}
.my-marks {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.my-marks h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.mark-tracker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.mark-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fbfdfb;
}
.mark-step.done {
  background: #eaf6ee;
  border-color: #bfe3c9;
}
.mark-step-icon {
  font-size: 15px;
  font-weight: 700;
  color: #b6c0ba;
}
.mark-step.done .mark-step-icon {
  color: var(--green-light);
}
.mark-step-label {
  font-size: 11.5px;
  font-weight: 700;
  flex: 1;
  color: #44584c;
}
.mark-step-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.mark-step.done .mark-step-time {
  color: #086a31;
}

.login {
  max-width: 440px;
  margin: 10vh auto;
}
.login label {
  margin: 15px 0;
}
.login h1 {
  color: var(--green);
  font-size: 26px;
}
.formgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field-full {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 24px;
}
.error {
  color: #9d3030;
  background: #fff0f0;
  padding: 12px;
  border-radius: 8px;
}
.note {
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  padding: 14px;
  line-height: 1.6;
  margin: 12px 0;
  font-size: 13px;
  border-radius: 0 10px 10px 0;
}
.success {
  background: #e4f4e9;
  padding: 12px;
  border-radius: 8px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 900px;
  width: calc(100vw - 32px);
  max-height: 90vh;
  padding: 26px;
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: rgba(3, 34, 22, 0.55);
  backdrop-filter: blur(2px);
}
.photo {
  max-width: 100%;
  max-height: 65vh;
  display: block;
  margin: auto;
  border-radius: 12px;
}
.thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 7px;
}
.cards {
  display: grid;
  gap: 10px;
}
.card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: box-shadow 0.12s ease;
}
.card:hover {
  box-shadow: var(--shadow-sm);
}
.card .actions {
  margin-top: 10px;
}
#status {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark2);
  color: white;
  border-radius: 14px;
  padding: 14px 22px;
  z-index: 1000;
  max-width: min(95vw, 650px);
  display: none;
  box-shadow: var(--shadow-lg);
}
.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
  min-width: 1000px;
}
.calendar > div {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
}
.calendar .shift {
  display: block;
  padding: 9px;
  background: #dceee1;
  margin-top: 6px;
  border-radius: 7px;
}
.company {
  display: flex;
  align-items: center;
  gap: 12px;
}
.company img {
  max-width: 50px;
  max-height: 50px;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
details {
  margin-top: 14px;
}
summary {
  cursor: pointer;
  color: var(--green);
}
pre {
  white-space: pre-wrap;
  font-size: 12px;
}
a {
  color: var(--green);
}
@media (max-width: 850px) {
  .shell {
    display: block;
  }
  nav {
    flex-direction: row;
    overflow: auto;
    padding: 10px;
    gap: 6px;
  }
  nav button {
    white-space: nowrap;
  }
  nav button:hover {
    padding-left: 12px;
  }
  .content {
    padding: 16px;
  }
  header {
    padding: 14px;
    font-size: 13px;
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  header h1 {
    font-size: 19px;
  }
  .whoami {
    order: -1;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .field-full {
    grid-column: auto;
  }
  td,
  th {
    padding: 9px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .nav-group {
    display: none;
  }
  .cal-legend {
    gap: 5px 10px;
    padding: 10px;
  }
  .cal-legend-item {
    font-size: 10px;
  }
  .cal-day,
  .cal-day.cal-outside {
    min-height: 58px;
    padding: 4px 3px;
  }
  .cal-num {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  .cal-ev-label {
    display: none;
  }
  .cal-ev {
    gap: 0;
    justify-content: center;
  }
  .cal-ev-holiday {
    padding: 1px;
    font-size: 0;
    text-align: center;
  }
  .cal-ev-holiday::before {
    content: "🎉";
    font-size: 10px;
  }
  .cal-more {
    display: none;
  }
  .evidence-card {
    grid-template-columns: 1fr;
  }
}
@media print {
  header,
  nav,
  .toolbar,
  button,
  #status {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .content {
    padding: 0;
  }
  .panel {
    box-shadow: none;
    border: 0;
  }
  table {
    font-size: 10px;
  }
}

/* ---- Modificación de permisos por la jefatura ---- */
[hidden] {
  display: none !important;
}
.permit-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.permit-was {
  font-size: 11px;
  color: var(--muted);
  text-decoration: line-through;
}
.permit-request {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-light);
  border-radius: var(--radius-sm);
  background: #f6faf7;
}
.permit-box-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.mod-toggle {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed #d9b35a;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  color: #7a5a06;
}
.permit-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}
.permit-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fbfcfb;
}
.permit-box.requested strong {
  color: #5d6f65;
}
.permit-box.granted {
  background: #eaf6ee;
  border-color: #bfe3c9;
}
.permit-box.granted.reduced {
  background: var(--yellow-soft);
  border-color: #ecd08a;
}
.card.notice-mod {
  border-left: 4px solid #d9960f;
  background: #fffaf0;
}
@media (max-width: 850px) {
  .permit-compare {
    grid-template-columns: 1fr;
  }
}
.revoke-warning {
  padding: 12px 16px;
  margin: 4px 0 12px;
  border: 1px solid #f0c2c2;
  border-left: 4px solid #c24b4b;
  border-radius: var(--radius-sm);
  background: #fdf3f3;
  color: #6e2a2a;
  font-size: 13px;
}
.revoke-warning ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.revoke-warning li {
  margin: 3px 0;
}


/* ===== Calendario: legibilidad, tarjeta flotante y agenda interactiva ===== */
h1, h2, h3, h4 {
  letter-spacing: -0.02em;
}
.cal-grid > :nth-child(1) { border-top-left-radius: calc(var(--radius-sm) - 1px); }
.cal-grid > :nth-child(7) { border-top-right-radius: calc(var(--radius-sm) - 1px); }
.cal-grid > :nth-last-child(7) { border-bottom-left-radius: calc(var(--radius-sm) - 1px); }
.cal-grid > :last-child { border-bottom-right-radius: calc(var(--radius-sm) - 1px); }
.cal-toolbar { align-items: center; }
.cal-month { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; min-width: 170px; text-align: center; }
.cal-hint { font-size: 12px; margin: -6px 0 12px; }
.cal-day {
  min-height: 132px;
  gap: 3px;
}
.cal-day.cal-past:not(.cal-selected) { background: #fcfdfc; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.cal-num {
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.cal-todo {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #c24b4b;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(194, 75, 75, 0.35);
}
.cal-ev {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  align-items: flex-start;
  color: #2a3d33;
  padding: 1px 0;
}
.cal-ev .cal-dot { margin-top: 5px; }
.cal-ev-label {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.cal-ev-holiday { font-size: 11px; }
.cal-ev-holiday .cal-ev-label { -webkit-line-clamp: 1; }
.cal-more { font-size: 11px; padding-left: 13px; }

/* Tarjeta flotante con toda la información del día */
.cal-pop {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% - 8px);
  left: 8px;
  width: 300px;
  max-height: 380px;
  overflow: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #d6e2d9;
  box-shadow: 0 18px 44px -14px rgba(7, 42, 27, 0.35), 0 2px 6px rgba(7, 42, 27, 0.08);
  flex-direction: column;
  gap: 8px;
  text-align: left;
  cursor: default;
  pointer-events: none;
}
.cal-pop.pop-left { left: auto; right: 8px; }
.cal-pop.pop-up { top: auto; bottom: calc(100% - 8px); }
@media (hover: hover) and (min-width: 851px) {
  .cal-day:hover .cal-pop,
  .cal-day:focus-visible .cal-pop { display: flex; }
  .cal-day:hover { z-index: 25; }
}
.cal-pop-date { font-size: 13.5px; font-weight: 750; color: var(--dark); letter-spacing: -0.01em; }
.cal-pop-holiday { font-size: 12px; font-weight: 700; color: #8a600a; background: #fff3d6; border-radius: 6px; padding: 4px 8px; }
.cal-pop-sec { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px solid var(--line); }
.cal-pop-title { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; color: #44584c; margin-bottom: 2px; }
.cal-pop-line { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.cal-pop-more { font-size: 11.5px; color: var(--muted); font-style: italic; }
.cal-pop-cta { font-size: 11.5px; font-weight: 700; color: var(--green); padding-top: 6px; border-top: 1px dashed var(--line); }

/* Agenda del día */
.cal-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 8px;
  background: linear-gradient(180deg, #fbfdfb, #fff 120px);
  scroll-margin-top: 90px;
}
.agenda-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.agenda-nav { width: 38px; height: 38px; padding: 0; font-size: 20px; line-height: 1; border-radius: 50%; }
.agenda-title { display: flex; flex-direction: column; gap: 2px; }
.agenda-title h3 { margin: 0; font-size: 20px; font-weight: 750; }
.agenda-kicker { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green-light); }
.agenda-summary { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.agenda-pill { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.pill-todo { background: #fdecec; color: #9d3030; }
.pill-ok { background: #e6f5ea; color: #086a31; }
.pill-info { background: #eef2f0; color: #44584c; }
.agenda-group { margin-bottom: 10px; }
.agenda-group-title { margin: 14px 0 10px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.agenda-sec { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); padding: 12px 14px 4px; margin-bottom: 12px; background: #fff; }
.agenda-sec.sec-pending { border-left-color: #d9960f; }
.agenda-sec.sec-bad { border-left-color: #c24b4b; }
.agenda-sec.sec-warn { border-left-color: #dd8a2e; }
.agenda-sec.sec-good { border-left-color: #1f9a4e; }
.agenda-sec.sec-turno { border-left-color: #7c8d84; }
.agenda-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.agenda-sec-title { font-size: 14.5px; font-weight: 750; color: var(--ink); }
.agenda-count { font-size: 11.5px; font-weight: 750; padding: 2px 8px; border-radius: 999px; background: #eef2f0; color: #44584c; }
.agenda-hint { font-size: 12px; color: var(--muted); flex-basis: 100%; }
.agenda-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.agenda-actions button { padding: 6px 12px; font-size: 12.5px; }
.agenda-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.agenda-chip { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 10px; }
.chip-holiday { background: #fff3d6; color: #8a600a; }
.chip-bday { background: #fde8f2; color: #9c2a62; }
.chip-anniv { background: #ecebfb; color: #3d3fa0; }
.agenda-empty { padding: 6px 0 14px; }
@media (max-width: 850px) {
  .cal-day { min-height: 60px; }
  .cal-todo { min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
  .cal-pop { display: none !important; }
  .cal-hint { display: none; }
  .cal-detail { padding: 14px 12px 4px; }
  .agenda-title h3 { font-size: 16px; }
  .cal-month { min-width: 0; }
  .cal-ev-label { display: none; }
  .cal-ev { justify-content: center; }
  .cal-ev .cal-dot { margin-top: 0; }
  .cal-num { width: 18px; height: 18px; font-size: 11px; }
  .cal-ev-holiday { font-size: 0; padding: 1px; }
  .cal-more { display: none; }
  .agenda-head { grid-template-columns: auto 1fr auto; }
}

/* Historial de permisos */
.permit-box.granted.voided { background: #fbf1f1; border-color: #efcaca; }
.permit-box.granted.voided strong { text-decoration: line-through; color: #8a4a4a; }
.permit-was-note { font-size: 11px; color: var(--muted); font-style: italic; }
.timeline { list-style: none; margin: 4px 0 8px; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #d9960f; box-shadow: 0 0 0 3px #fff; }
.timeline li.tl-good::before { background: #1f9a4e; }
.timeline li.tl-bad::before { background: #c24b4b; }
.tl-when { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tl-detail { color: #44584c; }

/* Reportes */
.report-filters label { min-width: 150px; }
.report-filters label:first-child { min-width: 240px; }
.report-head h3 { margin: 18px 0 2px; font-size: 17px; }
.report-head p { margin: 0 0 12px; }

/* V5.3 — Executive home: visual layer only; no changes to business rules */
.executive-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:30px 34px;margin-bottom:16px;border-radius:22px;color:#fff;background:linear-gradient(115deg,#073b2a 0%,#10733d 72%,#168c49 100%);box-shadow:0 16px 38px rgba(7,59,42,.16)}
.executive-eyebrow{font-size:.7rem;letter-spacing:.17em;font-weight:800;color:#f3cc57}
.executive-hero h2{margin:8px 0;font-size:clamp(1.3rem,2.7vw,2rem);line-height:1.18;color:#fff}
.executive-subtitle{margin:0;color:#e4f1e9;font-size:.88rem}
.executive-alert{display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 155px;min-height:110px;border:1px solid rgba(255,255,255,.23);border-radius:17px;background:rgba(255,255,255,.11);text-align:center}
.executive-alert.has-alerts{border-color:#f3cc57;background:rgba(239,189,54,.16)}
.executive-alert strong{font-size:2.6rem;line-height:1.1;color:#fff}
.executive-alert span{font-size:.75rem;color:#f4f8f5}
.executive-priorities{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:20px}
.executive-priority{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;min-width:0;padding:18px 20px;border:1px solid #dbe7de;border-radius:15px;background:#fff;color:#173c2a;box-shadow:0 4px 16px rgba(7,59,42,.06)}
.executive-priority.needs-attention{border-left:4px solid #efbd36}
.executive-priority span{font-size:.84rem;font-weight:700}
.executive-priority strong{font-size:1.8rem;line-height:1.1}
.executive-priority small{font-size:.72rem;color:#397956}
.executive-priority:hover{background:#f2f8f3;transform:translateY(-1px)}
@media(max-width:700px){.executive-hero{padding:22px;align-items:stretch;flex-direction:column}.executive-alert{flex-basis:auto;min-height:76px;flex-direction:row;gap:14px}.executive-priorities{grid-template-columns:1fr}.executive-priority{display:grid;grid-template-columns:1fr auto;align-items:center}.executive-priority small{grid-column:1/-1}}

/* V5.3.1 — Guardia 360: filtrado accesible */
@media(max-width:720px){.toolbar:has(select[name="estado"]){align-items:stretch}.toolbar:has(select[name="estado"]) label{min-width:0;max-width:100%}}

/* V5.3.2: filtros accesibles del calendario Executive */
.cal-view-filters{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 5px}
.cal-view-filters .cal-filter-btn{border-radius:999px;padding:8px 13px;background:#f3f7f4;color:#174b36;border:1px solid #c8d9ce;font-weight:650}
.cal-view-filters .cal-filter-btn.is-active{background:#075238;color:#fff;border-color:#075238}
.cal-view-filters .cal-filter-btn:focus-visible{outline:3px solid #f0bf35;outline-offset:2px}
.cal-filter-note{font-size:12px;margin:0 0 10px}
@media(max-width:600px){.cal-view-filters{gap:6px}.cal-view-filters .cal-filter-btn{font-size:12px;padding:7px 10px}}

/* Calendario nativo junto a la fecha DD-MM-AAAA. */
.calendar-picker{max-width:160px;min-height:36px;margin-top:4px;cursor:pointer;}

/* Identificación de la versión instalada, también en pantallas pequeñas. */
.app-version { display: block; color: #36574b; font-size: .8rem; font-weight: 600; margin: .15rem 0 .45rem; }

/* V5.4.14: Executive, navegación y lectura adaptable. */
.mobile-menu-button{display:none}.module-heading{margin:0 0 22px;padding:4px 2px}.module-heading h2{margin:7px 0;font-size:1.45rem;color:#143f30}.module-heading .executive-eyebrow{color:#516d60}.module-heading p{margin:0;font-size:.85rem}
.table-block{min-width:0;margin-top:12px}.table-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0}.table-tools .muted{font-size:.78rem}.table-view-toggle{font-size:.8rem}.executive-table:focus-visible{outline:3px solid #b98a16;outline-offset:3px}.executive-table th{vertical-align:top}.executive-table td{overflow-wrap:anywhere}.executive-table td button{margin:3px}
.executive-table.as-cards table,.executive-table.as-cards tbody{display:block;width:100%}.executive-table.as-cards thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.executive-table.as-cards tr{display:block;border:1px solid #dbe6df;border-radius:12px;margin:0 0 12px;padding:10px;background:#fff}.executive-table.as-cards td{display:grid;grid-template-columns:minmax(100px,35%) minmax(0,1fr);gap:12px;border:0;border-bottom:1px solid #edf2ee;padding:9px;text-align:left}.executive-table.as-cards td:before{content:attr(data-label);font-size:.76rem;font-weight:700;color:#526c60}.executive-table.as-cards td.empty{display:block}.executive-table.as-cards td.empty:before{content:none}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #c29420;outline-offset:3px}dialog{max-height:90dvh;overflow:auto}dialog .actions{position:sticky;bottom:-1px;background:#fff;padding:14px 0 4px;border-top:1px solid #e2eae5;z-index:2}dialog h2{color:#143f30}form[aria-busy=true]{cursor:progress}
@media(max-width:850px){.mobile-menu-button{display:inline-flex;align-items:center;justify-content:center}#main-navigation{display:none}#main-navigation.mobile-open{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;border-radius:0}#main-navigation .nav-group{display:block;grid-column:1/-1}#main-navigation button{white-space:normal;text-align:left;min-height:44px}header .toolbar{gap:8px}header button{min-height:44px}header .whoami{width:100%}.content{padding:14px;min-width:0}.panel{padding:16px;min-width:0}.module-heading{margin-bottom:16px}.toolbar{max-width:100%}.toolbar label{min-width:0;max-width:100%}.formgrid input,.formgrid select,.formgrid textarea{min-width:0;max-width:100%}input,select,textarea{font-size:16px;min-height:44px}input[type=checkbox]{min-height:24px;width:24px;height:24px}button{min-height:44px}.table-view-toggle{min-height:44px}.executive-table{max-width:100%;overflow-x:auto}dialog{width:calc(100% - 20px);max-width:calc(100% - 20px);max-height:calc(100dvh - 20px);padding:16px;box-sizing:border-box}dialog .actions{gap:10px}dialog .actions button{flex:1}.app-version{color:inherit}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{.table-tools,.mobile-menu-button,.module-heading{display:none}.executive-table.as-cards table{display:table}.executive-table.as-cards tbody{display:table-row-group}.executive-table.as-cards tr{display:table-row}.executive-table.as-cards td{display:table-cell}.executive-table.as-cards thead{position:static;width:auto;height:auto;clip-path:none;display:table-header-group}.executive-table.as-cards td:before{content:none}}

.backup-download{flex:1 1 320px;min-width:0;max-width:100%}.backup-download p{overflow-wrap:anywhere}
/* V5.4.15: continuidad del calendario y acciones agrupadas. */
.cell-content{min-width:0;overflow-wrap:anywhere}.executive-table.as-cards .cell-content{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.executive-table.as-cards .cell-content>div,.executive-table.as-cards .cell-content>p{max-width:100%}.executive-table.as-cards .cell-content button{margin:0}.planner-summary{font-weight:700;color:#174b36}.planner-calendar{align-items:stretch;min-width:0;gap:10px}.planner-day{min-width:0;background:#f4f8f5;border:1px solid #dbe6df;border-radius:12px;padding:10px}.planner-day h3{font-size:.85rem;margin:0 0 12px;color:#174b36}.planner-day .shift{display:block;width:100%;white-space:pre-line;overflow-wrap:anywhere;text-align:left;line-height:1.6;padding:12px;margin:0 0 10px;min-width:0}.planner-day .muted{font-size:.8rem}.planner-filters>label{flex:1;min-width:160px}.planner-calendar{grid-template-columns:repeat(7,minmax(0,1fr))}
@media(max-width:1100px){.planner-calendar{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.planner-calendar{grid-template-columns:1fr}.planner-filters{display:grid;grid-template-columns:1fr}.planner-filters>label{min-width:0;width:100%}.executive-table.as-cards td{grid-template-columns:minmax(90px,32%) minmax(0,1fr);gap:8px;padding:9px 4px}.executive-table.as-cards .cell-content button{width:100%}}

/* 5.4.31 */
.settlement-suggestion{margin:.5rem 0 1rem}.settlement-suggestion h3{margin:.25rem 0 .5rem}
.twofa-secret{font-family:ui-monospace,Consolas,monospace;font-size:1.05rem;letter-spacing:.08em;word-break:break-all;background:#f3f7f4;border:1px dashed #9cb8a5;border-radius:8px;padding:.6rem .8rem;display:block;margin:.4rem 0}
.twofa-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.35rem .8rem;font-family:ui-monospace,Consolas,monospace;font-size:1rem;margin:.5rem 0}
.twofa-qr{display:block;margin:.5rem auto;max-width:220px;width:100%;height:auto;image-rendering:pixelated;background:#fff;padding:8px;border-radius:8px}
button.linklike{background:none;box-shadow:none;color:var(--dark,#073b2a);text-decoration:underline;padding:.3rem 0;font-weight:500;margin-top:.4rem}
button.linklike:hover{background:none;box-shadow:none}
button.warn-soft{border:1px solid #d9960f;background:#fff6dd}
a.button{display:inline-flex;align-items:center;justify-content:center;padding:.55rem .9rem;border-radius:10px;text-decoration:none;font-weight:600;background:#eef4f0;color:var(--dark,#073b2a);border:1px solid #c8dacd}
.twofa-secret code{font-size:1.1rem;letter-spacing:.1em;word-break:break-all}
/* 5.4.33 cierre paso a paso */
.close-flow{display:flex;flex-direction:column;gap:.8rem}
.close-progress{display:flex;flex-wrap:wrap;gap:.4rem}
.close-chip{padding:.3rem .7rem;border-radius:999px;background:#eef2ef;color:#4b5d52;font-size:.85rem;font-weight:600}
.close-chip.done{background:#dff0e4;color:#1f6b3a}
.close-chip.current{background:#f2b632;color:#2a2205}
.close-step{border:1px solid #d7e3da;border-radius:12px;padding:.8rem 1rem;background:#fff}
.close-step.current{border:2px solid #f2b632;box-shadow:0 2px 10px rgba(242,182,50,.18)}
.close-step.done{background:#f6faf7}
.close-step-head{display:flex;gap:.8rem;align-items:center}
.close-step-head h3{margin:0;font-size:1.05rem}
.close-step-head p{margin:.1rem 0 0}
.close-step-num{flex:0 0 2rem;height:2rem;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#073b2a;color:#fff;font-weight:700}
.close-step.done .close-step-num{background:#2f8a4e}
.close-step.current .close-step-num{background:#f2b632;color:#2a2205}
.close-step-count{color:#9a5b00;font-weight:600}
.close-detail{margin:.25rem 0;font-size:.9rem}
.close-people summary{cursor:pointer;font-weight:600;padding:.4rem 0}
.pact-table{width:100%;border-collapse:collapse;font-size:.9rem}
.pact-table th,.pact-table td{padding:.35rem .4rem;border-bottom:1px solid #e3ebe5;text-align:left;vertical-align:middle}
.pact-table input[type=number]{width:5.5rem}
.pact-warn{font-size:.8rem;color:#7a6400}
.pact-warn.bad{color:#a12f2f;font-weight:700}
.inline-check{display:flex;align-items:center;gap:.4rem}
.labor-item{border-top:1px solid #e3ebe5;padding:.4rem 0}
.labor-item ul{margin:.2rem 0 .2rem 1.4rem;font-size:.9rem}
.table-wrap{overflow-x:auto}
.close-ready-date{font-weight:700;color:#1f6b3a}
