/* Sistema del Local — estilos propios sobre Bootstrap 5.3 */
:root {
  --loc-primary: #2563eb;
  --loc-bg: #f3f5f9;
  --loc-side: #0f172a;
  --loc-side-2: #1e293b;
  --loc-text: #1e293b;
  --loc-radius: 14px;
  --loc-shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.06);
}
body { background: var(--loc-bg); color: var(--loc-text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* estructura */
.loc-shell { display: flex; min-height: 100vh; }
.loc-sidebar { width: 262px; background: var(--loc-side); color: #cbd5e1; position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column; overflow-y: auto; transition: transform .2s; }
.loc-main { margin-left: 262px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.loc-top { position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid #e2e8f0; padding: .6rem 1.1rem; display: flex; align-items: center; gap: .75rem; }
.loc-content { padding: 1.25rem 1.25rem 3rem; max-width: 1500px; width: 100%; }

/* menú lateral */
.loc-brand { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.loc-brand img { height: 34px; max-width: 120px; object-fit: contain; border-radius: 6px; }
.loc-brand-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--loc-primary); display: grid; place-items: center; color: #fff; font-size: 1.15rem; }
.loc-nav { padding: .6rem .6rem 2rem; display: flex; flex-direction: column; gap: 2px; }
.loc-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; color: #cbd5e1; text-decoration: none; border-radius: 10px; font-size: .93rem; }
.loc-link i:first-child { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.loc-link:hover { background: var(--loc-side-2); color: #fff; }
.loc-link.active { background: var(--loc-primary); color: #fff; }
.loc-chev { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.loc-parent:not(.collapsed) .loc-chev { transform: rotate(180deg); }
.loc-sublink { display: block; padding: .38rem .75rem .38rem 2.7rem; color: #94a3b8; text-decoration: none; font-size: .87rem; border-radius: 8px; }
.loc-sublink:hover { color: #fff; background: var(--loc-side-2); }
.loc-sublink.active { color: #fff; font-weight: 600; background: rgba(255,255,255,.08); }
.loc-overlay { display: none; }

/* barra superior */
.loc-search { flex: 1; max-width: 640px; position: relative; }
.loc-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.loc-search .form-control { padding-left: 2.3rem; border-radius: 999px; background: #f1f5f9; border-color: transparent; }
.loc-search .form-control:focus { background: #fff; border-color: var(--loc-primary); box-shadow: 0 0 0 .2rem rgba(37,99,235,.15); }
.loc-top-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.loc-chip { background: #ecfdf5; color: #047857; border-radius: 999px; padding: .3rem .75rem; font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.loc-chip.chip-warn { background: #fef3c7; color: #b45309; }
.loc-bell { position: absolute; top: -4px; right: -4px; font-size: .65rem; }

/* tarjetas y tablas */
.card { border: 0; border-radius: var(--loc-radius); box-shadow: var(--loc-shadow); }
.card-header { background: transparent; border-bottom: 1px solid #eef2f7; font-weight: 600; }
.kpi { border-radius: var(--loc-radius); background: #fff; box-shadow: var(--loc-shadow); padding: 1rem 1.1rem; height: 100%; }
.kpi .lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 600; }
.kpi .val { font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.kpi .sub { font-size: .8rem; color: #64748b; }
.kpi-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.kpi-link:hover .kpi { box-shadow: 0 2px 4px rgba(15,23,42,.08), 0 8px 22px rgba(15,23,42,.1); }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f8fafc; }
.btn { border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; }
.badge { font-weight: 600; }
.text-money-in { color: #15803d; font-weight: 600; }
.text-money-out { color: #b91c1c; font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.clickable { cursor: pointer; }

/* POS */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1rem; align-items: start; }
.pos-results { max-height: 340px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.pos-result { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem .85rem; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.pos-result:last-child { border-bottom: 0; }
.pos-result:hover, .pos-result.sel { background: #eff6ff; }
.pos-total { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.pos-sticky { position: sticky; top: 76px; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .85rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.k-col { background: #e9eef5; border-radius: var(--loc-radius); padding: .6rem; min-height: 200px; }
.k-col.drag-over { outline: 2px dashed var(--loc-primary); background: #dbeafe; }
.k-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem; padding: .2rem .35rem .55rem; }
.k-card { background: #fff; border-radius: 12px; padding: .65rem .75rem; margin-bottom: .55rem; box-shadow: var(--loc-shadow); cursor: grab; border-left: 4px solid #cbd5e1; font-size: .87rem; }
.k-card.demorada { border-left-color: #dc2626; }
.k-card.dragging { opacity: .45; }
.k-card a { text-decoration: none; color: inherit; }

/* firma */
.firma-pad { border: 1px dashed #94a3b8; border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 160px; }

/* impresión */
.print-doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 1.5rem; }
@media print {
  .loc-sidebar, .loc-top, .no-print, .alert { display: none !important; }
  .loc-main { margin: 0 !important; }
  .loc-content { padding: 0 !important; }
  body { background: #fff !important; }
  .print-doc { box-shadow: none !important; padding: 0 !important; max-width: none; }
}

/* mobile */
@media (max-width: 991.98px) {
  .loc-sidebar { transform: translateX(-100%); }
  .loc-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .loc-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }
  .loc-main { margin-left: 0; }
  .loc-content { padding: .9rem .75rem 3rem; }
  .pos-grid { grid-template-columns: 1fr; }
  .pos-sticky { position: static; }
  .loc-search { max-width: none; }
}
