/* =====================================================================
   Infinycore - Inventario & API REST
   Estetica clara y pastel. Sin fondos oscuros.
   ===================================================================== */

:root {
    --bg: #f4f7fb;
    --bg-soft: #eef3fa;
    --surface: #ffffff;
    --surface-alt: #f8fafd;

    --pastel-blue: #e8f1fd;
    --pastel-blue-strong: #4a8fd4;
    --pastel-green: #e6f6ed;
    --pastel-green-strong: #3da06d;
    --pastel-amber: #fdf3e2;
    --pastel-amber-strong: #d99a3c;
    --pastel-rose: #fdedf0;
    --pastel-rose-strong: #d96a7d;
    --pastel-violet: #f0ecfb;
    --pastel-violet-strong: #8a72d0;
    --pastel-cyan: #e4f6f8;
    --pastel-cyan-strong: #3aa5b5;

    --ink: #24344a;
    --ink-soft: #5b6b81;
    --ink-muted: #8797aa;
    --line: #e3eaf3;
    --line-strong: #cfdbea;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(36, 52, 74, .04);
    --shadow: 0 2px 10px rgba(36, 52, 74, .05);
    --shadow-md: 0 8px 24px rgba(36, 52, 74, .07);

    --sidebar-w: 258px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pastel-blue-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }

code, pre, .mono { font-family: var(--mono); font-size: 13px; }

/* ---------------------------------------------------------------
   Estructura general
   --------------------------------------------------------------- */

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

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 24px 28px 32px;
    max-width: 1560px;
    width: 100%;
}

/* ---------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------- */

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #2f6fa8;
    background: linear-gradient(140deg, var(--pastel-blue), var(--pastel-cyan));
}

.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-text strong { font-size: 15px; font-weight: 700; }
.sidebar-brand-text span { font-size: 11.5px; color: var(--ink-muted); }

.sidebar-close {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 20px;
    color: var(--ink-soft);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-weight: 550;
    font-size: 14px;
    transition: background .15s, color .15s;
}

.nav-link i { font-size: 19px; color: var(--ink-muted); transition: color .15s; }
.nav-link:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav-link:hover i { color: var(--pastel-blue-strong); }

.nav-link.is-active {
    background: var(--pastel-blue);
    color: #2f6fa8;
    font-weight: 650;
}
.nav-link.is-active i { color: var(--pastel-blue-strong); }

.sidebar-footer {
    border-top: 1px solid var(--line);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #3d8f66;
    background: var(--pastel-green);
}

.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sidebar-user-info strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { font-size: 11.5px; color: var(--ink-muted); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(36, 52, 74, .28);
    z-index: 35;
}

/* ---------------------------------------------------------------
   Topbar
   --------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.topbar-title h1 i { font-size: 21px; color: var(--pastel-blue-strong); }
.topbar-title p { font-size: 12.5px; color: var(--ink-muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.topbar-auth {
    background: transparent;
    border: 0;
    position: static;
    padding: 0 0 18px;
    justify-content: center;
}
.topbar-auth .topbar-title h1 { display: none; }
.topbar-auth .topbar-title p { display: none; }

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 19px;
    color: var(--ink-soft);
    cursor: pointer;
    flex: 0 0 auto;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }

.sidebar-toggle { display: none; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--line);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--ink-muted);
    background: var(--surface);
}
.footer .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

/* ---------------------------------------------------------------
   Botones
   --------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn i { font-size: 17px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: #eaf2fc; color: #2f6fa8; border-color: #cfe1f5; }
.btn-primary:hover { background: #ddebfb; border-color: #bcd7f1; }

.btn-success { background: var(--pastel-green); color: #2e8558; border-color: #c6e8d5; }
.btn-success:hover { background: #d8f0e3; }

.btn-danger { background: var(--pastel-rose); color: #c05268; border-color: #f4d3da; }
.btn-danger:hover { background: #fbe0e5; }

.btn-ghost { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-sm i { font-size: 15px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------
   Tarjetas
   --------------------------------------------------------------- */

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

.card + .card { margin-top: 18px; }

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
    background: var(--surface-alt);
}

.card-header h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-header h2 i { font-size: 18px; color: var(--pastel-blue-strong); }
.card-header .spacer { flex: 1; }

.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------------------------------------------------------------
   Stats
   --------------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 13px;
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    inset: auto -18px -30px auto;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--tone, var(--pastel-blue));
    opacity: .5;
}

.stat-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 21px;
    background: var(--tone, var(--pastel-blue));
    color: var(--tone-strong, var(--pastel-blue-strong));
    position: relative;
    z-index: 1;
}

