/* ==========================================================================
   Agustina — imagen nueva (etapa 1: base y menú lateral)
   Se carga después de app.css y movil.css: solo cambia la apariencia,
   no la estructura ni el funcionamiento. Para volver atrás basta con
   quitar este archivo del layout.
   ========================================================================== */

:root {
  --ground: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F8F7;
  --ink: #1B1B1B;
  --ink-2: #36403C;
  --muted: #626A67;
  --line: #E6E9E7;
  --line-2: #CDD3D0;
  --accent: #0E6B5C;
  --accent-soft: #E6F2EE;
  --accent-dark: #09493F;
  --side: #F7F8F7;
  --side-ink: #36403C;
  --danger: #B03A2E;
  --danger-soft: #FDF2F0;
  --warning: #9A520A;
  --warning-soft: #FFF6E8;
  --success: #1E7B4F;
  --success-soft: #E8F5EE;
  --input-line: #9AA29F;
  --sidebar: 256px;
}

body { background: var(--ground); }
.num { font-family: var(--font); font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Menú lateral claro ---------- */
.sidebar { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); }
.brand { padding: 20px 20px 4px; gap: 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; font-size: 14px; }
.brand-name { color: var(--ink); font-size: 15px; font-weight: 700; }
.brand-sub { color: var(--muted); }

