:root {
  --bg: #f3f6f2;
  --bg-deep: #0b1f17;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --ink: #14231c;
  --muted: #5b6b62;
  --line: rgba(15, 61, 46, 0.12);
  --brand: #0f3d2e;
  --brand-2: #1f6b4f;
  --accent: #c9852a;
  --accent-soft: #fff4e5;
  --danger: #b42318;
  --ok: #0f766e;
  --warn: #b54708;
  --shadow: 0 18px 50px rgba(11, 31, 23, 0.12);
  --radius: 18px;
  --nav-h: 64px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  max-width: 100vw;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 133, 42, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(31, 107, 79, 0.16), transparent 50%),
    linear-gradient(180deg, #eef5ef 0%, var(--bg) 40%, #e7efe8 100%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  backdrop-filter: blur(14px);
  background: rgba(243, 246, 242, 0.82);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(15, 61, 46, 0.12);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 650; letter-spacing: -0.02em;
}
.brand-text span { font-size: 0.72rem; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 0.5rem; }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.sidebar {
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--line);
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow: auto;
}
.nav-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0.4rem 0.6rem 0.7rem;
}
.nav-btn {
  width: 100%;
  display: flex; align-items: center; gap: 0.7rem;
  border: 0; background: transparent; color: var(--ink);
  padding: 0.75rem 0.85rem; border-radius: 12px;
  cursor: pointer; text-align: left; margin-bottom: 0.25rem;
  transition: background .18s ease, transform .18s ease;
}
.nav-btn:hover { background: rgba(15, 61, 46, 0.06); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(15, 61, 46, 0.12), rgba(201, 133, 42, 0.12));
  font-weight: 700;
}
.nav-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(15, 61, 46, 0.08); font-size: 0.9rem;
}

.content { padding: 1.25rem 1.25rem 5.5rem; min-width: 0; }

.page-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing: -0.03em;
}
.page-head p { margin: 0.35rem 0 0; color: var(--muted); max-width: 46ch; }

.btn {
  border: 0; border-radius: 12px; padding: 0.7rem 1rem;
  cursor: pointer; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; gap: 0.45rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 10px 24px rgba(15, 61, 46, 0.25);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(15, 61, 46, 0.32); }
.btn-secondary {
  background: var(--surface-solid); color: var(--brand);
  border: 1px solid var(--line);
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-danger { background: #fee4e2; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 0.45rem 0.7rem; font-size: 0.85rem; border-radius: 10px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 1rem;
  min-width: 0;
  overflow-x: clip;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.stat {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  animation: rise .45s ease both;
}
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
.stat::after {
  content: "";
  position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,133,42,.18), transparent 70%);
}
.stat label { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 0.35rem; }
.stat strong {
  font-family: var(--font-display);
  font-size: 1.45rem; letter-spacing: -0.02em;
}
.stat.ok strong { color: var(--ok); }
.stat.warn strong { color: var(--warn); }
.stat.danger strong { color: var(--danger); }

.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.chart-box { min-height: 280px; }
.chart-box.chart-box-pie {
  min-height: 0;
}
.chart-pie-wrap {
  max-width: 260px;
  max-height: 260px;
  margin: 0 auto;
  position: relative;
}
.chart-pie-wrap canvas {
  max-height: 260px !important;
}
.chart-box h3, .panel h3 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 1rem; align-items: center;
}
.field, .field-inline {
  display: flex; flex-direction: column; gap: 0.3rem;
}
.field[hidden],
.auth-form-row[hidden],
.register-only[hidden] {
  display: none !important;
}
.field label, .field-inline label {
  font-size: 0.78rem; color: var(--muted); font-weight: 650;
}
.field input, .field select, .field textarea,
.toolbar input, .toolbar select,
.field-inline input, .field-inline select, .field-inline textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus {
  border-color: rgba(31, 107, 79, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 107, 79, 0.12);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.form-grid .full { grid-column: 1 / -1; }

.doc-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: stretch;
}
.doc-search input { width: 100%; min-width: 0; }
.doc-search .btn { white-space: nowrap; padding-inline: 1rem; }
.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.field-hint.ok { color: var(--ok); }
.field-hint.err { color: var(--danger); }

