/* ======================================================
   Complementos v2 (styles.css conserva la identidad visual original)
   ====================================================== */

.muted { color: var(--muted); }
.error-text { color: #b91c1c !important; font-weight: 600; }
.mt { margin-top: 22px; }
.w-200 { max-width: 220px; }
.align-end { display: flex; align-items: flex-end; }
.wrap { white-space: normal; word-break: break-word; max-width: 420px; }
.neg { color: #b91c1c; font-weight: 700; }
.hidden { display: none !important; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; font-size: 12px; }
kbd { font: 600 10px/1 Inter, sans-serif; background: #e2e8f0; color: #475569; border-radius: 5px; padding: 3px 5px; margin-left: auto; }
.plain-list { margin: 8px 0 16px; padding-left: 20px; color: #475569; }
.plain-list li { margin: 4px 0; }
.print-only { display: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.report-filter-grid.four { grid-template-columns: 1fr 1fr 1fr auto; }

aside { display: flex; flex-direction: column; }
#nav { display: flex; flex-direction: column; gap: 4px; }
.aside-foot { margin-top: auto; padding: 14px 12px 4px; color: var(--muted); font-size: 11px; }

/* Botones extra */
button.danger { background: #b91c1c; }
button.big-btn { width: 100%; padding: 16px; font-size: 16px; margin-top: 12px; }
button.is-busy { opacity: .6; cursor: progress; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.small-btn { white-space: nowrap; }

/* Placa grande */
.plate-input { font-size: 20px !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* Estado del turno en la cabecera */
.shift-badge { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: #fee2e2; color: #991b1b; }
.shift-badge.open { background: #dcfce7; color: #166534; }

/* Pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e2e8f0; color: #334155; }
.pill-ok { background: #dcfce7; color: #166534; }
.pill-bad { background: #fee2e2; color: #991b1b; }
.pill-warn { background: #fef3c7; color: #92400e; }

.notice.warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.notice.ok { background: #f0fdf4; border-color: #86efac; color: #166534; }

/* Salida / cobro */
.checkout { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 22px; align-items: start; margin-top: 14px; }
.checkout .ticket { margin: 0; }
.pay-panel { background: var(--soft); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.total-line b { font-size: 18px; }
.seg { display: flex; gap: 6px; margin-bottom: 14px; }
.seg-btn { flex: 1; background: #fff; color: #334155; border: 1px solid var(--border); }
.seg-btn.active { background: var(--primary2); color: #fff; border-color: var(--primary2); }
.change-line { margin-top: 8px; font-size: 16px; }
.change-line b { font-size: 20px; }
.done-ticket { margin-top: 16px; opacity: .85; }

/* Mensualidades */
.sub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; align-items: end; }
.sub-grid label { margin-top: 0; }
.sub-total { font-size: 15px; gap: 6px; padding-bottom: 10px; }
.sub-total b { font-size: 18px; margin-left: 6px; }

textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; resize: vertical; }

/* Avisos (toasts) */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { padding: 12px 16px; border-radius: 12px; color: #fff; background: #166534; box-shadow: var(--shadow); font-weight: 600; transition: opacity .35s, transform .35s; }
.toast-error { background: #b91c1c; }
.toast-warn { background: #b45309; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Diálogos */
.app-dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, 92vw); box-shadow: 0 24px 70px rgba(15,23,42,.25); }
.app-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.app-dialog form { padding: 22px; }
.app-dialog h3 { margin: 0 0 8px; }
.app-dialog input, .app-dialog select { width: 100%; margin-bottom: 4px; }
.dialog-text { white-space: pre-line; margin: 0; font-size: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 1000px) {
  .grid-2, .checkout { grid-template-columns: 1fr; }
  .sub-grid { grid-template-columns: 1fr 1fr; }
  .report-filter-grid.four { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) !important; }
  aside, main { min-width: 0; }
  aside { display: block !important; }
  .tab.card { overflow-x: auto; }
  .space-between { flex-wrap: wrap; gap: 10px; }
  .w-200 { max-width: 100%; }
  #nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  #nav .nav { flex: 0 0 auto; width: auto; margin: 0; }
  #nav kbd, .aside-foot { display: none; }
}

/* Facturación electrónica */
.fe-picker { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.fe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; align-items: end; }
.fe-grid .span-2 { grid-column: span 2; }
.fe-grid .span-3, .span-3 { grid-column: 1 / -1; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; }
.check input { width: auto; margin: 0; }
.check.big { font-size: 15px; padding: 10px 14px; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; }
.mono { font-family: "Courier New", monospace; font-size: 10px; word-break: break-all; }
.report-filter-grid.five { grid-template-columns: repeat(5, 1fr); }
a.small-btn { display: inline-block; text-decoration: none; }
.pay-panel .fe-grid { grid-template-columns: 1fr 1fr; }
.pay-panel .fe-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 1000px) {
  .fe-grid, .report-filter-grid.five { grid-template-columns: 1fr; }
  .fe-grid .span-2 { grid-column: auto; }
}
.ticket .fe-clave { font-size: 10px; word-break: break-all; text-align: center; margin: 2px 0; }
.ticket .fe-tipo { text-align: center; font-weight: 900; margin: 4px 0; }
.fe-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.fe-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: #fff; color: #334155; border: 2px solid var(--border); padding: 10px 12px; }
.fe-option small { font-weight: 500; font-size: 12px; color: var(--muted); }
.fe-option.active { border-color: var(--primary2); background: #eef2ff; color: var(--primary2); }
.fe-tiquete input { width: 100%; }
.act-list { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: #475569; }
.num-table td, .num-table th { white-space: nowrap; }
.num-table tfoot th { background: #f1f5f9; }
details summary { cursor: pointer; font-weight: 700; margin: 8px 0; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll table { min-width: 100%; }
