:root {
    --ly-primary: #1a3154;
    --ly-primary-soft: #e9f5ff;
    --ly-accent: #5cb7f0;
    --ly-bg: #f6f9fc;
    --ly-surface: #ffffff;
    --ly-text: #18242f;
    --ly-muted: #627588;
    --ly-border: #dce5ef;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top right, #ebf6ff, #f6f9fc 48%, #eef4fa 100%);
  color: var(--ly-text);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--ly-text);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ly-border);
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  overflow: hidden;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.4rem 0.2rem 1.2rem;
  border-bottom: 0;
  box-shadow: 0 10px 14px -14px rgba(22, 56, 88, 0.45);
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.brand-link:hover {
  background: transparent;
  color: inherit;
  transform: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #c8d2db;
    box-shadow: 4px 8px 20px #1b65a680;
}

.brand-logo {
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-title {
  font-size: 1rem;
  margin: 0;
  line-height: 1;
}

.brand-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ly-muted);
  text-transform: uppercase;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1.25rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.menu-nav a {
  color: var(--ly-text);
  text-decoration: none;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
}

.menu-nav a:hover,
.menu-nav a.active {
  background: var(--ly-primary-soft);
  color: var(--ly-primary);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--ly-border);
  padding-top: 1rem;
  font-size: 0.86rem;
}

.sidebar-user-card {
  border: 1px solid #d8e4f1;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-radius: 14px;
  padding: 0.75rem;
}

.sidebar-user-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-user-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1a3154;
  background: #e9f2fc;
  font-size: 1.1rem;
}

.sidebar-user-label {
  font-size: 0.72rem;
  color: var(--ly-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ly-text);
}

.sidebar-logout-btn {
  border-radius: 10px;
}

.swal2-popup.swal-lym-popup {
  border-radius: 16px;
  border: 1px solid var(--ly-border);
  box-shadow: 0 18px 44px rgba(17, 50, 75, 0.2);
  padding: 1.15rem 1.2rem;
}

.swal-lym-popup .swal2-title {
  color: #17344f;
  font-size: 1.18rem;
}

.swal-lym-popup .swal2-html-container {
  color: #5f7389;
  font-size: 0.94rem;
}

.swal-lym-popup .swal2-actions {
  gap: 0.65rem;
  margin-top: 1rem;
}

.swal-lym-popup .swal2-actions .swal2-styled {
  margin: 0;
}

.swal-lym-confirm,
.swal-lym-cancel {
  border: 0;
  border-radius: 10px;
  padding: 0.56rem 0.95rem;
  font-weight: 600;
}

.swal-lym-confirm {
  background: #d44734;
  color: #fff;
}

.swal-lym-confirm:hover {
  background: #b93a2a;
}

.swal-lym-cancel {
  background: #edf2f7;
  color: #2f4a64;
}

.swal-lym-cancel:hover {
  background: #dee8f2;
}

.alert {
  border-radius: 14px;
  border-width: 1px;
  box-shadow: 0 10px 24px rgba(17, 50, 75, 0.08);
}

.alert .btn-close {
  opacity: 0.72;
}

.alert .btn-close:hover {
  opacity: 1;
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--ly-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0px;
  z-index:1000;
}

.content-body {
  padding: 1.2rem;
}

.table-card {
  border: 1px solid #d3e1ef;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 18px 36px rgba(15, 45, 72, 0.11);
  overflow: hidden;
}

.table-card .table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

    .table-card .table thead th {
        background: #24507cd9;
        border-bottom: 1px solid #1f3157;
        color: #e6eef9;
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 0.95rem 1rem;
    }

.table-card .table thead th:first-child {
  border-top-left-radius: 12px;
}

.table-card .table thead th:last-child {
  border-top-right-radius: 12px;
}

.table-card .table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.table-card .table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.table-card .table tbody td {
  border-color: #eef3f8;
  padding: 0.9rem 1rem;
  vertical-align: middle;
  background: #ffffff;
}

.table-card .table tbody tr:nth-child(even) td {
  background: #fcfeff;
}

.table-card .table tbody tr:hover td {
  background: #f2f8ff;
}

.table-pagination {
  padding: 0.45rem 0.2rem 0;
}

.table-pagination-count {
  color: #5f7389 !important;
  font-size: 0.82rem;
  font-weight: 600;
}

.table-pagination-nav {
  margin-left: auto;
}

.ly-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.ly-pagination .page-link {
  min-width: 36px;
  height: 36px;
  padding: 0 0.7rem;
  border: 1px solid #cfdeed;
  border-radius: 10px !important;
  background: #f7fbff;
  color: #1f4d7a;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(23, 66, 102, 0.08);
}

.ly-pagination .page-item.active .page-link {
  background: #24507cd9;
  border-color: #1f466f;
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 73, 116, 0.24);
}

.ly-pagination .page-item.disabled .page-link {
  background: #f3f7fb;
  border-color: #dde8f3;
  color: #8aa0b5;
  box-shadow: none;
}