.adjuntos-toolbar { margin-bottom: 0.55rem; }
.adjuntos-pick { cursor: pointer; display: inline-flex; }
.adjuntos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}
.adjuntos-empty {
  grid-column: 1 / -1;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  background: #fafcfb;
}
.adjunto-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.adjunto-card.is-pending { border-style: dashed; border-color: #b7cfc2; }
.adjunto-preview {
  aspect-ratio: 4 / 3;
  background: #f1f5f2;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.adjunto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.adjunto-icon {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #3f5f4f;
  background: #e7f0ea;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}
.adjunto-meta {
  padding: 0.45rem 0.55rem 0.2rem;
  font-size: 0.78rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adjunto-actions {
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem 0.45rem 0.55rem;
}
.adjunto-actions .btn { flex: 1; }

.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 0.75rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th {
  background: #f7faf7; color: var(--muted);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
tr:hover td { background: #fbfdfb; }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
}
.badge.emitido { background: #e8f1ff; color: #175cd3; }
.badge.pagado { background: #dcfae6; color: #067647; }
.badge.no_pagado { background: #ffefd6; color: #b54708; }
.badge.anulado { background: #fee4e2; color: #b42318; }
.badge.reunion { background: #e8f1ff; color: #175cd3; }
.badge.cita { background: #f3e8ff; color: #6941c6; }
.badge.nota { background: #f2f4f7; color: #344054; }

.estado-quick-wrap { display: inline-flex; max-width: 100%; }
select.estado-quick {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.35rem 1.55rem 0.35rem 0.7rem;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 12px) calc(50% - 2px),
    calc(100% - 7px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 9.5rem;
  min-width: 0;
}
select.estado-quick:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 107, 79, 0.15);
  border-color: rgba(31, 107, 79, 0.35);
}
select.estado-quick:disabled { opacity: 0.65; cursor: wait; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(11, 31, 23, 0.45);
  display: none; align-items: flex-end; justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; animation: fade .2s ease; }
.modal {
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 22px 22px 16px 16px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1.2rem;
  animation: slideUp .28s ease;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1rem;
}
.modal-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 1.35rem;
}
.items-editor { display: grid; gap: 0.6rem; min-width: 0; }
.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.55fr) minmax(0, 0.7fr) minmax(3.2rem, 0.45fr) auto;
  gap: 0.45rem;
  align-items: end;
  width: 100%;
  min-width: 0;
}
.item-row > .field,
.item-row > .btn {
  min-width: 0;
}
.item-row .btn-remove-item {
  width: 2.5rem;
  flex-shrink: 0;
  justify-self: end;
}
.item-igv .igv-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  user-select: none;
}
.item-igv .igv-toggle input {
  width: auto;
  min-width: 1rem;
  margin: 0;
  accent-color: var(--brand-2);
}
.item-igv .igv-toggle:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
  color: var(--muted);
}
.totals-box {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3faf6, #fff8ef);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.totals-box span { color: var(--muted); font-size: 0.85rem; }
.totals-box strong { font-family: var(--font-display); font-size: 1.2rem; }

.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem 1rem 1.25rem;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(201, 133, 42, 0.22), transparent 55%),
    radial-gradient(700px 420px at 80% 100%, rgba(31, 107, 79, 0.35), transparent 50%),
    linear-gradient(160deg, #071510 0%, #0f3d2e 55%, #123628 100%);
}
.auth-wrap {
  width: min(380px, 100%);
  display: grid;
  gap: 0.85rem;
  animation: authIn 0.4s ease both;
}
.auth-header {
  text-align: center;
  color: #f5faf6;
  padding: 0;
}
.auth-brand-logo {
  width: min(112px, 34vw);
  height: auto;
  margin: 0 auto 0.45rem;
  display: block;
  background: #fff;
  border-radius: 14px;
  padding: 0.4rem 0.5rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}
.auth-kicker {
  display: none;
}
.auth-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}
.auth-tagline {
  margin: 0.25rem auto 0;
  max-width: 28ch;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(245, 250, 246, 0.78);
}
.auth-panel {
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}
.auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  padding: 0.2rem;
  margin-bottom: 0.75rem;
  background: rgba(15, 61, 46, 0.07);
  border-radius: 10px;
}
.auth-mode button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease;
}
.auth-mode button:hover { color: var(--ink); }
.auth-mode button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 4px 12px rgba(11, 31, 23, 0.08);
}
.auth-form-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--brand);
}
.auth-form-lead {
  margin: 0.15rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}
.auth-form {
  display: grid;
  gap: 0.55rem;
}
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.auth-form .field label {
  font-size: 0.76rem;
  margin-bottom: 0.2rem;
}
.auth-form .field input {
  padding: 0.62rem 0.75rem;
  font-size: 0.92rem;
  border-radius: 10px;
}
.auth-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.72rem 0.9rem;
  font-size: 0.92rem;
  border-radius: 11px;
}
.auth-error {
  background: #fee4e2;
  color: var(--danger);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.1rem;
  font-size: 0.82rem;
  display: none;
}
.auth-error.show { display: block; }

@keyframes authIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .auth-form-row { grid-template-columns: 1fr; }
  .auth-wrap { gap: 0.75rem; }
  .auth-panel { padding: 0.9rem 0.95rem 1rem; }
  .auth-brand-logo { width: min(96px, 30vw); }
  .auth-screen { padding: 0.75rem 0.85rem 1rem; align-content: center; }
}

