* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0e1b1f;
    color: #e8f3f4;
    min-height: 100vh;
}

/* ---------- Barra y menú superior ---------- */
.barra {
    background: #14333b;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #2a5560;
}

.barra strong { color: #fff; font-size: 17px; }
.barra .usuario { color: #9ad0d8; font-size: 12px; }

.menu {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #12272c;
    position: sticky;
    top: 48px;
    z-index: 9;
    overflow-x: auto;
}

.menu a {
    flex: 1 1 auto;
    text-align: center;
    background: #1d3f48;
    color: #fff;
    text-decoration: none;
    padding: 10px 6px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #2c5a66;
    white-space: nowrap;
}

.caja { padding: 12px 14px; max-width: 1100px; margin: 0 auto; }

/* ---------- Login ---------- */
.login-body { background: #0e1b1f; }
.login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login form {
    background: #14333b;
    padding: 28px;
    border-radius: 14px;
    width: 90%;
    max-width: 340px;
    border: 1px solid #2a5560;
}

.login .logo-titulo {
    text-align: center;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.login h1 { text-align: center; color: #9ad0d8; margin-bottom: 16px; font-size: 15px; font-weight: 600; }

.login input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #2c5a66;
    background: #0e1b1f;
    color: #fff;
    font-size: 15px;
}

.login button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    background: #1d8a5c;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.error { color: #ff7a7a; text-align: center; margin-top: 10px; font-size: 13px; }

/* ---------- Resumen y títulos ---------- */
.resumen-hoy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #14333b;
    border: 1px solid #2a5560;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.resumen-hoy span { font-size: 11px; color: #7fc0cb; letter-spacing: 1px; }
.resumen-hoy strong { font-size: 20px; color: #6fe08a; }

.titulo-pagina h1 { font-size: 18px; color: #fff; margin-bottom: 10px; }

/* ---------- Vender: filtros y productos ---------- */
.categoria-filtro {
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
    overflow-x: auto;
}

.filtro {
    background: #1d3f48;
    color: #e8f3f4;
    border: 1px solid #2c5a66;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.filtro.activo { background: #1d8a5c; border-color: #1d8a5c; color: #fff; }

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.producto {
    background: #14333b;
    border: 1px solid #2a5560;
    border-radius: 10px;
    padding: 12px 6px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    min-height: 62px;
    justify-content: center;
}

.producto:active { background: #1d8a5c; }

.p-nombre { font-size: 12px; line-height: 1.2; }
.p-precio { color: #6fe08a; font-size: 12px; font-weight: 700; }

/* ---------- Carrito ---------- */
.carrito {
    background: #14333b;
    border: 1px solid #2a5560;
    border-radius: 12px;
    padding: 12px 14px;
}

.carrito h2 { font-size: 11px; color: #7fc0cb; letter-spacing: 1px; margin-bottom: 8px; }

.items { margin-bottom: 8px; }

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 2px;
    border-bottom: 1px solid #1f424a;
    font-size: 13px;
    gap: 6px;
}

.i-nombre { flex: 1; }
.i-nombre small { color: #9ad0d8; }
.i-sub { color: #fff; font-weight: 600; }

.i-botones button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #2c5a66;
    background: #0e1b1f;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.total-fila {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
}

.total-fila strong { color: #6fe08a; font-size: 20px; }

.pagos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.pago {
    background: #1d3f48;
    color: #fff;
    border: 1px solid #2c5a66;
    border-radius: 10px;
    padding: 12px 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.pago.activo { background: #1d8a5c; border-color: #1d8a5c; }

.cobrar {
    width: 100%;
    background: #1d8a5c;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.cobrar:disabled { opacity: .6; }

.aviso {
    margin-top: 10px;
    background: #3a2f12;
    border: 1px solid #6b5414;
    color: #ffd166;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
}

.aviso.ok { background: #123a26; border-color: #1d8a5c; color: #8dffb0; }

/* ---------- Ventas de hoy ---------- */
.lista-ventas { display: flex; flex-direction: column; gap: 10px; }

.card {
    background: #14333b;
    border: 1px solid #2a5560;
    border-radius: 12px;
    padding: 13px 14px;
}

.card.vacio { text-align: center; color: #9ad0d8; font-size: 14px; padding: 24px; }

.v-fila {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.v-monto { color: #6fe08a; font-weight: 700; font-size: 15px; }
.gris { color: #93a9ad; font-size: 12px; }

@media (min-width: 900px) {
    .productos-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .vender { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
}

/* ================= CAJA ESTILO FORM3 ================= */
.caja-body { background: #000; overflow: hidden; }
.f3 { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }

.f3-header {
    background: rgb(30,60,70);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 12px;
    height: 70px;
    flex-shrink: 0;
}
.f3-logo { width: 65px; height: 65px; object-fit: contain; }
.f3-cedula { display: flex; flex-direction: column; justify-content: center; margin-right: auto; }
.f3-titulo { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.f3-modo { color: rgb(130,165,170); font-style: italic; font-size: 12px; }

.f3-reloj { text-align: right; padding-right: 24px; }
.f3-fecha, .f3-hora { display: block; color: #fff; font-size: 16px; font-weight: 700; }

.f3-usuario { padding-right: 24px; text-align: right; }
.f3-user-label { display: block; color: rgb(130,165,170); font-size: 11px; font-weight: 700; }
.f3-user-nombre { display: block; color: rgb(160,195,200); font-size: 13px; font-weight: 700; }

.f3-btn {
    border: none;
    border-radius: 5px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.f3-cambiar { background: rgb(173,216,230); color: #000; }
.f3-salir { background: rgb(192,57,43); color: #fff; }

.f3-herramientas { display: flex; gap: 10px; padding: 9px 22px 0 22px; flex-shrink: 0; }
.f3-herra {
    background: rgb(34,66,76);
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    height: 32px;
    padding: 0 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.f3-herra:hover { background: rgb(42,74,84); }
.f3-herra.activo { background: rgb(42,74,84); }
.f3-herra.disabled { opacity: .55; cursor: default; }

.f3-linea { background: rgb(34,66,76); height: 2px; margin: 6px 22px 0 22px; flex-shrink: 0; }

.f3-cuerpo { flex: 1; min-height: 0; display: flex; }
.f3-cafetera { display: flex; flex-direction: column; width: 100%; min-width: 0; min-height: 0; }

/* --- categorías a lo ancho (como el panel2 del Form3) --- */
.f3-catseccion { flex-shrink: 0; padding: 8px 14px 0 14px; }
.f3-cats-titulo { color: rgb(130,165,170); font-size: 12px; font-weight: 700; padding: 2px 2px; }
.f3-cats { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.f3-cat {
    width: 93px;
    min-width: 93px;
    height: 80px;
    background: rgb(26,54,62);
    color: #fff;
    border: 1px solid rgb(46,78,88);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.1;
}
.f3-cat img { height: 42px; max-width: 80px; object-fit: contain; pointer-events: none; }
.f3-cat.activo, .f3-cat:hover { background: rgb(34,66,76); border-color: rgb(50,84,94); }

/* --- zona inferior: productos (izq) + carrito (der) --- */
.f3-columnas {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 566px 1fr;
    gap: 6px;
    padding: 0 14px 8px 14px;
}

.f3-izq { display: flex; flex-direction: column; min-height: 0; }
.f3-productos {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: rgb(18,34,40);
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 130px);
    align-content: start;
    gap: 10px;
    padding: 8px;
}
.f3-producto {
    width: 130px;
    height: 78px;
    background: linear-gradient(180deg, rgb(0,58,116), rgb(0,51,102));
    border: 2px solid rgb(173,216,230);
    border-radius: 20px;
    color: #fff;
    padding: 7px 9px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-align: center;
}
.f3-producto:hover {
    border-color: rgb(220,240,252);
    background: linear-gradient(180deg, rgb(0,65,130), rgb(0,52,104));
}
.f3-p-nombre {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.f3-p-precio { font-size: 12px; font-weight: 700; color: rgb(173,216,230); }

.f3-der { display: flex; flex-direction: column; min-height: 0; gap: 6px; }

.f3-tabla {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: rgb(0,58,116);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}
.f3-tabla-cab {
    display: grid;
    grid-template-columns: minmax(0,1fr) 120px 55px 115px;
    background: rgb(23,52,60);
    padding: 0 8px;
    height: 38px;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}
.f3-tabla-cab span { text-align: center; }
.f3-tabla-cab span:first-child { text-align: left; }
.f3-tabla-items { flex: 1; }
.f3-vacio { color: #8fb3ca; font-size: 13px; text-align: center; padding: 26px 8px; font-weight: 700; }
.f3-item {
    display: grid;
    grid-template-columns: minmax(0,1fr) 120px 55px 115px;
    align-items: center;
    padding: 0 8px;
    height: 28px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgb(36,68,76);
    font-family: 'Segoe UI', Arial, sans-serif;
}
.f3-item:nth-child(even) { background: rgb(0,44,88); }
.f3-item.activo { background: rgb(173,216,230); color: #000; }
.f3-i-nombre { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f3-i-salsas { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f3-i-cant { text-align: center; font-weight: 700; }
.f3-i-sub { text-align: right; font-family: Consolas, monospace; font-weight: 700; }

.f3-acciones { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; flex-shrink: 0; }
.f3-acc {
    border: none;
    border-radius: 2px;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 8px;
    cursor: pointer;
}
.f3-anular { background: rgb(150,35,30); }
.f3-imprimir { background: rgb(190,150,45); color: #000; }
.f3-eliminar { background: rgb(180,50,40); }

.f3-total {
    background: rgb(0,40,80);
    border-radius: 5px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    flex-shrink: 0;
}
.f3-total span { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.f3-total strong { font-size: 26px; font-weight: 700; }

.f3-cobrar {
    background: rgb(173,216,230);
    color: #000;
    border: none;
    border-radius: 5px;
    padding: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}
.f3-cobrar:disabled { opacity: .6; }

.f3-aviso {
    flex-shrink: 0;
    background: rgb(58,47,18);
    border: 1px solid #6b5414;
    color: #ffd166;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    max-height: 42px;
    overflow-y: auto;
}
.f3-aviso.ok { background: rgb(18,58,38); border-color: rgb(29,138,92); color: rgb(141,255,176); }

/* --- Panel de pagos (modal, igual al pnlPagos del Form3) --- */
.f3-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    overflow-y: auto;
    padding: 8px 0;
}
.f3-pagos {
    position: relative;
    width: 540px;
    max-width: 96vw;
    max-height: 94vh;
    overflow-y: auto;
    background: rgb(0,40,80);
    border: 1px solid rgb(55,55,65);
    border-radius: 8px;
    padding: 14px 16px 16px 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.f3-cerrar {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.f3-p-monto { color: #fff; font-size: 19px; font-weight: 700; text-align: center; padding: 4px 0 10px 0; }
.f3-p-linea { height: 2px; background: rgb(160,195,200); margin-bottom: 10px; }

.f3-tarjetas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.f3-tarjeta {
    background: rgb(0,40,80);
    border: 1px solid rgb(55,55,65);
    border-radius: 6px;
    padding: 10px 4px;
    cursor: pointer;
    text-align: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}
.f3-t-icono { font-size: 25px; line-height: 1.1; margin-bottom: 6px; }
.f3-t-texto { color: #fff; font-size: 9.5px; font-weight: 700; line-height: 1.15; }
.f3-t-sub { color: rgb(150,180,205); font-size: 8.5px; margin-top: 3px; }

.f3-p-fila { display: flex; gap: 12px; margin-top: 12px; }
.f3-p-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.f3-p-label { color: rgb(150,180,205); font-size: 9.5px; font-weight: 700; text-align: center; }
.f3-p-input {
    background: rgb(0,40,80);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    border: 1px solid #33546b;
    border-radius: 3px;
    padding: 6px 8px;
    font-family: 'Segoe UI', Arial, sans-serif;
}
.f3-p-cambio {
    background: rgb(0,40,80);
    color: rgb(39,174,96);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #33546b;
    border-radius: 3px;
    padding: 6px 8px;
}
.f3-p-cambio.rojo { color: rgb(231,76,60); }
.f3-p-cambio.ancho { margin-top: 12px; }
.f3-p-cli-label { color: rgb(150,180,205); font-size: 10px; }
.f3-p-cli-input {
    background: rgb(0,40,80);
    color: #fff;
    font-size: 11px;
    border: 1px solid #33546b;
    border-radius: 3px;
    padding: 6px 8px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.f3-confirmar {
    margin-top: 14px;
    width: 100%;
    background: rgb(173,216,230);
    color: #000;
    border: none;
    border-radius: 20px;
    padding: 11px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

@media (min-width: 1100px) {
    .f3-cats { overflow-x: visible; }
}

@media (max-width: 900px) {
    .f3-columnas {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
        overflow-y: hidden;
    }
    .f3-izq { min-height: 0; }
    .f3-der { max-height: 46vh; }
    .f3-tabla { max-height: 20vh; }
}

@media (max-width: 700px) {
    .f3-header { height: auto; flex-wrap: wrap; gap: 4px; padding: 4px 8px; }
    .f3-logo { width: 40px; height: 40px; }
    .f3-titulo { font-size: 14px; }
    .f3-modo { display: none; }
    .f3-reloj { display: none; }
    .f3-usuario { padding-right: 4px; }
    .f3-herramientas { padding: 4px 8px 0 8px; gap: 6px; }
    .f3-herra { height: 28px; padding: 0 12px; font-size: 12px; }
    .f3-linea { margin: 4px 8px 0 8px; }
    .f3-catseccion { padding: 4px 8px 0 8px; }
    .f3-cats-titulo { display: none; }
    .f3-cat { width: 74px; min-width: 74px; height: 62px; font-size: 8px; gap: 1px; }
    .f3-cat img { height: 30px; }
    .f3-columnas { padding: 0 8px 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
    .f3-productos { grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 6px; padding: 5px; }
    .f3-producto { width: auto; height: 62px; border-radius: 14px; padding: 4px 6px; }
    .f3-p-nombre { font-size: 10px; }
    .f3-p-precio { font-size: 11px; }
    .f3-tabla { max-height: 18vh; }
    .f3-tabla-cab { grid-template-columns: minmax(0, 1fr) 46px 40px 74px; height: 30px; font-size: 10px; }
    .f3-item { grid-template-columns: minmax(0, 1fr) 46px 40px 74px; height: 24px; font-size: 11px; }
    .f3-acciones { gap: 4px; }
    .f3-acc { font-size: 11px; padding: 6px; }
    .f3-total { padding: 4px 12px; }
    .f3-total span { font-size: 13px; }
    .f3-total strong { font-size: 21px; }
    .f3-cobrar { padding: 10px; font-size: 16px; }
    .f3-aviso { font-size: 11px; padding: 5px 8px; max-height: 34px; }
    .f3-tarjetas { grid-template-columns: repeat(2, 1fr); }
    .f3-pagos { width: 96vw; }
    .f3-cambiar, .f3-salir { font-size: 14px; padding: 10px 16px; }
}