:root {
  --navy: #102a43;
  --navy-2: #183b56;
  --blue: #2563eb;
  --blue-soft: #eaf2ff;
  --green: #16803d;
  --green-soft: #e9f8ef;
  --amber: #b96500;
  --amber-soft: #fff4dc;
  --red: #c62828;
  --red-soft: #fdecec;
  --purple: #6d4cc2;
  --purple-soft: #f1edff;
  --ink: #172033;
  --muted: #657186;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #e2e8f0;
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button, select, input { font: inherit; }
button { cursor: pointer; transition: all 0.2s ease; }

header {
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 22px 28px 18px;
  box-shadow: 0 6px 24px rgba(16, 42, 67, 0.2);
}

.header-wrap { max-width: 1500px; margin: auto; }
.header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.eyebrow { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: #bcd1e5; font-weight: 800; }
.header-title { font-size: 28px; line-height: 1.1; font-weight: 800; margin: 6px 0; }
.header-subtitle { color: #d9e5ef; max-width: 760px; line-height: 1.5; margin: 0; }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
.filter { min-width: 116px; }
.filter label { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #c9d8e6; font-weight: 800; margin-bottom: 5px; }
.filter select, .filter input {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}
.filter.date { min-width: 145px; }
.date-control { position: relative; display: flex; align-items: center; }
.date-control > input[type="text"] { padding-right: 42px; }
.date-calendar-btn {
  position: absolute;
  right: 5px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  box-sizing: border-box;
  padding: 32px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.login-card h1 { margin: 8px 0; color: var(--navy); font-size: 26px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.login-eyebrow { color: var(--blue); }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.login-form input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
.login-form input:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.25); border-color: var(--blue); }
.login-form .upload-btn { width: 100%; margin-top: 14px; }
.login-error {
  margin-bottom: 16px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
}

@media (max-width: 480px) {
  .login-shell { padding: 14px; }
  .login-card { padding: 24px 18px; }
}
.date-calendar-btn:hover, .date-calendar-btn:focus-visible { background: #edf3f8; outline: none; }
.calendar-icon { display: block; width: 14px; height: 13px; margin: auto; border: 1.5px solid currentColor; border-radius: 2px; position: relative; }
.calendar-icon::before { content: ''; position: absolute; left: -1.5px; right: -1.5px; top: 3px; border-top: 1.5px solid currentColor; }
.native-date-proxy { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.date-control input[aria-invalid="true"] { border-color: #f8b4b4; box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.12); }

.action-filter { min-width: max-content; }
.action-label { visibility: hidden; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.hdr-btn {
  height: 38px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.hdr-btn.primary, .hdr-btn.apply {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  padding: 0 16px;
}
.hdr-btn.primary:hover, .hdr-btn.apply:hover { background: #1d4ed8; }

.hdr-btn.secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}
.hdr-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
}

.upload-btn {
  background: var(--blue);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  height: 40px;
  padding: 0 20px;
  font-size: 13px;
}
.upload-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.dropdown { position: relative; display: inline-block; }
.caret { font-size: 9px; margin-left: 2px; transition: transform 0.2s ease; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  background: #ffffff;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(16, 42, 67, 0.18);
  padding: 6px;
  min-width: 240px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.dropdown.open .dropdown-menu { display: flex; }
.dropdown.open .caret { transform: rotate(180deg); }

.management-menus { display: inline-flex; gap: 8px; align-items: center; }
.account-menu-btn {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(79, 174, 169, 0.26);
  color: #fff;
  border: 1px solid rgba(147, 221, 216, 0.58);
  backdrop-filter: blur(4px);
}
.account-menu-btn:hover {
  background: rgba(79, 174, 169, 0.4);
  border-color: rgba(190, 239, 235, 0.82);
}

.dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 9px;
  text-align: left;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  transition: background 0.15s ease;
  cursor: pointer;
}
.dropdown-item:hover { background: #f0f5fc; }
.dropdown-item.primary-item { background: rgba(37, 99, 235, 0.06); }
.dropdown-item.primary-item:hover { background: rgba(37, 99, 235, 0.12); }
.dropdown-item.primary-item .item-title { color: var(--blue); }
.dropdown-item .item-title { font-size: 12px; font-weight: 800; color: #1e293b; }
.dropdown-item .item-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }

.dropdown-divider { height: 1px; background: #e2e8f0; margin: 4px 6px; }

.period-strip {
  max-width: 1500px;
  margin: 14px auto 0;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #d9e5ef;
  font-size: 12px;
}
.period-strip strong { color: #fff; }

nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(16, 42, 67, 0.05);
}
.nav-wrap { max-width: 1500px; margin: auto; padding: 8px 24px; display: flex; gap: 6px; overflow: auto; }
.nav-btn {
  border: 0;
  background: transparent;
  color: #5f6b7c;
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 750;
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(37, 99, 235, 0.05); color: var(--blue); }
.nav-btn.active { background: var(--blue-soft); color: #164e9a; }

main { max-width: 1500px; margin: auto; padding: 24px 24px 60px; }

.empty-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fd 100%);
  border: 1px solid #d0e1f7;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  margin-bottom: 24px;
  text-align: center;
}
.empty-banner-header { max-width: 680px; margin: 0 auto 32px; }
.empty-banner-badge {
  display: inline-block;
  background: var(--blue-soft);
  color: #164e9a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid #b8cef0;
}
.empty-banner-header h2 { font-size: 26px; font-weight: 850; margin: 0 0 10px; color: var(--navy); }
.empty-banner-header p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.main-cta-btn { height: 46px; padding: 0 28px; font-size: 14px; }

.empty-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: left; }
.empty-step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03); }
.empty-step-num { width: 32px; height: 32px; border-radius: 10px; background: var(--blue-soft); color: #164e9a; font-weight: 850; display: grid; place-items: center; font-size: 15px; margin-bottom: 12px; }
.empty-step strong { display: block; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.empty-step span { font-size: 12px; color: var(--muted); line-height: 1.5; }

.page { display: none; }
.page.active { display: block; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.page-heading h2 { font-size: 23px; margin: 0 0 5px; font-weight: 800; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.45; }
.context-badge {
  background: #edf2f7;
  border: 1px solid #dce3eb;
  border-radius: 999px;
  padding: 7px 11px;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 116px;
  position: relative;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 14px 35px rgba(16, 42, 67, 0.12); }
.metric-card:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.metric-card.good:before { background: var(--green); }
.metric-card.warn:before { background: var(--amber); }
.metric-card.bad:before { background: var(--red); }
.metric-card.purple:before { background: var(--purple); }

.metric-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.metric-label { font-size: 11px; line-height: 1.25; text-transform: uppercase; letter-spacing: 0.065em; color: var(--muted); font-weight: 800; flex: 1; }

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  cursor: help;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  user-select: none;
  padding: 0;
  font-family: inherit;
}
.info-btn:hover, .info-btn:focus-visible, .info-btn.open {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  outline: none;
}

.info-btn[data-tooltip]:is(:hover, :focus-visible, .open)::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  white-space: normal;
  text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 999;
  pointer-events: none;
}
.info-btn[data-tooltip]:is(:hover, :focus-visible, .open)::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  right: 4px;
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  z-index: 1000;
  pointer-events: none;
}
.table-wrap .info-btn[data-tooltip]:is(:hover, :focus-visible, .open)::after,
.table-wrap .info-btn[data-tooltip]:is(:hover, :focus-visible, .open)::before {
  z-index: 20;
}
.metric-value { font-size: 28px; letter-spacing: -0.035em; font-weight: 820; margin: 9px 0 4px; }
.metric-help { font-size: 11px; line-height: 1.35; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.grid-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}
.panel-title { font-size: 15px; font-weight: 800; margin: 0; }
.panel-title .info-btn { margin-left: 4px; vertical-align: 1px; }
.panel-sub { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 4px 0 10px; }

.chart { height: auto; min-height: 250px; }
.chart.short { min-height: 245px; }
.chart.tall { min-height: 430px; }

.reading {
  background: linear-gradient(120deg, #eef5ff, #f6fbff);
  border: 1px solid #cfe0f7;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
}
.reading-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #dcecff;
  color: #164e9a;
  font-size: 21px;
  font-weight: bold;
}
.reading h3 { margin: 0 0 7px; font-size: 16px; font-weight: 800; }
.reading p { margin: 0; color: #40516a; line-height: 1.6; }
.reading p + p { margin-top: 5px; }

.insight-list { display: grid; gap: 9px; }
.insight { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.insight-mark { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--red-soft); color: var(--red); font-weight: 900; }
.insight.action .insight-mark { background: var(--green-soft); color: var(--green); }
.insight strong { display: block; font-size: 12px; margin: 1px 0 3px; }
.insight span { font-size: 11px; color: var(--muted); line-height: 1.4; }

.day-selector { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.day-selector select { height: 38px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 0 12px; min-width: 150px; }

.timeline { display: flex; width: 100%; height: 52px; border-radius: 12px; overflow: hidden; background: #eef2f6; border: 1px solid var(--line); margin: 18px 0 10px; }
.timeline-seg { height: 100%; min-width: 1px; position: relative; }
.timeline-seg.zero { background: #ef6a6a; }
.timeline-seg.one { background: #f4bd57; }
.timeline-seg.many { background: #55b77a; }
.timeline-seg:hover { filter: brightness(0.94); }

.timeline-hours { display: grid; grid-template-columns: repeat(10, 1fr); font-size: 10px; color: var(--muted); margin-top: -4px; }
.timeline-hours span:last-child { text-align: right; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin: 10px 0; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

.day-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.mini-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafcff; }
.mini-stat b { display: block; font-size: 18px; margin-bottom: 3px; }
.mini-stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.055em; font-weight: 800; }

.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: visible; max-height: none; position: relative; z-index: 1; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
th { position: sticky; top: 0; z-index: 2; text-align: left; background: #f8fafc; color: #566274; text-transform: uppercase; font-size: 10px; letter-spacing: 0.055em; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.number { text-align: right; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.good { background: var(--green-soft); color: var(--green); border: 1px solid #bce6ca; }
.badge.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid #f8e1b4; }
.badge.bad { background: var(--red-soft); color: var(--red); border: 1px solid #f8b4b4; }
.badge.info { background: var(--blue-soft); color: #164e9a; border: 1px solid #b8cef0; }
.badge.purple { background: var(--purple-soft); color: var(--purple); border: 1px solid #dcd0ff; }

/* Celula de Hora da Matriz de Abertura */
.time-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.time-cell.good { background: var(--green-soft); color: var(--green); border: 1px solid #bce6ca; }
.time-cell.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid #f8e1b4; }
.time-cell.bad { background: var(--red-soft); color: var(--red); border: 1px solid #f8b4b4; }
.time-cell.purple { background: var(--purple-soft); color: var(--purple); border: 1px solid #dcd0ff; }

.agent-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 8px 11px; font-size: 11px; font-weight: 750; color: #526074; cursor: pointer; transition: all 0.2s; }
.agent-chip.selected { border-color: #8ab2ed; background: var(--blue-soft); color: #164e9a; }
.agent-chip input { margin: 0; accent-color: var(--blue); }
.picker-actions { display: flex; gap: 8px; margin-top: 10px; }
.agent-selection-panel { margin-bottom: 14px; }
.team-charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.small-btn { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #465468; padding: 0 11px; font-size: 11px; font-weight: 800; }
.small-btn.primary { background: var(--blue-soft); border-color: #b8cef0; color: #164e9a; }
.small-btn.danger { background: var(--red-soft); border-color: #f8b4b4; color: var(--red); }

/* Modal Gestão de Cargas */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  max-width: 850px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 800; }
.close-modal-btn { border: 0; background: transparent; font-size: 24px; font-weight: bold; color: var(--muted); }
.close-modal-btn:hover { color: var(--ink); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.justification-modal-card { max-width: 720px; }
.justification-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-field { min-width: 0; }
.form-field.full-width, .decision-field.full-width { grid-column: 1 / -1; }
.form-field label, .decision-field legend {
  display: block;
  margin-bottom: 6px;
  color: #40516a;
  font-size: 11px;
  font-weight: 800;
}
.form-field > input, .form-field > textarea, .light-date-control > input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  font: inherit;
  outline: none;
}
.form-field > input { height: 40px; }
.form-field > textarea { resize: vertical; min-height: 82px; }
.form-field > input:focus, .form-field > textarea:focus, .light-date-control > input[type="text"]:focus {
  border-color: #8ab2ed;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}
.decision-field { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.decision-field label { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: #40516a; }
.decision-field input { accent-color: var(--blue); }
.form-message, .overlap-warning { margin-top: 14px; padding: 12px; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.form-message.error { color: var(--red); background: var(--red-soft); border: 1px solid #f8b4b4; }
.overlap-warning { color: #7a4b06; background: var(--amber-soft); border: 1px solid #f8e1b4; }
.overlap-warning > div { display: grid; gap: 4px; margin: 8px 0; }
.justification-panel { margin-top: 14px; }
.justification-list-state { margin-bottom: 10px; padding: 11px; border-radius: 9px; background: #f8fafc; color: var(--muted); font-size: 12px; }
.justification-list-state.loading { color: #164e9a; background: var(--blue-soft); }
.justification-list-state.error { color: var(--red); background: var(--red-soft); border: 1px solid #f8b4b4; }
.table-note { margin-top: 5px; color: var(--muted); font-size: 10px; max-width: 280px; }
.row-actions { display: flex; gap: 6px; }
.justification-modal-actions .upload-btn:disabled { opacity: 0.55; cursor: wait; }

/* Gráficos nativos responsivos */
.vchart-scroll { overflow-x: auto; overflow-y: hidden; padding: 12px 2px 4px; }
.vchart-scroll .vchart { width: max-content; min-width: 100%; }
.vchart-scroll .vcol { min-width: var(--group-min, 60px); flex: 0 0 var(--group-min, 60px); }
.vchart { height: 230px; display: flex; align-items: stretch; justify-content: center; gap: 8px; width: 100%; border-bottom: 1px solid var(--line); padding: 8px 4px 0; position: relative; background: repeating-linear-gradient(to top, transparent 0, transparent 44px, #edf1f5 45px); }
.vcol { min-width: 0; max-width: 140px; flex: 1 1 0; display: grid; grid-template-rows: 24px 1fr 28px; gap: 4px; text-align: center; }
.vvalue { font-size: 10px; color: #40516a; font-weight: 800; white-space: nowrap; }
.vtrack { height: 100%; min-width: var(--group-min, 60px); display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.vbar { width: 22px; min-height: 2px; border-radius: 6px 6px 2px 2px; transition: height 0.3s ease; }
.vbar.slim { width: 18px; }
.vlabel { font-size: 11px; font-weight: 750; color: #40516a; white-space: nowrap; padding-top: 4px; }

.hchart { display: grid; gap: 12px; padding: 7px 0; }
.hrow { display: grid; grid-template-columns: 125px 1fr; gap: 10px; align-items: center; }
.hlabel { font-size: 11px; font-weight: 750; color: #40516a; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.hbars { display: grid; gap: 5px; }
.hbar-line { display: grid; grid-template-columns: 1fr 78px; gap: 8px; align-items: center; }
.htrack { height: 13px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.hfill { height: 100%; border-radius: 999px; min-width: 1px; transition: width 0.3s ease; }
.hnum { font-size: 10px; color: #64748b; font-weight: 750; }
.hbar-annotation { display: flex; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 10px; }
.hbar-annotation b { color: var(--purple); min-width: 78px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 11px; color: #40516a; font-weight: 700; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }

.stack-chart { display: grid; gap: 13px; padding: 7px 0; }
.stack-row { display: grid; grid-template-columns: 125px 1fr 55px; gap: 10px; align-items: center; }
.stack-track { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: #eef2f6; }
.stack-seg { height: 100%; min-width: 0; transition: width 0.3s ease; }
.stack-total { font-size: 10px; color: #64748b; font-weight: 750; }

.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; min-height: 235px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; border-radius: 50%; position: relative; }
.donut:after { content: ""; position: absolute; inset: 31px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 2; font-size: 22px; font-weight: 850; }
.donut-center small { display: block; font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.donut-legend { display: grid; gap: 12px; min-width: 190px; }
.donut-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 11px; }
.donut-item i { width: 11px; height: 11px; border-radius: 3px; }
.donut-item b { font-size: 12px; }

.heat-scroll { overflow-y: auto; overflow-x: auto; height: 100%; max-height: 480px; width: 100%; padding: 0 8px 8px 0; }
.heat-layout { display: flex; flex-direction: column; width: 100%; min-width: 100%; min-height: 100%; }
.heat-axis-row { display: grid; grid-template-columns: 64px 1fr; flex: 0 0 18px; }
.heat-axis { position: relative; height: 18px; }
.heat-axis-label { position: absolute; top: 0; transform: translateX(-50%); font-size: 9px; color: #64748b; font-weight: 700; white-space: nowrap; }
.heat-axis-label.start { transform: none; }
.heat-axis-label.end { transform: translateX(-100%); }
.heat-grid { display: grid; flex: 1; gap: 3px; align-items: stretch; width: 100%; min-width: 0; min-height: 0; grid-auto-rows: minmax(18px, 1fr); }
.heat-day { position: sticky; left: 0; z-index: 3; background: #fff; padding-right: 6px; font-size: 11px; font-weight: 800; color: #40516a; white-space: nowrap; }
.heat-cell { width: 100%; min-height: 18px; height: 100%; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.4); transition: transform 0.15s ease, box-shadow 0.15s ease; cursor: pointer; }
.heat-cell:hover { transform: scale(1.2); z-index: 10; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }
.heat-cell.zero { background: #ef6a6a; }
.heat-cell.one { background: #f4bd57; }
.heat-cell.many { background: #55b77a; }
.heat-cell.justified { background: #a8b2bf; }

.range-chart { display: grid; gap: 7px; max-height: 245px; overflow-y: auto; overflow-x: hidden; padding: 5px 0; }
.range-row { display: grid; grid-template-columns: 55px 1fr; gap: 8px; align-items: center; }
.range-label { font-size: 9px; color: #64748b; text-align: right; }
.range-track { height: 16px; margin: 0 8px; background: #eef2f6; border-radius: 999px; position: relative; }
.range-span { position: absolute; top: 5px; height: 6px; background: #b7c8dc; border-radius: 999px; }
.range-dot { position: absolute; top: 2px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.range-dot.first { background: var(--blue); }
.range-dot.last { background: var(--green); }
.range-empty { color: var(--muted); font-size: 10px; padding-left: 8px; }

details { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 0 16px; margin-top: 16px; }
summary { cursor: pointer; padding: 15px 0; font-weight: 800; color: #40516a; }
details .method-body { padding: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.method-item { border-left: 3px solid #c8d6e5; padding-left: 10px; }
.method-item strong { display: block; color: #344054; margin-bottom: 3px; }

.empty { color: var(--muted); padding: 20px; text-align: center; }
#coverageHeatmap .empty.loading,
#coverageHeatmap .empty.error {
  min-height: 220px;
  display: grid;
  place-items: center;
}
.footer-note { color: var(--muted); font-size: 11px; text-align: center; margin-top: 18px; }

.metric-comparison { margin-top: 8px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.metric-comparison.good { color: var(--green); }
.metric-comparison.bad { color: var(--red); }
.metric-comparison.neutral { color: var(--muted); }
.data-state { padding: 18px; margin-bottom: 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); background: #fff; }
.data-state.error { color: var(--red); border-color: #f8b4b4; background: var(--red-soft); }
.quality-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.header-wrap > .quality-strip { max-width: 1500px; margin: 10px auto 0; color: #d9e5ef; font-size: 11px; }
.quality-label { color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: 0.055em; }
.quality-item { border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 5px 9px; background: rgba(255, 255, 255, 0.08); }
.quality-item b { color: #fff; }
.quality-item.ok { border-color: rgba(85, 183, 122, 0.65); }
.quality-item.warning { border-color: rgba(244, 189, 87, 0.75); color: #ffe6ad; }
.panel-header-flex { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.table-pagination { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.page-info { color: var(--muted); font-size: 11px; font-weight: 750; }
.pagination-btn:disabled { opacity: 0.45; cursor: default; }
.modal-caption { margin: 2px 0 0; font-size: 11px; color: var(--muted); }

.users-modal-card { max-width: 980px; }
.password-modal-card { max-width: 560px; }
.users-modal-body { display: grid; gap: 22px; }
.user-section { border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.user-section h4 { margin: 0 0 14px; color: var(--navy); font-size: 15px; }
.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.user-form-grid .full-width { grid-column: 1 / -1; }
.user-form-grid input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
.user-form-grid input:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.2); border-color: var(--blue); }
.user-form-grid small { color: var(--muted); }
.users-table-wrap { max-height: 300px; overflow: auto; }
.user-action-panel { background: #f8fafc; }
.user-status-text { min-height: 40px; display: flex; align-items: center; font-weight: 750; }
.form-message.success { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }
.form-message.error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.form-message { border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.chatbot-table-wrap { max-height: 480px; overflow: auto; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; font-size: 11px; color: var(--muted); }
.chatbot-cell { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #465468; padding: 6px 9px; font-size: 10px; font-weight: 800; }
.chatbot-cell.active { background: var(--purple-soft); border-color: #dcd0ff; color: var(--purple); }
.coverage-primary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; align-items: stretch; }
.coverage-primary-grid > .panel { display: flex; flex-direction: column; }
.coverage-primary-grid > .panel > .chart { flex: 1; }
.coverage-secondary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }

@media (max-width: 1250px) {
  .header-top { display: block; }
  .filters { justify-content: flex-start; margin-top: 18px; }
  .empty-steps { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  header { padding: 20px; }
  .filters { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter, .filter.date { min-width: 0; }
  .action-filter { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .btn-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .btn-group > .hdr-btn, .btn-group > .dropdown, .btn-group > .dropdown > .hdr-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
  .management-menus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-column: 1 / -1; width: 100%; }
  .management-menus > .dropdown, .management-menus > .dropdown > .hdr-btn { width: 100%; min-width: 0; }
  .management-menus > .dropdown > .hdr-btn { justify-content: center; }
  .management-menus > #configDropdown > .dropdown-menu { left: 0; right: auto; }
  .nav-wrap, main { padding-left: 15px; padding-right: 15px; }
  .grid-2, .grid-equal, .grid-3, .coverage-primary-grid, .coverage-secondary-grid { grid-template-columns: 1fr; }
  .day-summary { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .justification-form-grid { grid-template-columns: 1fr; }
  .form-field.full-width, .decision-field.full-width { grid-column: auto; }
  .justification-modal-actions { display: grid; grid-template-columns: 1fr; }
  .justification-modal-actions > button { width: 100%; }
  .justification-panel .panel-header-flex { display: grid; grid-template-columns: 1fr; }
  .justification-panel .panel-header-flex > button { width: 100%; }
  .row-actions { min-width: 142px; }
}

@media (max-width: 700px) {
  .user-form-grid { grid-template-columns: 1fr; }
  .user-form-grid .full-width { grid-column: auto; }
  .users-modal-card, .password-modal-card { width: 100%; max-height: calc(100vh - 20px); }
  .account-menu-btn { max-width: 100%; }
}
