:root {
  --brand: #155eef;
  --brand-dark: #0f3fb3;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #f6f8fb;
  --sidebar: #0f172a;
}
* { box-sizing: border-box; }
body { color: var(--ink); background: var(--surface); }
.staging-banner { background: #fff3cd; color: #664d03; padding: .45rem 1rem; text-align: center; font-size: .85rem; font-weight: 700; border-bottom: 1px solid #ffecb5; }
button, input, select { font: inherit; }
.login-page { background: radial-gradient(circle at top left, #dbeafe, #f8fafc 44%, #eef2ff); }
.login-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; background: #fff; border-radius: 28px; overflow: hidden; }
.login-brand { background: linear-gradient(145deg, #0f172a, #173f87); color: white; display: flex; flex-direction: column; justify-content: center; }
.login-brand h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.05em; }
.brand-kicker, .eyebrow { display: inline-flex; width: max-content; padding: .35rem .65rem; border-radius: 999px; background: #dbeafe; color: #1746a2; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.login-brand .brand-kicker { background: rgba(255,255,255,.12); color: #dbeafe; }
.architecture-note { margin-top: 2rem; padding: 1rem; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; display: grid; gap: .25rem; background: rgba(255,255,255,.06); }
.login-form { display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-weight: 800; }
.demo-box { font-size: .84rem; padding: 1rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 14px; display: grid; gap: .4rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.25rem 1rem; background: var(--sidebar); color: white; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: .75rem; padding: .5rem .5rem 1.5rem; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #fff; color: var(--sidebar); font-weight: 900; }
.brand strong, .brand small { display:block; }
.brand small { color: #94a3b8; }
.sidebar nav { display: grid; gap: .45rem; }
.nav-item { border: 0; text-align: left; padding: .8rem .9rem; border-radius: 12px; background: transparent; color: #cbd5e1; font-weight: 700; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: white; }
.sidebar-footer { margin-top: auto; color: #94a3b8; font-size: .8rem; padding: .75rem; }
.app-main { min-width: 0; }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top:0; z-index:10; }
.context-selectors { display: flex; gap: .6rem; min-width: 420px; }
.user-summary { display: flex; align-items: center; gap: .9rem; }
.user-summary strong, .user-summary small { display:block; }
.user-summary small { color: var(--muted); }
.icon-button { width: 40px; height: 40px; border:1px solid var(--line); border-radius: 10px; background:white; }
.content { padding: 1.5rem; }
.panel { display:none; }
.panel.active { display:block; }
.page-heading { display:flex; justify-content:space-between; align-items:end; gap:1rem; margin-bottom:1.25rem; }
.page-heading h1 { margin:.35rem 0 .15rem; font-size: 2rem; font-weight: 850; letter-spacing: -.04em; }
.page-heading p { margin:0; color: var(--muted); }
.card-lite { background:#fff; border:1px solid var(--line); border-radius:18px; padding:1.25rem; box-shadow: 0 8px 24px rgba(15,23,42,.035); }
.card-lite h2 { font-size:1.1rem; font-weight:800; }
.stat-card { background:white; border:1px solid var(--line); border-radius:18px; padding:1.25rem; min-height:130px; }
.stat-card span { color:var(--muted); font-size:.85rem; }
.stat-card strong { display:block; margin-top:.35rem; font-size:2rem; line-height:1; }
.meta-label { display:block; color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; margin-bottom:.25rem; }
.flow-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.75rem; margin-top:1rem; }
.flow-grid span { background:#f8fafc; border:1px solid var(--line); border-radius:12px; padding:.85rem; }
.table th { color:#64748b; font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; }
.badge-soft { display:inline-block; padding:.35rem .6rem; border-radius:999px; background:#dcfce7; color:#166534; font-weight:700; font-size:.75rem; }
.app-dialog { width:min(620px, calc(100vw - 2rem)); border:0; border-radius:18px; padding:0; box-shadow:0 30px 80px rgba(15,23,42,.25); }
.app-dialog::backdrop { background:rgba(15,23,42,.55); }
.app-dialog form { padding:1.25rem; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.dialog-head h2 { margin:0; font-size:1.3rem; font-weight:800; }
.close-dialog { border:0; background:transparent; font-size:1.8rem; line-height:1; color:#64748b; }
.check-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.5rem; }
.check-card { display:flex; gap:.5rem; align-items:center; padding:.7rem .8rem; border:1px solid var(--line); border-radius:10px; }
.app-toast { position:fixed; right:1rem; top:90px; z-index:100; min-width:260px; max-width:420px; padding:.9rem 1rem; border-radius:12px; color:white; background:#166534; box-shadow:0 15px 35px rgba(15,23,42,.18); }
.app-toast.error { background:#b91c1c; }

@media (max-width: 991.98px) {
  .login-shell { grid-template-columns:1fr; }
  .login-brand { min-height:300px; }
  .app-layout { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:-270px; width:250px; transition:left .2s ease; box-shadow:10px 0 30px rgba(15,23,42,.25); }
  .sidebar.open { left:0; }
  .context-selectors { min-width:0; flex:1; }
  .topbar { padding:.8rem 1rem; flex-wrap:wrap; }
  .user-summary { width:100%; justify-content:flex-end; }
  .content { padding:1rem; }
  .flow-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 575.98px) {
  .context-selectors { flex-direction:column; width:calc(100% - 56px); }
  .page-heading { align-items:flex-start; flex-direction:column; }
  .flow-grid, .check-grid { grid-template-columns:1fr; }
  .stat-card { min-height:110px; }
}

/* v0.2 catálogo */
.nav-section { margin: .9rem .8rem .2rem; color: #64748b; font-size: .66rem; font-weight: 800; letter-spacing: .12em; }
.badge-tax { display:inline-block; padding:.32rem .55rem; border-radius:999px; background:#eff6ff; color:#1d4ed8; font-weight:750; font-size:.74rem; }
.badge-soft.badge-warning { background:#fef3c7; color:#92400e; }
.badge-soft.badge-danger { background:#fee2e2; color:#991b1b; }
.badge-soft.badge-muted { background:#e5e7eb; color:#4b5563; }
.wide-dialog { width:min(900px, calc(100vw - 2rem)); }
.dialog-shell { padding:1.25rem; }
.dialog-actions { display:flex; justify-content:flex-end; gap:.5rem; margin-top:1.5rem; }
.tax-preview { padding:.8rem 1rem; border-radius:12px; background:#eff6ff; color:#1e3a8a; font-size:.88rem; }
.modifier-chip-list { display:flex; flex-wrap:wrap; gap:.4rem; }
.modifier-chip-list span { padding:.35rem .55rem; border-radius:999px; background:#f1f5f9; color:#475569; font-size:.76rem; }
.modifier-options { display:grid; gap:.55rem; }
.modifier-option-row { display:grid; grid-template-columns: 120px minmax(160px,1fr) 120px 90px 90px 42px; gap:.5rem; align-items:center; }
.option-active { display:flex; align-items:center; gap:.35rem; font-size:.82rem; white-space:nowrap; }
.mini-stat { border:1px solid var(--line); border-radius:12px; padding:.8rem; background:#f8fafc; }
.mini-stat span { display:block; color:var(--muted); font-size:.75rem; }
.mini-stat strong { font-size:1.45rem; }
.table code { font-size:.78rem; color:#334155; background:#f1f5f9; padding:.18rem .35rem; border-radius:5px; }
.audit-list { display: grid; gap: .7rem; max-height: 300px; overflow-y: auto; }
.audit-list > div { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; }
.audit-list small { display: block; color: var(--muted); }
.audit-list p { margin: .3rem 0 0; }
.app-dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.sidebar nav { overflow-y: auto; }

@media (max-width: 767.98px) {
  .modifier-option-row { grid-template-columns:1fr 1fr; border:1px solid var(--line); border-radius:12px; padding:.75rem; }
  .modifier-option-row .option-name { grid-column:span 2; }
}
