/* ============================================================================
   ERP Insumos y Máquinas — capa visual unificada (criterios de CLAUDE.md)
   Se carga DESPUÉS de app.css. No cambia markup: reestiliza las clases
   existentes para que TODAS las pantallas (proformas, productos, clientes,
   ventas, proveedores, reportes, admin, papeleras…) queden iguales a las
   ya rediseñadas.
   ============================================================================ */

:root {
    --ui-bg:        #e9e7e3;
    --ui-frame:     #f5f3ef;
    --ui-surface:   #ffffff;
    --ui-strip:     #faf9f6;
    --ui-border:    #d4d0c8;
    --ui-line:      #e6e3dd;
    --ui-line-soft: #efece6;
    --ui-ink:       #1c1c1f;
    --ui-text:      #242428;
    --ui-label:     #3c3c41;
    --ui-muted:     #6b6b70;
    --ui-ph:        #8a8782;
    --ui-red:       #b5301c;
    --ui-red-h:     #8f2516;
    --ui-red-tint:  #fbeae6;
    --ui-ring:      0 0 0 3px rgba(181, 48, 28, .28);
    --ui-shadow:    0 1px 2px rgba(28, 28, 31, .06);
    --ui-pop:       0 6px 16px rgba(28, 28, 31, .12), 0 1px 3px rgba(28, 28, 31, .08);

    /* estados comerciales: sólido · fondo · texto */
    --st-cotizado:  #3c3c41; --st-cotizado-bg:  #ececee; --st-cotizado-fg:  #3c3c41;
    --st-aprobado:  #3a6ea5; --st-aprobado-bg:  #e6eef7; --st-aprobado-fg:  #234a73;
    --st-pagado:    #2f8a4f; --st-pagado-bg:    #e2f1e7; --st-pagado-fg:    #1d6b3a;
    --st-facturado: #c47a0a; --st-facturado-bg: #fbf0dc; --st-facturado-fg: #7a4a05;
    --st-rechazado: #a8a5a0; --st-rechazado-bg: #f0efed; --st-rechazado-fg: #6b6b70;

    /* que app.css herede la paleta nueva */
    --color-bg: var(--ui-frame);
    --color-border: var(--ui-line);
    --color-primary-hover: var(--ui-red-h);
    --color-primary-soft: var(--ui-red-tint);
    --radius: 8px;
    --radius-sm: 6px;
}

