* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: #f1f5f9; color: #1e293b; padding-bottom: 90px; }

/* Barra Superior */
header { background: #0f172a; color: white; padding: 14px 20px; position: sticky; top: 0; z-index: 30; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.header-wrap { max-width: 1100px; margin: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo-kc { background: #10b981; color: #0f172a; font-weight: 900; padding: 6px 10px; border-radius: 10px; font-size: 18px; }
.brand h1 { font-size: 18px; line-height: 1.1; }
.brand p { font-size: 11px; color: #94a3b8; }

.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tasa-box { background: #1e293b; padding: 6px 10px; border-radius: 10px; border: 1px solid #334155; font-size: 13px; color: #94a3b8; }
.tasa-box input { width: 65px; background: transparent; border: none; color: #fbbf24; font-weight: bold; font-size: 14px; text-align: right; outline: none; }
.btn-rol { background: #4f46e5; color: white; border: none; padding: 7px 12px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.badge-red { background: rgba(16,185,129,0.2); color: #6ee7b7; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }

/* Contenedor Principal */
main { max-width: 1100px; margin: 20px auto; padding: 0 16px; }
.sec-title { font-size: 13px; font-weight: 800; text-transform: uppercase; color: #64748b; margin-bottom: 12px; display: flex; justify-content: space-between; }

/* Tablero del Dueño (4 Tarjetas) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi-card { background: white; padding: 18px; border-radius: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 5px solid #cbd5e1; }
.kpi-ventas { border-left-color: #10b981; }
.kpi-gastos { border-left-color: #f43f5e; }
.kpi-caja { border-left-color: #2563eb; }
.kpi-alerta { background: #fffbeb; border: 1px solid #fcd34d; border-left: 5px solid #f59e0b; }
.kpi-label { font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; }
.kpi-val { font-size: 26px; font-weight: 900; margin: 4px 0; }
.kpi-ventas .kpi-val { color: #059669; }
.kpi-gastos .kpi-val { color: #e11d48; }
.kpi-caja .kpi-val { color: #1d4ed8; }
.kpi-sub { font-size: 12px; color: #64748b; }

/* Los 9 Módulos */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.mod-btn { background: white; border: 1px solid #e2e8f0; border-radius: 18px; padding: 18px; text-align: left; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.04); transition: transform 0.15s; }
.mod-btn:active { transform: scale(0.96); }
.mod-btn.destacado { background: #059669; color: white; border: none; }
.mod-btn.destacado p { color: #d1fae5; }
.mod-icon { font-size: 30px; display: block; margin-bottom: 8px; }
.mod-btn h3 { font-size: 16px; font-weight: 800; margin-bottom: 3px; }
.mod-btn p { font-size: 12px; color: #64748b; }

/* Botón Flotante y Modal POS */
.fab-btn { position: fixed; bottom: 20px; right: 20px; background: #059669; color: white; border: none; padding: 16px 24px; border-radius: 50px; font-size: 16px; font-weight: 800; box-shadow: 0 8px 20px rgba(5,150,105,0.4); cursor: pointer; z-index: 40; }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,0.75); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.activo { display: flex; }
.modal-box { background: white; width: 100%; max-width: 420px; border-radius: 24px; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 14px; }
.modal-box select { width: 100%; padding: 10px; border-radius: 12px; border: 1px solid #cbd5e1; margin-bottom: 10px; font-size: 14px; }
.row-prod { display: flex; gap: 8px; margin-bottom: 12px; }
.btn-dark { background: #1e293b; color: white; border: none; padding: 0 16px; border-radius: 12px; font-weight: bold; cursor: pointer; height: 40px; }
.resumen-box { background: #f8fafc; padding: 14px; border-radius: 16px; margin-bottom: 14px; font-size: 14px; }
.resumen-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.resumen-total { font-size: 18px; font-weight: 900; color: #059669; border-top: 1px solid #e2e8f0; padding-top: 8px; }
.acciones-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-emitir { background: #059669; color: white; border: none; padding: 12px; border-radius: 12px; font-weight: bold; cursor: pointer; }
.btn-wa { background: #22c55e; color: white; border: none; padding: 12px; border-radius: 12px; font-weight: bold; cursor: pointer; }
.oculto { display: none !important; }
.bloqueado { opacity: 0.4; pointer-events: none; }