.stat-body { min-width: 0; position: relative; z-index: 1; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--ink-muted); font-weight: 550; }
.stat-hint { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

.tone-blue   { --tone: var(--pastel-blue);   --tone-strong: var(--pastel-blue-strong); }
.tone-green  { --tone: var(--pastel-green);  --tone-strong: var(--pastel-green-strong); }
.tone-amber  { --tone: var(--pastel-amber);  --tone-strong: var(--pastel-amber-strong); }
.tone-rose   { --tone: var(--pastel-rose);   --tone-strong: var(--pastel-rose-strong); }
.tone-violet { --tone: var(--pastel-violet); --tone-strong: var(--pastel-violet-strong); }
.tone-cyan   { --tone: var(--pastel-cyan);   --tone-strong: var(--pastel-cyan-strong); }

/* ---------------------------------------------------------------
   Alertas
   --------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 13.5px;
    margin-bottom: 14px;
}
.alert i { font-size: 18px; flex: 0 0 auto; margin-top: 1px; }
.alert span { min-width: 0; word-break: break-word; }
.alert-success { background: var(--pastel-green); border-color: #c6e8d5; color: #2e8558; }
.alert-error   { background: var(--pastel-rose);  border-color: #f4d3da; color: #c05268; }
.alert-warning { background: var(--pastel-amber); border-color: #f2e0be; color: #a9762a; }
.alert-info    { background: var(--pastel-blue);  border-color: #cfe1f5; color: #2f6fa8; }

.auth-wrap .alert { margin-bottom: 14px; }

/* ---------------------------------------------------------------
   Formularios
   --------------------------------------------------------------- */

.form-stack { display: flex; flex-direction: column; gap: 15px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.field-control {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 0 11px;
    transition: border-color .15s, box-shadow .15s;
}
.field-control:focus-within {
    border-color: var(--pastel-blue-strong);
    box-shadow: 0 0 0 3px rgba(74, 143, 212, .13);
}
.field-control > i { font-size: 18px; color: var(--ink-muted); flex: 0 0 auto; }
.field-control input,
.field-control select,
.field-control textarea {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    padding: 9px 0;
}
.field-control select { cursor: pointer; }
.field-control textarea { resize: vertical; padding: 9px 0; min-height: 74px; }

.field-control.is-invalid { border-color: var(--pastel-rose-strong); }

.field-action {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--ink-muted);
    font-size: 17px;
    padding: 2px;
    display: grid;
    place-items: center;
}
.field-action:hover { color: var(--ink); }

.field-hint { font-size: 11.5px; color: var(--ink-muted); }

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

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    user-select: none;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--pastel-blue-strong); cursor: pointer; }

/* ---------------------------------------------------------------
   Login
   --------------------------------------------------------------- */

.body-auth {
    background:
        radial-gradient(1100px 520px at 12% -8%, #eaf2fc 0%, rgba(234, 242, 252, 0) 62%),
        radial-gradient(900px 460px at 92% 4%, #e6f6ed 0%, rgba(230, 246, 237, 0) 58%),
        var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 412px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 44px; height: 44px; flex: 0 0 44px; font-size: 23px; }
.auth-brand h1 { font-size: 18px; }
.auth-brand p { font-size: 12.5px; color: var(--ink-muted); }

.auth-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ---------------------------------------------------------------
   Tablas
   --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-muted);
    padding: 11px 14px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-alt); }
.table .nowrap { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { margin-left: 5px; }

.cell-strong { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--ink-muted); }

/* ---------------------------------------------------------------
   Badges
   --------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 650;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge i { font-size: 13px; }
.badge-green  { background: var(--pastel-green);  color: #2e8558; border-color: #c6e8d5; }
.badge-rose   { background: var(--pastel-rose);   color: #c05268; border-color: #f4d3da; }
.badge-amber  { background: var(--pastel-amber);  color: #a9762a; border-color: #f2e0be; }
.badge-blue   { background: var(--pastel-blue);   color: #2f6fa8; border-color: #cfe1f5; }
.badge-violet { background: var(--pastel-violet); color: #6f5bb8; border-color: #ddd6f4; }
.badge-grey   { background: var(--bg-soft);       color: var(--ink-soft); border-color: var(--line); }

/* ---------------------------------------------------------------
   Filtros
   --------------------------------------------------------------- */

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 12px;
    align-items: end;
}
.filters .field-control { padding: 0 10px; }
.filters .btn-row { display: flex; gap: 8px; }

/* ---------------------------------------------------------------
   Paginacion
   --------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    background: var(--surface-alt);
}

.pagination-info { font-size: 12.5px; color: var(--ink-muted); }
.pagination-links { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

.page-link {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}
.page-link:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.page-link.is-active { background: var(--pastel-blue); border-color: #cfe1f5; color: #2f6fa8; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }
.page-link i { font-size: 15px; }

.page-ellipsis { color: var(--ink-muted); padding: 0 3px; }

/* ---------------------------------------------------------------
   Zona de carga
   --------------------------------------------------------------- */

.dropzone {
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    padding: 34px 22px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-dragging {
    border-color: var(--pastel-blue-strong);
    background: var(--pastel-blue);
}

.dropzone-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 13px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 29px;
    color: #2f6fa8;
    background: var(--pastel-blue);
}

