/* =========================================================================
   SKGI — Armazenagem e Ordem de Retirada
   Design system: tokens, shell, componentes. Sem dependência externa.
   ========================================================================= */

:root {
    color-scheme: light;

    /* Identidade herdada do sistema antigo (#084d6e / #00aea1), recalibrada. */
    --brand-900: #04303f;
    --brand-800: #063f54;
    --brand-700: #084d6e;
    --brand-600: #0b6489;
    --brand-500: #0d7fa8;
    --accent-500: #00aea1;
    --accent-400: #17c7b8;
    --accent-050: #e6f7f5;

    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;

    --surface: #ffffff;
    --surface-2: #f7f9fb;
    --surface-3: #eef2f6;
    --page: #f2f5f8;
    --border: #dfe6ec;
    --border-strong: #c7d3dd;

    --danger: #d92d20;
    --danger-bg: #fef3f2;
    --warn: #b54708;
    --warn-bg: #fffaeb;
    --ok: #067647;
    --ok-bg: #ecfdf3;
    --info: #175cd3;
    --info-bg: #eff8ff;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, .16);

    --sidebar-w: 260px;
    --topbar-h: 62px;

    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-num: "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --ink-900: #e8eef4;
        --ink-700: #c2ced9;
        --ink-500: #93a3b1;
        --ink-400: #7a8a99;

        --surface: #131b23;
        --surface-2: #182129;
        --surface-3: #1f2a34;
        --page: #0d141a;
        --border: #263340;
        --border-strong: #33434f;

        --danger-bg: #2a1512;
        --warn-bg: #2a2011;
        --ok-bg: #10241a;
        --info-bg: #101d2e;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 4px 16px rgba(0, 0, 0, .45);
        --shadow-lg: 0 18px 48px rgba(0, 0, 0, .6);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-900);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------------------------------------------------------------- shell -- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--brand-800) 0%, var(--brand-900) 100%);
    color: #dbe7ee;
    z-index: 40;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    min-height: var(--topbar-h);
}

.sidebar__logo {
    width: 38px; height: 38px;
    border-radius: 9px;
    object-fit: cover;
    background: #fff;
    flex: none;
}

/* Logo do cliente: cartao branco, porque o PNG e azul e transparente. */
.sidebar__cia {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .4rem .7rem;
    background: #fff;
    border-radius: 10px;
}

.sidebar__cia img { display: block; width: 100%; max-height: 52px; object-fit: contain; }

/* Marca do SKGI no rodape do menu, menor que o logo do cliente. */
.sidebar__skgi { display: flex; align-items: center; gap: .55rem; margin-bottom: .65rem; }
.sidebar__logo--sm { width: 28px; height: 28px; border-radius: 7px; }
.sidebar__skgi .sidebar__title { font-size: .8rem; }
.sidebar__skgi .sidebar__subtitle { font-size: .64rem; }

.sidebar__title { font-size: .95rem; font-weight: 650; color: #fff; line-height: 1.15; }
.sidebar__subtitle { font-size: .72rem; color: #8fb4c6; letter-spacing: .04em; text-transform: uppercase; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: .85rem .6rem 1.5rem; }

.sidebar__group {
    padding: 1rem .6rem .35rem;
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #7ba3b8;
    font-weight: 650;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: #cddfe9;
    font-size: .875rem;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}

.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

.nav-link.active {
    background: rgba(0, 174, 161, .18);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent-400);
}

.nav-link svg { flex: none; opacity: .85; }

.sidebar__footer {
    padding: .85rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, .09);
    font-size: .72rem;
    color: #7ba3b8;
}

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar__spacer { flex: 1; }

.topbar__user { display: flex; align-items: center; gap: .6rem; }

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-050);
    color: var(--brand-700);
    font-weight: 700;
    font-size: .8rem;
    flex: none;
}

@media (prefers-color-scheme: dark) {
    .avatar { background: rgba(0, 174, 161, .16); color: var(--accent-400); }
}

