/* ══════════════════════════════════════════════════════════════
   Helados Ludovico · Gestión de Inventario · v1.0
   Paleta: Azul #1565A0 · Cian #00B4CC · Naranja #F5821F · Verde #7EC855
   ══════════════════════════════════════════════════════════════ */

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

:root {
  --blue:       #1565A0;
  --blue-dark:  #0D3F6B;
  --blue-mid:   #1A6EA8;
  --cyan:       #00B4CC;
  --cyan-light: #E0F6FA;
  --cyan-pale:  #F0FBFD;
  --orange:     #F5821F;
  --green:      #7EC855;
  --red:        #E53935;
  --yellow:     #FFB300;
  --bg:         #F0F4F8;
  --text:       #0D2E4A;
  --text-mid:   #1E5C8A;
  --text-muted: #6B8EAA;
  --border:     #C5DFF0;
  --shadow:     0 2px 16px rgba(21,101,160,0.09);
  --nav-h:      64px;
}

html, body { height: 100%; }
body {
  font-family: 'Poppins', 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Utilidades ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════════ */
#screen-login {
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 20px;
}

.login-hero {
  display: flex; flex-direction: column;
  align-items: center; margin-bottom: 32px;
}
.login-logo  { width: 96px; height: 96px; object-fit: contain; margin-bottom: 14px; }
.login-title { font-size: 24px; font-weight: 800; color: white; margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: rgba(255,255,255,0.6); font-weight: 500; }

.login-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; width: 100%; max-width: 340px;
}
.login-btn {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 16px; padding: 18px 12px;
  cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  font-family: 'Poppins', sans-serif;
}
.login-btn:hover, .login-btn:active {
  background: rgba(255,255,255,0.18);
  border-color: var(--cyan);
  transform: translateY(-3px);
}
.login-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: white;
  letter-spacing: 0;
}
.login-name {
  font-size: 12px; font-weight: 700; color: white;
  text-align: center; line-height: 1.35;
}

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT (post-login)
   ══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Top Bar ── */
.topbar {
  background: var(--blue-dark);
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.topbar-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar-right { flex-shrink: 0; }
.topbar-logo  { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.topbar-title { font-size: 16px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  cursor: pointer; border: 2px solid rgba(255,255,255,0.25);
  transition: border-color .2s;
}
.topbar-avatar:hover { border-color: var(--cyan); }

/* ── Contenido principal ── */
.main-content {
  flex: 1;
  padding: 16px 16px 32px;
  max-width: 700px; width: 100%; margin: 0 auto;
  overflow-y: auto;
}

/* ── Top Nav (under topbar) ── */
.top-nav {
  background: var(--blue-dark);
  border-bottom: 3px solid var(--orange);
  position: sticky; top: var(--nav-h); z-index: 99;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}
.nav-items { display: flex; }

.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; border: none; background: transparent;
  color: rgba(255,255,255,0.4);
  font-family: 'Poppins', sans-serif; font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  transition: color .2s, background .2s;
  padding: 10px 0; position: relative;
}
.nav-item.active {
  color: var(--cyan);
  background: rgba(0,180,204,0.08);
}
.nav-item.active::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 3px; background: var(--cyan);
}
.nav-item svg { width: 20px; height: 20px; }

/* ── Pantallas ─────────────────────────────────────────────── */
#main-content .screen { display: none; }
#main-content .screen.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   COMPONENTES COMPARTIDOS
   ══════════════════════════════════════════════════════════════ */