/* ---------- Base ---------- */
html, body {
    font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    background: var(--ui-bg);
    color: var(--ui-text);
    -webkit-font-smoothing: antialiased;
}
body { padding: 16px 16px 40px; }
h1, h2, h3 { color: var(--ui-ink); font-weight: 600; }
.muted { color: var(--ui-muted); }
.small { font-size: 12px; }
code { background: var(--ui-line-soft); border-radius: 6px; }
::selection { background: #f3cfc7; }

.content a:not([class]) { color: var(--ui-text); text-decoration: underline; text-underline-offset: 3px; }
.content a:not([class]):hover { color: var(--ui-red); }

.th-num, td.th-num, .metric, .totales, .totales-linea .val, table.data td { font-variant-numeric: tabular-nums; }

/* ---------- Marco ---------- */
.topbar,
.content { max-width: 1280px; margin-left: auto; margin-right: auto; }

.content {
    background: var(--ui-frame);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 0 0 1px var(--ui-border), var(--ui-shadow);
    padding: 24px 16px 32px;
    min-height: calc(100vh - 140px);
}
/* login (sin topbar): el marco va completo */
body:not(:has(.topbar)) .content { border-radius: 8px; margin-top: 40px; min-height: 0; max-width: 480px; }

/* ---------- Barra superior ---------- */
.topbar {
    background: #1c1c1f;
    border-bottom: 3px solid var(--ui-red);
    border-radius: 8px 8px 0 0;
    position: static;
    box-shadow: none;
}
.topbar-inner { max-width: none; padding: 10px 16px; gap: 20px; }
.brand-logo { border-radius: 6px; background: #fff; padding: 2px 6px; }
.topnav { gap: 8px 12px; }
.topbar .topnav a { padding: 6px 12px; border-radius: 6px; border-bottom: 0; font-size: 14px; line-height: 1.3; }
.topbar .topnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }

.nav-main { display: inline-flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, .06); border-radius: 8px; border: 0; }
.nav-main a { font-weight: 600; color: #f5f3ef; }
.topbar .nav-main a.active,
.topbar .topnav a.active {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 -2px 0 var(--ui-red);
    border-bottom: 0;
    padding-bottom: 6px;
}
.topbar .nav-secundario { color: #a8a5a0; font-weight: 500; }
.nav-secundarios { gap: 2px; border: 0; padding: 0; }

.user-box { gap: 10px; font-size: 13px; }
.user-role { border-radius: 6px; background: rgba(255, 255, 255, .1); color: #d4d0c8; padding: 2px 8px; font-size: 12px; }
.topbar .btn-link { height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 6px; border: 1px solid #44444a; color: #d4d0c8; font-size: 13px; }

/* ---------- Encabezado de página ----------
   El h1 va DENTRO de un contenedor: .page-head se dibuja como la franja
   de encabezado del primer contenedor. */
.page-head,
.page-head-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 24px;
    padding: 14px 24px;
    background: var(--ui-strip);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: var(--ui-shadow);
}
.page-head h1,
.page-title-big { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.2; color: var(--ui-ink); letter-spacing: 0; }
.page-head p,
.page-head .muted { margin: 2px 0 0; font-size: 13px; color: var(--ui-muted); }

/* ---------- Contenedores ---------- */
.card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: var(--ui-shadow);
    padding: 20px 24px 24px;
    margin: 0 0 24px;
}
.card.no-padding { padding: 0; overflow: hidden; }

/* franja de encabezado del contenedor */
.card > h2:first-child,
.card > .card-head:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: -20px -24px 20px;
    padding: 14px 24px;
    background: var(--ui-strip);
    border-bottom: 1px solid var(--ui-line);
    border-radius: 8px 8px 0 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--ui-ink);
    text-transform: none;
    letter-spacing: 0;
}
.card > .card-head:first-child h2 { margin: 0; font-size: 17px; font-weight: 600; }
.card > h2:first-child small,
.card > h2:first-child .muted { font-size: 13px; font-weight: 400; color: var(--ui-muted); }
.card h3 { font-size: 12px; font-weight: 600; color: var(--ui-muted); letter-spacing: .04em; }
.card > p.muted:first-of-type { font-size: 13px; margin-top: 0; }