.nav-search { padding: 14px 14px 8px; }
.nav-search input {
  height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px #D5EDE4; }

.nav { padding: 0 14px 16px; }
.nav a {
  min-height: 34px; gap: 10px; padding: 0 10px; border-radius: 9px;
  color: var(--side-ink); font-size: 14px;
}
.nav a:hover { background: #EEF1EF; color: var(--ink); }
.nav a.active { background: #fff; color: var(--accent); font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
.nav svg { width: 18px; height: 18px; color: #7E8783; }
.nav a.active svg { color: var(--accent); }
.nav .soon { color: #7E8783; }

.nav-group { margin-top: 6px; }
.nav-toggle {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #7E8783;
  padding: 0 10px; min-height: 32px; border-radius: 8px;
}
.nav-toggle:hover { color: var(--ink); background: #EEF1EF; }
.nav-toggle svg { width: 14px; height: 14px; }
.nav-count { background: transparent; color: #7E8783; font-weight: 600; font-size: 11px; padding: 0; opacity: 1; }
.nav-group:not(.collapsed) .nav-count { opacity: 1; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px 20px 18px; color: var(--muted); }
.sidebar-foot strong { color: var(--ink); font-weight: 600; }

/* ---------- Barra superior: discreta ---------- */
.topbar { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(6px); }
.topbar-title strong { font-size: 16px; }
.user-menu > summary { border-color: var(--line); }

/* ---------- Página ---------- */
@media (min-width: 1024px) {
  .page { max-width: 1240px; margin: 0; padding: 32px 44px 64px; }
}
.eyebrow { letter-spacing: .06em; }
h1 { font-size: 28px; }
@media (max-width: 767px) { h1 { font-size: 24px; } }

/* ---------- Botones ---------- */
.btn { min-height: 42px; border-color: var(--line-2); border-radius: 10px; font-size: 14px; }
.btn:hover { background: #F4F6F5; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 52px; font-size: 16px; }

/* ---------- Campos ---------- */
.field > span, .label { font-size: 14px; font-weight: 600; }
.input, .select, .textarea { border: 1.5px solid var(--input-line); border-radius: 10px; padding: 0 14px; }
.textarea { padding: 10px 14px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px #D5EDE4; }

/* ---------- Tarjetas, cifras y avisos ---------- */
.card { border-color: var(--line); border-radius: 16px; }
@media (min-width: 768px) { .card { padding: 18px 22px; } }
.stat { border-radius: 14px; padding: 16px 18px; gap: 2px; }
.stat .label { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.stat .value { font-family: var(--font); font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.stat .sub { font-size: 12px; }

.alert { border-radius: 12px; padding: 14px 16px; }
.alert-success { border-color: #C6E5D3; color: #185C3B; }
.alert-warning { border-color: #F2D6AE; color: #6E3B07; }
.alert-danger { border-color: #F0CBC5; color: #7A2A1F; }

/* ---------- Estados (píldoras) ---------- */
.badge { height: auto; padding: 3px 9px; border-radius: 9px; font-weight: 700; }
.badge-success { color: var(--success); }
.badge-muted { background: #F0F2F1; color: var(--muted); }

/* ---------- Filtros ---------- */
.chip { min-height: 34px; border-radius: 17px; border-color: var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.active, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Tablas y listas: filas ligeras ---------- */
.table-wrap { border: 0; border-radius: 0; }
.table th {
  background: transparent; text-transform: none; letter-spacing: 0; font-weight: 600;
  color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 10px; border-top: 0; border-bottom: 1px solid var(--line); font-variant-numeric: lining-nums tabular-nums; }
.table tr.link:hover td { background: #F7F8F7; }
.table-scroll thead th { background: #fff; }
.list-row { border-top-color: var(--line); }
a.list-row:hover { background: #F7F8F7; }
.empty { border: 0; padding: 36px 20px; }

/* ---------- Pestañas de sección ---------- */
.tabs a.active, .tabs [aria-current="page"] { color: var(--accent); }

/* ==========================================================================
   Etapa 2: Resumen (computadora y tableta)
   ========================================================================== */
.dz-head { align-items: flex-end; margin-bottom: 22px; }
.dz-hello .eyebrow { margin: 0 0 2px; }
.dz-hello h1 { font-size: 28px; }
.dz-hello p:not(.eyebrow) { margin-top: 4px; font-size: 15px; }
.dz-card { border-radius: 16px; }
.dz-setup, .dz-done { margin-bottom: 18px; }

.rz-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.rz-tile { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; }
a.rz-tile[href]:hover { border-color: var(--line-2); color: var(--ink); }
.rz-tile .k { font-size: 13px; color: var(--muted); }
.rz-tile .v { font-family: var(--font); font-size: 24px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.rz-tile .d { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-ok { color: var(--success); } .t-amb { color: var(--warning); } .t-red { color: var(--danger); }

.rz-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.rz-two .dz-chart { margin: 0; padding: 20px 22px 16px; }
.rz-two .dz-chart-head h3 { font-size: 17px; font-weight: 700; }
.rz-two .dz-chart-total strong { font-size: 22px; }
.rz-two .dz-bars { height: 200px; gap: clamp(2px, .45vw, 8px); }
.rz-two .dz-days { gap: clamp(2px, .45vw, 8px); }
.rz-two .dz-bar-fill { border-radius: 2px 2px 0 0; }

.rz-agenda { padding: 20px 22px 10px; }
.rz-agenda h2 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.rz-quiet { color: var(--muted); font-size: 14px; padding: 10px 0 14px; }
.rz-group h3 { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.rz-group h3 span { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rz-group h3 { color: var(--c); }
.rz-group.is-urgent { --c: var(--danger); }
.rz-group.is-today { --c: var(--accent); }
.rz-group.is-week { --c: var(--warning); }
.rz-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.rz-item + .rz-item { border-top: 1px solid var(--line); }
.rz-check { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.8px solid var(--c); background: #fff; color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
.rz-check svg { opacity: 0; }
.rz-item.is-done .rz-check { background: var(--c); }
.rz-item.is-done .rz-check svg { opacity: 1; }
.rz-item.is-done .rz-t strong { color: var(--muted); text-decoration: line-through; text-decoration-color: #0003; }
.rz-t { flex: 1; min-width: 0; }
.rz-t strong { display: block; font-size: 15px; font-weight: 600; }
.rz-t small { display: block; font-size: 13px; color: var(--muted); }
.rz-a { font-family: var(--font); font-size: 15px; white-space: nowrap; }
.rz-item .btn { flex: none; }

.rz-more { display: flex; justify-content: flex-end; margin-top: 4px; }
.rz-add > summary { border-color: transparent; background: transparent; color: var(--muted); font-weight: 600; }
.rz-add > summary:hover { color: var(--ink); background: #F4F6F5; }
.rz-add .dz-pop { top: auto; bottom: calc(100% + 6px); }
.dz-widgets { margin-top: 4px; }

@media (max-width: 1180px) {
  .rz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rz-two { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Etapa 3: listas de ventas y compras (computadora)
   ========================================================================== */
.page-head .sub { color: var(--muted); margin-top: 4px; }
@media (max-width: 767.98px) { .m-desk-grid { display: none !important; } }
.rz-tiles.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
@media (min-width: 768px) {
  .inv-wrap { border: 0; padding: 0; background: none; border-radius: 0; }
  .inv-wrap .chips { margin: 4px 0 6px !important; }
}
.inv-table td { white-space: nowrap; }
.inv-table td.inv-c { white-space: normal; min-width: 200px; max-width: 380px; overflow-wrap: anywhere; }
.inv-table td.inv-c a { color: var(--ink); text-decoration: none; font-weight: 500; }
.inv-table td.mono { font-family: var(--font); font-variant-numeric: tabular-nums; }
.inv-table tr:hover td.inv-c a { color: var(--accent); }
.inv-wrap .table-wrap { margin-top: 8px; }
@media (min-width: 768px) { .inv-wrap .input { min-height: 42px; font-size: 15px; } }

/* Nueva factura / cotización (computadora): misma estructura, imagen del prototipo */
@media (min-width: 1024px) {
  .inv-head { display: block; margin-bottom: 20px; }
  .inv-head .eyebrow { margin-bottom: 2px; }
}
.step { background: var(--accent-soft); color: var(--accent); }
.totals .kv span:last-child { font-family: var(--font); font-variant-numeric: lining-nums tabular-nums; font-weight: 600; }
@media (min-width: 768px) {
.grand-total { background: #fff; color: var(--ink); border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 4px; }
  .grand-total span:first-child { color: var(--ink); letter-spacing: .04em; }
  .grand-total strong { font-family: var(--font); font-size: 32px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
  .grand-total #t-savings { color: var(--success); }
}
.grand-total strong { font-family: var(--font); font-variant-numeric: lining-nums tabular-nums; }
@media (min-width: 1024px) {
  .invoice-side .segmented { background: #F0F2F1; }
}
@media (min-width: 768px) {
  .m-only-grid2 { display: none !important; }
  .cust-chips { margin: 4px 0 6px; }
}
.inv-table .badge + .badge { margin-left: 4px; }

/* Cifras de dinero con la letra del sistema (números de ancho fijo), como en el prototipo; los códigos siguen en .mono */
.line-amount strong, .mobile-total strong, .order-change strong, .scan-last .total, .cash-expected > strong,
.stepper input, .price-input, .disc-input, .amount-box, .disc-off,
.pos-tile-price, .pos-tile-incart, .pos-line-total, .pos-totals .kv .num, .pos-grand strong, .pos-pay #pos-pay-amount,
.pos .pos-totals .num, .pos .pos-pay .num, .pf-suffix i, .pos-recv .mono, .pos-recv input {
  font-family: var(--font); font-variant-numeric: lining-nums tabular-nums;
}
.pos-grand strong { letter-spacing: -.01em; font-weight: 700; }
.table th.right { text-align: right; }

/* ==========================================================================
   Etapa 4: más listas en tabla (productos, cotizaciones, usuarios, notas, recurrentes)
   ========================================================================== */
@media (min-width: 768px) {
  .stat-dark { background: #fff; color: var(--ink); border-color: var(--line); }
  .stat-dark .label, .stat-dark .sub { color: var(--muted); }
  .stat-dark .value { color: var(--accent); }
}

/* ==========================================================================
   Etapa 5: órdenes, prospectos, caja y detalles
   ========================================================================== */
@media (min-width: 768px) {
  .cash-expected { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; }
  .cash-expected .label { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 400; }
  .cash-expected > strong { color: var(--accent); font-weight: 700; }
  .cash-expected small { color: var(--muted); }
}
/* Botón fantasma: sin borde (la regla general de .btn de la etapa 1 se lo había puesto) */
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #F4F6F5; }
@media (min-width: 768px) {
  /* Detalles: el «← Facturas» de arriba pasa a ser la ruta pequeña en verde, como en el prototipo */
  .page-head > div > a.btn-ghost:first-child { min-height: 0; height: auto; padding: 0; margin-bottom: 4px; gap: 4px;
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
  .page-head > div > a.btn-ghost:first-child:hover { background: none; color: var(--accent-dark); }
  .page-head > div > a.btn-ghost:first-child svg { width: 14px; height: 14px; }
  .page-head h1.mono { font-family: var(--font); font-size: 28px !important; letter-spacing: -.01em; }
  /* Códigos y números de documento con la letra del sistema */
  .mono { font-family: var(--font); font-variant-numeric: lining-nums tabular-nums; }
}
/* Menú: las opciones largas ocupan dos líneas sin apretarse */
.nav a { padding-top: 6px; padding-bottom: 6px; line-height: 1.25; }