.ly-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  background: #e9f3fc;
  border-color: #b8d1e8;
  color: #1a4772;
}

.ly-pagination .page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(40, 129, 203, 0.18);
}

.ly-pagination .ly-page-gap .page-link {
  min-width: 30px;
  padding: 0 0.45rem;
}

@media (max-width: 768px) {
  .table-pagination {
    justify-content: center !important;
  }

  .table-pagination-count {
    width: 100%;
    text-align: center;
  }

  .table-pagination-nav {
    width: 100%;
    margin-left: 0;
  }

  .ly-pagination {
    justify-content: center;
  }

  .ly-pagination .page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 0.55rem;
    font-size: 0.8rem;
  }
}

.badge-soft {
  border-radius: 999px;
  background: var(--ly-primary-soft);
  color: var(--ly-primary);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.form-control,
.form-select {
  border-radius: 0.85rem;
  border: 1px solid #d5e3f1;
  background-color: #fbfdff;
  box-shadow: inset 0 1px 1px rgba(20, 57, 89, 0.05);
  min-height: 42px;
}

.form-control:focus,
.form-select:focus {
  border-color: #77afe1;
  box-shadow: 0 0 0 0.2rem rgba(40, 129, 203, 0.18);
  background: #fff;
}

.input-validation-error,
.form-control.input-validation-error,
.form-select.input-validation-error,
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #d44734 !important;
  background-color: #fff7f6;
  box-shadow: 0 0 0 0.2rem rgba(212, 71, 52, 0.14);
}

.field-validation-error,
span.field-validation-error,
.text-danger.field-validation-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b93a2a !important;
}

.validation-summary-errors {
  border-radius: 12px;
  border: 1px solid #efb5ad;
  background: #fff3f1;
  color: #8f2a1f;
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.5rem;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.validation-summary-valid {
  display: none;
}

select.form-select[multiple] {
  min-height: 140px;
  padding: 0.6rem;
}

select.form-select[multiple] option {
  border-radius: 8px;
  margin: 2px 0;
  padding: 0.35rem 0.55rem;
}

.btn {
  border-radius: 0.75rem;
}

.btn-sm {
  border-radius: 0.65rem;
}

.choices {
  margin-bottom: 0;
}

.choices__inner {
  min-height: 42px;
  border-radius: 0.85rem;
  border: 1px solid #d5e3f1;
  background-color: #fbfdff;
  padding: 0.45rem 0.75rem;
  box-shadow: inset 0 1px 1px rgba(20, 57, 89, 0.05);
}

.choices[data-type*=select-one] .choices__inner {
  padding-bottom: 0.45rem;
}

.choices[data-type*=select-one]::after {
  border-color: #5e7c97 transparent transparent transparent;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: #77afe1;
  box-shadow: 0 0 0 0.2rem rgba(40, 129, 203, 0.18);
  background: #fff;
}

.choices.is-invalid .choices__inner {
  border-color: #d44734 !important;
  background: #fff7f6;
  box-shadow: 0 0 0 0.2rem rgba(212, 71, 52, 0.14);
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  border: 1px solid #cfe0ef;
  border-radius: 0.85rem;
  margin-top: 6px;
  box-shadow: 0 12px 24px rgba(21, 56, 85, 0.14);
  overflow: hidden;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  padding: 0.6rem 0.8rem;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: #eaf4ff;
  color: #145992;
}

.choices__list--multiple .choices__item {
  border-radius: 999px;
  background: #e9f5ff;
  border: 1px solid #cce3f8;
  color: #185c95;
}

.supervision-legend,
.supervision-table-card .supervision-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #5f7389;
    font-size: 0.78rem;
    font-weight: 600;
}

.supervision-legend span,
.supervision-table-card .supervision-legend span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

.supervision-legend .status-dot {
    flex-shrink: 0;
}

.supervision-grid thead th {
    background: #24507cd9;
    color: #e5effa;
    border-bottom-color: #1f3157;
}

.supervision-grid thead th:first-child {
  border-top-left-radius: 0;
}

.supervision-grid thead th:last-child {
  border-top-right-radius: 0;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  border: 2px solid transparent;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
}

.status-dot.ok {
        color: #16a34a;
        border-color: #4ade80;
}

.status-dot.bad {
    color: #dc2626;
    border-color: #f87171;
}

.status-dot.na {
  color: #8a99ad;
  border-color: #c8d0db;
}

.value-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
}

.value-pill.high {
  background: #1f9d60;
}

.value-pill.mid {
  background: #f0a23a;
}

.value-pill.low {
  background: #df4a54;
}

.value-pill.scale-0 {
  background: #7f1d1d;
}

.value-pill.scale-1 {
  background: #7a1c1c;
}

.value-pill.scale-2 {
  background: #b82e2e;
}

.value-pill.scale-3 {
  background: #c4831f;
}

.value-pill.scale-4 {
  background: #3f8f4a;
}

.value-pill.scale-5 {
  background: #1f6b3a;
}

