:root {
  --peumos: #06371F;
  --peumos-2: #0b4d2d;
  --peumos-soft: #e8f1ec;
  --bg: #f4f6f5;
  --line: #e3e7e5;
  --bs-primary: #06371F;
  --bs-primary-rgb: 6, 55, 31;
  --bs-link-color: #0b5a33;
  --bs-link-hover-color: #06371F;
}
body { background: var(--bg); color: #1d2a24; font-size: 15px; }
a { color: #0b5a33; }

/* ---------- Botones ---------- */
.btn-primary { --bs-btn-bg: var(--peumos); --bs-btn-border-color: var(--peumos); --bs-btn-hover-bg: var(--peumos-2); --bs-btn-hover-border-color: var(--peumos-2); --bs-btn-active-bg: #042a17; --bs-btn-disabled-bg: var(--peumos); --bs-btn-disabled-border-color: var(--peumos); }
.btn-outline-primary { --bs-btn-color: var(--peumos); --bs-btn-border-color: var(--peumos); --bs-btn-hover-bg: var(--peumos); --bs-btn-hover-border-color: var(--peumos); --bs-btn-active-bg: var(--peumos); }
.btn { border-radius: 10px; font-weight: 500; }
.btn-lg { padding: .8rem 1.2rem; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: #4c8a69; box-shadow: 0 0 0 .2rem rgba(6,55,31,.15); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--peumos); border-color: var(--peumos); }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--peumos); color: #fff; flex-direction: column; padding: 22px 14px; z-index: 1030; overflow-y: auto; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: #fff; padding: 0 10px 22px; }
.brand-name { font-weight: 800; letter-spacing: 3px; font-size: 1.15rem; color: #fff; }
.brand-sub { font-size: .7rem; letter-spacing: 3px; opacity: .7; color: #fff; }
.sidebar .nav-link, .sidebar-mobile .nav-link { color: rgba(255,255,255,.82); display: flex; align-items: center; gap: 12px; padding: .6rem .8rem; border-radius: 10px; margin-bottom: 2px; font-size: .93rem; }
.sidebar .nav-link i, .sidebar-mobile .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover, .sidebar-mobile .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active, .sidebar-mobile .nav-link.active { background: #fff; color: var(--peumos); font-weight: 600; }
.sidebar .nav-link .badge, .sidebar-mobile .nav-link .badge { background: #f0b429; color: #3b2a00; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-foot a { color: rgba(255,255,255,.85); }
.sidebar-mobile { background: var(--peumos); color: #fff; width: 290px !important; }
.sidebar-mobile .brand { padding: 0; }

.main { min-height: 100vh; }
@media (min-width: 992px) { .main { margin-left: 250px; } }
.topbar { position: sticky; top: 0; z-index: 1020; background: var(--peumos); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.content { padding: 24px; max-width: 1400px; }
@media (max-width: 575px) { .content { padding: 14px; } }

/* ---------- Encabezados y tarjetas ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; color: var(--peumos); }
.page-head .sub { color: #6b7a72; font-size: .85rem; letter-spacing: .5px; }
.card { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; padding: .85rem 1.1rem; border-radius: 14px 14px 0 0 !important; }
.kpi { padding: 18px 20px; }
.kpi .label { font-size: .8rem; color: #6b7a72; text-transform: uppercase; letter-spacing: .6px; }
.kpi .value { font-size: 1.9rem; font-weight: 800; color: var(--peumos); line-height: 1.2; }
.kpi.warn .value { color: #b7791f; }
.kpi-sm { padding: 12px 10px; }
.kpi-sm .label { font-size: .68rem; }
.kpi-sm .value { font-size: clamp(.95rem, 4.3vw, 1.4rem); white-space: nowrap; }
.kpi .icon { font-size: 1.6rem; color: var(--peumos); opacity: .25; }

/* ---------- Tablas ---------- */
.table { margin: 0; --bs-table-bg: transparent; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: #6b7a72; font-weight: 600; background: #f8faf9; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { vertical-align: middle; border-color: var(--line); }
.table-hover tbody tr:hover { background: #f6faf8; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: #374740; white-space: nowrap; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 16px; }

/* ---------- Estados ---------- */
.badge-status { display: inline-block; padding: .3em .7em; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.st-solicitado     { background: #e0ecff; color: #1d4ed8; }
.st-en_revision    { background: #ede9fe; color: #6d28d9; }
.st-pendiente_pago { background: #fef3c7; color: #92400e; }
.st-pagado_parcial { background: #ffedd5; color: #c2410c; }
.st-pagado         { background: #dcfce7; color: #166534; }
.st-rechazado      { background: #fee2e2; color: #b91c1c; }
.st-anulado        { background: #e5e7eb; color: #4b5563; }
.st-activa         { background: #dcfce7; color: #166534; }
.st-cerrada        { background: #e5e7eb; color: #374151; }
.st-anulada        { background: #fee2e2; color: #b91c1c; }
.st-enviado        { background: #dcfce7; color: #166534; }
.st-pendiente      { background: #fef3c7; color: #92400e; }
.st-error          { background: #fee2e2; color: #b91c1c; }
.st-vigente        { background: #dcfce7; color: #166534; }
.st-reversado      { background: #e5e7eb; color: #4b5563; }

/* ---------- Tarjetas móviles (coordinador) ---------- */
.req-card { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.req-card:hover { border-color: #b9cfc3; color: inherit; }
.req-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.req-card .title { font-weight: 600; }
.req-card .meta { font-size: .82rem; color: #6b7a72; }
.req-card .amt { font-weight: 700; font-size: 1.05rem; color: var(--peumos); }
.progress { height: 6px; border-radius: 99px; background: #e8ecea; }
.progress-bar { background: #16a34a; }

.fab { position: fixed; right: 18px; bottom: 18px; width: 60px; height: 60px; border-radius: 50%; background: var(--peumos); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; box-shadow: 0 8px 20px rgba(6,55,31,.35); z-index: 1040; }
.fab:hover { color: #fff; background: var(--peumos-2); }

/* ---------- Detalle / timeline ---------- */
dl.info dt { font-size: .75rem; text-transform: uppercase; color: #6b7a72; letter-spacing: .5px; font-weight: 600; }
dl.info dd { margin-bottom: .8rem; font-weight: 500; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--peumos); border: 2px solid #fff; }
.timeline li:last-child { border-left-color: transparent; }
.timeline .when { font-size: .78rem; color: #6b7a72; }

/* ---------- Login ---------- */
.auth-body { background: linear-gradient(160deg, #06371F 0%, #0b4d2d 55%, #f4f6f5 55%); min-height: 100vh; }
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 56px 18px; }
.auth-brand { color: #fff; text-align: center; margin-bottom: 26px; }
.auth-brand .brand-name { font-size: 1.8rem; }
.auth-card { border: 0; box-shadow: 0 18px 40px rgba(0,0,0,.15); }

/* ---------- Impresión / PDF ---------- */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .fab, .no-print, .alert, .btn { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; font-size: 11px; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .table thead th { background: #06371F !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
