/* Sistema responsive — estilo app moderna (sin degradados) */
:root {
  --primary: #1B4079;
  --primary-hover: #163566;
  --secondary: #4D7C8A;
  --accent: #8FAD88;
  --lime: #C7DB94;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --nav-h: 64px;
  --container: 1120px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* —— Navbar —— */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.navbar-inner {
  height: 100%;
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  min-width: 0;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.logo-lg { width: 56px; height: 56px; font-size: 1rem; border-radius: 14px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-role {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 130;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.nav-overlay {
  display: none;
}

.offcanvas-head { display: none; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: flex-end;
}
.offcanvas-body {
  display: contents;
}
.nav-spacer { flex: 1; }
.nav-item {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active {
  background: rgba(27, 64, 121, 0.08);
  color: var(--primary);
}
.nav-user {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  padding: 0 0.5rem;
}

/* —— Page —— */
.page { padding: 1.5rem 0 2.5rem; flex: 1; width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.page-title { display: none; } /* usamos page-head de cada vista */
.page-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-head h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.page-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.page-head .btn { width: 100%; }

.flash-wrap {
  width: min(100% - 2rem, var(--container));
  margin: 1rem auto 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0 calc(1rem + var(--safe-bottom));
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--surface);
}

/* —— Cards —— */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 1rem;
}
.card > h2 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card h2 .badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* —— Fields —— */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.field .hint { font-size: 0.72rem; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2rem;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(77, 124, 138, 0.18);
}
.field input[readonly] {
  background: var(--surface-2);
  color: var(--muted);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 4.25rem;
}
.password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  border: 1px solid var(--line);
}
.password-toggle:hover,
.password-toggle.is-visible {
  background: rgba(27, 64, 121, 0.08);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-2); color: var(--primary); border: 1px solid var(--line); }
.btn-lime { background: var(--lime); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}
.btn-ghost-light {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-sm {
  min-height: 34px;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

/* —— Filters —— */
.filters,
.filters-admin,
.filters-campo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: end;
}
.filters .field,
.filters-admin .field,
.filters-campo .field { margin-bottom: 0; }
.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* —— Reports —— */
.report-list { display: grid; gap: 0.75rem; }
.report-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
}
.report-item .meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.report-item .num { font-weight: 800; font-size: 1rem; }
.report-item .sub { color: var(--muted); font-size: 0.86rem; margin-top: 0.15rem; }
.report-item .chip,
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--ok-bg);
  color: var(--ok);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.report-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.report-actions form,
.inline-form { display: inline; margin: 0; }

.report-table-desktop { display: none; }
.report-list-mobile { display: block; }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  background: var(--surface-2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafc; }
.td-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* —— Form sections —— */
.repeatable { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
.repeat-card {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.85rem 0.25rem;
  position: relative;
}
.repeat-card .remove-row { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; }
.pct-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 560px) {
  .pct-row { grid-template-columns: 1fr 1fr 1fr; }
}
.desviacion-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--primary);
}
.desviacion-box.neg { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.desviacion-box.pos { background: var(--ok-bg); border-color: #a7f3d0; color: var(--ok); }

.resource-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}
.resource-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.resource-row-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.resource-row .field {
  display: block;
  width: 100%;
  margin: 0;
  min-width: 0;
}
.resource-row .field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.resource-row input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-height: 44px;
}
.resource-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.resource-dup,
.resource-remove {
  width: 36px;
  height: 36px;
  padding: 0;
  min-height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.resource-dup { color: var(--primary); }

.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 640px) {
  .photos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .photos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.photo-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111;
  aspect-ratio: 1;
  border: 1px solid var(--line);
}
.photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-card .del {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 0;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  z-index: 2;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.92);
  padding: 1rem;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  position: relative;
  width: min(100%, 960px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 5.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  background: #0a0a0a;
}
.lightbox-meta {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  backdrop-filter: blur(6px);
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-close {
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 2;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.lightbox-prev { left: max(0.5rem, env(safe-area-inset-left)); }
.lightbox-next { right: max(0.5rem, env(safe-area-inset-right)); }
@media (max-width: 640px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.2rem; }
  .lightbox-img { max-height: calc(100vh - 6rem); }
}
.dropzone {
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.dropzone strong { color: var(--primary); display: block; margin-bottom: 0.25rem; }

.quill-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  margin-bottom: 0.75rem;
}
.quill-wrap .ql-toolbar.ql-snow {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.quill-wrap .ql-container.ql-snow { border: 0; min-height: 130px; }
.quill-wrap .ql-editor { min-height: 130px; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.6rem;
  margin: 1rem -1rem -1rem;
  padding: 0.85rem 1rem calc(0.85rem + var(--safe-bottom));
  background: rgba(245, 247, 250, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* —— Accesos —— */
.accesos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.acceso-panel .field,
.acceso-confirm .field { margin-left: 0; margin-right: 0; }
.panel-desc { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.88rem; }
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* —— Toast / empty / modal —— */
.toast {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  margin-bottom: 0.75rem;
}
.toast-success { background: var(--ok-bg); color: var(--ok); border-color: #a7f3d0; }
.toast-error { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.toast-info { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }

.empty {
  text-align: center;
  padding: 3rem 1.25rem;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.empty .btn { margin-top: 1rem; width: auto; min-width: 180px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 0.35rem; text-align: center; font-size: 1.05rem; }
.modal p { margin: 0 0 1rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

/* —— Login page —— */
.login-page { background: var(--bg); min-height: 100dvh; }
.login-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
.login-hero {
  display: none;
  background: var(--primary);
  color: #fff;
  padding: 3rem;
}
.login-hero-inner { max-width: 420px; }
.login-hero h1 {
  margin: 1.25rem 0 0.5rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.login-hero p {
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 1rem;
  line-height: 1.55;
}
.login-points {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}
.login-points li {
  padding-left: 1.4rem;
  position: relative;
  color: rgba(255,255,255,.9);
  font-weight: 500;
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--lime);
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}
.login-box {
  width: min(100%, 400px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
}
.login-box h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-sub {
  margin: 0.35rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.login-form .btn { margin-top: 0.35rem; }

.muted { color: var(--muted); }
code {
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* —— Breakpoints —— */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
  }
  .nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .navbar-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    height: 100dvh;
    margin: 0;
    padding: 0;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    z-index: 130;
    overflow: auto;
  }
  .navbar-nav.is-open { transform: translateX(0); }

  .offcanvas-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .offcanvas-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }
  .offcanvas-brand strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
  }
  .offcanvas-brand small {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
  }
  .offcanvas-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
  }

  .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem calc(1.25rem + var(--safe-bottom));
  }
  .nav-spacer {
    display: block;
    height: 1px;
    background: rgba(226, 232, 240, 0.9);
    margin: 0.65rem 0;
    flex: none;
  }
  .nav-item { padding: 0.85rem 0.9rem; border-radius: 10px; }
  .nav-user { padding: 0.35rem 0.9rem 0.15rem; font-size: 0.8rem; }
  .nav-logout { margin-top: 0.35rem; width: 100%; }

  body.nav-open { overflow: hidden; }
}

@media (min-width: 768px) {
  .nav-overlay { display: none !important; }
  .offcanvas-head { display: none !important; }
  .offcanvas-body { display: contents; }
  .nav-spacer { flex: 1; height: auto; background: transparent; margin: 0; }

  .page-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  .page-head .btn {
    width: auto;
    min-width: 160px;
  }

  .filters-admin {
    grid-template-columns: 1.4fr 0.7fr 1fr 1fr auto;
  }
  .filters-admin .filter-actions {
    display: flex;
    gap: 0.5rem;
  }
  .filters-admin .filter-actions .btn,
  .filters-campo .filter-actions .btn {
    width: auto;
    min-width: 100px;
  }

  .filters-campo {
    grid-template-columns: 1.4fr 0.8fr auto;
  }
  .filters-campo .filter-actions {
    display: flex;
    gap: 0.5rem;
  }

  .report-list-mobile { display: none; }
  .report-table-desktop { display: block; }

  .accesos-grid { grid-template-columns: 1fr 1fr; }

  .login-layout { grid-template-columns: 1.05fr 1fr; }
  .login-hero { display: grid; place-items: center; }
  .modal-backdrop { align-items: center; }

  .sticky-actions {
    margin: 1.25rem 0 0;
    padding: 1rem 0 0;
    background: transparent;
    backdrop-filter: none;
    border-top: 0;
    max-width: 360px;
    margin-left: auto;
  }
}

@media (min-width: 1024px) {
  :root { --container: 1180px; }
  .card { padding: 1.25rem 1.35rem 1.35rem; }
}
