.admin { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(11,11,12,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 8px var(--s4); min-height: 56px; }
.topbar .who { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.topbar .who form { display: inline; }
.topbar .who button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(16,16,19,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.bottomnav a, .bottomnav summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h); color: var(--muted); text-decoration: none !important; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; list-style: none; cursor: pointer; }
.bottomnav summary::-webkit-details-marker { display: none; }
.bottomnav a.active { color: var(--white); }
.bottomnav a.active svg { color: var(--red); }
.bottomnav svg { width: 24px; height: 24px; }
.bottomnav details { position: relative; }
.bottomnav details[open] summary { color: var(--white); }
.bottomnav .more { position: absolute; bottom: calc(100% + 8px); right: 8px; width: 230px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.bottomnav .more a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; }
.bottomnav .more a:hover, .bottomnav .more a.active { background: var(--surface-2); color: var(--white); }
.bottomnav .more form { display: contents; }
.bottomnav .more button { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; background: none; border: 0; color: var(--danger); font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; cursor: pointer; border-radius: var(--radius-sm); text-align: left; }
.bottomnav .more button:hover { background: var(--surface-2); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 5; width: 60px; height: 60px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 300; box-shadow: 0 10px 28px var(--red-glow); text-decoration: none !important; border: 0; }
.fab:hover { background: #E42F39; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s4); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; animation: rise .25s ease both; }
.kpi:nth-child(2) { animation-delay: .03s } .kpi:nth-child(3) { animation-delay: .06s } .kpi:nth-child(4) { animation-delay: .09s }
@media (prefers-reduced-motion: reduce) { .kpi, .flash div { animation: none; } }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.kpi.in::before { background: var(--ok); } .kpi.out::before { background: var(--red); } .kpi.pend::before { background: var(--warn); }
.kpi.bal.pos::before { background: var(--ok); } .kpi.bal.neg::before { background: var(--danger); }
.kpi .label { margin: 0 0 2px; font-size: 12px; }
.kpi .val { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: clamp(26px, 7vw, 36px); line-height: 1; color: var(--white); }
.kpi .sub { font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.kpi a { position: absolute; inset: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-bottom: var(--s5); }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; border: 1px solid var(--line-2); border-radius: var(--radius); font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 15px; text-decoration: none !important; background: var(--surface); }
.quick a:hover { border-color: var(--red); }
.quick a .plus { color: var(--red); font-size: 22px; line-height: 1; font-style: normal; }
.section { margin-bottom: var(--s5); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.section-head a { font-size: 14px; color: var(--muted); }

/* Pagar sheet (details) */
.pay { position: relative; }
.pay summary { list-style: none; }
.pay summary::-webkit-details-marker { display: none; }
.pay[open] .sheet { display: flex; }
.sheet { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 4; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px; gap: 6px; flex-direction: column; min-width: 190px; box-shadow: var(--shadow); }
.sheet button { min-height: 44px; }

/* Tablas de escritorio */
@media (min-width: 1024px) {
  .admin { padding-bottom: var(--s6); padding-left: 220px; }
  .bottomnav { left: 0; right: auto; top: 0; bottom: 0; width: 220px; height: auto; display: flex; flex-direction: column; padding: 16px 10px; border-top: 0; border-right: 1px solid var(--line); gap: 2px; }
  .bottomnav a, .bottomnav summary { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; }
  .bottomnav a.active { background: var(--surface-2); }
  .bottomnav details { margin-top: auto; }
  .bottomnav .more { position: static; width: auto; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 8px; }
  .bottomnav .brand { display: flex; padding: 6px 12px 18px; }
  .fab { bottom: 24px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .quick { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 1023px) { .bottomnav .brand { display: none; } }