.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 0.4rem 0.45rem calc(0.4rem + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.15rem;
  overflow: visible;
}
.mobile-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 0;
  padding: 0.35rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
}
.mobile-nav button.active { color: var(--brand); }
.mobile-nav .mico {
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mobile-nav .mico svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}
.mobile-nav .mico svg [fill="none"] {
  fill: none;
}
.mobile-nav .mlabel {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.mobile-nav .nav-primary {
  color: #fff;
}
.mobile-nav .nav-primary .mico {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 61, 46, 0.28);
  margin-top: -1.05rem;
}
.mobile-nav .nav-primary .mico svg {
  width: 1.2rem;
  height: 1.2rem;
}
.mobile-nav .nav-primary .mlabel {
  color: var(--brand);
  margin-top: 0.05rem;
}
.mobile-nav .nav-primary.active .mlabel {
  font-weight: 800;
}

.mobile-more {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.mobile-more[hidden] { display: none !important; }
.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 24, 18, 0.45);
}
.mobile-more-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 0.7rem 1rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(11, 31, 23, 0.18);
  display: grid;
  gap: 0.45rem;
  animation: slideUp 0.22s ease;
}
.mobile-more-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #d7e0da;
  margin: 0.15rem auto 0.4rem;
}
.mobile-more-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.mobile-more-item {
  border: 1px solid var(--line);
  background: #f7faf7;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.mobile-more-item.active {
  border-color: rgba(31, 107, 79, 0.35);
  background: #eef7f2;
  color: var(--brand);
}
.mobile-more-item .mico {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brand);
}
.mobile-more-item .mico svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.empty {
  text-align: center; padding: 2.2rem 1rem; color: var(--muted);
}
.empty strong {
  display: block; color: var(--ink);
  font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.35rem;
}

.toast-wrap {
  position: fixed; right: 1rem; bottom: 5.2rem; z-index: 100;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  background: var(--bg-deep); color: #fff;
  padding: 0.75rem 1rem; border-radius: 12px;
  box-shadow: var(--shadow); animation: rise .25s ease;
  max-width: 320px; font-size: 0.9rem;
}

.notif-panel {
  position: absolute; right: 0.5rem; top: calc(var(--nav-h) - 4px);
  width: min(360px, calc(100vw - 1rem));
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
  display: none; max-height: 420px; overflow: auto; z-index: 60;
}
.notif-panel.open { display: block; animation: rise .2s ease; }
.notif-item {
  padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line);
}
.notif-item.unread { background: #f7fbf8; }
.notif-item strong { display: block; font-size: 0.9rem; margin-bottom: 0.2rem; }
.notif-item p { margin: 0; color: var(--muted); font-size: 0.82rem; }

.agenda-list { display: grid; gap: 0.7rem; }
.agenda-card {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: 0.8rem; align-items: start;
  padding: 0.9rem; border-radius: 16px;
  background: #fff; border: 1px solid var(--line);
  animation: rise .35s ease both;
}
.agenda-date {
  background: var(--accent-soft); color: #8a4b08;
  border-radius: 12px; text-align: center; padding: 0.55rem 0.3rem;
}
.agenda-date .d {
  font-family: var(--font-display); font-size: 1.35rem; line-height: 1;
}
.agenda-date .m { font-size: 0.72rem; text-transform: uppercase; font-weight: 800; }
.agenda-card h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.agenda-card p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.desktop-only {}
.mobile-hint { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; } to { opacity: 1; }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: grid; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .item-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(3.6rem, auto);
  }
  .item-row .item-desc { grid-column: 1 / -1; }
  .item-row .btn-remove-item {
    grid-column: 1 / -1;
    width: 100%;
    height: 2.6rem;
    justify-self: stretch;
  }
  .desktop-only { display: none !important; }
  .mobile-hint { display: block; }
  .content { padding-bottom: 7.2rem; }
}

@media (min-width: 981px) {
  .dashboard-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  .hero-panel {
    padding: 1.4rem;
    border-radius: 22px;
    background:
      linear-gradient(135deg, rgba(15,61,46,0.95), rgba(31,107,79,0.88)),
      radial-gradient(circle at 90% 10%, rgba(201,133,42,0.35), transparent 40%);
    color: #fff;
    box-shadow: var(--shadow);
  }
  .hero-panel h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: -0.03em;
  }
  .hero-panel p { margin: 0.5rem 0 1rem; opacity: 0.88; max-width: 42ch; }
  .hero-metrics { display: flex; gap: 1.2rem; flex-wrap: wrap; }
  .hero-metrics div span { display: block; font-size: 0.78rem; opacity: 0.75; }
  .hero-metrics div strong { font-family: var(--font-display); font-size: 1.35rem; }
}

.contact-card-list { display: grid; gap: 0.75rem; padding: 0.85rem; }
.contact-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
}
.contact-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.contact-card-head strong { font-size: 1.02rem; }
.contact-meta { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dash-brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  padding: 0.35rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