.topbar__name { font-weight: 600; font-size: .875rem; line-height: 1.1; }
.topbar__meta { font-size: .74rem; color: var(--ink-500); max-width: 32rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { padding: 1.5rem; max-width: 1500px; width: 100%; }

/* O seletor carrega .topbar de proposito: sem isso, o display:inline-flex de
   .btn (definido adiante) venceria por ordem e o botao apareceria no desktop. */
.topbar .menu-toggle { display: none; }

/* --------------------------------------------------------------- header -- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-head__text { flex: 1; min-width: 240px; }
.page-head__subtitle { color: var(--ink-500); font-size: .875rem; margin-top: .2rem; }
.page-head__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: var(--ink-500);
    margin-bottom: .4rem;
}

/* ---------------------------------------------------------------- cards -- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card__head {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.card__title { font-size: .95rem; font-weight: 650; }
.card__body { padding: 1.15rem; }
.card__foot {
    padding: .9rem 1.15rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.stat__label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-500);
    font-weight: 650;
}

.stat__value { font-size: 1.75rem; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: .78rem; color: var(--ink-500); }
.stat--danger .stat__value { color: var(--danger); }
.stat--warn .stat__value { color: var(--warn); }
.stat--ok .stat__value { color: var(--ok); }

/* --------------------------------------------------------------- tables -- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .85rem;
    white-space: nowrap;
}

table.data th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font-weight: 650;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-500);
    background: var(--surface-3);
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--border);
}

table.data td {
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.data tbody tr:hover td { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tfoot td {
    background: var(--surface-3);
    font-weight: 680;
    border-top: 2px solid var(--border-strong);
}

.num { text-align: right; font-variant-numeric: tabular-nums; }
.col-actions { width: 1%; white-space: nowrap; }

/* Observacao: texto completo. Quebra a linha quando precisa e respeita as quebras
   que o usuario digitou (a tabela toda e "nowrap", entao a celula desfaz isso). */
table.data td.obs { white-space: pre-line; overflow-wrap: anywhere; min-width: 14rem; max-width: 30rem; }
/* Cliente e transportadora: coluna estreita que quebra a linha em vez de alargar
   a tabela e criar barra de rolagem (mesmo motivo do .obs acima). */
table.data td.estreita { white-space: normal; overflow-wrap: anywhere; min-width: 8rem; max-width: 12rem; }
/* Descricao do produto no estoque: quebra a linha em vez de alargar a tabela.
   No celular a regra do .c-prod (mais abaixo) libera a largura de novo. */
table.data--estoque .c-prod { white-space: normal; overflow-wrap: anywhere; min-width: 12rem; max-width: 22rem; }
/* Pedidos: dez colunas precisam caber em 1280px sem barra de rolagem. Células mais
   justas, cabeçalho e status quebram a linha, colunas de texto mais estreitas e os
   botões empilhados (a coluna fica da largura do maior, não da soma dos três). */
table.data--pedidos th,
table.data--pedidos td { padding: .55rem .5rem; }
table.data--pedidos th { white-space: normal; }
table.data--pedidos .badge { white-space: normal; line-height: 1.25; }
/* Status longo ("Enviado para separação") quebra em duas linhas, não em três. */
table.data--pedidos td.c-status { min-width: 10rem; }
table.data--pedidos td.obs { min-width: 7rem; max-width: 16rem; }
table.data--pedidos td.estreita { min-width: 6.5rem; max-width: 9rem; }
table.data--pedidos .btn-row { flex-direction: column; align-items: stretch; gap: .3rem; }
.muted { color: var(--ink-500); }
.strong { font-weight: 650; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .82em; }
/* Mesmo tamanho de letra do .mono, sem trocar a fonte: usado na descricao ao lado do codigo. */
.fonte-codigo { font-size: .82em; }

/* QuickGrid herda o mesmo visual da tabela padrão. */
.quickgrid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.quickgrid th { background: var(--surface-3); color: var(--ink-500); }
.quickgrid > tbody > tr:hover > td { background: var(--surface-2); }

/* --------------------------------------------------------------- badges -- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .16rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 650;
    line-height: 1.5;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge--neutral { background: var(--surface-3); color: var(--ink-700); border-color: var(--border); }
.badge--ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge--info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* -------------------------------------------------------------- buttons -- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .5rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink-900);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, transform .06s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary {
    background: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
}
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); }

.btn--accent {
    background: var(--accent-500);
    border-color: var(--accent-500);
    color: #04302c;
}
.btn--accent:hover { background: var(--accent-400); border-color: var(--accent-400); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-700); }
.btn--ghost:hover { background: var(--surface-3); }

.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-bg); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 12%, var(--danger-bg)); }

.btn--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); }
.btn--ok:hover { background: color-mix(in srgb, var(--ok) 12%, var(--ok-bg)); }

.btn--sm { padding: .3rem .55rem; font-size: .78rem; }
.btn--icon { padding: .35rem; width: 30px; height: 30px; }
.btn--block { width: 100%; }

.btn-row { display: flex; gap: .4rem; align-items: center; }

/* --------------------------------------------------------------- forms --- */

.field { display: flex; flex-direction: column; gap: .3rem; }
.field__label { font-size: .8rem; font-weight: 620; color: var(--ink-700); }
.field__hint { font-size: .76rem; color: var(--ink-500); }

.input, .textarea, .select {
    width: 100%;
    padding: .5rem .7rem;
    font: inherit;
    font-size: .875rem;
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .12s ease, box-shadow .12s ease;
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 22%, transparent);
}

