:root {
    --azul: #1f3a5f;
    --verde: #1e7d4f;
    --rojo: #b3261e;
    --gris: #5f6b7a;
    --borde: #d0d7e2;
    --fondo: #f5f7fa;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    color: #18202b;
    background: var(--fondo);
    -webkit-text-size-adjust: 100%;
}

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

.barra {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    padding-top: calc(.6rem + env(safe-area-inset-top));
    background: var(--azul);
    color: #fff;
}
.marca { font-weight: 700; letter-spacing: .02em; margin-right: auto; }
.quien { font-size: .85rem; opacity: .9; }

.contenido { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.4rem; margin: .5rem 0 1rem; }

.formulario {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 1rem;
}
.formulario label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .95rem; }

input {
    font: inherit;
    padding: .75rem;
    border: 1px solid var(--borde);
    border-radius: 8px;
    min-height: 48px;
    background: #fff;
}
input:focus { outline: 2px solid var(--azul); outline-offset: 1px; }

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 10px;
    background: var(--azul);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.boton:disabled { opacity: .55; cursor: default; }

.boton-chico {
    min-height: 36px;
    padding: 0 .8rem;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
}

.error { margin: 0; padding: .6rem .8rem; border-radius: 8px; background: #fdecea; color: var(--rojo); }
.aviso { margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 8px; background: #fff6df; color: #6b4e00; }
.ok { margin: 0; padding: .6rem .8rem; border-radius: 8px; background: #e6f4ec; color: var(--verde); }

.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.cargando { text-align: center; color: var(--gris); padding: 2rem 1rem; }
.acciones { display: flex; flex-direction: column; gap: .75rem; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .8rem 1rem;
    background: #fff3cd;
    color: #5c4400;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, .2);
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .6rem; }


/* ---------- menu y estado de sincronizacion ---------- */
.menu { display: flex; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #d8dee6; }
.menu a { padding: 8px 14px; border-radius: 8px; color: #1f3a5f; text-decoration: none; font-weight: 600; }
.menu a:hover { background: #eef2f7; }
.sinc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 12px; font-size: 0.85rem; color: #4a5568; background: #f7f9fb; border-bottom: 1px solid #e3e8ee; }

/* ---------- vender ---------- */
.buscar { width: 100%; font-size: 1.1rem; padding: 12px; }
.lista { list-style: none; margin: 8px 0 0; padding: 0; }
.lista li { margin-bottom: 6px; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid #d8dee6; border-radius: 8px; background: #fff; text-align: left; font-size: 1rem; cursor: pointer; }
.item:hover { background: #eef2f7; }
.item.sub { margin: 4px 0 0 24px; width: calc(100% - 24px); background: #f7f9fb; }
.item .nombre { flex: 1; }
.item .precio { font-weight: 700; }
.item .stock { color: #6b7685; font-size: 0.85rem; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla td { padding: 8px 4px; border-bottom: 1px solid #e3e8ee; vertical-align: middle; }
.tabla .num { text-align: right; white-space: nowrap; font-weight: 600; }
.tabla .cantidad { white-space: nowrap; }
.cant { width: 64px; text-align: center; padding: 6px; }
.totales { display: grid; gap: 6px; margin-top: 12px; justify-items: end; }
.total { font-size: 1.5rem; font-weight: 800; }
.pago { display: grid; gap: 10px; margin-top: 12px; }
.vuelto { font-size: 1.2rem; }
.boton.grande { font-size: 1.2rem; padding: 14px; }