/* bloques de formulario numerados 01, 02… con badge rojo */
.content { counter-reset: bloque; }
.content:has(form[method="post"] > .card) .card > h2:first-child,
.content:has(form[method="post"] > .card) .card > .card-head:first-child h2 { justify-content: flex-start; }
.content:has(form[method="post"] > .card) .card > h2:first-child::before,
.content:has(form[method="post"] > .card) .card > .card-head:first-child h2::before {
    counter-increment: bloque;
    content: counter(bloque, decimal-leading-zero);
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    margin-right: 12px;
    box-sizing: border-box;
    border-radius: 6px;
    background: var(--ui-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.card > .card-head:first-child h2 { display: inline-flex; align-items: center; }

/* ---------- Grillas y espaciado ---------- */
.grid { gap: 16px; margin-bottom: 0; }
.grid + .grid { margin-top: 16px; }
.content > .grid { margin-bottom: 24px; gap: 24px; }

/* ---------- Campos ---------- */
label { margin-bottom: 0; }
.grid label, .card > label { display: flex; flex-direction: column; gap: 8px; }
.card > label + label { margin-top: 16px; }
label > span,
.pagos-metodos-label,
.check-label,
.sub-titulo { font-size: 13px; font-weight: 600; color: var(--ui-label); text-transform: none; letter-spacing: 0; margin: 0; }

input[type=text], input[type=email], input[type=number], input[type=password],
input[type=search], input[type=tel], input[type=url], input[type=date],
input:not([type]), select, textarea {
    height: 40px;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: none;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
textarea { height: auto; min-height: 72px; padding: 9px 12px; line-height: 1.4; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ui-ph); opacity: 1; }
input:focus, select:focus, textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    border-color: var(--ui-text);
    box-shadow: var(--ui-ring);
    outline: none;
}
input:disabled, select:disabled, textarea:disabled { background: var(--ui-frame); color: var(--ui-ph); }
input[type=checkbox], input[type=radio] { accent-color: var(--ui-text); width: 16px; height: 16px; }
input[type=file] { height: auto; padding: 8px; border-style: dashed; }

.check-pagado, .check-group { border-radius: 8px; }
.check-pagado:has(input:checked) { background: var(--ui-red-tint); border-color: var(--ui-red); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    text-align: left;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #fff; border-color: var(--ui-text); color: var(--ui-text); text-decoration: none; }
.btn:focus-visible, .btn-mini:focus-visible { outline: 2px solid var(--ui-red); outline-offset: 2px; }
.btn-primary { background: var(--ui-red); border-color: var(--ui-red); color: #fff; }
.btn-primary:hover { background: var(--ui-red-h); border-color: var(--ui-red-h); color: #fff; }
.btn-primary:active { background: #6e1c11; }
.btn-dark { background: var(--ui-text); border-color: var(--ui-text); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; color: #fff; }
.btn-ghost, .btn-link { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--ui-line-soft); border-color: transparent; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-group { gap: 8px; align-items: center; }

.btn-mini, .btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.btn-mini:hover, .btn-edit:hover { background: #fff; border-color: var(--ui-text); color: var(--ui-text); text-decoration: none; }
.btn-mini-primary { color: var(--ui-red); border-color: var(--ui-red); }
.btn-mini-primary:hover { background: var(--ui-red-tint); color: var(--ui-red-h); border-color: var(--ui-red); }
.btn-mini-ok { color: var(--st-pagado-fg); border-color: var(--st-pagado); background: var(--st-pagado-bg); }
.btn-mini-ok:hover { background: var(--st-pagado-bg); border-color: var(--st-pagado-fg); color: var(--st-pagado-fg); }
.btn-mini-danger { color: #8a8782; border-color: transparent; background: transparent; width: 30px; padding: 0; justify-content: center; }
.btn-mini-danger:hover { color: var(--ui-red); background: #fbe4df; border-color: transparent; }

/* barra de acciones del formulario: fija abajo, como en los prototipos */
.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin: 24px 0 0;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-top: 2px solid var(--ui-text);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -6px 20px rgba(28, 28, 31, .10);
}
.form-actions .btn-primary { min-width: 200px; }

/* ---------- Búsqueda y filtros ---------- */
.buscador-hero-form,
.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 0 0 24px;
    padding: 12px 24px;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: var(--ui-shadow);
}
.buscador-hero {
    position: relative;
    flex: 0 1 320px;
    height: 40px;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: none;
}
.buscador-hero:focus-within { border-color: var(--ui-text); box-shadow: var(--ui-ring); }
.buscador-hero-ico { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--ui-muted); }
.buscador-hero-input,
.buscador-hero .buscador-hero-input:focus {
    height: 38px;
    padding: 0 12px 0 36px;
    font-size: 14px;
    font-weight: 400;
    border: 0;
    box-shadow: none;
    background: transparent;
}
.buscador-hero:has(.buscador-hero-input[value]:not([value=""])) { background: var(--ui-red-tint); border-color: var(--ui-red); }

/* filtros secundarios: chicos para no robar atención */
.filtros-secundarios,
.filters .filters-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0; padding: 0; background: none; border: 0; }
.filtros-secundarios label,
.filters label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.filtros-secundarios label > span,
.filters label > span { font-size: 12px; font-weight: 600; color: var(--ui-muted); }
.filtros-secundarios input,
.filtros-secundarios select,
.filters input, .filters select {
    height: 30px;
    width: auto;
    padding: 0 8px;
    font-size: 13px;
    color: var(--ui-ph);
    border-radius: 6px;
}
.filtros-secundarios .btn,
.filters .btn { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 6px; border-color: transparent; color: var(--ui-red); background: transparent; }
.filtros-secundarios .btn:hover,
.filters .btn:hover { background: var(--ui-red-tint); border-color: transparent; color: var(--ui-red-h); }
/* filtro activo */
.filtros-secundarios input[value]:not([value=""]),
.filters input[value]:not([value=""]),
.filtros-secundarios select:has(option:checked:not([value=""])),
.filters select:has(option:checked:not([value=""])) { background: var(--ui-red-tint); border-color: var(--ui-red); color: var(--ui-text); }
.filters .filter-q input { width: 260px; height: 40px; font-size: 14px; border-radius: 8px; }

/* pestañas (períodos / estados) */
.periodo-tabs { gap: 8px; background: none; padding: 0; border-radius: 0; flex-wrap: wrap; }
.periodo-tab {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 14px;
    font-size: 15px; font-weight: 600; color: var(--ui-text);
    background: #fff; border: 1px solid var(--ui-border); border-radius: 8px;
    box-shadow: var(--ui-shadow);
}
.periodo-tab:hover { border-color: var(--ui-text); background: #fff; color: var(--ui-text); }
.periodo-tab.active, .periodo-tab.active:hover { background: var(--ui-text); border-color: var(--ui-text); color: #fff; box-shadow: 0 0 0 1px var(--ui-text); }
.periodo-custom input { height: 30px; font-size: 13px; border-radius: 6px; }

/* ---------- Tablas / listados ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; border: 0; }
table.data th {
    padding: 12px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    border-bottom: 1px solid var(--ui-label);
    white-space: nowrap;
}
table.data td { padding: 14px 12px; border-top: 1px solid var(--ui-line-soft); border-bottom: 0; vertical-align: middle; }
table.data th:first-child, table.data td:first-child { padding-left: 24px; }
table.data th:last-child,  table.data td:last-child  { padding-right: 24px; }
table.data tbody tr:hover td { background: var(--ui-strip); }
table.data td.empty { padding: 56px 24px; font-size: 15px; color: var(--ui-muted); text-align: center; }
table.data tfoot td { border-top: 2px solid var(--ui-text); background: var(--ui-strip); font-weight: 700; }
table.data .th-num, table.data td.th-num { text-align: right; }
.card:not(.no-padding) > table.data { margin: 0 -24px; width: calc(100% + 48px); }
.items-table td { padding: 8px; }
.items-table th { padding: 8px; }

/* sin filas pintadas: el estado se lee en el chip */
tr.row-cotizado, tr.row-aprobado, tr.row-pagado, tr.row-facturado, tr.row-rechazado,
tr.row-pendiente, tr.row-enviada, tr.row-facturada, tr.row-rechazada, tr.row-convertida, tr.row-enviado,
.row-cotizado td, .row-aprobado td, .row-pagado td, .row-facturado td, .row-rechazado td { background: transparent; }
tr.row-rechazado td, tr.row-rechazada td { color: var(--ui-muted); }

table.kv td { padding: 6px 0; font-size: 15px; }
table.kv td.label { font-size: 13px; font-weight: 600; color: var(--ui-label); text-transform: none; letter-spacing: 0; width: 180px; }

/* ---------- Chips de estado (999px solo acá) ---------- */
.badge, .chip-doc, .env-pill, .canal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    white-space: nowrap;
    border: 0;
}
.badge-cotizado,  .badge-aprobado, .badge-pagado, .badge-facturado, .badge-rechazado { --dot: currentColor; }
.badge-cotizado::before, .badge-aprobado::before, .badge-pagado::before, .badge-facturado::before, .badge-rechazado::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot);
}
.badge-cotizado  { background: var(--st-cotizado-bg);  color: var(--st-cotizado-fg);  --dot: var(--st-cotizado); }
.badge-aprobado  { background: var(--st-aprobado-bg);  color: var(--st-aprobado-fg);  --dot: var(--st-aprobado); }
.badge-pagado    { background: var(--st-pagado-bg);    color: var(--st-pagado-fg);    --dot: var(--st-pagado); }
.badge-facturado { background: var(--st-facturado-bg); color: var(--st-facturado-fg); --dot: var(--st-facturado); }
.badge-rechazado { background: var(--st-rechazado-bg); color: var(--st-rechazado-fg); --dot: var(--st-rechazado); }
.badge-enviado   { background: var(--st-aprobado-bg);  color: var(--st-aprobado-fg); }

/* chips genéricos: neutros, sin colores inventados */
.badge-gray, .badge-slate, .badge-blue, .canal-chip, .canal-otro, .chip-doc-presupuesto, .badge-fact-p, .fact-p-code { background: var(--ui-line-soft); color: var(--ui-label); }
.badge-green, .env-si  { background: var(--st-pagado-bg);    color: var(--st-pagado-fg); }
.badge-amber, .env-prepar { background: var(--st-facturado-bg); color: var(--st-facturado-fg); }
.badge-coral, .env-no  { background: var(--ui-red-tint);     color: var(--ui-red-h); }
.canal-whatsapp, .canal-mail, .canal-telefono, .canal-recomendacion, .canal-local { background: var(--ui-line-soft); color: var(--ui-label); }

/* tipo de comprobante: letra en cuadrado 6px (no es un estado) */
.badge-fact-a, .badge-fact-b, .badge-fact-p, .fact-code, .chip-doc-factura-a, .chip-doc-factura-b {
    border-radius: 6px; height: 24px; padding: 0 8px; font-size: 12px; font-weight: 700;
    background: var(--ui-line-soft); color: var(--ui-ink); font-variant-numeric: tabular-nums;
}
.chip-doc:hover { filter: brightness(.96); text-decoration: none; }
.no-fact { font-size: 12px; color: var(--ui-ph); font-style: normal; }

.canal-icon, .flag { border-radius: 6px; }
.flag-on { background: var(--st-pagado); border-color: var(--st-pagado); }

/* ---------- Avisos ---------- */
.alert {
    padding: 12px 16px;
    margin: 0 0 24px;
    font-size: 15px;
    border: 1px solid;
    border-radius: 8px;
}
.alert-success { background: #e7f3ec; border-color: #b9dcc6; color: #1d5e36; }
.alert-error   { background: var(--ui-red-tint); border-color: #f0c4ba; color: var(--ui-red-h); }
.alert-info    { background: #eef3f9; border-color: #c9d8ea; color: #234a73; }
.alert-warning { background: var(--st-facturado-bg); border-color: #ecd3a3; color: var(--st-facturado-fg); }
.alert-compacto { padding: 8px 14px; font-size: 13px; }

/* ---------- Totales ---------- */
.totales, .totales-proforma, .totales-final {
    margin: 16px 0 0 auto;
    max-width: 380px;
    padding: 16px 24px 20px;
    background: var(--ui-strip);
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    font-size: 15px;
    color: var(--ui-muted);
}
.totales > div, .totales-proforma > div { display: flex; justify-content: space-between; padding: 2px 0; }
.totales strong, .totales-proforma strong { color: var(--ui-text); font-weight: 600; }
.totales .total-row, .totales-proforma .total-final, .totales-linea.total-final {
    margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--ui-line);
    font-size: 17px; font-weight: 600; color: var(--ui-ink); background: none;
}
.totales .total-row strong, .totales-proforma .total-final strong, .totales-linea.total-final .val { font-size: 24px; color: var(--ui-ink); }
.totales-override { border-radius: 8px; }

/* ---------- Otros componentes ---------- */
.autocomplete-list {
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    box-shadow: var(--ui-pop);
    overflow: hidden;
}
.autocomplete-item { padding: 10px 14px; border-bottom: 1px solid var(--ui-line-soft); font-size: 15px; }
.autocomplete-item:hover { background: var(--ui-strip); }
.autocomplete-item small { font-size: 12px; color: var(--ui-muted); }
.autocomplete-create:hover { background: var(--ui-line-soft); }

.tipo-card-body { border: 1px solid var(--ui-border); border-radius: 8px; background: #fff; }
.tipo-card:hover .tipo-card-body { border-color: var(--ui-text); }
.tipo-card input[type="radio"]:checked + .tipo-card-body { background: var(--ui-red-tint); border-color: var(--ui-red); box-shadow: 0 0 0 1px var(--ui-red); }
.tipo-letra { border-radius: 6px; }

.quick-card { border: 1px solid var(--ui-border); border-radius: 8px; box-shadow: var(--ui-shadow); background: #fff; }
.quick-card:hover { border-color: var(--ui-text); transform: none; box-shadow: var(--ui-shadow); }

.kpi-card .metric { font-size: 28px; font-weight: 600; color: var(--ui-ink); }
.kpi-card-accent { background: var(--ui-ink); border-color: var(--ui-ink); }
.kpi-card-accent h3, .kpi-card-accent .muted { color: #c8c5be !important; }
.kpi-card-accent .metric { color: #fff; }

.adjunto-uploader, .asociar-venta-form { border-radius: 8px; background: var(--ui-strip); border: 1px solid var(--ui-line); padding: 16px; }

.login-card { border: 1px solid var(--ui-border); border-radius: 8px; box-shadow: var(--ui-shadow); }

@media (max-width: 760px) {
    body { padding: 0; }
    .topbar { border-radius: 0; }
    .content { border-radius: 0; padding: 16px 12px; }
    .card { padding: 16px; }
    .card > h2:first-child, .card > .card-head:first-child { margin: -16px -16px 16px; padding: 12px 16px; }
    .form-actions .btn-primary { min-width: 0; }
}