.input:disabled, .textarea:disabled { background: var(--surface-3); color: var(--ink-500); }
.textarea { resize: vertical; min-height: 84px; }
.input--qty { width: 96px; text-align: right; padding: .3rem .5rem; }
.input--cod { width: 12rem; padding: .3rem .5rem; text-transform: uppercase; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.form-grid--wide { grid-column: 1 / -1; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}

.filter-bar .field { min-width: 180px; }

.validation-message, .field__error { color: var(--danger); font-size: .78rem; }
.invalid { border-color: var(--danger) !important; }

/* --------------------------------------------------------------- alerts -- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem .95rem;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: .86rem;
    margin-bottom: 1rem;
}

.alert--info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 28%, transparent); color: var(--info); }
.alert--ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 28%, transparent); color: var(--ok); }
.alert--warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 28%, transparent); color: var(--warn); }
.alert--danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 28%, transparent); color: var(--danger); }
.alert__body { flex: 1; }
.alert__title { font-weight: 650; margin-bottom: .1rem; }

.empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--ink-500);
}

.empty__title { font-weight: 650; color: var(--ink-700); margin-bottom: .25rem; }

.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent-500);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 2.5rem;
    color: var(--ink-500);
    font-size: .875rem;
}

/* Cursor de espera: ao clicar num link (navegacao.js liga "navegando") e enquanto
   houver um indicador de carregamento na tela. "progress" deixa clicar mesmo assim. */
body.navegando,
body.navegando *,
body:has(.loading-row),
body:has(.loading-row) * { cursor: progress !important; }

/* Texto de "demorando" sob o indicador: invisivel de inicio, revelado pela animacao. */
.loading-slow {
    margin-top: -1.5rem;
    padding: 0 1rem 2rem;
    text-align: center;
    font-size: .8rem;
    color: var(--ink-500);
    opacity: 0;
    animation: revelar .4s ease 8s forwards;
}

@keyframes revelar { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------- login --- */

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--page);
}

.login__aside {
    position: relative;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #e8f4f8;
    background:
        radial-gradient(1100px 520px at 8% -8%, rgba(0, 174, 161, .30), transparent 60%),
        linear-gradient(155deg, var(--brand-800) 0%, var(--brand-900) 100%);
}