/* Card */
.card {
  background: white; border-radius: 14px;
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
  padding: 16px;
}
.card-title {
  font-size: 13px; font-weight: 700; color: var(--blue);
  margin-bottom: 12px;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-ok    { background: #E8F5E9; color: #2E7D32; }
.badge-low   { background: #FFF8E1; color: #E65100; }
.badge-crit  { background: #FFEBEE; color: var(--red); }
.badge-pend  { background: #FFF3E0; color: #E65100; }
.badge-pedido { background: #E3F2FD; color: var(--blue); }
.badge-recv  { background: #E8F5E9; color: #2E7D32; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: none;
  font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: white; box-shadow: 0 3px 10px rgba(21,101,160,0.25); }
.btn-primary:hover { background: var(--blue-mid); }
.btn-outline { background: white; color: var(--blue); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); }
.btn-ghost   { background: transparent; color: var(--text-muted); border: none; padding: 6px 8px; }
.btn-ghost:hover { color: var(--red); }
.btn-sm      { padding: 5px 11px; font-size: 11px; border-radius: 8px; }

/* FAB */
.fab {
  position: fixed; bottom: 24px; right: 16px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--orange); color: white; border: none;
  font-size: 28px; font-weight: 300; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(245,130,31,0.45);
  transition: transform .2s, box-shadow .2s; z-index: 98;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(245,130,31,0.55); }

/* Inputs */
.form-row {
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px;
}
.form-row.two-col {
  flex-direction: row; gap: 12px;
}
.form-row.two-col > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.form-row label {
  font-size: 11px; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.4px;
}
input, select, textarea {
  padding: 10px 12px; border: 2px solid var(--border); border-radius: 10px;
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 500;
  color: var(--text); background: white; outline: none;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,180,204,0.13);
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231565A0' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}

/* Toggle group */
.toggle-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.toggle-btn {
  padding: 8px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); background: white;
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; color: var(--text-mid); transition: all .2s;
}
.toggle-btn.active {
  background: var(--blue); color: white; border-color: var(--blue);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,30,60,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal {
  background: white; border-radius: 18px;
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  padding: 22px; animation: fadeScale .22s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
@keyframes fadeScale {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1.5px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--blue); }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--bg); cursor: pointer; font-size: 16px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.modal-body   { /* flex-grow */ }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1.5px solid var(--border);
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--blue-dark); color: white;
  padding: 11px 22px; border-radius: 22px;
  font-size: 13px; font-weight: 600;
  z-index: 300; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: opacity .25s;
}
.toast-success { background: #2E7D32; }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue-dark); }

/* Spinner */
.spinner-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--border);
  border-top-color: var(--cyan); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty / Error */
.empty-msg {
  text-align: center; padding: 24px 16px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.error-msg { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════ */

/* Saludo */
.dash-greeting {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 10px;
}
.dash-greeting-name { font-size: 17px; font-weight: 700; color: var(--text); }
.dash-greeting-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dash-last-conteo-badge {
  background: white; border-radius: 20px; padding: 7px 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--blue);
  box-shadow: var(--shadow); white-space: nowrap; cursor: default;
}

/* KPIs */
.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.kpi {
  background: white; border-radius: 14px; padding: 14px 8px 12px;
  text-align: center; box-shadow: var(--shadow);
  border-bottom: 3px solid var(--border);
  transition: transform .15s;
}
.kpi:active { transform: scale(0.97); }
.kpi-icon { font-size: 20px; margin-bottom: 4px; }
.kpi-val  { font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi-lbl  { font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; margin-top: 4px; letter-spacing: 0.3px; }

#kpi-ok   { border-color: #4CAF50; }
#kpi-ok   .kpi-val { color: #2E7D32; }
#kpi-low  { border-color: var(--yellow); }
#kpi-low  .kpi-val { color: #E65100; }
#kpi-crit { border-color: var(--red); }
#kpi-crit .kpi-val { color: var(--red); }

/* Acciones rápidas */
.dash-actions {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.dash-action-btn {
  background: white; border: none; border-radius: 14px;
  padding: 16px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow); transition: all .2s;
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  color: var(--text-mid);
}
.dash-action-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(21,101,160,0.13); }
.dash-action-btn:active { transform: scale(0.97); }
.dash-action-icon { font-size: 26px; }

/* Alertas */
.alert-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }
.alert-item-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.alert-item-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.alert-item-info  { min-width: 0; }
.alert-name  { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-sub   { font-size: 11px; color: var(--text-muted); display: block; }
.alert-stock { font-size: 12px; font-weight: 700; color: var(--text-mid); }
.btn-alert-compra {
  background: var(--cyan-light); border: none; border-radius: 8px;
  width: 32px; height: 32px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.btn-alert-compra:hover { background: var(--cyan); }

.dash-all-ok {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0; font-size: 13px; font-weight: 600; color: var(--green);
}
.dash-all-ok-icon { font-size: 24px; }

/* ══════════════════════════════════════════════════════════════
   INVENTARIO
   ══════════════════════════════════════════════════════════════ */
.search-bar { margin-bottom: 12px; }
.search-bar input { width: 100%; }

.producto-item {
  background: white; border-radius: 12px; margin-bottom: 10px;
  padding: 13px 14px; box-shadow: var(--shadow);
}
.producto-main {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px; margin-bottom: 8px;
}
.producto-info   { flex: 1; min-width: 0; }
.producto-nombre { font-size: 14px; font-weight: 700; display: block; }
.producto-cat    { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.producto-stock-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.producto-prov { color: var(--cyan); font-weight: 700; }
.stock-min-lbl   { font-size: 10px; color: var(--text-muted); }

.stock-bar  { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin-bottom: 8px; }
.stock-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.stock-fill-ok   { background: linear-gradient(90deg, var(--cyan), #4CAF50); }
.stock-fill-low  { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.stock-fill-crit { background: var(--red); }

.producto-actions { display: flex; gap: 8px; align-items: center; }

/* ══════════════════════════════════════════════════════════════
   CONTEO SEMANAL
   ══════════════════════════════════════════════════════════════ */
.conteo-header {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
  border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.conteo-header-title { font-size: 16px; font-weight: 700; color: white; }
.conteo-header-sub   { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 3px; }

.conteo-grupo { margin-bottom: 16px; }
.conteo-cat-title {
  font-size: 11px; font-weight: 700; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 8px 0 6px; border-bottom: 1.5px solid var(--cyan-light);
  margin-bottom: 6px;
}
.conteo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.conteo-item:last-child { border-bottom: none; }
.conteo-item-info { flex: 1; min-width: 0; }
.conteo-nombre    { font-size: 13px; font-weight: 600; }
.conteo-actual    { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.conteo-input-wrap { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.conteo-input {
  width: 80px; text-align: center; padding: 8px 6px;
  font-size: 15px; font-weight: 700;
}
.conteo-unidad { font-size: 11px; color: var(--text-muted); min-width: 20px; }

/* ══════════════════════════════════════════════════════════════
   LISTA DE COMPRAS
   ══════════════════════════════════════════════════════════════ */
.filter-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); background: white;
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; color: var(--text-mid);
  transition: all .2s;
}
.filter-tab.active { background: var(--blue); color: white; border-color: var(--blue); }

.compra-item {
  background: white; border-radius: 12px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.compra-check-wrap { padding-top: 2px; }
.compra-check {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--border); background: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; transition: all .2s; flex-shrink: 0;
}
.compra-check-pend  { border-color: var(--orange); color: var(--orange); }
.compra-check-pedido { border-color: var(--blue);  color: var(--blue); background: rgba(21,101,160,0.08); }
.compra-check-recv  { background: var(--green); border-color: var(--green); color: white; }

.compra-info   { flex: 1; min-width: 0; }
.compra-nombre { font-size: 13px; font-weight: 700; display: block; }
.compra-nombre.tachado { text-decoration: line-through; color: var(--text-muted); }
.compra-qty    { font-size: 12px; color: var(--text-mid); display: block; margin-top: 2px; font-weight: 600; }
.compra-notas  { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; font-style: italic; }
.compra-meta   { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 5px; }

.compras-actions {
  display: flex; justify-content: center; padding: 8px 0 16px;
}

/* ══════════════════════════════════════════════════════════════
   CALCULADORA DE RECETAS
   ══════════════════════════════════════════════════════════════ */
.calc-form { margin-bottom: 16px; }
.calc-litros-input { height: 54px; font-size: 22px; font-weight: 800; text-align: center; }

.calc-empty {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}
.calc-empty-icon { font-size: 54px; margin-bottom: 12px; }
.calc-empty p    { font-size: 13px; font-weight: 500; line-height: 1.6; }

.calc-res-header {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
  border-radius: 14px; padding: 18px 20px; margin-bottom: 14px;
}
.calc-res-nombre { font-size: 20px; font-weight: 800; color: white; }
.calc-res-sub    { font-size: 12px; color: var(--cyan); font-weight: 600; margin-top: 3px; }
.calc-res-pills  { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.pill         { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill-cyan    { background: rgba(0,180,204,0.22); color: var(--cyan); }
.pill-orange  { background: rgba(245,130,31,0.22); color: var(--orange); }
.pill-green   { background: rgba(126,200,85,0.22); color: var(--green); }

.calc-table { width: 100%; border-collapse: collapse; }
.calc-table thead tr  { background: var(--blue); }
.calc-table thead th  { padding: 10px 16px; font-size: 11px; font-weight: 700;
  color: white; text-transform: uppercase; letter-spacing: 0.5px; text-align: left; }
.calc-table thead th:last-child { text-align: right; }
.calc-table tbody tr:nth-child(odd)  { background: var(--cyan-pale); }
.calc-table tbody tr:nth-child(even) { background: var(--cyan-light); }
.calc-table tbody td { padding: 10px 16px; font-size: 13px; font-weight: 500;
  border-bottom: 1px solid var(--border); }
.calc-table tbody td:last-child { text-align: right; font-weight: 700; color: var(--blue); }
.calc-table tfoot tr  { background: var(--blue); }
.calc-table tfoot td  { padding: 11px 16px; font-size: 13px; font-weight: 800; color: white; }
.calc-table tfoot td:last-child { text-align: right; color: var(--cyan); }

.calc-nota {
  margin-top: 12px; padding: 12px 16px;
  background: #FFF8EE; border-left: 4px solid var(--orange);
  border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--orange);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE · MOBILE FIRST
   ══════════════════════════════════════════════════════════════ */

/* Pantalla compras - edición inline de cantidad */
.compra-qty-wrap { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.compra-qty-input {
  width: 72px; padding: 6px 8px; font-size: 15px; font-weight: 700;
  border: 2px solid var(--cyan); border-radius: 8px; text-align: center;
}
.compra-qty-unidad { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.btn-qty-save {
  padding: 6px 12px; font-size: 13px; font-weight: 700;
  background: var(--cyan); color: white; border: none;
  border-radius: 8px; cursor: pointer; min-width: 36px;
}

@media (max-width: 480px) {
  /* Layout */
  .main-content { padding: 12px 12px 24px; }

  /* Topbar */
  .topbar { height: 54px; }
  .topbar-logo  { width: 32px; height: 32px; }
  .topbar-title { font-size: 14px; }
  .topbar-avatar { width: 32px; height: 32px; font-size: 10px; }
  :root { --nav-h: 54px; }

  /* Nav */
  .nav-item { font-size: 8px; padding: 8px 0; }
  .nav-item svg { width: 18px; height: 18px; }

  /* Login */
  .login-logo  { width: 80px; height: 80px; }
  .login-title { font-size: 20px; }
  .login-btn   { padding: 14px 10px; border-radius: 12px; }
  .login-avatar { width: 44px; height: 44px; font-size: 14px; }
  .login-name  { font-size: 11px; }

  /* KPIs */
  .kpi-grid { gap: 7px; }
  .kpi      { padding: 10px 6px; border-radius: 10px; }
  .kpi-val  { font-size: 24px; }
  .kpi-lbl  { font-size: 9px; }

  /* Cards */
  .card { padding: 13px; border-radius: 12px; }
  .card-title { font-size: 12px; }

  /* Botones */
  .btn    { padding: 9px 14px; font-size: 12px; }
  .btn-sm { padding: 6px 10px; font-size: 11px; }
  .btn-full { padding: 14px; font-size: 14px; }

  /* Forms */
  .form-row.two-col { flex-direction: column; }
  input, select { padding: 10px 12px; font-size: 14px; }

  /* Inventario */
  .producto-nombre { font-size: 13px; }
  .producto-actions { gap: 6px; }

  /* Conteo */
  .conteo-header { padding: 13px 14px; }
  .conteo-header-title { font-size: 14px; }
  .conteo-input { width: 72px; font-size: 16px; }
  .conteo-nombre { font-size: 12px; }

  /* Compras */
  .compra-item  { padding: 11px 12px; }
  .compra-nombre { font-size: 12px; }
  .compra-check { width: 30px; height: 30px; font-size: 14px; }

  /* Calculadora */
  .calc-litros-input { height: 58px; font-size: 24px; }
  .calc-res-nombre { font-size: 17px; }
  .calc-table tbody td { padding: 9px 12px; font-size: 12px; }
  .calc-table tfoot td { padding: 10px 12px; font-size: 12px; }

  /* FAB */
  .fab { width: 48px; height: 48px; font-size: 24px; bottom: 18px; right: 14px; }

  /* Filter tabs */
  .filter-tab { padding: 5px 11px; font-size: 11px; }

  /* Modal */
  .modal { padding: 18px; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

@media (max-width: 340px) {
  .login-grid { grid-template-columns: 1fr; max-width: 180px; }
  .nav-item span { display: none; }
  .nav-item { padding: 10px 0; }
}
