/* =====================================================================
   TallerSys · Sistema de diseño (cristal claro, heredado de AidaSys)
   Una sola hoja para todas las pantallas. Prefijos por página solo
   cuando haga falta algo muy específico.
   ===================================================================== */
:root {
  --brand: #f97316;
  --brand-2: #ea580c;
  --brand-gradient: linear-gradient(135deg, #fb923c 0%, #f97316 45%, #ea580c 100%);
  --dark: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: rgba(226, 232, 240, .95);
  --bg: #f8fafc;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .92);
  --shadow: 0 8px 24px -12px rgba(15, 23, 42, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .3);
  --radius: 18px;
  --radius-sm: 12px;
  --green: #10b981; --red: #ef4444; --amber: #f59e0b; --blue: #3b82f6;
  --violet: #8b5cf6; --cyan: #06b6d4; --orange: #f97316; --indigo: #6366f1; --slate: #64748b;
  --aside-w: 262px;
  --font-title: 'Outfit', system-ui, sans-serif;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; color: var(--text); line-height: 1.5;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(249, 115, 22, .13), transparent 65%),
    radial-gradient(700px 480px at 42% -14%, rgba(245, 158, 11, .09), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-title); color: var(--dark); margin: 0; line-height: 1.2; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; } .hidden { display: none !important; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.t-green { color: #059669; } .t-red { color: #dc2626; } .t-amber { color: #b45309; } .t-brand { color: var(--brand-2); }
.mt-0{margin-top:0}.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}
.flex { display: flex; gap: 10px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------------- Layout ---------------- */
.page-wrapper { display: flex; min-height: 100vh; }
.main-content { flex: 1; min-width: 0; margin-left: var(--aside-w); padding: 22px 26px 60px; transition: margin .25s; }
body.aside-collapsed .main-content { margin-left: 78px; }
.container-narrow { max-width: 1100px; margin: 0 auto; }

/* ---------------- Aside ---------------- */
.aside {
  position: fixed; inset: 0 auto 0 0; width: var(--aside-w); z-index: 60;
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: width .25s, transform .25s;
}
.aside-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.aside-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-gradient); color: #fff; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; box-shadow: 0 8px 18px -8px rgba(234, 88, 12, .6); overflow: hidden; }
.aside-logo img { width: 100%; height: 100%; object-fit: cover; }
.aside-brand .t { min-width: 0; }
.aside-brand .t b { display: block; font-family: var(--font-title); font-size: 16px; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aside-brand .t span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.aside-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; }
.aside-nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 14px 10px 6px; }
.aside-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: #334155; font-weight: 500;
  text-decoration: none; margin-bottom: 2px; transition: background .15s, color .15s; white-space: nowrap;
}
.aside-nav a i { width: 20px; text-align: center; color: var(--faint); font-size: 15px; transition: color .15s; }
.aside-nav a:hover { background: rgba(249, 115, 22, .08); color: var(--dark); }
.aside-nav a:hover i { color: var(--brand); }
.aside-nav a.active { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 18px -10px rgba(234, 88, 12, .8); }
.aside-nav a.active i { color: #fff; }
.aside-nav a .badge-n { margin-left: auto; background: rgba(239, 68, 68, .12); color: #b91c1c; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.aside-nav a.active .badge-n { background: rgba(255,255,255,.25); color: #fff; }
.aside-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; }
.aside-foot .avatar { width: 36px; height: 36px; }
.aside-foot .who { flex: 1; min-width: 0; }
.aside-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aside-foot .who span { font-size: 11px; color: var(--muted); }
.aside-toggle { position: absolute; top: 24px; right: -13px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 11px; box-shadow: var(--shadow); }
body.aside-collapsed .aside { width: 78px; }
body.aside-collapsed .aside .t, body.aside-collapsed .aside-nav .sec, body.aside-collapsed .aside-nav a span, body.aside-collapsed .aside-foot .who, body.aside-collapsed .aside-nav a .badge-n { display: none; }
body.aside-collapsed .aside-nav a { justify-content: center; padding: 10px; }
body.aside-collapsed .aside-foot { flex-direction: column; }
body.aside-collapsed .aside-toggle i { transform: rotate(180deg); }
.mobile-bar { display: none; }
.scrim { display: none; }

.topbar-alert { position: sticky; top: 0; z-index: 70; text-align: center; padding: 9px 14px; font-weight: 600; font-size: 13px; color: #fff; }
.topbar-alert.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.topbar-alert.support { background: linear-gradient(90deg, #7c3aed, #6d28d9); display: flex; justify-content: center; align-items: center; gap: 12px; }
.topbar-alert button { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 8px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12px; }

/* ---------------- Cristal ---------------- */
.glass, .card, .page-head, .kpi {
  background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 18px; margin-bottom: 18px; position: relative; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.card-title h3 i { color: var(--brand); }
.card.p-0 { padding: 0; }

/* Franja de degradado que respeta el radio */
.stripe::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding-top: 3px; background: var(--brand-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none;
}

/* ---------------- Encabezado de página ---------------- */
.page-head { position: relative; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .ph-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-gradient); color: #fff; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; box-shadow: 0 10px 22px -10px rgba(234, 88, 12, .7); }
.page-head .ph-text { flex: 1; min-width: 180px; }
.page-head h1 { font-size: 22px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.page-head .ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-box input { padding-left: 34px !important; min-width: 240px; }

/* ---------------- KPIs ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { position: relative; padding: 16px; overflow: hidden; display: flex; gap: 14px; align-items: center; --accent: var(--brand); text-decoration: none !important; color: inherit; }
.kpi::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: .7; }
.kpi .k-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 18px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); flex-shrink: 0; }
.kpi .k-val { font-family: var(--font-title); font-size: clamp(18px, 2.1vw, 24px); font-weight: 700; color: var(--dark); line-height: 1.1; }
.kpi .k-lbl { font-size: 12px; color: var(--muted); }
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.acc-green { --accent: var(--green); } .acc-red { --accent: var(--red); } .acc-amber { --accent: var(--amber); } .acc-blue { --accent: var(--blue); }
.acc-violet { --accent: var(--violet); } .acc-cyan { --accent: var(--cyan); } .acc-indigo { --accent: var(--indigo); } .acc-slate { --accent: var(--slate); }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none !important;
  transition: transform .1s, box-shadow .15s, background .15s; white-space: nowrap; line-height: 1.2; color: var(--text); background: #fff;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 18px -10px rgba(234, 88, 12, .9); }
.btn-primary:hover { box-shadow: 0 10px 24px -10px rgba(234, 88, 12, 1); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: #334155; }
.btn-secondary:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-success { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: #dc2626; }
.btn-danger:hover { background: #fef2f2; }
.btn-warning { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.btn-wa { background: #22c55e; color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }

/* Botones de acción en tablas (34px con tinte) */
.acts { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.act {
  --c: var(--cyan); width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; border: 0; cursor: pointer;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); transition: background .15s, color .15s; text-decoration: none !important; font-size: 14px;
}
.act:hover { background: var(--c); color: #fff; }
.act.edit { --c: var(--cyan); } .act.del { --c: var(--red); } .act.view { --c: var(--amber); } .act.pay { --c: var(--green); }
.act.print { --c: var(--slate); } .act.wa { --c: #16a34a; } .act.brand { --c: var(--brand); } .act.violet { --c: var(--violet); }

/* ---------------- Pills ---------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; line-height: 1.5; }
.pill i { font-size: 10px; }
.pill-green  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.pill-red    { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.pill-amber  { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.pill-blue   { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.pill-cyan   { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.pill-violet { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.pill-orange { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.pill-indigo { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }
.pill-slate  { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.pill-gray   { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* ---------------- Formularios ---------------- */
.field { margin-bottom: 14px; min-width: 0; }
.field label, .lbl { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.field label .req { color: var(--red); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font: inherit; font-size: 14px; color: var(--text);
  background: rgba(255, 255, 255, .9); transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(249, 115, 22, .15); }
.field textarea, textarea.input { resize: vertical; min-height: 70px; }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 99px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(17px); }
.input-group { display: flex; } .input-group .input { border-radius: 10px 0 0 10px; } .input-group .btn { border-radius: 0 10px 10px 0; }
.alert { padding: 11px 14px; border-radius: 11px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.alert-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* Segmentos (selector tipo pastilla) */
.seg { display: inline-flex; background: rgba(241, 245, 249, .9); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg a, .seg label { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.seg .on, .seg input:checked + span { background: #fff; color: var(--dark); box-shadow: 0 2px 6px rgba(15,23,42,.08); }
.seg input { display: none; }
.seg label span { padding: 7px 14px; border-radius: 9px; }
.seg label { padding: 0; }

/* ---------------- Pestañas ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button.on { color: var(--brand-2); border-bottom-color: var(--brand); }
.tabs button .n { background: #f1f5f9; color: var(--muted); border-radius: 99px; font-size: 11px; padding: 0 7px; }
.tab-panel { display: none; } .tab-panel.on { display: block; }

/* ---------------- Tablas ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl, table.dataTable { width: 100% !important; border-collapse: separate !important; border-spacing: 0; }
table.tbl th, table.dataTable thead th {
  background: rgba(241, 245, 249, .9) !important; color: #475569; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700; padding: 11px 12px !important; border-bottom: 1px solid var(--line) !important; text-align: left;
}
table.tbl th:first-child, table.dataTable thead th:first-child { border-top-left-radius: 12px; }
table.tbl th:last-child, table.dataTable thead th:last-child { border-top-right-radius: 12px; }
table.tbl td, table.dataTable tbody td { padding: 11px 12px !important; border-bottom: 1px solid #f1f5f9 !important; vertical-align: middle; }
table.tbl tbody tr, table.dataTable tbody tr { background: transparent !important; transition: background .12s, box-shadow .12s; }
table.tbl tbody tr:hover, table.dataTable tbody tr:hover { background: rgba(255, 247, 237, .7) !important; box-shadow: inset 3px 0 0 var(--brand); }
table.dataTable tbody td.sorting_1, table.dataTable.display tbody tr > .sorting_1 { box-shadow: none !important; background: transparent !important; }
table.dataTable.no-footer { border-bottom: 0 !important; }
table.tbl tfoot td { padding: 10px 12px; font-weight: 700; }
.t-title { font-weight: 600; color: var(--dark); }
.t-sub { font-size: 12px; color: var(--muted); }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-gradient); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; font-family: var(--font-title); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.dataTables_wrapper .bottom-table { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 0; flex-wrap: wrap; gap: 10px; }
.dataTables_wrapper .dataTables_info { color: var(--muted) !important; font-size: 12.5px; padding: 0 !important; }
.dataTables_wrapper .dataTables_paginate { padding: 0 !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button { border: 1px solid var(--line) !important; border-radius: 9px !important; background: #fff !important; margin: 0 2px !important; padding: 5px 11px !important; color: #334155 !important; font-size: 12.5px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--brand-gradient) !important; color: #fff !important; border-color: transparent !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .45; }
.dataTables_wrapper .dataTables_processing { background: var(--glass-strong) !important; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty i { font-size: 34px; color: #cbd5e1; display: block; margin-bottom: 10px; }

/* ---------------- Modales ---------------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal.open { display: flex; animation: fadeIn .15s; }
.modal-box { position: relative; width: 100%; max-width: 620px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); min-width: 0; }
.modal-box.lg { max-width: 900px; } .modal-box.sm { max-width: 440px; } .modal-box.xl { max-width: 1180px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; }
.modal-head h3 { flex: 1; font-size: 18px; }
.modal-close { border: 0; background: rgba(15,23,42,.05); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--muted); }
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 6px 22px 10px; overflow-y: auto; min-width: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ---------------- Autocompletar ---------------- */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 320px; overflow-y: auto; display: none; }
.ac-list.open { display: block; }
.ac-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; display: flex; gap: 10px; align-items: center; }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.hl { background: #fff7ed; }
.ac-item .r { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ac-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* Ficha de selección (cliente/vehículo elegido) */
.chip-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid #fed7aa; background: #fff7ed; border-radius: 14px; }
.chip-card .grow b { display: block; }

/* ---------------- Línea de tiempo ---------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: #e2e8f0; border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.tl-item .tl-head { font-size: 12px; color: var(--muted); }
.tl-item .tl-body { margin-top: 3px; }

/* ---------------- Stepper de la orden ---------------- */
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: thin; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.step::before { content: ''; position: absolute; top: 15px; left: -50%; right: 50%; height: 3px; background: #e2e8f0; z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { position: relative; z-index: 1; width: 32px; height: 32px; margin: 0 auto 6px; border-radius: 50%; background: #f1f5f9; border: 2px solid #e2e8f0; display: grid; place-items: center; font-size: 13px; color: var(--faint); }
.step.done { color: #15803d; } .step.done::before { background: #86efac; }
.step.done .dot { background: #dcfce7; border-color: #86efac; color: #15803d; }
.step.cur { color: var(--brand-2); } .step.cur::before { background: #86efac; }
.step.cur .dot { background: var(--brand-gradient); border-color: transparent; color: #fff; box-shadow: 0 0 0 5px rgba(249, 115, 22, .18); }

/* ---------------- Kanban (tablero) ---------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.k-col { background: rgba(241, 245, 249, .65); border: 1px solid var(--line); border-radius: 18px; padding: 10px; min-height: 200px; display: flex; flex-direction: column; }
.k-col.drop { background: rgba(255, 237, 213, .8); border-color: #fdba74; }
.k-col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-family: var(--font-title); font-size: 14px; }
.k-col-head .n { margin-left: auto; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 0 9px; font-size: 12px; }
.k-col-head .dotc { width: 10px; height: 10px; border-radius: 50%; }
.k-cards { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 60px; }
.k-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: grab; box-shadow: 0 4px 12px -8px rgba(15, 23, 42, .25); position: relative; border-left: 4px solid var(--kc, var(--slate)); }
.k-card:hover { box-shadow: 0 10px 22px -12px rgba(15, 23, 42, .35); }
.k-card.dragging { opacity: .5; }
.k-card .kc-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.k-card .kc-folio { font-weight: 700; color: var(--brand-2); }
.k-card .kc-veh { font-weight: 700; font-family: var(--font-title); font-size: 15px; color: var(--dark); margin: 4px 0 2px; }
.k-card .kc-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.k-card .kc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; }
.k-card .late { color: #dc2626; font-weight: 700; }
.placa { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 11.5px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 1px 7px; letter-spacing: .04em; color: var(--dark); }

/* ---------------- Detalle (pares etiqueta/valor) ---------------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dl > div { background: rgba(248, 250, 252, .9); border: 1px solid #eef2f7; border-radius: 12px; padding: 9px 12px; min-width: 0; }
.dl small { display: block; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.dl b { font-weight: 600; word-break: break-word; }

/* Totales */
.totals { margin-left: auto; width: 100%; max-width: 340px; }
.totals .row { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .row.big { font-size: 20px; font-weight: 800; font-family: var(--font-title); border-top: 1px dashed #cbd5e1; padding-top: 10px; margin-top: 4px; color: var(--dark); }

/* Checklist de recepción */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 13px; }
.checklist label:has(input:checked) { border-color: #86efac; background: #f0fdf4; }
.checklist input { accent-color: var(--green); width: 16px; height: 16px; }

/* Medidor de combustible */
.fuel { display: flex; gap: 6px; }
.fuel label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; cursor: pointer; font-size: 12px; font-weight: 700; background: #fff; }
.fuel input { display: none; }
.fuel label:has(input:checked) { background: var(--brand-gradient); color: #fff; border-color: transparent; }

/* Diagrama de daños */
.car-diagram { position: relative; width: 100%; max-width: 520px; margin: 0 auto; cursor: crosshair; user-select: none; }
.car-diagram svg { width: 100%; height: auto; display: block; }
.dmg-pin { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: pointer; }

/* Firma */
.sig-wrap { border: 2px dashed #cbd5e1; border-radius: 14px; background: #fff; position: relative; touch-action: none; }
.sig-wrap canvas { width: 100%; height: 180px; display: block; border-radius: 12px; }
.sig-wrap .sig-clear { position: absolute; top: 8px; right: 8px; }
.sig-wrap .sig-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #cbd5e1; font-size: 12px; pointer-events: none; }

/* Galería de fotos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery .ph { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: #f1f5f9; border: 1px solid var(--line); }
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery .ph .tag { position: absolute; left: 6px; top: 6px; }
.gallery .ph .del { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; }
.dropzone { border: 2px dashed #fdba74; border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: rgba(255, 247, 237, .6); }
.dropzone:hover { background: #fff7ed; }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.pos-summary { position: sticky; top: 16px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { border: 0; background: #f8fafc; width: 28px; height: 32px; cursor: pointer; font-weight: 700; color: var(--muted); }
.qty input { width: 54px; border: 0; text-align: center; font: inherit; height: 32px; }
.inp-sm { width: 100%; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; font: inherit; font-size: 13px; background: #fff; }
.inp-sm:focus { outline: none; border-color: var(--brand); }
.pay-rows .pay-row { display: grid; grid-template-columns: 1fr 120px 34px; gap: 6px; margin-bottom: 6px; }

/* Calendario */
.fc { --fc-border-color: #e2e8f0; --fc-today-bg-color: rgba(249, 115, 22, .07); --fc-button-bg-color: #fff; --fc-button-text-color: #334155; --fc-button-border-color: #e2e8f0; --fc-button-hover-bg-color: #f8fafc; --fc-button-hover-border-color: #cbd5e1; --fc-button-active-bg-color: #f97316; --fc-button-active-border-color: #f97316; font-size: 13px; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-family: var(--font-title); font-size: 20px; }
.fc .fc-event { border-radius: 7px; padding: 1px 4px; border: 0; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand { background: var(--brand-gradient); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255,255,255,.08); right: -180px; bottom: -200px; }
.auth-brand h1 { color: #fff; font-size: 40px; max-width: 460px; }
.auth-brand ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; max-width: 420px; }
.auth-brand li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-brand li i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.auth-form { display: grid; place-items: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; margin-bottom: 4px; }
.pass-wrap { position: relative; }
.pass-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); cursor: pointer; padding: 6px; }

/* Página pública (cotización/seguimiento) */
.public-wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.pub-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 10px; align-items: center; }
.pub-item.rej { opacity: .6; background: #fafafa; }
.pub-item.rej .pub-desc { text-decoration: line-through; }
.pub-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.pub-toggle button { border: 0; background: #fff; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); }
.pub-toggle button.ok.on { background: #16a34a; color: #fff; }
.pub-toggle button.no.on { background: #dc2626; color: #fff; }

/* SweetAlert al tono */
.swal2-popup { border-radius: 20px !important; font-family: var(--font) !important; }
.swal2-title { font-family: var(--font-title) !important; }
.swal2-styled.swal2-confirm { background: var(--brand-gradient) !important; border-radius: 11px !important; }
.swal2-styled.swal2-cancel { border-radius: 11px !important; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1200px) {
  .pos { grid-template-columns: 1fr; }
  .pos-summary { position: static; }
}
@media (max-width: 992px) {
  .aside { transform: translateX(-100%); width: 280px !important; box-shadow: var(--shadow-lg); }
  body.aside-open .aside { transform: none; }
  body.aside-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 55; }
  body.aside-open { overflow: hidden; }
  .aside-toggle { display: none; }
  body.aside-collapsed .aside .t, body.aside-collapsed .aside-nav .sec, body.aside-collapsed .aside-nav a span, body.aside-collapsed .aside-foot .who { display: revert; }
  .main-content, body.aside-collapsed .main-content { margin-left: 0; padding: 12px 12px 60px; overflow-x: clip; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .mobile-bar button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 17px; cursor: pointer; }
  .mobile-bar b { font-family: var(--font-title); font-size: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 26px 22px; }
  .auth-brand h1 { font-size: 24px; }
  .auth-brand ul, .auth-brand .auth-foot { display: none; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-4.keep-2, .grid-3.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: auto; }
  .page-head { padding: 14px; }
  .page-head h1 { font-size: 19px; }
  .page-head .ph-actions { width: 100%; }
  .page-head .ph-actions .btn { flex: 1; }
  .search-box, .search-box input { width: 100%; min-width: 0; }
  .card { padding: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi .k-icon { width: 36px; height: 36px; font-size: 15px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { max-height: 94vh; border-radius: 22px 22px 0 0; max-width: 100% !important; }
  /* Tablas → tarjetas */
  table.cards thead { display: none; }
  table.cards, table.cards tbody { display: block; }
  table.cards tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: #fff !important; }
  table.cards tbody td { border: 0 !important; padding: 0 !important; min-width: 0; }
  table.cards tbody td::before { content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase; color: var(--faint); font-weight: 700; letter-spacing: .04em; }
  table.cards tbody td:first-child { grid-column: 1 / -1; }
  table.cards tbody td:first-child::before { display: none; }
  table.cards tbody td.td-acts { grid-column: 1 / -1; }
  table.cards tbody td.td-acts::before { display: none; }
  table.cards tbody td.dataTables_empty { grid-column: 1 / -1; }
  table.cards tbody td.dataTables_empty::before { display: none; }
  .dataTables_wrapper .bottom-table { justify-content: center; }
  .kanban { grid-auto-columns: 86%; scroll-snap-type: x mandatory; }
  .k-col { scroll-snap-align: start; }
}

/* ---------------- Impresión ---------------- */
@media print {
  .aside, .mobile-bar, .page-head .ph-actions, .no-print, .topbar-alert { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; }
  .card, .page-head { box-shadow: none !important; backdrop-filter: none !important; }
}
