/* ─── Limpimax — Design system tokens (copiados de src/index.css) ───────────── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/inter-latin-700-normal.woff2') format('woff2');
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: #F4F6F8;
  color: #1A2B3C;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input { font-family: 'Inter', system-ui, sans-serif; }

a { color: inherit; text-decoration: none; }

/* ─── Demo frame chrome (marca de agua "mockup") ─────────────────────────────── */
.demo-badge {
  position: fixed;
  bottom: 10px;
  right: 12px;
  z-index: 999;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9CA3AF;
  background: rgba(255,255,255,0.9);
  border: 1px solid #E5E7EB;
  border-radius: 99px;
  padding: 3px 10px;
  pointer-events: none;
}

/* ─── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: #1A2B3C;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  width: 100%;
  flex-shrink: 0;
}
.navbar-brand { display: flex; align-items: center; gap: 8px; margin-right: 32px; flex-shrink: 0; }
.navbar-brand img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.navbar-brand span { font-size: 13px; font-weight: 500; color: #fff; }
.navbar-nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.navbar-link {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 400;
  color: rgba(255,255,255,0.55); white-space: nowrap; cursor: pointer;
  transition: color .15s ease, background .15s ease; border: none; background: none;
}
.navbar-link:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.09); }
.navbar-link.active { background: #0D5C8A; color: #fff; font-weight: 500; }
.navbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.navbar-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #0D5C8A;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.navbar-username { font-size: 11px; color: rgba(255,255,255,0.6); }
.navbar-logout { background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; background: #F4F6F8; }
.app-body { flex: 1; }
.app-content { padding: 24px 32px; max-width: 1280px; margin: 0 auto; }

.section-title { font-size: 20px; font-weight: 600; color: #0D5C8A; letter-spacing: -0.3px; line-height: 1.2; margin: 0; }

/* ─── Botones ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; font-family: 'Inter', sans-serif; }
.btn-primary { background: #0D5C8A; color: #fff; padding: 10px 16px; min-height: 40px; font-size: 14px; }
.btn-primary:hover { background: #0a4a70; }
.btn-secondary { background: #fff; color: #4A5568; border: 1.5px solid #D1D5DB; padding: 8px 14px; min-height: 40px; }
.btn-secondary:hover { background: #F4F6F8; }

/* ─── Pills de filtro ─────────────────────────────────────────────────────── */
.pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill {
  flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 99px;
  border: 0.5px solid #D1D5DB; background: #fff; color: #4A5568;
  font-size: 12px; font-weight: 400; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 5px; font-family: 'Inter', sans-serif;
}
.pill.active { border-color: #0D5C8A; background: #0D5C8A; color: #fff; font-weight: 600; }
.pill .count { background: #F0F0F0; border-radius: 99px; padding: 0 5px; font-size: 10px; font-weight: 700; line-height: 16px; }
.pill.active .count { background: rgba(255,255,255,0.25); }

.search-box { position: relative; flex-shrink: 0; width: 240px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #4A5568; }
.search-box input {
  width: 100%; padding: 7px 10px 7px 30px; border: 1px solid #D1D5DB; border-radius: 8px;
  font-size: 13px; outline: 0; background: #fff; box-sizing: border-box; font-family: 'Inter', sans-serif;
}

/* ─── Badges de estado ────────────────────────────────────────────────────── */
.badge { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 99px; display: inline-block; white-space: nowrap; }
.badge-borrador        { background: #F0F0F0; color: #9A9A9A; }
.badge-confirmado      { background: #E8F4FF; color: #1B9ED6; }
.badge-en_produccion   { background: #FFF3E0; color: #F57C00; }
.badge-listo_reparto   { background: #FFFDE7; color: #F9A825; }
.badge-en_reparto      { background: #E3F2FD; color: #1565C0; }
.badge-entregado       { background: #E8F8F0; color: #2E9E5C; }
.badge-cerrado         { background: #D4EDDA; color: #145A32; }
.badge-entrega_fallida { background: #FDECEA; color: #D32F2F; }
.badge-anulado         { background: #ECEFF1; color: #455A64; }

.tipo-pill { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px; flex-shrink: 0; }
.tipo-mayorista { background: #E8F4FF; color: #1B9ED6; }
.tipo-minorista { background: #F4F6F8; color: #4A5568; }

/* ─── Tabla de pedidos ────────────────────────────────────────────────────── */
.card-panel { background: #fff; border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; }
.pedidos-table { width: 100%; border-collapse: collapse; }
.pedidos-table th {
  padding: 8px 12px; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: #4A5568; text-align: left; white-space: nowrap;
  border-bottom: 1px solid #D1D5DB;
}
.pedidos-table th.right { text-align: right; }
.pedidos-table td { padding: 10px 12px; border-bottom: 0.5px solid #F4F6F8; vertical-align: middle; }
.pedidos-table tr { transition: background .15s; cursor: pointer; }
.pedidos-table tbody tr:hover { background: #F4F6F8; }
.pedidos-table tr.vencida { background: #FFF8F8; }
.ped-num { font-size: 12px; font-weight: 700; color: #0D5C8A; font-variant-numeric: tabular-nums; }
.ped-cliente { font-weight: 600; font-size: 13px; color: #1A2B3C; }
.ped-dir { font-size: 11px; color: #4A5568; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ped-total { font-size: 13px; font-weight: 700; color: #1A2B3C; }
.ped-fecha { font-size: 12px; }
.action-btn {
  height: 28px; padding: 0 10px; color: #fff; border: none; border-radius: 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}
.icon-btn {
  background: transparent; border: 1px solid #D1D5DB; border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #4A5568; flex-shrink: 0;
}
.icon-btn.wa { color: #25D366; }
.row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.table-footer { padding: 10px 12px; border-top: 0.5px solid #F4F6F8; font-size: 12px; color: #4A5568; }

/* ─── KPI cards (dashboard) ──────────────────────────────────────────────── */
.kpi-card { background: #fff; border: 0.5px solid #D1D5DB; border-radius: 10px; padding: 14px 16px; }
.kpi-header { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.kpi-label { font-size: 9px; font-weight: 500; color: #4A5568; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-value { font-size: 28px; font-weight: 500; color: #1A2B3C; letter-spacing: -0.5px; line-height: 1; }
.kpi-sub { margin: 6px 0 0; font-size: 12px; font-weight: 400; color: #4A5568; }

.panel { background: #fff; border: 0.5px solid #D1D5DB; border-radius: 10px; overflow: hidden; }
.panel-header { padding: 12px 16px; border-bottom: 0.5px solid #F4F6F8; font-size: 12px; font-weight: 500; color: #1A2B3C; letter-spacing: -0.3px; }

.grid { display: grid; }

/* ─── Drawer / Dialog ─────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.drawer-dialog {
  background: #fff; border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  width: 620px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column;
}
.drawer-header { height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 0.5px solid #F4F6F8; flex-shrink: 0; }
.drawer-title { font-size: 15px; font-weight: 700; color: #1A2B3C; }
.drawer-close { background: none; border: none; cursor: pointer; color: #4A5568; display: flex; padding: 4px; border-radius: 6px; }
.drawer-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.drawer-footer { padding: 12px 18px; gap: 8px; flex-direction: row-reverse; align-items: center; display: flex; border-top: 0.5px solid #F4F6F8; flex-shrink: 0; }

.sec-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sec-label span.txt { font-size: 9px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.08em; }
.sec-label span.badge-count { font-size: 10px; background: #F4F6F8; color: #4A5568; padding: 1px 6px; border-radius: 99px; }
.divider { height: 0.5px; background: #F4F6F8; margin: 4px 0; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { position: relative; }
.form-label .fi-input, .form-label .fi-select {
  width: 100%; padding: 22px 10px 8px 10px; outline: 0; border: 1px solid rgba(105,105,105,0.4);
  border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 12px; height: 36px;
  transition: border-color .2s ease; background: #fff; box-sizing: border-box;
}
.form-label .fi-textarea {
  width: 100%; padding: 22px 10px 8px 10px; outline: 0; border: 1px solid rgba(105,105,105,0.4);
  border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 12px; min-height: 56px;
  transition: border-color .2s ease; background: #fff; box-sizing: border-box; resize: none;
}
.form-label .fi-input:focus, .form-label .fi-textarea:focus, .form-label .fi-select:focus { border-color: #1B9ED6; }
.form-label .flabel {
  position: absolute; left: 10px; top: 4px; font-size: 10px; font-weight: 600; color: #1B9ED6;
  pointer-events: none;
}
.button-group { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid #D1D5DB; }
.button-group button {
  flex: 1; background: #fff; border: none; padding: 8px 0; font-size: 12px; font-weight: 600;
  color: #4A5568; cursor: pointer; font-family: 'Inter', sans-serif;
}
.button-group button + button { border-left: 1px solid #D1D5DB; }
.button-group button.active { background: #0D5C8A; color: #fff; }

.item-row {
  display: grid; grid-template-columns: 1fr 1fr 56px; gap: 10px; align-items: start;
  background: #F9FAFB; border: 0.5px solid #F0F0F0; border-radius: 12px; padding: 12px;
  margin-bottom: 8px;
}
.item-row-mini { font-size: 12px; color: #4A5568; }

.totales-box { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; row-gap: 8px; padding: 14px 0 0; }
.tot-label { font-size: 12px; color: #4A5568; }
.tot-value { font-size: 13px; color: #1A2B3C; text-align: right; }
.tot-total-label { font-size: 13px; font-weight: 700; color: #1A2B3C; }
.tot-total-value { font-size: 22px; font-weight: 700; color: #0D5C8A; letter-spacing: -0.5px; }

/* ─── scroll container for the whole mockup page (fixed viewport) ───────── */
.viewport {
  width: 1280px;
  min-height: 800px;
  margin: 0 auto;
  background: #F4F6F8;
  overflow: hidden;
}