.login__aside h2 { font-size: 1.9rem; color: #fff; max-width: 22ch; line-height: 1.2; }
.login__aside p { color: #a9c9d8; max-width: 44ch; }

.login__bullets { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .7rem; }
.login__bullets li { display: flex; align-items: center; gap: .6rem; color: #bcd8e5; font-size: .9rem; }
.login__bullets .dot { background: var(--accent-400); width: 7px; height: 7px; }

.login__panel {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login__box {
    width: 100%;
    max-width: 390px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.login__logo { height: 54px; width: auto; margin-bottom: 1.25rem; border-radius: 8px; }
.login__box h1 { font-size: 1.3rem; margin-bottom: .25rem; }
.login__box .login__lead { color: var(--ink-500); font-size: .875rem; margin-bottom: 1.5rem; }
.login__fields { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.login__footer { margin-top: 1.5rem; text-align: center; font-size: .74rem; color: var(--ink-400); }
.login__footer img { height: 34px; opacity: .85; margin-bottom: .5rem; border-radius: 6px; }

/* --------------------------------------------------------- error banner -- */

#blazor-error-ui {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    display: none;
    padding: .85rem 1.25rem;
    background: var(--warn-bg);
    color: var(--warn);
    border-top: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
    box-shadow: var(--shadow-lg);
    font-size: .86rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    font-weight: 700;
    padding: 0 .35rem;
}

.blazor-error-boundary {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1024px) {
    :root { --sidebar-w: 232px; }
    .login { grid-template-columns: 1fr; }
    .login__aside { display: none; }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }

    .topbar .menu-toggle { display: inline-flex; }
    .main { margin-left: 0; }
    .content { padding: 1rem; }
    .topbar { padding: 0 1rem; }
    .topbar__meta { display: none; }

    /* Alterna sem JavaScript: o checkbox fica escondido antes da sidebar. */
    #menu-state:checked ~ .shell .sidebar { transform: translateX(0); }
    #menu-state:checked ~ .shell .scrim { display: block; }

    .scrim {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(4, 20, 28, .45);
        z-index: 35;
    }

    /* Estoque no celular: cada produto vira uma linha com codigo, descricao e
       quantidade disponivel, sem rolagem lateral. As colunas de saldo fisico,
       empenhada, quarentena e nao conforme ficam so no computador. */
    table.data--estoque,
    table.data--estoque tbody,
    table.data--estoque tfoot { display: block; white-space: normal; }

    table.data--estoque thead { display: none; }

    table.data--estoque tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: .75rem;
        padding: .7rem .9rem;
        border-bottom: 1px solid var(--border);
    }

    table.data--estoque tbody tr:last-child { border-bottom: none; }
    table.data--estoque td { display: block; padding: 0; border: 0; }
    table.data--estoque .c-extra { display: none; }

    table.data--estoque .c-cod { grid-column: 1; grid-row: 1; }
    table.data--estoque .c-prod {
        grid-column: 1;
        grid-row: 2;
        margin-top: .15rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
        min-width: 0;
        max-width: none;
    }

    table.data--estoque .c-disp,
    table.data--estoque .c-tot-val {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        font-size: 1.15rem;
    }

    table.data--estoque .c-disp::before,
    table.data--estoque .c-tot-val::before {
        display: block;
        font-size: .62rem;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--ink-500);
    }

    table.data--estoque .c-disp::before { content: "Disponível"; }
    table.data--estoque .c-tot-val::before { content: "Total disponível"; }

    table.data--estoque .c-tot-txt { grid-column: 1; grid-row: 1 / span 2; align-self: center; }

    /* Botao Lotes na linha do codigo, para nao dobrar a altura de cada produto. */
    table.data--estoque .c-acoes { grid-column: 1; grid-row: 1; justify-self: end; width: auto; }
    table.data--estoque .c-acoes .btn { padding: .15rem .55rem; font-size: .72rem; }

    table.data--estoque tfoot td { border-top: 0; }

    table.data--estoque tfoot tr {
        background: var(--surface-3);
        border-top: 2px solid var(--border-strong);
        border-bottom: none;
    }
}

@media print {
    .sidebar, .topbar, .page-head__actions, .card__foot, .btn { display: none !important; }
    .main { margin-left: 0; }
    body { background: #fff; }
    .card { border: none; box-shadow: none; }
}

.login__aside-foot { color: #7ba3b8; font-size: .78rem; }

/* --------------------------------------------------------------- modal --- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(4, 20, 28, .5);
    backdrop-filter: blur(2px);
}

.modal {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal__head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.modal__body { padding: 1.25rem; }

.modal__foot {
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.mb-1 { margin-bottom: 1rem; }