.dropzone h3 { font-size: 15.5px; margin-bottom: 4px; }
.dropzone p { font-size: 12.5px; color: var(--ink-muted); }
.dropzone .dropzone-file {
    margin-top: 13px;
    font-size: 13px;
    font-weight: 600;
    color: #2e8558;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.dropzone.has-file .dropzone-file { display: flex; }

.requirements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
    gap: 12px;
}

.requirement {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    background: var(--surface-alt);
}
.requirement h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.requirement h4 i { color: var(--pastel-blue-strong); font-size: 17px; }
.requirement p { font-size: 12px; color: var(--ink-muted); }
.requirement code {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11.5px;
}

/* ---------------------------------------------------------------
   Resumen de importacion
   --------------------------------------------------------------- */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 12px;
}

.summary-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    background: var(--tone, var(--bg-soft));
}
.summary-item .summary-value { font-size: 21px; font-weight: 700; line-height: 1.2; }
.summary-item .summary-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }

.issue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}
.issue-list li {
    display: flex;
    gap: 9px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
}
.issue-list li:last-child { border-bottom: 0; }
.issue-row {
    flex: 0 0 auto;
    font-weight: 650;
    font-size: 11.5px;
    padding: 1px 7px;
    border-radius: 5px;
    height: fit-content;
    background: var(--pastel-rose);
    color: #c05268;
}
.issue-row.is-warning { background: var(--pastel-amber); color: #a9762a; }

/* ---------------------------------------------------------------
   Codigo / documentacion
   --------------------------------------------------------------- */

.code-block {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink);
    margin: 0;
    white-space: pre;
}

.token-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--pastel-cyan);
    border: 1px solid #c7e8ee;
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-family: var(--mono);
    font-size: 13px;
    word-break: break-all;
    color: #22798a;
}

.endpoint-list { display: flex; flex-direction: column; gap: 11px; }

.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    background: var(--surface-alt);
    flex-wrap: wrap;
}

.method {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    background: var(--pastel-green);
    color: #2e8558;
    border: 1px solid #c6e8d5;
}

.endpoint code { color: var(--ink); font-weight: 600; }
.endpoint-desc { font-size: 12.5px; color: var(--ink-muted); flex: 1 1 200px; }

/* ---------------------------------------------------------------
   Estados vacios
   --------------------------------------------------------------- */

.empty {
    text-align: center;
    padding: 42px 22px;
    color: var(--ink-muted);
}
.empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 13px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 28px;
    color: var(--pastel-blue-strong);
    background: var(--pastel-blue);
}
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.empty p { font-size: 13px; margin-bottom: 15px; }

/* ---------------------------------------------------------------
   Grafico simple (barras CSS)
   --------------------------------------------------------------- */

.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 132px;
    padding-top: 10px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 0;
    height: 100%;
    justify-content: flex-end;
}

.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }

.chart-bar {
    width: 11px;
    border-radius: 4px 4px 2px 2px;
    background: var(--pastel-blue);
    min-height: 3px;
    transition: height .3s;
}
.chart-bar.is-error { background: var(--pastel-rose); }

.chart-label { font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; }
.chart-value { font-size: 11.5px; font-weight: 650; color: var(--ink-soft); }

/* ---------------------------------------------------------------
   Detalle producto
   --------------------------------------------------------------- */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
    gap: 14px;
}

.detail-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    background: var(--surface-alt);
}
.detail-item dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); font-weight: 650; }
.detail-item dd { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; word-break: break-word; }

.thumbs { display: flex; gap: 9px; flex-wrap: wrap; }
.thumb {
    width: 62px;
    height: 62px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    object-fit: contain;
    background: var(--surface-alt);
    padding: 3px;
}

/* ---------------------------------------------------------------
   Utilidades
   --------------------------------------------------------------- */

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-2 > .card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.text-muted { color: var(--ink-muted); }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media (max-width: 1080px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-md);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-close { display: block; }
    .sidebar-toggle { display: grid; }
    .content { padding: 20px 18px 28px; }
    .topbar { padding: 13px 18px; }
    .footer { padding: 13px 18px; }
}

@media (max-width: 720px) {
    body { font-size: 14px; }
    .content { padding: 16px 13px 24px; }
    .topbar { padding: 11px 13px; gap: 10px; }
    .topbar-title h1 { font-size: 16.5px; }
    .topbar-actions .btn span.btn-text { display: none; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
    .stat { padding: 12px 13px; gap: 10px; }
    .stat-value { font-size: 20px; }
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; }
    .table th, .table td { padding: 9px 11px; }
    .filters { grid-template-columns: 1fr 1fr; }
    .filters .field-wide { grid-column: 1 / -1; }
    .dropzone { padding: 26px 16px; }
    .auth-card { padding: 22px; }
    .pagination { justify-content: center; }
    .code-block { font-size: 11.5px; }
}

@media (max-width: 480px) {
    .filters { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .btn { padding: 8px 12px; font-size: 13px; }
}

@media print {
    .sidebar, .topbar-actions, .footer, .pagination { display: none; }
    .content { padding: 0; }
    body { background: #fff; }
}