/* The shell of the redesign (0.25.0): the grouped sidebar, the top bar, Roger's drawer and Inicio.
   The approved mockup (Mockups/rediseno-panel-admin/) is the reference for sizes, spacing and colors;
   the brand tokens stay in app.css. */

.app { display: flex; height: 100%; }
.newver:not([hidden]) ~ .app { height: calc(100% - 40px); }
/* 2.8.0: the simulation's red bar (app.css) takes its 32 px the same way, alone or over the new-version line */
.simbar:not([hidden]) ~ .app { height: calc(100% - 32px); }
.simbar:not([hidden]) ~ .newver:not([hidden]) ~ .app { height: calc(100% - 72px); }

/* Sidebar */
.side { width: 232px; flex: none; background: var(--navy); color: #E8EFEA; display: flex; flex-direction: column; min-height: 0; position: relative; }
.sbrand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
/* 2.0.0 brand (Mockups/marca-admin-2.0.0): the flame as tall as the logo's letters, "Admin Ver." two spaces in */
.sbrand .brand { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.sbrand .lockup { display: flex; align-items: center; gap: 10px; }
.sbrand .sym { height: 30px; width: auto; flex: none; display: block; }
.sbrand .word { width: 150px; height: auto; display: block; }
.sbrand .s { font-size: 11px; color: #9FB3A8; letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 0 7px; white-space: nowrap; }
.menu-btn { display: none; margin-left: auto; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); background: none; color: #fff; border-radius: 8px; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 4px 10px 10px; overflow: auto; min-height: 0; }
.nav .g { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7F968A; padding: 14px 10px 6px; font-weight: 600; }
.nav button[data-v] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: #D5E0D9; font-weight: 500; font-size: 13.5px; text-align: left; }
.nav button[data-v] svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav button[data-v]:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav button[data-v].on { background: var(--oro); color: var(--navy); font-weight: 600; }
.nav button[data-v].on svg { opacity: 1; }
/* counts: neutral (Inicio, Pedidos), green (unread), red (waiting on a person) */
.nav .cnt-n, .nav .cnt-u, .nav .cnt { color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; line-height: 1.5; }
.nav button[data-v] > :is(.cnt-n, .cnt-u, .cnt):not([hidden]) { margin-left: auto; }
.nav button[data-v] > :is(.cnt-n, .cnt-u, .cnt):not([hidden]) ~ :is(.cnt-u, .cnt) { margin-left: 4px; }
.nav .cnt-n { background: rgba(255,255,255,.14); }
.nav .on .cnt-n { background: var(--navy); }
.nav .cnt-u { background: #1E7A4A; }
.nav .cnt { background: #D14B3E; }
.nav .sp { flex: 1; min-height: 12px; }
.nav .foot { border-top: 1px solid rgba(255,255,255,.08); margin: 0 -10px; padding: 10px 10px 0; }
.user { position: relative; margin-top: 4px; }
.who-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 8px; color: inherit; text-align: left; }
.who-btn:hover { background: rgba(255,255,255,.06); }
.who-btn .av { width: 32px; height: 32px; border-radius: 50%; background: var(--oro); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.who-btn .nm-rl { display: flex; flex-direction: column; min-width: 0; }
.who-btn .nm { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-btn .rl { font-size: 11px; color: #9FB3A8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; z-index: 50; }
.user-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; color: var(--text); font-weight: 600; font-size: 13.5px; }
.user-menu button:hover { background: var(--wash); }

/* Top bar */
.mainc { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.top { height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--border); }
.top .grow { flex: 1; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; color: #8A978F; }
.search svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; font-size: 13px; color: var(--text); outline: none; }
.search kbd { font: inherit; font-size: 11px; border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; background: #fff; }
.ibtn { position: relative; width: 36px; height: 36px; flex: none; border: 1px solid var(--border); background: #fff; border-radius: 8px; display: grid; place-items: center; color: #4A5A52; font-size: 16px; }
.ibtn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibtn .bn { position: absolute; top: -6px; right: -6px; margin: 0; background: #D14B3E; color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.roger-btn { display: flex; align-items: center; gap: 8px; flex: none; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.roger-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.roger-btn .gd { color: var(--oro); white-space: pre; }
.mainc .main { padding: 20px 24px; }

/* Roger's drawer */
.scrim { position: fixed; inset: 0; background: rgba(10,20,15,.25); z-index: 30; }
.rdrawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%; background: #fff; border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(0,0,0,.08);
  transform: translateX(100%); visibility: hidden; transition: transform .2s, visibility 0s .2s; z-index: 40; display: flex; flex-direction: column; }
/* the new-version line stays above the drawer and its shade, so Actualizar is always in reach */
.newver:not([hidden]) ~ .app :is(.rdrawer, .scrim) { top: 40px; }
.simbar:not([hidden]) ~ .app :is(.rdrawer, .scrim) { top: 32px; }
.simbar:not([hidden]) ~ .newver:not([hidden]) ~ .app :is(.rdrawer, .scrim) { top: 72px; }
/* shown at once on open, hidden only once it has slid out */
.rdrawer.open { transform: none; visibility: visible; transition: transform .2s; }
.rd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rd-hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--navy); color: #fff; }
.rd-hd img { width: 22px; height: 22px; }
.rd-hd b { font-size: 15px; }
.rd-hd .grow { flex: 1; }
.rd-hd .x { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; padding: 0 2px; }
.rd-sub { display: flex; gap: 8px; align-items: center; padding: 10px 18px 4px; }
.rd-sub select { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: #fff; font-size: 13px; }
.rd-links { display: flex; gap: 14px; padding: 2px 18px 8px; border-bottom: 1px solid #F0EEE6; }
.rd-links .link { background: none; border: 0; padding: 0; color: #4A5A52; font-size: 12.5px; text-decoration: underline; }
.rdrawer .msgs { padding: 16px 18px; }
.rdrawer .rg, .rdrawer .me-msg { max-width: 92%; }
.rd-steps { border-top: 1px solid #F0EEE6; padding: 8px 18px; max-height: 140px; overflow: auto; }
.rd-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 18px 0; }
.rd-sugg button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; color: #4A5A52; }
.rdrawer .composer { border-top: 0; }

/* The page pattern and Inicio. A section's title is an h1 on the page; with `paged` its header bar sits on the
   page and what follows is the card. */
.view h1.t { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 8px; }
.card.paged { background: none; border: 0; border-radius: 0; gap: 14px !important; }
.card.paged > .bar:first-child { padding: 0 0 2px; border-bottom: 0; }
.card.paged > .bar:first-child ~ * { background: var(--surface); border: 1px solid var(--border); border-radius: var(--corner); }
.phead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.phead h1 { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.phead .sub { color: #4A5A52; font-size: 13px; margin-top: 2px; }
.phead .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sel { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: #fff; font-size: 13px; color: var(--text); }
.sel.sm { padding: 4px 8px; font-size: 12px; }
.ini { gap: 16px; padding-bottom: 24px; }
.ini .kpis { gap: 16px; }
.ini .kpi { padding: 16px 18px; display: flex; flex-direction: column; }
.ini .kpi .l { font-size: 12px; color: #4A5A52; font-weight: 500; }
.ini .kpi .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 2px; line-height: 1.1; }
.ini .kpi .d { font-size: 12px; color: #8A978F; }
.ini .kpi .d b { font-weight: 600; }
.up { color: #1E7A4A; } .dn { color: #B42318; } .wn { color: #9A5B00; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: auto; padding-top: 10px; box-sizing: content-box; }
.spark i { flex: 1; background: #E3EEE7; border-radius: 2px; display: block; }
.spark i.h { background: var(--navy); }
.ini-g21 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.ini-g1 { display: grid; gap: 16px; }
.ini-card { overflow: hidden; }
.ini-ch { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #F0EEE6; }
.ini-ch h2 { margin: 0; font-size: 14px; font-weight: 600; }
.ini-ch .r { margin-left: auto; display: flex; gap: 6px; align-items: center; color: #4A5A52; font-size: 12.5px; }
.ini-card .link { background: none; border: 0; padding: 0; color: var(--text); font-size: 12.5px; text-decoration: underline; }
.ini-list { list-style: none; margin: 0; padding: 0; }
.ini-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid #F0EEE6; }
.ini-list li:last-child { border-bottom: 0; }
.ini-list .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ini-list .ic svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ini-list .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ini-list .tx b { font-weight: 600; }
.ini-list .tx .s { font-size: 12.5px; color: #4A5A52; margin-top: 2px; }
.ini-list .ac { display: flex; gap: 6px; flex: none; }
.ic.warn { background: #FFF2DD; color: #9A5B00; } .ic.bad { background: #FDEBE9; color: #B42318; } .ic.ok { background: #E6F4EC; color: #1E7A4A; }
.ic.info { background: #E9F0FA; color: #1F4E8C; } .ic.gold { background: #FFF6D1; color: #7A5A00; }
.ini-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; align-items: end; height: 180px; padding: 14px 18px 12px; }
.ini-bars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.ini-bars .v { font-size: 11.5px; color: #4A5A52; font-variant-numeric: tabular-nums; }
.ini-bars i { width: 100%; max-width: 56px; background: #1E4A35; border-radius: 6px 6px 2px 2px; display: block; }
.ini-bars .today i { background: var(--oro); }
.ini-bars .d { font-size: 11.5px; color: #8A978F; }
.help { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #8A978F; color: #8A978F; font-size: 10.5px; font-weight: 700; cursor: help; position: relative; }
.help:hover::after, .help:focus::after { content: attr(data-t); position: absolute; right: -6px; top: 22px; background: #14211B; color: #fff; font-weight: 400; font-size: 12px; line-height: 1.4; padding: 8px 10px; border-radius: 7px; width: 260px; z-index: 20; text-align: left; }
table.ini-top td { padding: 10px 18px; border-bottom: 1px solid #F0EEE6; }
table.ini-top tr:last-child td { border-bottom: 0; }
.ini-top .wh { display: flex; align-items: center; gap: 10px; }
.ini-top .nm { font-weight: 600; }
.ini-top .sb { font-size: 12px; color: #8A978F; white-space: nowrap; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: #fff; flex: none; }
.thumb.none { display: grid; place-items: center; background: var(--wash); color: var(--navy); font-weight: 700; }

@media (max-width: 1100px) {
  .ini .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ini-g21 { grid-template-columns: minmax(0, 1fr); }
}

/* Under 900 px the sidebar is a top bar with a menu button; the list opens over the page */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: auto; flex-direction: row; z-index: 35; }
  .sbrand { flex: 1; padding: 8px 12px; min-width: 0; }
  .sbrand .sym { height: 25.5px; }
  .sbrand .word { width: 127.5px; }
  .sbrand .s { font-size: 10px; margin-top: 4px; }
  .menu-btn { display: grid; }
  .nav { display: none; position: absolute; top: 100%; left: 0; width: min(300px, 86vw); height: calc(100dvh - 61px); background: var(--navy); box-shadow: 12px 0 32px rgba(0,0,0,.25); }
  .side.open .nav { display: flex; }
  .simbar:not([hidden]) ~ .app .nav { height: calc(100dvh - 93px); }
  .top { height: 52px; padding: 0 10px; gap: 8px; }
  .search { display: none; }
  .mainc .main { padding: 8px; }
}
@media (max-width: 820px) {
  .ini .kpi .v { font-size: 20px; }
  .ini .kpi { padding: 12px 14px; }
  .ini-bars { gap: 6px; padding: 12px 10px 10px; }
  .ini-bars .v { font-size: 10px; }
  .ini-list li { flex-wrap: wrap; padding: 12px 14px; }
  .ini-list .ac { width: 100%; justify-content: flex-end; }
  table.ini-top td { padding: 8px 12px; }
  .phead h1 { font-size: 20px; }
  .roger-btn .gd, .roger-btn .rb-ask { display: none; }
  .newver:not([hidden]) ~ .app :is(.rdrawer, .scrim) { top: 60px; }
  .newver:not([hidden]) ~ .app { height: calc(100% - 60px); }
  .simbar:not([hidden]) ~ .app :is(.rdrawer, .scrim) { top: 40px; }
  .simbar:not([hidden]) ~ .app { height: calc(100% - 40px); }
  .simbar:not([hidden]) ~ .app .nav { height: calc(100dvh - 101px); }
  .simbar:not([hidden]) ~ .newver:not([hidden]) ~ .app :is(.rdrawer, .scrim) { top: 100px; }
  .simbar:not([hidden]) ~ .newver:not([hidden]) ~ .app { height: calc(100% - 100px); }
  .help:hover::after, .help:focus::after { width: 220px; }
}
