/* ERP — corporativo claro, barra azul marino, tablas densas, esquinas rectas */
:root { --bg: #e9edf2; --surface: #ffffff; --surface-2: #f6f8fb; --line: #d5dce6; --text: #10243a; --muted: #5b6b7e; --accent: #0b5cad; --accent-hover: #094a8c; --accent-2: #0d9488; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; }
body { font-family: 'IBM Plex Sans', 'Inter', sans-serif; background: var(--bg); }
h1, h2, h3, h4, .brand { font-family: 'IBM Plex Sans', sans-serif; letter-spacing: 0; }

.app { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 0; z-index: 20; height: 3.5rem; flex-direction: row; align-items: stretch; gap: 0; padding: 0 1.5rem; background: #0b2545; border: 0; border-bottom: 3px solid #0d9488; }
.brand { padding: 0 2rem 0 0; font-size: 1rem; font-weight: 700; color: #fff; align-items: center; }
.brand .logo { background: #0d9488; border-radius: 3px; color: #fff; }
.side button.nav { color: rgba(255,255,255,.65); border-radius: 0; padding: 0 1.1rem; font-size: .84rem; align-items: center; }
.side button.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.side button.nav.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 -3px 0 #38bdf8; }
.side .grow { display: block; flex: 1; }
.side .user { border: 0; color: #fff; align-self: center; padding: 0; }
.side .user .muted { color: rgba(255,255,255,.55); }
.avatar { background: #0d9488; border-color: transparent; color: #fff; border-radius: 3px; }
.main { padding: 1.5rem 2rem 6rem; max-width: 90rem; margin: 0 auto; }
.top { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.top h1 { font-size: 1.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.card { border-radius: 3px; box-shadow: 0 1px 2px rgba(16,36,58,.06); }
.stat.card { border-left: 4px solid var(--accent); }
.stat.card:nth-child(2) { border-left-color: #0d9488; } .stat.card:nth-child(3) { border-left-color: #15803d; } .stat.card:nth-child(4) { border-left-color: #b91c1c; }
.stat .value { font-family: 'IBM Plex Sans'; font-weight: 600; font-size: 1.5rem; }
table { font-size: .82rem; }
th { background: #eef2f7; color: #34475c; padding: .55rem .75rem; border-bottom: 2px solid var(--line); }
td { padding: .55rem .75rem; border-bottom: 1px solid #e6ebf2; }
tbody tr:nth-child(even) { background: #f8fafc; }
.btn { border-radius: 3px; font-weight: 500; }
.search { border-radius: 3px; }
.pill { border-radius: 3px; text-transform: uppercase; font-size: .66rem; letter-spacing: .04em; }
.bars .bar { background: #0b5cad; border-radius: 1px; }
.bars .col:hover .bar { background: #0d9488; }
.tab { border-radius: 3px; }
.tab.active { background: #0b5cad; color: #fff; border-color: #0b5cad; }
.modal .box { border-radius: 4px; border-color: var(--line); }

/* ===== Mejoras de la demo: módulos nuevos, avisos y barra inferior en celular ===== */
.mtop { display: none; }
.rowact { white-space: nowrap; text-align: right; }
.rowact .btn + .btn { margin-left: .4rem; }
.grid2b { grid-template-columns: 1.6fr 1fr; }
.alerts { display: flex; flex-direction: column; gap: .7rem; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .85rem; border-radius: 3px; border-left: 4px solid var(--accent); background: var(--surface-2); font-size: .82rem; }
.alert b { display: block; }
.alert span { color: var(--muted); font-size: .76rem; }
.alert.bad { border-left-color: var(--bad); } .alert.warn { border-left-color: var(--warn); } .alert.info { border-left-color: var(--accent-2); }
.alert .btn { padding: .3rem .8rem; font-size: .75rem; flex: none; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.25rem; font-size: .9rem; }
.detail dt { color: var(--muted); } .detail dd { margin: 0; text-align: right; }
.modal .box .field select, .modal .box .field input { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 4.6rem; transform: translate(-50%, 12px); background: #0b2545; color: #fff; padding: .65rem 1.1rem; border-radius: 4px; font-size: .84rem; box-shadow: 0 10px 30px rgba(11,37,69,.35); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 120; max-width: calc(100vw - 2rem); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.demo-banner { bottom: .8rem; }
.toast { bottom: 4rem; }
#permTable input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

@media (max-width: 1250px) {
  .side { padding: 0 1rem; }
  .brand { padding-right: 1rem; }
  .side button.nav { padding: 0 .7rem; font-size: .8rem; gap: .4rem; }
  .side .user .muted { display: none; }
}
@media (max-width: 1000px) {
  .grid2b { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .mtop { display: block; position: sticky; top: 0; z-index: 20; background: #0b2545; color: #fff; font-weight: 700; font-size: .95rem; padding: .7rem 1rem; border-bottom: 3px solid #0d9488; }
  .app { display: block; }
  .side { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto; height: auto !important; z-index: 60; flex-direction: row !important; flex-wrap: nowrap !important; justify-content: space-between; align-items: stretch; padding: .15rem .1rem calc(.15rem + env(safe-area-inset-bottom)) !important; border: 0; border-top: 3px solid #0d9488; gap: 0; }
  .side .brand, .side .grow, .side .user { display: none !important; }
  .side button.nav { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: .15rem; padding: .35rem .1rem !important; min-height: 3rem; font-size: .6rem !important; text-align: center; }
  .side button.nav i { width: 1.15rem; height: 1.15rem; }
  .side button.nav.active { box-shadow: inset 0 3px 0 #38bdf8; }
  .main { padding: 1rem .9rem 9rem; }
  .demo-banner { bottom: 4.4rem; }
  .toast { bottom: 8rem; }
  .rowact .btn { display: inline-block; margin-bottom: .25rem; }
}
.brand, .side .user b { white-space: nowrap; }
@media (max-width: 1150px) and (min-width: 701px) { .side .user > div:last-child { display: none; } .brand { font-size: .9rem; } }
/* Hover legible en la barra azul marino (gana a la regla del tema claro) */
body.light .side button.nav { color: rgba(255,255,255,.7); }
body.light .side button.nav:hover { background: rgba(255,255,255,.14); color: #fff; }
body.light .side button.nav.active, body.light .side button.nav.active:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 700px) { :root { --fs-bn: 4.4rem; } }