.kpi-card {
  border: 1px solid var(--ly-border);
  border-radius: 18px;
  background: var(--ly-surface);
  padding: 1rem;
  min-height: 110px;
  box-shadow: 0 8px 24px rgba(17, 50, 75, 0.05);
}

.kpi-card span {
  color: var(--ly-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-card h3 {
  margin: 0.6rem 0 0;
  font-size: 2rem;
  font-weight: 700;
}

.kpi-card.warning h3 {
  color: #d44734;
}

.kpi-card.success h3 {
  color: #1f8f60;
}

.kpi-card.high h3 {
  color: #1f8f60;
}

.kpi-card.mid h3 {
  color: #f0a23a;
}

.kpi-card.low h3 {
  color: #df4a54;
}

.kpi-card.scale-0 h3 {
  color: #7f1d1d;
}

.kpi-card.scale-1 h3 {
  color: #7a1c1c;
}

.kpi-card.scale-2 h3 {
  color: #b82e2e;
}

.kpi-card.scale-3 h3 {
  color: #c4831f;
}

.kpi-card.scale-4 h3 {
  color: #3f8f4a;
}

.kpi-card.scale-5 h3 {
  color: #1f6b3a;
}

.panel-card {
  border: 1px solid var(--ly-border);
  border-radius: 18px;
  background: var(--ly-surface);
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(17, 50, 75, 0.05);
}

.empty-state-box {
  border: 1px dashed #c7d9ea;
  border-radius: 14px;
  padding: 1rem;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
}

.panel-head h4 {
  margin: 0;
  font-size: 1rem;
}

.chart-wrap {
  position: relative;
  min-height: 260px;
}

.report-chart-wrap {
  min-height: 300px;
}

.report-state-card {
  display: flex;
  flex-direction: column;
}

.report-state-chart-wrap {
  flex: 1 1 auto;
  min-height: 360px;
}

.report-state-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.checklist-donut-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.checklist-donut-card {
  border: 1px solid #e3ebf4;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 0.75rem 0.65rem;
  text-align: center;
  min-height: 188px;
  width: 120px;
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.checklist-donut-title {
  width: 100%;
  font-size: 0.76rem;
  font-weight: 700;
  color: #23415f;
  line-height: 1.2;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist-donut-canvas-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0.4rem 0 0.7rem;
  flex-shrink: 0;
}

.checklist-donut-canvas {
  width: 100% !important;
  height: 100% !important;
}

.checklist-donut-meta {
  min-height: 34px;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #627588;
}

@media (max-width: 1399.98px) {
  .report-state-chart-wrap {
    min-height: 320px;
  }

  .checklist-donut-card {
    width: 110px;
    flex-basis: 110px;
  }
}

@media (max-width: 575.98px) {
  .report-state-chart-wrap {
    min-height: 280px;
  }

  .checklist-donut-grid {
    gap: 0.7rem;
  }

  .checklist-donut-card {
    width: 120px;
    flex-basis: 120px;
  }
}

.report-section-head h4 {
  font-size: 1rem;
  margin: 0;
}

.report-year-pill {
  border-radius: 999px;
  border: 1px solid #cddcee;
  background: #f3f8fe;
  color: #1c4a7a;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
}

.report-annual-table .table thead th {
  text-align: center;
}

.report-annual-table .table thead th:first-child {
  text-align: left;
}

.report-total-cell {
  background: #ebf3fd;
  color: #1c4a7a;
}

.report-total-row td {
  background: #f3f8fe !important;
}

.insumo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.insumo-badge.is-pending {
  color: #954d00;
  background: #fff3dc;
  border: 1px solid #f2d19a;
}

.insumo-badge.is-paid {
  color: #0d6a3d;
  background: #e7f8ee;
  border: 1px solid #9dd9b6;
}

.state-list {
  list-style: none;
  padding: 0;
}

.state-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--ly-border);
  padding: 0.8rem 0;
  color: var(--ly-muted);
}

.state-list li:last-child {
  border-bottom: none;
}

.state-list strong {
  color: var(--ly-text);
}

.login-body {
  background: linear-gradient(130deg, #d7eeff 0%, #7ec5f2 45%, #2b88cc 100%);
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.login-card {
  width: 100%;
  max-width: 460px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 25px 55px rgba(6, 37, 64, 0.26);
  padding: 1.8rem;
}

.login-brand h1 {
  font-size: 1.4rem;
  margin: 0.85rem 0 0.2rem;
}

.login-brand p {
  margin: 0;
  color: var(--ly-muted);
  font-size: 0.9rem;
}

.logo-pill {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border-radius: 16px;
  background: linear-gradient(145deg, #52b8ef, #1f6fb2);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
}

.modal-dialog {
    display: grid;
    place-content: center;
}

@media (max-width: 992px) {
    .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    position: static;
    height: auto;
    overflow: visible;
    align-self: stretch;
  }

  .menu-nav {
    overflow: visible;
  }

}
