/* ==========================================================
   Mekora styles
   All colors live in theme.css; change them there to restyle the app.
   ========================================================== */

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Colors, shadows and sizes are in theme.css. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg) linear-gradient(180deg, var(--bg), var(--bg-end));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .25rem; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.8rem; letter-spacing: -.025em; }
h2 { font-size: 1.12rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
p { margin: 0 0 .5rem; }
a { color: inherit; }
.muted { color: var(--muted); }
.link { color: var(--link); font-weight: 650; text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.pre { white-space: pre-wrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ---------- App layout: top bar (tablet/computer), bottom bar (phone) ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 58px; flex-shrink: 0;
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 26px; display: block; }
.brand .brand-icon { display: none; }

.nav { display: flex; align-items: center; gap: 2px; min-width: 0; flex-shrink: 0; } /* never squeezed under the search box */
.nav > a, .menu > summary {
  position: relative;
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .7rem; min-height: 40px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap;
  cursor: pointer; list-style: none;
  transition: background .15s, color .15s;
}
.menu > summary::-webkit-details-marker { display: none; }
.nav > a .icon, .menu > summary .icon { color: var(--sidebar-muted); transition: color .15s; }
.nav > a:hover, .menu > summary:hover { background: var(--sidebar-hover); color: #fff; }
.nav > a:hover .icon, .menu > summary:hover .icon { color: #fff; }
.nav > a.active, .menu > summary.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav > a.active .icon, .menu > summary.active .icon { color: var(--sidebar-active-text); }
.nav a.locked { color: var(--sidebar-muted); }
.plan-tag {
  margin-left: auto; font-style: normal; font-size: .7rem; font-weight: 650;
  background: var(--sidebar-line); color: var(--sidebar-muted); border-radius: 6px; padding: .05rem .45rem;
}

/* Drop-down menus ("Más", the person menu, the phone's "Más"): light panel under the bar. */
.menu { position: relative; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  min-width: 230px; padding: .4rem;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-panel a, .menu-panel .logout {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .6rem .7rem; min-height: 42px; border-radius: 9px;
  color: var(--text); text-decoration: none; font: inherit; font-weight: 600; font-size: .92rem;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-panel a .icon, .menu-panel .logout .icon { color: var(--muted); }
.menu-panel a:hover, .menu-panel .logout:hover { background: var(--surface-2); }
.menu-panel a.active { background: var(--selected-soft); box-shadow: inset 3px 0 0 var(--text); }
.menu-panel a.menu-danger, .menu-panel a.menu-danger .icon { color: var(--danger-text); }
.menu-panel a.menu-danger { border-top: 1px solid var(--border); }
.menu-panel .plan-tag { background: var(--neutral-soft); color: var(--muted); }
.menu-panel .nav-admin { border-top: 1px dashed var(--border-strong); border-radius: 0 0 9px 9px; margin-top: .2rem; }
.user-menu .menu-panel { left: auto; right: 0; }
.who { display: flex; flex-direction: column; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; line-height: 1.3; min-width: 0; }
.who strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font-size: .8rem; color: var(--muted); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.topbar-cta { min-height: 40px; }
.bell {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none; transition: background .15s, color .15s;
}
.bell:hover, .bell.active { background: var(--sidebar-hover); color: #fff; }
.bell-count {
  position: absolute; top: 1px; right: 0;
  background: var(--sidebar-badge-bg); color: var(--sidebar-badge-text); border-radius: 999px;
  font-size: .68rem; font-weight: 750; padding: 0 .35rem; min-width: 1.2rem; text-align: center; line-height: 1.2rem;
}
.user-menu > summary { padding: 0; min-height: 40px; }
.user-menu .avatar { width: 36px; height: 36px; background: var(--avatar); box-shadow: 0 0 0 1px var(--sidebar-line); font-size: .9rem; }

.shop-switch {
  display: flex; align-items: center; gap: .4rem; flex-shrink: 1; min-width: 0; max-width: 220px;
  background: var(--sidebar-hover); border: 1px solid var(--sidebar-line); border-radius: 10px;
  padding: .25rem .3rem .25rem .6rem; color: var(--sidebar-muted);
}
.shop-switch form { flex: 1; min-width: 0; }
.shop-switch select {
  border: 0; color: #fff; font-weight: 600; font-size: .88rem; padding: .2rem 1.5rem .2rem .1rem; min-height: 0;
  width: 100%; cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238EA0BA' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .3rem center;
}
.shop-switch select option { color: var(--text); }
.shop-switch select:focus { box-shadow: none; }
.shop-current { flex: 1; min-width: 0; color: #fff; font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .2rem .1rem; }
/* Two or more locations: the name is a button that opens the list of locations. */
.shop-menu { padding: 0; }
.topbar .shop-menu > summary { display: flex; align-items: center; gap: .4rem; width: 100%; min-width: 0; padding: .25rem .5rem .25rem .6rem; cursor: pointer; list-style: none; border-radius: 10px; }
.shop-menu > summary::-webkit-details-marker { display: none; }
.topbar .shop-menu > summary:hover, .topbar .shop-menu[open] > summary { background: rgba(255,255,255,.08); color: #fff; }
.shop-menu .menu-panel { min-width: 240px; }
.menu-title { margin: .2rem .7rem .3rem; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.shop-menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-panel .menu-item {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem; min-height: 42px; border-radius: 9px;
  color: var(--text); font: inherit; font-weight: 600; font-size: .92rem; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-panel .menu-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel .menu-item .icon { color: var(--muted); }
.menu-panel .menu-item:hover { background: var(--surface-2); }
.menu-panel .menu-item.active { background: var(--selected-soft); box-shadow: inset 3px 0 0 var(--text); }
.menu-panel a.menu-sep { border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; margin-top: .2rem; }
.admin-badge { background: var(--surface); color: var(--warning-text); }

.bottom-nav { display: none; }

.main { flex: 1; width: 100%; min-width: 0; padding: 1.75rem 2rem 4rem; max-width: 1320px; margin: 0 auto; }
.main:has(> .board), .main:has(> .board-page), .main:has(> .tablero) { max-width: none; }

/* Narrower screens (small laptops, tablets): icons only for the top-bar items, the active one keeps its name. */
@media (max-width: 1360px) {
  .nav > a:not(.active) span, .more-menu > summary span { display: none; }
  .nav > a, .menu > summary { padding: .5rem .6rem; }
}
@media (max-width: 1000px) {
  .nav > a.active span { display: none; } /* tablets: icons only (the name shows on hover) */
  .shop-switch { min-width: 52px; }
  .topbar-cta span { display: none; }
  .topbar-cta { padding: 0 .7rem; }
  .shop-switch { max-width: 170px; }
}

/* Phone: dark bar on top (logo, location, bell, person), the menu moves to a bar at the bottom. */
@media (max-width: 760px) {
  .topbar { height: 54px; padding: 0 .75rem; gap: .5rem; }
  .brand .brand-full { display: none; }
  .brand .brand-icon { display: block; height: 24px; }
  .topbar .nav, .topbar .topbar-cta { display: none; }
  .admin-app .topbar .nav { display: flex; overflow-x: auto; scrollbar-width: none; }
  .admin-app .topbar .nav span { display: none; }
  .shop-switch { max-width: none; flex: 1; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around; align-items: stretch;
    background: var(--card); border-top: 1px solid var(--border);
    padding: .3rem .25rem calc(.45rem + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px -14px rgba(28, 31, 36, .35);
  }
  .bottom-nav > a, .bn-more > summary {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    min-height: 52px; padding: .2rem .1rem; border-radius: 10px;
    color: var(--faint); text-decoration: none; font-weight: 650; font-size: .7rem; background: none; list-style: none; cursor: pointer;
  }
  .bottom-nav > a .icon, .bn-more > summary .icon { width: 22px; height: 22px; color: currentColor; }
  .bottom-nav > a.active, .bn-more > summary.active { color: var(--text); background: none; }
  .bottom-nav > a.locked .plan-tag { display: none; }
  .bn-more { flex: 1; display: flex; }
  .bn-more > summary:hover { background: none; color: var(--faint); }
  .bn-more[open] > summary { color: var(--text); }
  .bn-more .menu-panel { top: auto; bottom: calc(100% + 10px); left: auto; right: .25rem; min-width: 240px; }
  .bn-cta { color: var(--text) !important; }
  .bn-ring {
    width: 46px; height: 46px; margin-top: -22px; border-radius: 50%;
    display: grid; place-items: center; background: var(--text); color: var(--ink); box-shadow: var(--shadow);
    border: 3px solid var(--card);
  }
  .bn-ring .icon { color: var(--ink) !important; }
  .main { padding: 1.1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
  .admin-app .main { padding-bottom: 3rem; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head p { margin: 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .25rem; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; transition: color .15s; }
.back:hover { color: var(--text); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card h2 .icon { color: var(--faint); }
.form-card { max-width: 760px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.25rem; align-items: start; }
.two-col .card { margin-bottom: 0; }

.coming-soon { display: flex; gap: 1rem; align-items: center; border-style: dashed; border-color: var(--border-strong); box-shadow: none; background: transparent; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'value icon' 'label icon';
  align-items: center; column-gap: .9rem; row-gap: .15rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.15rem 1.3rem; text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease);
}
.stat .stat-icon { grid-area: icon; align-self: start; }
.stat .stat-value { grid-area: value; }
.stat .stat-label { grid-area: label; }
.stat-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 11px; background: var(--neutral-soft); color: var(--brand-dark-2);
}
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-weight: 500; font-size: .9rem; line-height: 1.3; }
.stat:has(.stat-icon-danger) .stat-value { color: var(--danger); }
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-1px); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--border); }
.list-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem .6rem; margin: 0 -.6rem; text-decoration: none; border-radius: var(--radius-sm);
  color: var(--text); transition: background .15s;
}
a.list-row:hover, button.list-row:hover { background: var(--surface); }
.list-row > .icon { color: var(--border-hover); transition: transform .15s, color .15s; }
a.list-row:hover > .icon:last-child { color: var(--text); transform: translateX(2px); }
.list-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: .1rem; }
.list-main small, .list-side small { color: var(--muted); font-size: .88rem; }
.list-side { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; max-width: 40%; min-width: 0; }
.avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--avatar); color: #fff; font-weight: 650;
}
.empty {
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
  color: var(--muted); text-align: center; padding: 2.25rem 1rem; margin: 0; font-weight: 500;
}
.empty::before {
  content: ''; width: 52px; height: 52px; border-radius: 16px;
  background: var(--surface) no-repeat center / 24px;
  border: 1px solid var(--border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23D0D5DA' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2.5-7.5A2 2 0 017.4 4h9.2a2 2 0 011.9 1.5L21 13'/%3E%3Cpath d='M3 13v5a2 2 0 002 2h14a2 2 0 002-2v-5h-5l-1.5 2.5h-5L8 13z'/%3E%3C/svg%3E");
}

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.badge-brand { background: var(--neutral-soft); border-color: transparent; color: var(--brand-dark-2); }

/* ---------- Vehicles ---------- */
.vehicles { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.vehicle {
  display: flex; align-items: flex-start; gap: .9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .95rem 1.05rem;
  transition: border-color .15s;
}
.vehicle:hover { border-color: var(--border-strong); }
.vehicle-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--brand-dark); flex-shrink: 0; }
.vehicle-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.vehicle-meta { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; font-weight: 500; }
.plate {
  display: inline-block; padding: .02rem .45rem; border: 1.5px solid var(--plate-text); border-radius: 5px;
  font-weight: 700; color: var(--plate-text); letter-spacing: .05em; font-size: .8rem; background: var(--plate-bg);
  white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums;
}

.details { display: grid; grid-template-columns: max-content 1fr; gap: .65rem 1.5rem; margin: .75rem 0 0; }
.details dt { color: var(--muted); font-weight: 500; font-size: .9rem; }
.details dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.1rem; min-height: 44px;
  border: 1px solid var(--btn-border); border-radius: var(--radius-sm);
  background: linear-gradient(var(--btn-bg), var(--btn-bg-end)); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--btn-shadow);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { border-color: var(--btn-border-hover); background: var(--btn-bg-end); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: #fff; box-shadow: 0 4px 12px -4px rgba(37, 211, 102, .5); }
.btn-whatsapp:hover { background: var(--whatsapp-hover); border-color: var(--whatsapp-hover); }
.btn-dark { background: var(--btn-dark); border-color: var(--btn-dark); color: #fff; }
.btn-dark:hover { background: var(--btn-dark-hover); border-color: var(--btn-dark-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-sm { padding: .4rem .8rem; min-height: 36px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > span { font-weight: 600; font-size: .9rem; }
.field em { font-style: normal; font-weight: 500; color: var(--faint); }
.field.narrow { max-width: 260px; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
input, textarea, select {
  font: inherit; color: var(--text);
  padding: .62rem .85rem; min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--input);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover, select:hover { border-color: var(--border-hover); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--focus); box-shadow: var(--ring);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
  background: var(--input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23D0D5DA' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center;
}
input[type="file"] { cursor: pointer; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; font-size: .85rem; color: var(--text);
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px;
  padding: .3rem .7rem; margin-right: .6rem; cursor: pointer;
}
textarea { resize: vertical; }
.uppercase { text-transform: uppercase; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand-dark); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; padding-top: .5rem; }
.settings { max-width: 820px; gap: 0; }
.settings .card { display: flex; flex-direction: column; gap: 1rem; }
.settings .card h2 { margin: 0; }
.settings .card h2 + .muted { margin-top: -.65rem; }
.sticky-actions {
  position: sticky; bottom: 0; padding: 1rem 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* ---------- Search ---------- */
.search {
  display: flex; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .4rem .4rem .4rem 1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--focus); box-shadow: var(--ring); }
.search > .icon { color: var(--faint); }
.search input { border: 0; box-shadow: none; padding-left: .25rem; }
.search input:focus { box-shadow: none; }

/* ---------- Messages ---------- */
.flash, .alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; margin-bottom: 1.25rem; border: 1px solid transparent; }
.flash { display: flex; align-items: center; gap: .6rem; animation: flash-in .35s var(--ease); }
.flash::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }
.flash-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success-text); }
.flash-error, .alert-error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-text); }
.alert { margin-bottom: 0; }
.flash { transition: opacity .4s; }
.flash.hide { opacity: 0; }

/* ---------- Login / setup ---------- */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 12% 8%, rgba(58, 63, 71, .08), transparent 42%),
    radial-gradient(circle at 92% 92%, rgba(28, 31, 36,.09), transparent 48%),
    var(--bg);
}
.auth .flash { width: 100%; max-width: 440px; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(28, 31, 36, .04), 0 24px 48px -24px rgba(28, 31, 36, .25);
  padding: 2.25rem 2.25rem 2rem;
}
.auth-card h1 { font-size: 1.65rem; }
.auth-card .form { margin-top: 1.5rem; }
.auth-card .alert { margin-top: 1rem; }
.auth-card .btn-block { min-height: 48px; font-size: 1rem; margin-top: .25rem; }
.auth-logo { height: 42px; display: block; margin-bottom: 1.75rem; }
.error-card { max-width: 560px; }

/* Login: brand panel + form */
.auth:has(.auth-split) { padding: 0; display: block; background: var(--bg); }
.auth:has(.auth-split) > .flash { position: absolute; top: 1rem; right: 1rem; z-index: 2; width: auto; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem;
  padding: 3rem clamp(2rem, 5vw, 4.5rem);
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, .07), transparent 38%),
    linear-gradient(160deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
  color: #fff;
}
.auth-brand-logo { height: 42px; align-self: flex-start; }
.auth-brand-copy { max-width: 30rem; }
.auth-brand-copy h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; margin-bottom: 1rem; }
.auth-brand-copy p { color: var(--sidebar-text); font-size: 1.08rem; line-height: 1.6; max-width: 34ch; margin: 0; }
.auth-preview { display: flex; flex-direction: column; gap: .6rem; max-width: 26rem; }
.auth-preview-row {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card); color: var(--text);
  border-radius: 12px; padding: .7rem .9rem;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.45);
}
.auth-preview-row:nth-child(2) { margin-left: 1.5rem; opacity: .92; }
.auth-preview-row:nth-child(3) { margin-left: 3rem; opacity: .84; }
.auth-preview-row strong { flex: 1; font-weight: 650; font-size: .95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth-panel .auth-card { box-shadow: none; border: 0; background: transparent; padding: 0; max-width: 380px; }
.auth-panel .auth-logo { display: none; }

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; min-height: 100vh; align-content: start; }
  .auth-brand { padding: 1.5rem 1.25rem 1.75rem; gap: 1rem; }
  .auth-brand-copy h2 { font-size: 1.6rem; margin-bottom: .4rem; }
  .auth-brand-copy p { font-size: .95rem; }
  .auth-preview { display: none; }
  .auth-panel { padding: 2rem 1.25rem 3rem; align-items: flex-start; }
}

/* ---------- Small helpers ---------- */
.small { font-size: .82rem; }
.text-danger { color: var(--danger) !important; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.stack .card { margin-bottom: 0; }
.section-gap { margin-top: 1.25rem; }
.stat-icon-success { background: var(--success-soft); color: var(--success); }
.stat-icon-danger { background: var(--danger-soft); color: var(--danger); }
.card-note { background: var(--warning-soft); border-color: var(--warning-border); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 3rem 1.25rem; }
.empty-state .stat-icon { width: 56px; height: 56px; border-radius: 16px; margin-bottom: .5rem; }
.empty-state p { max-width: 42ch; }
.empty-state .btn { margin-top: .5rem; }
.vehicle.summary { border: 0; padding: 0; margin: .5rem 0 1rem; }

/* ---------- Status colors (one per status) ---------- */
.status-draft              { --s: var(--status-draft); --s-soft: var(--status-draft-soft); --s-text: var(--status-draft-text); }
.status-received           { --s: var(--status-received); --s-soft: var(--status-received-soft); --s-text: var(--status-received-text); }
.status-assigned           { --s: var(--status-assigned); --s-soft: var(--status-assigned-soft); --s-text: var(--status-assigned-text); }
.status-inspection         { --s: var(--status-inspection); --s-soft: var(--status-inspection-soft); --s-text: var(--status-inspection-text); }
.status-diagnosis          { --s: var(--status-diagnosis); --s-soft: var(--status-diagnosis-soft); --s-text: var(--status-diagnosis-text); }
.status-awaiting_approval  { --s: var(--status-awaiting_approval); --s-soft: var(--status-awaiting_approval-soft); --s-text: var(--status-awaiting_approval-text); }
.status-changes_requested  { --s: var(--status-changes_requested); --s-soft: var(--status-changes_requested-soft); --s-text: var(--status-changes_requested-text); }
.status-approved           { --s: var(--status-approved); --s-soft: var(--status-approved-soft); --s-text: var(--status-approved-text); }
.status-in_repair          { --s: var(--status-in_repair); --s-soft: var(--status-in_repair-soft); --s-text: var(--status-in_repair-text); }
.status-awaiting_parts     { --s: var(--status-awaiting_parts); --s-soft: var(--status-awaiting_parts-soft); --s-text: var(--status-awaiting_parts-text); }
.status-ready              { --s: var(--status-ready); --s-soft: var(--status-ready-soft); --s-text: var(--status-ready-text); }
.status-delivered          { --s: var(--status-delivered); --s-soft: var(--status-delivered-soft); --s-text: var(--status-delivered-text); }
.status-cancelled          { --s: var(--status-cancelled); --s-soft: var(--status-cancelled-soft); --s-text: var(--status-cancelled-text); }

.status {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .65rem; border-radius: 999px;
  background: var(--s-soft); color: var(--s-text, var(--s));
  font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
.status-lg { font-size: .88rem; vertical-align: middle; margin-left: .4rem; padding: .25rem .75rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--s); flex-shrink: 0; }

.order-number { font-weight: 600; color: var(--faint); font-size: .88rem; font-variant-numeric: tabular-nums; }
.order-number-lg { min-width: 3rem; font-size: 1rem; color: var(--brand-dark); font-weight: 700; }

/* ---------- Board ---------- */
.board-hint { margin: -.75rem 0 .9rem; }
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(276px, 1fr);
  gap: 1rem; overflow-x: auto; padding-bottom: 1rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.column {
  background: var(--surface-2); border-radius: var(--radius); padding: .75rem;
  display: flex; flex-direction: column; min-height: 200px; scroll-snap-align: start;
}
.column-head { display: flex; align-items: center; gap: .55rem; padding: .25rem .35rem .8rem; }
.column-head .dot { box-shadow: 0 0 0 3px var(--s-soft); }
.column-head h2 { font-size: .92rem; font-weight: 650; margin: 0; flex: 1; letter-spacing: -.005em; }
.count { background: var(--surface-2); border-radius: 999px; padding: 0 .55rem; font-weight: 650; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.column-body { display: flex; flex-direction: column; gap: .65rem; }
.column-empty {
  color: var(--faint); text-align: center; font-size: .86rem; padding: 1.6rem .5rem; margin: 0;
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
}

.order-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .15s;
}
.order-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-strong); }
.order-card.is-stale { border-color: var(--danger-border); box-shadow: 0 0 0 3px var(--danger-soft); }
.order-card.is-stale:hover { box-shadow: 0 0 0 3px var(--danger-soft), var(--shadow-lg); }
.order-card-link { display: flex; flex-direction: column; gap: .35rem; padding: .85rem .95rem .6rem; text-decoration: none; color: var(--text); border-radius: 12px 12px 0 0; }
.order-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.order-card-top .small { color: var(--faint); }
.order-vehicle { font-size: 1rem; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
.order-vehicle .muted { color: var(--faint); font-weight: 500; }
.order-meta { display: flex; align-items: center; gap: .5rem; font-size: .87rem; color: var(--muted); font-weight: 500; min-width: 0; }
.order-problem {
  margin: 0; font-size: .86rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stale-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--danger-soft); color: var(--danger); border-radius: 999px;
  padding: .1rem .5rem; font-size: .75rem; font-weight: 650; white-space: nowrap;
}
.order-card-actions {
  display: flex; align-items: center; gap: .4rem;
  padding: 0 .75rem .75rem;
}
.move-form { flex: 1; min-width: 0; }
.move-form select {
  min-height: 36px; padding: .3rem 1.8rem .3rem .6rem; font-size: .84rem; font-weight: 600; background-position: right .5rem center;
  border-color: var(--border); background-color: var(--surface);
}
.icon-btn.icon-btn-whatsapp { color: var(--whatsapp-text); background: var(--whatsapp-soft); }
.icon-btn.icon-btn-whatsapp:hover { background: var(--success-panel); color: var(--whatsapp-text); }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin: -.75rem 0 1.1rem; scrollbar-width: none; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .42rem .9rem; border-radius: 999px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--border);
  font-weight: 600; font-size: .87rem; text-decoration: none; color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--ink); }

/* ---------- Order page: status steps ---------- */
.status-form { gap: .9rem; margin-top: .75rem; }
.status-steps { display: flex; flex-wrap: wrap; gap: .5rem; }
.step {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .95rem; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.step:hover { border-color: var(--s); background: var(--s-soft); }
.step.current { background: var(--s-text, var(--s)); border-color: var(--s-text, var(--s)); color: var(--ink); box-shadow: none; }
.step.current .dot { background: var(--ink); }
.note-row { display: flex; gap: .5rem; }
.note-row input { flex: 1; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: .9rem 0 0; padding: 0; }
.timeline li { display: flex; gap: .85rem; position: relative; padding-bottom: 1.1rem; }
.timeline li:not(:last-child)::before {
  content: ''; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--border-strong);
}
.timeline .dot { margin-top: 7px; box-shadow: 0 0 0 3px var(--s-soft); }
.timeline strong { font-size: .92rem; font-weight: 600; display: block; }
.timeline-note { margin: .25rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .7rem; font-size: .9rem; }
/* Change history under an Actividad entry: field, BEFORE (struck through) → AFTER. */
.changes { list-style: none; margin: .3rem 0; padding: .4rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: .86rem; display: flex; flex-direction: column; gap: .2rem; }
.changes li { overflow-wrap: anywhere; }
.changes-field { color: var(--muted); margin-right: .25rem; }
.changes del { color: var(--danger-text); text-decoration-color: var(--danger); }
.changes ins { color: var(--success-text); text-decoration: none; font-weight: 600; }
.changes-arrow { color: var(--muted); margin: 0 .3rem; }

[hidden] { display: none !important; }
.text-success { color: var(--success) !important; }
.narrow-page { max-width: 820px; }
.two-col-wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
h3.sub { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.icon-btn { border: 0; background: none; cursor: pointer; }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning-text); }
.badge-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-text); }
.flash-warning { background: var(--warning-soft); color: var(--warning-text); }

/* Clickable info bar (low stock, settings links) */
.notice {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1.1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
  font-weight: 650; text-decoration: none; color: var(--text);
}
.notice span { flex: 1; }
.notice:hover { border-color: var(--border-hover); }
.notice > .icon:first-child { color: var(--brand-dark-2); }
.notice-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-text); }
.notice-warning > .icon:first-child { color: var(--warning); }

/* ---------- Order detail (lines + totals) ---------- */
.order-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.order-detail .card { margin-bottom: 0; }
.payment-form { gap: .75rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.line-section { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.line-section:first-of-type { border-top: 0; margin-top: .5rem; padding-top: 0; }
.line-section h3 { display: flex; align-items: center; gap: .4rem; font-size: 1rem; margin-bottom: .5rem; color: var(--brand-dark); }
.line-section h3 .icon { color: var(--brand-dark-2); }
.line-empty { color: var(--faint); font-size: .9rem; margin: 0 0 .5rem; }
.lines { list-style: none; margin: 0 0 .6rem; padding: 0; }
.line { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line-main small { color: var(--muted); font-size: .85rem; }
.line-total { font-weight: 650; font-variant-numeric: tabular-nums; }
.line-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem;
  background: var(--surface); border-radius: var(--radius-sm); padding: .6rem;
}
.line-form input, .line-form select { min-height: 38px; padding: .4rem .6rem; font-size: .92rem; }
.line-form .grow { flex: 1 1 200px; }
.line-form .span-all { flex: 1 1 100%; }
.line-form .mini { display: flex; flex-direction: column; gap: .1rem; width: 105px; }
.line-form .mini span { font-size: .75rem; font-weight: 650; color: var(--muted); }
.line-form select[name="kind"] { width: auto; }
.line-form .btn { min-height: 38px; }

.card > h2 + form, .card > h2 + .list, .card > h2 + .movements { margin-top: .75rem; }
.totals dd { padding-left: 1rem; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .45rem 0; margin: .75rem 0 1rem; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); font-weight: 700; }
.totals dd { margin: 0; text-align: right; font-weight: 700; }
.totals .sep { border-top: 1px solid var(--border); padding-top: .5rem; color: var(--text); }
.totals .grand { font-size: 1.35rem; font-weight: 700; color: var(--brand-dark); border-top: 2px solid var(--brand-dark); padding-top: .5rem; }
.totals-form { gap: .75rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.input-group { display: flex; gap: .4rem; }
.input-group input { flex: 1; min-width: 0; }
.input-group select { width: auto; }

/* ---------- Settings: logo ---------- */
.settings-logo { max-width: 820px; }
.logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--border); border-radius: 12px; padding: .4rem; background: #fff; }
.logo-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.logo-form { min-width: 0; max-width: 100%; }
.logo-form input[type="file"] { border: 1px dashed var(--border-strong); min-height: 0; padding: .45rem; width: auto; flex: 1 1 220px; min-width: 0; max-width: 100%; }

/* ---------- Plans and shops ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: .75rem; }
.plan-option {
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-start;
  border: 2px solid var(--border); border-radius: var(--radius-sm); padding: .9rem;
}
.plan-option.current { border-color: var(--selected); background: var(--selected-soft); }
.plan-option strong { font-size: 1.05rem; }
.plan-option ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; flex: 1; }
.plan-option li { display: flex; gap: .35rem; align-items: center; }
.plan-option li .icon { color: var(--success); }
.upsell { display: flex; gap: 1rem; align-items: center; }


/* ---------- Transactions ---------- */
.filter-bar { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.filter-bar .field { flex: 0 1 170px; }
.filter-bar .field.grow { flex: 1 1 220px; }
.method-totals { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; margin: -.25rem 0 1.25rem; font-size: .92rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab {
  padding: .6rem 1rem; text-decoration: none; font-weight: 650; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; gap: .4rem; align-items: center;
}
.tab.active { color: var(--text); border-bottom-color: var(--brand-dark); }
.tab .count { background: var(--surface-2); }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--muted); padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.table thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.table thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface); }
.table td { padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.replaced { text-decoration: line-through; color: var(--muted); }
.block-badge { display: inline-block; margin-top: .25rem; }
.block { display: block; }
.capitalize { text-transform: capitalize; }

/* ---------- Inventory ---------- */
.stock {
  min-width: 3.2rem; padding: .35rem .5rem; border-radius: 10px; text-align: center;
  background: var(--success-soft); color: var(--success-text); font-weight: 700; font-variant-numeric: tabular-nums;
}
.stock-low { background: var(--warning-soft); color: var(--warning-text); }
.stock-out { background: var(--danger-soft); color: var(--danger-text); }
.stock-lg { font-size: 1.8rem; padding: .4rem 1rem; }
.big-stock { display: flex; align-items: center; gap: 1rem; margin: .5rem 0; }
.part-side { flex-direction: row; align-items: center; gap: .6rem; }
.adjust-form { gap: .75rem; }
.inline-form { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.inline-form .field { flex: 0 1 260px; }
.movements { list-style: none; margin: 0; padding: 0; }
.movements li { display: flex; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.movements li:last-child { border-bottom: 0; }
.movements li div { display: flex; flex-direction: column; }
.movements small { font-size: .85rem; }
.move { min-width: 3.5rem; text-align: center; font-weight: 700; border-radius: 8px; padding: .15rem .4rem; height: fit-content; font-variant-numeric: tabular-nums; }
.move-in { background: var(--success-soft); color: var(--success-text); }
.move-out { background: var(--surface); color: var(--muted); }

/* ==========================================================
   Version 2: users, photos, documents, notifications, import, admin
   ========================================================== */
.block { display: block; }
.pad { padding: .5rem 1rem; }
.alert-success-soft { background: var(--success-soft); color: var(--success-text); font-weight: 600; }
.alert-warning-soft { background: var(--warning-soft); color: var(--warning-text); font-weight: 700; }
.alert-info-soft { background: var(--info-soft); color: var(--info-text); font-weight: 600; }
.highlight-card { border: 2px solid var(--brand-dark-2); }
.collapsible { border-top: 1px solid var(--border); padding-top: .75rem; }
.collapsible > summary { cursor: pointer; font-weight: 650; color: var(--brand-dark-2); padding: .25rem 0; }
.collapsible[open] > summary { margin-bottom: .75rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Share link box */
.share-link { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; min-width: 0; font-size: .85rem; background: var(--surface); }
.share-actions { display: flex; gap: .5rem; flex-wrap: wrap; }


/* Roles */
.role-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.role-owner { background: var(--role-owner-soft); color: var(--role-owner); }
.role-manager { background: var(--role-manager-soft); color: var(--role-manager); }
.role-advisor { background: var(--role-advisor-soft); color: var(--role-advisor); }
.role-badges { display: inline-flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.role-mechanic { background: var(--role-mechanic-soft); color: var(--role-mechanic); }
.role-picker { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.role-picker label { display: flex; gap: .6rem; align-items: flex-start; border: 2px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem; cursor: pointer; }
.role-picker label:has(input:checked) { border-color: var(--selected); background: var(--selected-soft); }
.role-picker input { width: 18px; height: 18px; min-height: 0; margin-top: .2rem; accent-color: var(--brand-dark); }
.role-picker span { display: flex; flex-direction: column; }
.role-picker small { color: var(--muted); font-size: .82rem; }

.user-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.user-row { border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: 0; }
.user-row.inactive { opacity: .6; }
.user-row summary { display: flex; align-items: center; gap: .75rem; padding: .7rem .2rem; cursor: pointer; list-style: none; }
.user-row summary::-webkit-details-marker { display: none; }
.user-edit { padding: .25rem 0 .5rem 3.2rem; gap: .75rem; }
.reset-form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: 0 0 .9rem 3.2rem; }
.invite-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; margin-top: .75rem; }

/* Notifications */
.list form { margin: 0; }
button.list-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.notif.unread { background: var(--selected-soft); }
.notif-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface); color: var(--brand-dark); flex-shrink: 0; }
.notif-assigned { background: var(--role-mechanic-soft); color: var(--role-mechanic); }
.notif-stale { background: var(--danger-soft); color: var(--danger); }
.notif-low_stock { background: var(--warning-soft); color: var(--warning); }
.notif-announcement { background: var(--neutral-soft); color: var(--brand-dark-2); }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-dark); flex-shrink: 0; }

/* Files and documents */
.files { list-style: none; margin: .5rem 0; padding: 0; }
.file-row { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.file-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--surface); display: grid; place-items: center; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-icon { font-weight: 700; font-size: .75rem; color: var(--danger); }
.upload-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--surface); border-radius: var(--radius-sm); padding: .6rem; margin-top: .5rem; }
.upload-form input[type="file"] { flex: 1 1 220px; min-height: 0; padding: .45rem; background: var(--input); }
.upload-form input[type="text"] { flex: 1 1 220px; min-height: 38px; padding: .4rem .6rem; }
.upload-form .field { flex: 1 1 100%; }
.upload-form .hint { flex-basis: 100%; }

/* Photos */
.photo-upload { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.photo-upload input[type="text"] { flex: 1 1 200px; }
.photo-upload .hint { flex-basis: 100%; }
.photo-input {
  display: flex; align-items: center; gap: .5rem .75rem; cursor: pointer; flex: 1 1 100%; flex-wrap: wrap; min-width: 0;
  border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: .9rem 1rem; font-weight: 600; color: var(--brand-dark);
  background: var(--surface); transition: border-color .15s, background .15s;
}
.photo-input:hover { border-color: var(--brand-dark-2); background: var(--selected-soft); }
.photo-input .icon { color: var(--brand-dark-2); }
.photo-input input { border: 0; padding: 0; min-height: 0; font-size: .85rem; width: auto; flex: 1 1 180px; min-width: 0; max-width: 100%; background: transparent; box-shadow: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-top: .5rem; }
.photo-wrap { position: relative; }
.photo { margin: 0; position: relative; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--surface); }
.photo figcaption { font-size: .72rem; color: var(--muted); margin-top: .2rem; line-height: 1.3; }
.photo-pick { position: absolute; top: .35rem; left: .35rem; background: rgba(255,255,255,.92); border-radius: 6px; padding: .15rem; display: flex; z-index: 1; }
.photo-pick input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--brand-dark); }
.photo-note { font-size: .8rem; margin: .15rem 0 0; }
.photo-delete { position: absolute; top: .3rem; right: .3rem; }
.photo-delete .icon-btn { background: rgba(255,255,255,.9); width: 28px; height: 28px; }
.photo-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.photo-timeline > li { border-left: 3px solid var(--s); padding-left: .9rem; }

/* Check-in */
.checkin-facts { display: flex; gap: 2rem; flex-wrap: wrap; margin: .5rem 0; }
.checkin-facts > div { display: flex; flex-direction: column; gap: .2rem; }
.fuel { display: inline-flex; align-items: center; gap: 3px; }
.fuel i { width: 16px; height: 14px; border-radius: 3px; background: var(--border); }
.fuel i.on { background: var(--success); }
.fuel b { margin-left: .4rem; font-size: .9rem; }
.fuel-picker { display: flex; gap: .35rem; }
.fuel-picker label { flex: 1; }
.fuel-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.fuel-picker span {
  display: block; text-align: center; padding: .55rem .2rem; border: 2px solid var(--border); border-radius: 8px;
  font-weight: 650; cursor: pointer; min-height: 44px;
}
.fuel-picker input:checked + span { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--ink); }
.fuel-picker input:focus-visible + span { outline: 3px solid var(--focus); }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span { display: block; padding: .55rem .9rem; font-weight: 700; cursor: pointer; }
.segmented input:checked + span { background: var(--brand-dark); color: var(--ink); }

/* Activity */
.audit { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.audit li { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.audit li:last-child { border-bottom: 0; }

/* Mechanic view (phone first) */
.mech { max-width: 720px; }
.mech-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin: .25rem 0 1rem; }
.mech-head h1 { margin: .1rem 0 .35rem; }
.big-text { font-size: 1.1rem; }
.mech-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.mech-steps .step { justify-content: flex-start; text-align: left; min-height: 52px; }
.mech-list { display: grid; gap: .75rem; }
.mech-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.05rem 1.15rem 1.05rem 1.4rem; box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.mech-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--s); }
.mech-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.mech-card:active { transform: scale(.99); }
.mech-card.is-stale { border-color: var(--danger-border); box-shadow: 0 0 0 3px var(--danger-soft); }
.mech-card-top { display: flex; justify-content: space-between; align-items: center; }
.mech-vehicle { font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }

/* Import */
.steps-bar { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 1.25rem; counter-reset: step; flex-wrap: wrap; }
.steps-bar li {
  counter-increment: step; padding: .4rem .85rem; border-radius: 999px; background: var(--card); border: 1px solid var(--border);
  font-weight: 700; font-size: .85rem; color: var(--muted);
}
.steps-bar li::before { content: counter(step) '. '; }
.steps-bar li.active { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--ink); }
.steps-bar li.done { color: var(--success); border-color: var(--success-border); }
.map-row { display: grid; grid-template-columns: 200px 20px minmax(0, 1fr); gap: .75rem; align-items: center; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.map-row > .icon { transform: rotate(180deg); color: var(--muted); }
.import-badge { display: inline-block; font-size: .75rem; font-weight: 650; padding: .1rem .5rem; border-radius: 999px; }
.import-ok { background: var(--success-soft); color: var(--success-text); }
.import-warning { background: var(--warning-soft); color: var(--warning-text); }
.import-duplicate { background: var(--surface); color: var(--muted); }
.import-error { background: var(--danger-soft); color: var(--danger-text); }
.preview-table td { font-size: .88rem; }
.preview-table tr.row-error, .preview-table tr.row-duplicate { opacity: .7; }
.cell-missing { background: var(--danger-soft); }

/* Inventory search */
.part-search { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.part-search .field { flex: 1 1 140px; }
.part-search .field.grow { flex: 3 1 260px; }
.part-search .narrow-input { flex: 0 1 100px; }
.part-search .search-hint { flex-basis: 100%; }
.line-form .year-input { width: 110px; }

/* Settings shortcuts */
.settings-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; margin-bottom: 1.25rem; }
.settings-links .notice { margin-bottom: 0; }

/* Admin */
.pay { display: inline-block; font-size: .78rem; font-weight: 650; padding: .1rem .55rem; border-radius: 999px; }
.pay-current { background: var(--success-soft); color: var(--success-text); }
.pay-pending { background: var(--warning-soft); color: var(--warning-text); }
.pay-overdue { background: var(--danger-soft); color: var(--danger-text); }
.row-paused td { opacity: .6; }
.staff-rows { display: grid; gap: .4rem; }
.staff-row { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: .4rem; }
.onboarding h2 { color: var(--brand-dark); }
.paused-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.paused-card .auth-logo { margin-bottom: .5rem; }

/* Public shared photos */
.shared-page { padding: 1.5rem 1rem 3rem; max-width: 900px; margin: 0 auto; }
.shared-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.shared-head h1 { margin: 0; }
.shared-head .r-logo { width: 56px; height: 56px; object-fit: contain; }
.shared-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.shared-photos figure { margin: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.shared-photos img { width: 100%; display: block; }
.shared-photos figcaption { padding: .6rem .8rem; font-size: .85rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.shared-page .r-made { display: flex; justify-content: center; gap: .3rem; color: var(--muted); font-size: .8rem; margin-top: 2rem; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 1100px) {
  .order-detail { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .two-col .card { margin-bottom: 0; }
}

@media (max-width: 760px) {
  .move-form select { min-height: 44px; font-size: .92rem; }
  .order-card-actions .icon-btn { width: 44px; height: 44px; }
  .btn { min-height: 48px; }
  .btn-sm { min-height: 40px; }
  .page-head > .btn, .page-head .actions { width: 100%; }
  .page-head > .btn-primary { justify-content: center; }
  h1 { font-size: 1.45rem; }
  .card { padding: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .list-side { display: none; }
  .search .btn { display: none; }
  .board { grid-auto-columns: 82%; margin: 0 -1rem; padding: 0 1rem 1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat { padding: .9rem 1rem; column-gap: .5rem; }
  .stat-icon { width: 32px; height: 32px; border-radius: 9px; }
  .stat-icon svg { width: 17px; height: 17px; }
  .stat-value { font-size: 1.55rem; }
  .stat-label { font-size: .8rem; line-height: 1.2; }
  .note-row { flex-direction: column; }
  .status-steps .step { flex: 1 1 45%; justify-content: flex-start; text-align: left; }
  .column.is-empty { display: none; }
  .plan-grid { grid-template-columns: 1fr; }
  .order-row { flex-wrap: wrap; row-gap: .3rem; }
  .order-row > .icon { display: none; }
  .order-row .list-main { flex: 1 1 calc(100% - 4rem); }
  .order-row .list-side { display: flex; flex-direction: row; align-items: center; gap: .6rem; max-width: none; margin-left: 3.9rem; }
  .part-row .list-side { display: flex; }
  .line-form .mini { flex: 1 1 40%; width: auto; }
  .line-form .btn { flex: 1 1 100%; }
  .map-row { grid-template-columns: 1fr; gap: .25rem; }
  .map-row > .icon { display: none; }
  .staff-row { grid-template-columns: 1fr 1fr; }
  .staff-row input:first-child { grid-column: 1 / -1; }
  .user-edit, .reset-form { padding-left: 0; }
  .mech-head { flex-direction: column; }
  .checkin-facts { gap: 1rem; }
  .vehicle { flex-wrap: wrap; }
  .vehicle .btn-sm { order: 3; flex-basis: 100%; }
  .auth-card { padding: 1.75rem 1.4rem; }
}

/* Activity: note form above the timeline */
.note-form { gap: .6rem; margin: .75rem 0 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.note-form textarea { min-height: 64px; }
.note-form-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.timeline li.event-note .dot { background: var(--surface); border: 2px solid var(--s); }

/* Owner summary */
.section-title { font-size: 1rem; color: var(--muted); font-weight: 600; margin: 1.5rem 0 .75rem; }
.summary-card .stats { margin-bottom: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .summary-card .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-now { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.chip-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* ==========================================================
   Round 3: intake, workflow, estimates
   ========================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.center { text-align: center; }
.right { text-align: right; }


.intake-search input { font-size: 1.05rem; }
/* The × that empties the search box (big enough to tap). */
.search-clear { flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.search-clear:hover { background: var(--border); color: var(--text); }
.intake-results { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.intake-customer { margin-bottom: 0; }
.intake-customer .vehicle { align-items: center; }

/* VIN */
.vin-row { display: flex; gap: .5rem; }
.vin-row input { flex: 1; min-width: 0; letter-spacing: .06em; font-weight: 600; }
.scan-button { margin-top: .5rem; min-height: 52px; border-style: dashed; }
.vin-scanner { margin-top: .75rem; border-radius: 12px; overflow: hidden; background: #000; position: relative; text-align: center; padding-bottom: .75rem; }
.vin-scanner video { width: 100%; max-height: 50vh; object-fit: cover; display: block; }
.vin-scanner-tip { color: #fff; margin: .5rem 0; font-size: .9rem; }
.vin-result { margin: .35rem 0 0; font-size: .9rem; font-weight: 600; }
.vin-result:empty { display: none; }
.vin-result-ok { color: var(--success); }
.vin-result-warning { color: var(--warning-text); }
.vin-result-error { color: var(--danger); }

/* Intake helpers */
.progress { height: 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--success); border-radius: inherit; transition: width .3s var(--ease); }
.intake-next { display: flex; flex-direction: column; gap: .4rem; }
.collapsible-card > summary { cursor: pointer; font-weight: 650; }
.collapsible-card[open] > summary { margin-bottom: .75rem; }

/* Customer request */
.intake-request { max-width: 820px; gap: 0; }
.service-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.service-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.service-chip span {
  display: inline-flex; align-items: center; gap: .35rem; padding: .6rem .95rem; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card); font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.service-chip input:checked + span { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--ink); }
.service-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.service-price { font-weight: 750; }
.service-total { margin: .75rem 0 .25rem; font-size: 1.05rem; }
.service-total strong { font-size: 1.2rem; }
.service-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }

/* Workflow banner and one-time notices */
.workflow {
  display: flex; align-items: center; gap: .75rem; margin: -.5rem 0 1.25rem; padding: .8rem 1rem;
  border-radius: var(--radius-sm); background: var(--s-soft); color: var(--s-text, var(--text));
}
.workflow p { margin: 0; }
.workflow .dot { box-shadow: 0 0 0 4px rgba(255,255,255,.6); }
.notice-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-color: var(--success-border); background: var(--success-panel); }
.notice-card h2 { display: flex; align-items: center; gap: .4rem; margin: 0; }
.notice-card p { margin: .2rem 0 0; }
.notice-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.step:disabled { opacity: .45; cursor: not-allowed; background: var(--surface); }
.step:disabled:hover { border-color: var(--border-strong); background: var(--surface); }
span.step.current { cursor: default; }
.status-reasons { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .84rem; }
.status-reasons li { display: flex; align-items: center; gap: .35rem; }

/* Estimate */
.estimate-link { display: flex; flex-direction: column; gap: .5rem; padding: .9rem; margin: .75rem 0; border-radius: var(--radius-sm); background: var(--success-panel); border: 1px solid var(--success-border); }
.estimate-lines .line { flex-wrap: wrap; }
.price-form { display: flex; gap: .3rem; align-items: center; }
.price-form input { width: 96px; min-height: 36px; padding: .3rem .5rem; text-align: right; }
.price-form input.needs-price { border-color: var(--warning-border); background: var(--warning-soft); }
.estimate-total { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0; margin: 0 0 .75rem; border-top: 1px solid var(--brand-dark); font-size: 1.05rem; }
.estimate-total strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.approval-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; background: var(--surface); color: var(--muted); }
.approval-badge.approval-pending { background: var(--warning-soft); color: var(--warning-text); }
.approval-badge.approval-approved { background: var(--success-soft); color: var(--success-text); }
.approval-badge.approval-declined { background: var(--danger-soft); color: var(--danger); }
.approval-badge.approval-after { background: var(--neutral-soft); color: var(--brand-dark-2); }
.line.approval-declined .line-main strong, .line.approval-declined .line-total { text-decoration: line-through; color: var(--faint); }
.estimate-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; font-size: .9rem; }
.estimate-history li { padding-bottom: .6rem; border-bottom: 1px dashed var(--border); }
.estimate-add { gap: .5rem; padding-top: .9rem; margin-top: .9rem; border-top: 1px solid var(--border); }
.badge.estimate-sent { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.badge.estimate-approved, .badge.estimate-partial { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.badge.estimate-changes_requested { background: var(--status-changes_requested-soft); color: var(--status-changes_requested-text); border-color: transparent; }
.reception-card .checkin-facts { margin: 1rem 0 .5rem; }

/* Public pages (estimate for the customer) */
.public-page { width: 100%; max-width: 680px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.public-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.public-head h1 { margin: 0; font-size: 1.4rem; }
.public-head p { margin: 0; }
.public-head .r-logo { width: 52px; height: 52px; object-fit: contain; }
.estimate-items { list-style: none; margin: .5rem 0; padding: 0; }
.estimate-items li { border-bottom: 1px solid var(--border); padding: .2rem 0; }
.estimate-item { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; cursor: pointer; }
.estimate-item input { width: 24px; height: 24px; min-height: 0; accent-color: var(--brand-dark); flex-shrink: 0; }
.estimate-item-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.estimate-item-main small { color: var(--muted); }
.estimate-item-price { font-weight: 650; font-variant-numeric: tabular-nums; }
.estimate-items li.approval-declined .estimate-item-main strong, .estimate-items li.approval-declined .estimate-item-price { text-decoration: line-through; color: var(--faint); }
.estimate-actions { display: grid; gap: .5rem; }
.estimate-actions .btn { min-height: 52px; font-size: 1.02rem; }
.answer-box { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.auth .public-page .card { width: 100%; }

@media (max-width: 760px) {
  .vin-row { flex-direction: column; }
  .notice-actions, .notice-actions .btn, .notice-actions form { width: 100%; }
  .price-form input { width: 84px; }
}

.reception-card .photo-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .45rem; }
.reception-card .photo figcaption { font-size: .68rem; }

/* Local testing: switch user (only on your computer) */
.switch-user { display: flex; flex-direction: column; gap: .3rem; padding: .6rem; margin: .1rem 0 .3rem; border: 1px dashed var(--warning-border); border-radius: var(--radius-sm); background: var(--warning-soft); }
.switch-user label { display: flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 650; color: var(--warning-text); }
.switch-user select { min-height: 36px; padding: .3rem 1.8rem .3rem .5rem; font-size: .82rem; }

/* Errors: a light box with a warning icon, never a solid red block (so they don't look like buttons). */
.alert-error, .flash-error {
  display: flex; align-items: flex-start; gap: .6rem;
  background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--danger-text);
}
.alert-error::before, .flash.flash-error::before {
  content: ""; flex-shrink: 0; width: 18px; height: 18px; margin-top: .1rem; border-radius: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L1.8 18a2 2 0 001.7 3h17a2 2 0 001.7-3L13.7 3.9a2 2 0 00-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L1.8 18a2 2 0 001.7 3h17a2 2 0 001.7-3L13.7 3.9a2 2 0 00-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.alert-error > .icon:first-child { display: none; }

/* Storage warning (owners) */
.storage-banner { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); border: 1px solid var(--warning-border); background: var(--warning-soft); color: var(--warning-text); }
.storage-banner p { margin: .1rem 0 0; font-size: .9rem; }
.storage-banner > div { flex: 1; }
.storage-banner.storage-100 { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger-text); }
/* Admin price box */
.money-input { display: flex; align-items: center; gap: .4rem; }
.money-input span { color: var(--muted); font-weight: 600; }
.price-breakdown { margin-top: .5rem; }
.discount-picker { width: 100%; }
.discount-picker label { flex: 1; text-align: center; }
.admin-legacy { margin: -.75rem 0 1rem; }

/* Billing (Admin Mekora) */
.pay-due_soon { background: var(--warning-soft); color: var(--warning-text); }
.pay-paused { background: var(--neutral-soft); color: var(--brand-dark-2); }
.billing-history .line { gap: .4rem; }
.month-bars { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.month-bars li { display: grid; grid-template-columns: 130px 1fr auto; gap: .75rem; align-items: center; font-size: .92rem; }
.month-label { color: var(--muted); text-transform: capitalize; }
.month-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.month-bar span { display: block; height: 100%; background: var(--brand-dark); border-radius: inherit; }
.billing-receipt-logo { height: 40px; }
.billing-receipt h1 { margin: .2rem 0; }

/* Paused / canceled shops: read-only. The server refuses changes (readOnlyGuard); here we hide what can't be used. */
.archive-banner { display: flex; align-items: flex-start; gap: .85rem; flex-wrap: wrap; padding: 1rem 1.1rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); background: var(--sidebar-bg); color: #fff; }
.archive-banner > .icon { margin-top: .15rem; color: var(--warning); }
.archive-banner > div:first-of-type { flex: 1 1 280px; }
.archive-banner p { margin: .2rem 0 0; color: var(--sidebar-text); font-size: .92rem; }
.archive-banner strong { color: #fff; }
.read-only .main form[method="post"]:not([data-read-only-ok]),
.read-only .main a[href="/intake"], .read-only .main a[href^="/intake/"], .read-only .main a[href$="/new"], .read-only .main a[href$="/edit"],
.read-only .topbar-cta, .read-only .bn-cta, .read-only .main .note-form, .read-only .main [data-share-photos] { display: none !important; }

/* Exportar mis datos */
.export-contents { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.export-contents li { display: flex; gap: .5rem; align-items: center; }
.export-list { list-style: none; padding: 0; margin: 0; }
.export-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--border, #e5e7eb); }
.export-item:first-child { border-top: 0; }
.export-item > div:first-child { display: grid; gap: .15rem; }
.export-actions, .export-downloads { display: flex; flex-wrap: wrap; gap: .5rem; }
.export-downloads { margin: 1rem 0; }

/* Hojas y firmas (order card) */
.badge-success { background: var(--success-soft); border-color: transparent; color: var(--success-text); }
.sign-docs { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem; }
.sign-doc { border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; display: grid; gap: .4rem; }
.sign-doc.is-signed { border-color: var(--success-border); background: var(--success-panel); }
.sign-doc p { margin: 0; }
.sign-doc-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sign-doc-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.sign-doc-actions form.inline-form { display: contents; }
.sign-paper { flex-basis: 100%; }
.sign-paper > summary { list-style: none; display: inline-flex; cursor: pointer; }
.sign-paper > summary::-webkit-details-marker { display: none; }
.sign-paper[open] > summary { margin-bottom: .6rem; }
.sign-paper .form { max-width: 420px; }
.sign-link { border-top: 1px dashed var(--border-strong); padding-top: .6rem; }
.btn-lg { min-height: 52px; padding: .75rem 1.4rem; font-size: 1.05rem; }

/* Signing page (shop tablet or customer's phone) */
.sign-page { padding-bottom: 2rem; }
.sign-layout { max-width: 1280px; margin: 0 auto; display: grid; gap: 1rem; }
.sign-sheet .receipt { max-width: none; }
.sign-pad-card { display: grid; gap: .8rem; align-content: start; }
.sign-pad-card h2 { margin: 0; }
.sign-pad-card input[type="text"] { font-size: 1.1rem; min-height: 52px; }
.sign-pad { position: relative; border: 2px dashed var(--border-strong); border-radius: 14px; background: #fff; overflow: hidden; }
.sign-pad canvas { display: block; width: 100%; height: clamp(200px, 32vh, 340px); touch-action: none; cursor: crosshair; }
.sign-pad-hint { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 2.2rem; border-top: 1.5px solid var(--border-strong); padding-top: .35rem; color: var(--faint); font-size: .9rem; pointer-events: none; }
.has-signature .sign-pad-hint { color: transparent; }
.sign-actions { display: grid; grid-template-columns: 1fr 2fr; gap: .75rem; }
.sign-message { max-width: 820px; margin: 0 auto 1rem; text-align: center; }
.sign-thanks { border-top: 4px solid var(--success); }
.sign-thanks h1 { font-size: 1.4rem; margin: .25rem 0 .4rem; }
/* Tablet landscape and desktop: the sheet on the left, the pad stays in view on the right. */
@media (min-width: 1000px) {
  .sign-layout { grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); align-items: start; }
  .sign-pad-card { position: sticky; top: 1rem; }
  .sign-pad canvas { height: clamp(220px, 38vh, 380px); }
}

/* Tablets (iPad): portrait 768–834px and landscape 1024–1180px. */
@media (min-width: 761px) and (max-width: 1100px) {
  .main { padding: 1.6rem 1.5rem 3rem; }
}
/* Touch screens: large tap targets, and 16px+ text in fields so iPad/iPhone don't zoom in. */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .btn-sm { min-height: 42px; padding-left: .95rem; padding-right: .95rem; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { min-height: 48px; font-size: 16px; }
  textarea { font-size: 16px; }
  .chip { min-height: 42px; }
  .nav a { min-height: 46px; }
  .sign-actions .btn { min-height: 56px; }
}

/* Home screens: the big "Recibir vehículo" button */
.home-cta {
  display: flex; align-items: center; gap: 1rem; margin: 0 0 1.1rem; padding: .9rem 1.1rem;
  background: var(--accent); color: var(--accent-text); text-decoration: none; border-radius: 16px; box-shadow: var(--shadow-accent);
  transition: background .15s, transform .15s;
}
.home-cta:hover { background: var(--accent-hover); }
.home-cta:active { transform: scale(.99); }
.home-cta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.home-cta strong { font-size: 1.2rem; letter-spacing: -.01em; }
.home-cta small { font-size: .88rem; opacity: .88; }
.home-cta-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(30, 45, 59, .12); display: grid; place-items: center; flex-shrink: 0; }
.read-only .home-cta { display: none; }
@media (max-width: 760px) {
  .home-cta { padding: 1.05rem 1rem; }
  .home-cta strong { font-size: 1.3rem; }
}

/* ---------- Órdenes: split screen (list on the left, the selected order on the right) ---------- */
.main:has(> .split) { max-width: none; padding: 0; }
.main:has(> .split) > .flash, .main:has(> .split) > .storage-banner, .main:has(> .split) > .archive-banner { margin: .75rem 1rem 0; }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - 58px); min-height: 520px; }

.olist { background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.olist-head { padding: .8rem .8rem .55rem; border-bottom: 1px solid var(--border); display: grid; gap: .55rem; }
.olist-search { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 .7rem; background: var(--input); color: var(--faint); }
.olist-search:focus-within { box-shadow: var(--ring); border-color: var(--focus); }
.olist-search input { border: 0; padding: .5rem 0; min-height: 40px; flex: 1; min-width: 0; background: transparent; box-shadow: none !important; }
.olist-chips { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin: 0 -.8rem; padding: 0 .8rem 2px; }
.olist-chips .chip { flex-shrink: 0; }
.olist-chips .chip b { font-weight: 700; color: var(--faint); margin-left: .15rem; }
.olist-chips .chip.active b { color: var(--ink); }
.olist-count { margin: 0; font-size: .78rem; color: var(--faint); }
.olist .empty { padding: 1.5rem 1rem; }
.olist-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; align-items: center; padding: .65rem .8rem .65rem 1rem; border-bottom: 1px solid var(--surface-2); text-decoration: none; color: var(--text); position: relative; }
.orow::before { content: ""; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--s, transparent); }
.orow:hover { background: var(--surface); }
.orow.is-selected { background: var(--selected-soft); }
.orow.is-selected::before { background: var(--text); }
.orow-title { font-weight: 700; display: flex; gap: .35rem; min-width: 0; font-size: .93rem; }
.orow-n { color: var(--faint); flex-shrink: 0; }
.orow .status { justify-self: end; font-size: .72rem; }
.orow-sub { display: flex; gap: .4rem; align-items: center; font-size: .82rem; color: var(--muted); min-width: 0; }
.orow-when { font-size: .75rem; color: var(--faint); text-align: right; white-space: nowrap; }

.od { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.od-empty { display: grid; place-items: center; padding: 2rem; }
.od-placeholder { text-align: center; max-width: 340px; display: grid; justify-items: center; gap: .3rem; }
.od-placeholder h2 { margin: .5rem 0 0; }
.od-head { background: var(--card); border-bottom: 1px solid var(--border); padding: .8rem 1.25rem 0; box-shadow: 0 6px 14px -12px rgba(28, 31, 36, .25); position: relative; z-index: 5; flex-shrink: 0; }
.od-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.od-top h1 { font-size: 1.35rem; margin: 0; }
.od-meta { margin: 0; }
.od-back { display: none; align-items: center; gap: .2rem; color: var(--brand-dark-2); font-weight: 650; text-decoration: none; margin-left: -.3rem; }
.od-facts { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: .9rem; margin: .7rem 0; }
.od-fact { display: flex; gap: .6rem; align-items: center; min-width: 0; }
.od-fact-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--neutral-soft); display: grid; place-items: center; color: var(--brand-dark-2); flex-shrink: 0; }
.od-fact-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.od-fact-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-fact-text small { color: var(--muted); display: flex; gap: .35rem; align-items: center; white-space: nowrap; overflow: hidden; }
.od-assign select { min-height: 34px; padding: .2rem 2rem .2rem .6rem; font-weight: 600; width: 100%; }
.od-bar { display: flex; gap: .9rem; align-items: center; margin-bottom: .7rem; }
.od-note { flex: 1; min-width: 0; display: flex; gap: .55rem; align-items: flex-start; background: var(--warning-soft); border: 1px solid var(--warning-border); border-radius: 10px; padding: .45rem .7rem; text-decoration: none; color: var(--text); font-size: .88rem; line-height: 1.35; }
.od-note .avatar { width: 24px; height: 24px; font-size: .7rem; flex-shrink: 0; background: var(--avatar); }
.od-note-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.od-note-empty { background: var(--surface); border-style: dashed; border-color: var(--border-strong); color: var(--muted); align-items: center; font-weight: 600; }
.od-actions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.od-actions .inline-form { display: contents; }
.btn-icon { width: 40px; padding: 0; justify-content: center; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.od-menu .menu-panel { left: auto; right: 0; }
.od-status-panel { min-width: 380px; padding: .8rem; }
.od-status-panel .muted { margin: 0 0 .5rem; }
.menu-note { display: flex; gap: .5rem; align-items: center; padding: .5rem .7rem; color: var(--muted); font-size: .85rem; }
.od-tabs { display: flex; gap: .15rem; margin: 0 -.25rem; overflow-x: auto; scrollbar-width: none; }
.od-tab { padding: .6rem .9rem; font-weight: 650; color: var(--muted); text-decoration: none; border-bottom: 2.5px solid transparent; display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; font-size: .92rem; }
.od-tab b { font-weight: 650; font-size: .75rem; background: var(--neutral-soft); color: var(--brand-dark-2); border-radius: 999px; padding: 0 .45rem; }
.od-tab:hover { color: var(--text); }
.od-tab.active { color: var(--text); border-bottom-color: var(--text); }
.od-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem 2rem; }
.od-body > .workflow { margin-bottom: .9rem; }
.od-panel + .od-panel { margin-top: 1.25rem; }
.od-panel[hidden] { display: none !important; }
.od-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: .9rem; align-items: start; }
.od-grid .stack { gap: .9rem; }
.od-grid .card { padding: .85rem 1rem; }
.od-grid .card h2 { font-size: 1rem; }
.od-label { font-size: .72rem !important; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .45rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.od-label .link { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--brand-dark-2); }
.od-label-text { display: inline-flex; align-items: center; gap: .4rem; }
/* Each section of the order has its own color: a thin top line, the icon and a faint wash behind the title. */
.sec { --sec: var(--faint); --sec-soft: var(--surface-3); border-top: 3px solid var(--sec); background: linear-gradient(var(--sec-soft), var(--card) 3.2rem); }
.sec h2 .icon { color: var(--sec); }
.sec .od-label { color: color-mix(in srgb, var(--sec) 80%, var(--text)); }
.sec-request    { --sec: var(--sec-request);    --sec-soft: var(--sec-request-soft); }
.sec-diagnosis  { --sec: var(--sec-diagnosis);  --sec-soft: var(--sec-diagnosis-soft); }
.sec-checkin    { --sec: var(--sec-checkin);    --sec-soft: var(--sec-checkin-soft); }
.sec-estimate   { --sec: var(--sec-estimate);   --sec-soft: var(--sec-estimate-soft); }
.sec-payments   { --sec: var(--sec-payments);   --sec-soft: var(--sec-payments-soft); }
.sec-signatures { --sec: var(--sec-signatures); --sec-soft: var(--sec-signatures-soft); }
/* The order's status shows as a colored line on the left and top of its header. */
.od-head[class*="status-"] { border-top: 4px solid var(--s); box-shadow: inset 4px 0 0 var(--s), 0 6px 14px -12px rgba(28, 31, 36, .25); }
.od-box p { margin: 0; }
.od-kv { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; font-size: .9rem; }
.od-kv dt { color: var(--muted); }
.od-kv dd { margin: 0; font-weight: 650; text-align: right; }
.od-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .6rem; }
.od-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: block; }
.od-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-thumb b { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(28, 31, 36, .5); color: #fff; font-size: .95rem; }
.od-lines { width: 100%; border-collapse: collapse; font-size: .88rem; }
.od-lines td { padding: .25rem 0; border-bottom: 1px dashed var(--border); }
.od-lines td.num { text-align: right; font-weight: 650; white-space: nowrap; padding-left: .5rem; }
.od-lines tr:last-child td { border-bottom: 0; }
.od-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; border-top: 1px solid var(--border); margin: .5rem 0 .35rem !important; padding-top: .45rem; }
.od-total strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.od-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.od-recent li { display: grid; grid-template-columns: 8px 1fr auto; gap: .5rem; align-items: baseline; font-size: .85rem; }
.od-recent .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s, var(--border-strong)); transform: translateY(1px); }
.od-recent time { font-size: .75rem; white-space: nowrap; }
.sign-compact .btn-label { display: none; }
.sign-compact .sign-docs { margin-top: .2rem; gap: .5rem; }
.sign-compact .sign-doc { padding: .5rem .65rem; gap: .3rem; }
.sign-compact .sign-doc-actions .btn-sm { width: 36px; min-height: 36px; padding: 0; justify-content: center; }
.sign-compact .sign-paper { flex-basis: auto; }
/* The sheet to sign next: its button is the only red one and keeps its label. */
.sign-doc.is-next { border-color: var(--border-hover); box-shadow: inset 3px 0 0 var(--text); }
.sign-compact .sign-doc.is-next .btn-primary { width: auto; padding: 0 .7rem; }
.sign-compact .sign-doc.is-next .btn-primary .btn-label { display: inline; }
.sign-compact .sign-paper[open] { flex-basis: 100%; }

@media (max-width: 1240px) {
  .split { grid-template-columns: 300px minmax(0, 1fr); }
  .od-facts { gap: .7rem; }
}
@media (max-width: 1140px) {
  .od-grid { grid-template-columns: 1fr 1fr; }
  .od-grid > .stack:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
}
/* Tablet portrait and phone: list first, tap an order to open it full width. */
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split:not(.split-list-only) > .olist { display: none; }
  .split-list-only > .od-empty { display: none; }
  .split-list-only > .olist { border-right: 0; }
  .od-back { display: inline-flex; }
}
@media (max-width: 760px) {
  .split { display: block; height: auto; min-height: 0; }
  .split-list-only > .olist { background: transparent; }
  .split-list-only .olist-head { background: var(--bg); border: 0; padding: .9rem 1rem .4rem; }
  .split-list-only .olist-rows { display: grid; gap: .5rem; padding: .3rem 1rem 1rem; overflow: visible; }
  .split-list-only .orow { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem .75rem 1.05rem; }
  .split-list-only .orow::before { top: .7rem; bottom: .7rem; }
  .od-head { padding: .7rem 1rem 0; box-shadow: none; position: static; }
  .od-top { gap: .45rem; }
  .od-top .od-back { flex-basis: 100%; }
  .od-top h1 { font-size: 1.2rem; }
  .od-meta { flex-basis: 100%; }
  .od-facts { grid-template-columns: 1fr; gap: .45rem; margin: .6rem 0; }
  .od-fact-icon { width: 28px; height: 28px; }
  .od-bar { flex-direction: column; align-items: stretch; gap: .55rem; }
  .od-actions { flex-wrap: wrap; }
  .od-actions > .btn-primary, .od-actions > .inline-form > .btn-primary { flex: 1 1 100%; order: -1; }
  .od-status-panel { min-width: 0; width: calc(100vw - 2rem); }
  .od-actions .od-menu:not(.od-more) .menu-panel { left: 0; right: auto; }
  .od-tabs { position: sticky; top: 54px; background: var(--card); margin: 0 -1rem; padding: 0 .5rem; z-index: 6; border-top: 1px solid var(--border); }
  .od-body { overflow: visible; padding: .9rem 1rem 1rem; }
  .od-grid { grid-template-columns: 1fr; }
  .od-grid > .stack:nth-child(3) { display: flex; }
}
.diagnosis-edit { margin-top: .5rem; }
.diagnosis-edit > summary { list-style: none; display: inline-flex; }
.diagnosis-edit > summary::-webkit-details-marker { display: none; }
.diagnosis-edit > summary.hidden { display: none; }
.diagnosis-edit[open] > summary { margin-bottom: .5rem; }

/* Intake progress bar: Cliente → Vehículo → Fotos → Lo que pide → Firma */
.intake-progress { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; padding: 0; margin: -.4rem 0 1.25rem; }
.intake-progress li { display: grid; gap: .35rem; font-size: .78rem; font-weight: 700; color: var(--faint); text-align: center; }
.intake-progress li::before { content: ""; height: 6px; border-radius: 3px; background: var(--border-strong); }
.intake-progress li.done { color: var(--success-text); }
.intake-progress li.done::before { background: var(--success); }
.intake-progress li.active { color: var(--text); }
.intake-progress li.active::before { background: var(--text); }
.intake-progress span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sign-page .intake-progress { max-width: 1280px; margin: 0 auto 1rem; }

/* Intake photos: one camera session, many photos, uploaded together */
.burst { max-width: 760px; display: grid; gap: 1rem; }
.burst-form { display: grid; gap: .9rem; }
.burst-camera {
  display: grid; justify-items: center; gap: .45rem; text-align: center; width: 100%;
  padding: 1.6rem 1rem 1.4rem; border: 0; border-radius: 18px; cursor: pointer; font: inherit;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-end)); color: #fff;
}
.burst-camera strong { font-size: 1.3rem; }
.burst-camera > span:last-child { color: var(--sidebar-text); font-size: .92rem; max-width: 46ch; }
.burst-lens { width: 76px; height: 76px; border-radius: 50%; background: var(--text); color: var(--ink); display: grid; place-items: center; box-shadow: 0 0 0 7px rgba(255, 255, 255, .1); }
.burst-pick { position: relative; overflow: hidden; }
.burst-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.no-camera .burst-camera { display: none; }
.no-camera .burst-pick { min-height: 64px; font-size: 1.05rem; background: var(--brand-dark); color: var(--ink); border-color: var(--brand-dark); }
.burst-count { display: flex; align-items: center; gap: .75rem; font-size: .92rem; }
.burst-count strong { font-size: 1.05rem; white-space: nowrap; }
.burst-count .progress { flex: 1; }
.burst-count > span:last-child { white-space: nowrap; font-weight: 650; }
.text-success { color: var(--success-text); }
.burst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.burst-grid:empty { display: none; }
.burst-shot { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.burst-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.burst-shot b { position: absolute; left: 5px; top: 5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: rgba(28, 31, 36, .6); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.burst-shot.is-pending { outline: 2px dashed var(--text); outline-offset: -2px; }
.burst-remove { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(28, 31, 36, .65); color: #fff; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.burst-actions { display: grid; gap: .6rem; }

/* Full-screen camera */
.camera-open, .camera-open body { overflow: hidden; }
.camera-overlay { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: flex; flex-direction: column; }
.camera-overlay[hidden] { display: none; }
.camera-overlay video { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.camera-overlay.flash video { opacity: .35; }
.camera-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .75rem; padding: calc(.8rem + env(safe-area-inset-top)) 1rem .8rem; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.camera-count { min-width: 44px; height: 44px; padding: 0 .6rem; border-radius: 22px; background: var(--text); color: var(--ink); display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; }
.camera-hint { font-size: .92rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.camera-strip { position: absolute; left: 0; right: 0; bottom: calc(118px + env(safe-area-inset-bottom)); display: flex; gap: .35rem; justify-content: center; padding: 0 1rem; }
.camera-strip img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; }
.camera-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 1rem 1.25rem calc(1.2rem + env(safe-area-inset-bottom)); background: #000; }
.camera-cancel, .camera-done { background: none; border: 0; color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; min-height: 48px; cursor: pointer; }
.camera-cancel { justify-self: start; color: var(--sidebar-text); }
.camera-done { justify-self: end; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 1.3rem; }
.camera-shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.camera-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.camera-shutter:active span { transform: scale(.88); }
.camera-error { position: absolute; top: 40%; left: 1rem; right: 1rem; text-align: center; }
@media (orientation: landscape) and (max-height: 600px) {
  .camera-overlay { flex-direction: row; }
  .camera-controls { grid-template-columns: 1fr; grid-template-rows: 1fr auto 1fr; padding: 1rem; }
  .camera-strip { bottom: 1rem; right: 120px; justify-content: flex-start; }
}
.sign-later { max-width: 1280px; margin: .75rem auto 0; text-align: center; }
.sign-later .btn { color: var(--muted); }
/* During the intake the phone's bottom bar steps aside: the step's main button stays at the bottom instead. */
.burst-actions { position: sticky; bottom: 0; z-index: 4; background: var(--bg); padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom)); }
.burst-actions:not(:has(> :not([hidden]):not(noscript))) { display: none; }
@media (max-width: 760px) {
  .in-intake .bottom-nav { display: none; }
  .in-intake .main { padding-bottom: 1rem; }
}
@media (max-width: 760px) {
  .form-actions.sticky-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions.sticky-actions .btn { width: 100%; justify-content: center; }
}

/* Storage: Ajustes card, banner buttons, "how it works" notice */
.storage-card .progress { margin: .5rem 0 .9rem; height: 10px; }
.storage-progress span.is-high { background: var(--warning); }
.storage-progress span.is-full { background: var(--danger); }
.storage-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.storage-actions .inline-form { display: contents; }
.storage-banner .storage-actions { margin-left: auto; }
.storage-terms { margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: .88rem; }
.storage-terms p { margin: 0 0 .35rem; }
.storage-terms ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .25rem; color: var(--brand-dark-2); }
.check-row { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-top: .5rem; }
.check-row input { margin-top: .2rem; width: 18px; height: 18px; min-height: 0; }
.text-warning { color: var(--warning-text); }
@media (max-width: 760px) { .storage-banner { flex-wrap: wrap; } .storage-banner .storage-actions { margin-left: 0; } }

/* Customer number: C-0001 */
.cnum { display: inline-block; font-size: .72em; font-weight: 700; letter-spacing: .03em; color: var(--brand-dark-2); background: var(--neutral-soft); border-radius: 6px; padding: .05rem .4rem; vertical-align: middle; font-variant-numeric: tabular-nums; }
.cnum:empty { display: none; }

/* ---- Reason pickers (Cancelar orden, skipping check-in photos): one big tile per reason ---- */
.reason-picker, .cancel-charge { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.reason-picker legend { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.reason-option { display: flex; align-items: center; gap: .7rem; min-height: 48px; padding: .6rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 500; }
.reason-option input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--brand-dark); }
.reason-option:has(input:checked) { border-color: var(--brand-dark); background: var(--selected-soft); box-shadow: inset 3px 0 0 var(--brand-dark); }
.cancel-charge { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
/* Destructive but not a main action: outlined, never the solid brand red. */
.btn-danger { background: var(--surface); color: var(--danger-text); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-soft); }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }

/* ---- Empleados → Permisos grid: permissions fixed on the left, employees scroll sideways ---- */
.tabs-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.btn-xs { min-height: 0; padding: .15rem .55rem; font-size: .75rem; }
.perm-tools { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.perm-search { flex: 1; min-width: 220px; max-width: 460px; margin-bottom: .75rem; }
.perm-search input { border: 0; flex: 1; min-width: 0; background: transparent; }
.perm-pick { display: none; margin-bottom: .75rem; }
.perm-legend { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--muted); }
.perm-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.perm-legend .perm-cell { width: 26px; height: 26px; cursor: default; }
.perm-empty { color: var(--muted); }
.perm-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.perm-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.perm-grid th, .perm-grid td { border-bottom: 1px solid var(--border); padding: .35rem .5rem; }
.perm-corner, .perm-name {
  position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left;
  min-width: 250px; max-width: 300px; border-right: 1px solid var(--border);
}
.perm-corner { vertical-align: bottom; font-size: .8rem; color: var(--muted); font-weight: 650; }
.perm-name { font-weight: 550; font-size: .9rem; }
.perm-name small { display: block; font-weight: 400; }
.perm-name .icon { color: var(--muted); vertical-align: -2px; }
.perm-emp { min-width: 130px; text-align: center; vertical-align: bottom; padding: .8rem .5rem .6rem !important; }
.perm-emp-name { display: block; font-size: 1.05rem; line-height: 1.2; margin-bottom: .3rem; }
.perm-emp .role-badges { justify-content: center; }
.perm-count { display: block; min-height: 1.1em; margin-top: .25rem; color: var(--info-text); font-weight: 700; }
.perm-emp form { margin-top: .3rem; }
.perm-group th { background: var(--surface); text-align: left; font-size: .75rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.perm-group th span { position: sticky; left: .5rem; }
.perm-td { text-align: center; }
.perm-cell {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
  font: inherit; font-weight: 750; font-size: 1.05rem; border: 1px solid transparent; background: none; cursor: pointer; padding: 0;
}
.perm-cell.state-default { background: var(--surface); color: var(--text); }
.perm-cell.state-owner { cursor: default; }
.perm-cell.state-added { background: var(--info-soft); color: var(--info-text); border-color: var(--info-text); }
.perm-cell.state-removed { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.perm-cell.state-off { border: 1px dashed var(--border-strong); }
.perm-cell.state-locked, .perm-cell.state-blocked { color: var(--muted); cursor: not-allowed; }
button.perm-cell:not(:disabled):hover { box-shadow: 0 0 0 2px var(--border-strong); }
button.perm-cell:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.perm-grid .is-hidden { display: none; }
/* Phones: one employee at a time, picked from the list. */
@media (max-width: 760px) {
  .perm-pick { display: block; flex: 1 1 100%; }
  .perm-pick select { width: 100%; }
  .perm-grid [data-emp]:not(.is-current) { display: none; }
  .perm-corner, .perm-name { min-width: 0; max-width: none; }
  .perm-emp { min-width: 90px; }
}
.perm-badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 750; background: var(--info-soft); color: var(--info-text); text-decoration: none; }
.intake-service-form { flex: 1; flex-wrap: wrap; align-items: flex-end; } .intake-service-form .grow { flex: 1; min-width: 180px; } .intake-services .line { align-items: center; }
.price-input { max-width: 9rem; }

/* ---- Tablero: dragging cards between columns ---- */
.order-card-link { -webkit-touch-callout: none; }
.is-dragging-board, .is-dragging-board * { user-select: none; cursor: grabbing; }
.order-card.is-dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); opacity: .95; }
.column.is-drop-target { box-shadow: inset 0 0 0 2px var(--s); background: var(--s-soft); }
.column.is-drop-blocked { box-shadow: inset 0 0 0 2px var(--danger-border); }
.order-card.snap-back { animation: snap-back .4s var(--ease); }
@keyframes snap-back { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.board-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 90;
  max-width: min(92vw, 520px); padding: .75rem 1rem; border-radius: 12px;
  background: var(--brand-dark); color: var(--ink); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem;
}
.board-toast a { color: var(--ink); text-decoration: underline; margin-left: .35rem; }
@media (prefers-reduced-motion: reduce) { .order-card.snap-back { animation: none; } }

/* ---- Search in the top bar (customers, orders, vehicles) ---- */
.global-search { position: relative; flex: 1 1 240px; max-width: 460px; min-width: 170px; margin-left: auto; }
.gs-box {
  display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .55rem 0 .75rem;
  border-radius: 10px; background: var(--sidebar-hover); border: 1px solid var(--sidebar-line); color: var(--sidebar-muted);
}
.gs-box:focus-within { background: var(--card); border-color: var(--card); color: var(--muted); }
.gs-box input { flex: 1; min-width: 0; height: 100%; min-height: 0; padding: 0; border: 0; background: transparent; color: #fff; font-size: .92rem; box-shadow: none; }
.gs-box input::placeholder { color: var(--sidebar-muted); }
.gs-box:focus-within input { color: var(--text); }
.gs-box input:focus { box-shadow: none; outline: none; }
.gs-kbd { font: 650 .72rem/1 inherit; padding: .2rem .45rem; border-radius: 5px; border: 1px solid var(--sidebar-line); color: var(--sidebar-muted); }
.gs-box:focus-within .gs-kbd { display: none; }
.gs-toggle { display: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 10px; background: none; color: #fff; cursor: pointer; }
.gs-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 340px; max-height: 70vh; overflow: auto; z-index: 45;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem;
}
.gs-group h3 { font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .55rem .6rem .25rem; }
.gs-item { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .45rem .6rem; border-radius: 9px; color: var(--text); text-decoration: none; }
.gs-item .icon { color: var(--muted); flex-shrink: 0; }
.gs-item:hover, .gs-item.is-active { background: var(--surface-2); }
.gs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gs-main strong { font-weight: 650; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-main small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { margin: .6rem; color: var(--muted); font-size: .9rem; }
.gs-page { padding: .5rem; }
@media (max-width: 1000px) { .gs-kbd { display: none; } }
/* Tablets and phones: an icon; tapping it opens the box across the top bar. */
@media (max-width: 1100px) {
  .global-search { flex: 0 0 auto; max-width: none; min-width: 0; position: static; margin-left: 0; }
  .gs-toggle { display: grid; }
  .gs-box { display: none; }
  .global-search.is-open .gs-box { display: flex; position: absolute; left: .5rem; right: .5rem; top: 7px; z-index: 50; background: var(--card); color: var(--muted); }
  .global-search.is-open .gs-box input { color: var(--text); }
  .gs-results { position: fixed; left: .5rem; right: .5rem; top: 56px; min-width: 0; }
}

/* ---------- Spanish confirm / notice box (public/js/ui.js) ---------- */
.ui-dialog { border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem 1.25rem 1rem; max-width: min(92vw, 26rem); background: var(--card); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.ui-dialog::backdrop { background: rgba(28, 31, 36, .45); }
.ui-dialog h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.ui-dialog p { margin: 0 0 1.1rem; line-height: 1.45; }
.ui-dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* "Guardado ✓" after a permission is turned on or off */
.perm-saved { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, .5rem); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  background: var(--success-soft); color: var(--success-text); border: 1px solid var(--success-border); border-radius: 999px; padding: .35rem .9rem; font-size: .9rem; font-weight: 600; z-index: 50; }
.perm-saved.show { opacity: 1; transform: translate(-50%, 0); }

/* Tablero: the list of mechanics that opens when a card is dropped on Asignado */
.assign-dialog { width: min(92vw, 24rem); }
.assign-list { display: grid; gap: .25rem; margin: 0 0 1rem; max-height: 50vh; overflow: auto; }
.assign-option { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; min-height: 44px; }
.assign-option:hover { background: var(--surface); }
.assign-option input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--brand-dark); }
.assign-option:has(input:checked) { border-color: var(--border-strong); background: var(--selected-soft); font-weight: 600; }
.ui-dialog-input { width: 100%; margin: 0 0 1rem; }

/* ---------- Dashboards: charts (src/lib/charts.js, views/partials/chart-*.ejs) ---------- */
.chart { position: relative; margin: 0; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-tick { fill: var(--chart-tick); font-size: 11px; }
.chart-line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--chart-1); stroke: var(--card); stroke-width: 2; }
.chart-bar.is-hover, .chart-dot.is-hover { opacity: .8; }
.chart-fill-1 { fill: var(--chart-1); background: var(--chart-1); }
.chart-fill-2 { fill: var(--chart-2); background: var(--chart-2); }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-hit:focus-visible { fill: rgba(91, 101, 115, .08); }
.chart-guide { stroke: var(--border-hover); stroke-width: 1; pointer-events: none; }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 2;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  padding: .35rem .6rem; display: flex; flex-direction: column; white-space: nowrap; font-size: .8rem;
}
.chart-tip strong { color: var(--text); font-size: .95rem; }
.chart-tip span { color: var(--muted); }
.chart-legend { list-style: none; display: flex; gap: 1rem; padding: 0; margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: .4rem; }
.chart-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-table { margin-top: .5rem; font-size: .85rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.hbars li { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr auto; align-items: center; gap: .6rem; font-size: .9rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 5px; background: var(--chart-1); }
.hbar-current { background: var(--success); }
.hbar-due_soon { background: var(--warning); }
.hbar-overdue { background: var(--danger); }
.hbar-paused { background: var(--faint); }
.hbar-value { min-width: 2.5rem; text-align: right; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.dash-grid .card h2 { font-size: 1rem; margin: 0 0 .75rem; }
.dash-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.dash-filters .field { margin: 0; }
.attention { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.attention li { display: flex; gap: .6rem; align-items: center; padding: .55rem .75rem; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning-text); }
.attention li.is-danger { background: var(--danger-soft); color: var(--danger-text); }
.attention a { color: inherit; font-weight: 650; }
.meter { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin: .5rem 0; }
.meter i { display: block; height: 100%; background: var(--chart-1); }
.simple-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; font-size: .9rem; }
.simple-list li { display: flex; justify-content: space-between; gap: .75rem; }
@media (max-width: 600px) { .chart-tick { font-size: 20px; } }
/* ---------- Para revisar (Panel del Dueño) ---------- */
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; margin-left: .35rem; border-radius: 999px; background: var(--warning-soft); color: var(--warning-text); font-size: .72rem; font-weight: 750; line-height: 1; }
.review-card .chips { margin: 0 0 .75rem; }
.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.review-item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
.review-item.is-reviewed { background: var(--surface); }
.review-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1 1 18rem; }
.review-actions { display: flex; gap: .4rem; align-items: center; }
.iva-mode { border: 0; padding: 0; margin: .5rem 0; display: grid; gap: .4rem; }
.iva-mode legend { font-weight: 650; margin-bottom: .3rem; }
.tax-note { text-align: right; margin: .25rem 0 0; }

/* ---------- Check-in on wide screens (phase 4, part 3): one width for every step, and the steps fill it ---------- */
.in-intake .main { max-width: 1180px; }
.intake-cols { display: grid; }
@media (min-width: 1024px) {
  .in-intake .form-card, .intake-request, .burst { max-width: none; }
  /* Lo que pide: complaint, services and total | Al llegar. The buttons stay at the bottom of the screen. */
  .intake-cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
  .intake-cols > .card { margin-bottom: 0; }
  .intake-request .sticky-actions {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: .75rem 1rem; margin-bottom: .75rem; bottom: .75rem; z-index: 5;
  }
  /* Cliente: name | phone and email. Vehículo: VIN | year, make, model, plate, color, mileage. */
  .intake-customer-form, .intake-vehicle-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1.1rem 1.5rem; align-items: start; }
  .intake-vehicle-form > .field { grid-row: span 2; }
  .intake-customer-form > .form-actions, .intake-vehicle-form > .form-actions { grid-column: 1 / -1; }
  /* Fotos: camera and photos | "¿No se pueden tomar las fotos?" */
  .burst:has(> #sin-fotos) { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .burst > #sin-fotos { margin: 0; }
}

/* Ajustes on wide screens: the page uses the full width; the form's cards sit in two columns. */
@media (min-width: 1200px) {
  .main:has(> form.settings) .narrow-page, .main:has(> form.settings) .settings-logo { max-width: none; }
  form.settings { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
  form.settings > .card { margin-bottom: 0; }
  form.settings > .alert, form.settings > .form-actions { grid-column: 1 / -1; }
}

/* Recibir vehículo: "Cliente nuevo" is a big button next to the search (below it on phones). */
.intake-find { display: flex; gap: .75rem; align-items: stretch; margin-bottom: 1.25rem; }
.intake-find .search { flex: 1; min-width: 0; margin-bottom: 0; }
.intake-new-customer { flex-shrink: 0; min-height: 0; padding-inline: 1.4rem; border-width: 1.5px; border-color: var(--brand-dark-2); }
.intake-new-customer .icon { color: var(--brand-dark-2); }
@media (max-width: 760px) {
  .intake-find { flex-direction: column; }
  .intake-new-customer { min-height: 52px; }
}
@media (max-width: 760px) {
  /* Recepciones sin terminar: the text gets the full width, the buttons go on their own line. */
  #sin-terminar .list-row { flex-wrap: wrap; }
  #sin-terminar .list-row .list-main { flex: 1 1 calc(100% - 64px); }
  #sin-terminar .list-row form { margin-left: auto; }
}

/* ---------- Actividad: each kind of entry has its color and icon (phase 4, part 5) ---------- */
/* Every marker sits in a 22px column, so the line between entries runs through their middle. */
.timeline li:not(:last-child)::before { left: 10.5px; top: 24px; }
.timeline .dot { margin: 7px 6.5px 0; }
.ev-icon {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  color: var(--ev); background: var(--ev-soft); box-shadow: 0 0 0 1.5px var(--ev);
}
.ev-cancel    { --ev: var(--event-cancel);    --ev-soft: var(--event-cancel-soft); }
.ev-status    { --ev: var(--s);               --ev-soft: var(--s-soft); }
.ev-payment   { --ev: var(--event-payment);   --ev-soft: var(--event-payment-soft); }
.ev-signature { --ev: var(--event-signature); --ev-soft: var(--event-signature-soft); }
.ev-note      { --ev: var(--event-note);      --ev-soft: var(--event-note-soft); }
/* Everything else: a small plain dot, so the colored ones stand out. */
.timeline li.ev-other .dot { background: var(--event-other); box-shadow: none; }
.timeline li.event-note .dot { border-color: var(--event-note); }
/* Actividad reciente (Resumen): same colors as small dots. */
.od-recent li[class*="ev-"]:not(.ev-other) .dot { background: var(--ev); }
.od-recent li.ev-other .dot { background: var(--event-other); }
.ev-cancel strong, .od-recent li.ev-cancel > span:nth-child(2) { color: var(--status-cancelled-text); }

/* Órdenes: each status filter has its color dot; "Cancelada" is muted red when chosen. */
.olist-chips .chip[class*="status-"]::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
.olist-chips .chip.status-cancelled.active { background: var(--status-cancelled-text); border-color: var(--status-cancelled-text); color: var(--ink); }
.olist-chips .chip.status-cancelled.active::before { background: var(--ink); }
.olist-chips .chip.status-cancelled.active b { color: var(--ink); }

/* ---------- Tablero on computers and tablets (phase 4, part 6): the columns share the width, no sideways scrolling ---------- */
/* Each column is at least 128px; when they don't all fit in one row, the rest continue in a second row.
   Phones keep one column at a time with sideways scrolling. */
@media (min-width: 761px) {
  .board { display: flex; flex-wrap: wrap; align-items: stretch; overflow-x: visible; scroll-snap-type: none; gap: .65rem; }
  .board > .column { flex: 1 1 128px; min-width: 128px; padding: .55rem; container-type: inline-size; }
  .board .column-head { padding: .2rem .25rem .6rem; gap: .4rem; }
  .board .column-head h2 { font-size: .85rem; line-height: 1.2; }
}
/* Narrow columns: smaller cards that keep the same information. */
@container (max-width: 220px) {
  .order-card-link { padding: .6rem .65rem .45rem; gap: .25rem; }
  .order-card-top { flex-wrap: wrap; gap: 0 .4rem; }
  .order-card-top .small, .stale-badge { font-size: .72rem; }
  .order-vehicle { font-size: .9rem; }
  .order-meta { flex-wrap: wrap; gap: .2rem .4rem; font-size: .8rem; }
  .order-meta .plate { font-size: .72rem; }
  .order-problem { font-size: .8rem; }
  .order-card-actions { padding: 0 .5rem .5rem; gap: .3rem; }
  .move-form select { font-size: .78rem; padding-left: .45rem; }
  .icon-btn { width: 32px; height: 32px; }
}
/* Small tablets: the short logo, so everything fits in the top bar. */
@media (min-width: 761px) and (max-width: 900px) {
  .brand .brand-full { display: none; }
  .brand .brand-icon { display: block; height: 24px; }
}

/* Ajustes → Columnas del Tablero: each status with its color dot. */
.board-column-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .45rem 1rem; }
.board-column-checks .check { display: flex; align-items: center; gap: .5rem; }
.board-column-checks .dot { width: 9px; height: 9px; }

/* Tablero: where a dragged card will land. */
.drop-marker { height: 4px; border-radius: 2px; background: var(--brand-dark-2); margin: -2px 0; box-shadow: 0 0 0 3px rgba(58, 63, 71, .15); }

/* Tablero: sort and filter a column (the small button in its title). Lit up while a sort or filter is on. */
.col-tools { flex-shrink: 0; }
.col-tools-btn {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  color: var(--muted); background: transparent; transition: background .15s, color .15s;
}
.col-tools-btn:hover, .col-tools[open] .col-tools-btn { background: var(--card); color: var(--text); }
.col-tools.is-active .col-tools-btn { background: var(--brand-dark-2); color: var(--ink); }
.col-tools-panel {
  position: absolute; top: calc(100% + 6px); left: -8px; z-index: 20; width: 230px; padding: .8rem;
  display: grid; gap: .65rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.col-tools:not([open]) .col-tools-panel { display: none; }
.col-tools.align-right .col-tools-panel { left: auto; right: -8px; } /* set by board-tools.js near the right edge */
.col-tools-panel .field > span { font-size: .8rem; }
.col-tools-panel select { min-height: 38px; font-size: .88rem; padding-top: .35rem; padding-bottom: .35rem; }
.col-tools-panel .check { font-size: .88rem; }

@media (min-width: 761px) and (max-width: 1100px) { .shop-switch { max-width: 120px; } }

/* Order page: when the buttons don't fit next to the note, they wrap instead of running off the screen. */
.od-actions { flex-shrink: 1; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
/* Narrow Tablero columns: the title keeps room for the count and the sort button. */
@container (max-width: 160px) {
  .column-head > .dot { display: none; }
  .column-head { gap: .3rem; }
}
.board .column-head h2 { min-width: 0; overflow-wrap: anywhere; }

/* ==========================================================
   Look "Graphite": a premium car-site feel on a mid-grey graphite base (not black). Pill buttons and navigation,
   big clean headings, cards one shade lighter than the page, moody car pictures (public/brand/photos/).
   Buttons: main = solid orange (one per screen) · secondary = grey outline · minor = text or icon only ·
   destructive = red. Every button has its own icon. Colors are in theme.css (WCAG AA checked).
   ========================================================== */
/* Big, clean headings */
h1 { font-size: 2.1rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.1; }
.page-head { margin-bottom: 1.6rem; }
.page-head h1 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); }
.page-head p, .page-head .muted { color: var(--muted); font-size: 1.02rem; }
.back { color: var(--muted); }
.back:hover { color: var(--text); }
.section-title { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Pills: buttons, the top-bar items, the search boxes */
.btn { border-radius: var(--pill); border-width: 1.5px; box-shadow: none; padding-inline: 1.25rem; font-weight: 650; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-border-hover); }
.btn-sm { padding-inline: .9rem; }
.btn-icon { padding: 0; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: transparent; border-color: var(--btn-border); color: var(--text); }
.btn-dark:hover { background: var(--btn-hover); border-color: var(--btn-border-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--btn-hover); border-color: transparent; color: var(--text); }
.btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); }
.btn-whatsapp { background: transparent; border-color: var(--btn-border); color: var(--text); box-shadow: none; }
.btn-whatsapp:hover { background: var(--btn-hover); border-color: var(--btn-border-hover); }
.btn-whatsapp .icon { color: var(--whatsapp-text); }
.btn-next { border-color: var(--text); font-weight: 750; }
.btn-nav { background: transparent; border-color: var(--sidebar-muted); color: var(--sidebar-text); }
.btn-nav:hover { background: var(--sidebar-hover); border-color: var(--sidebar-text); color: #fff; }
.badge-next { background: var(--text); border-color: transparent; color: var(--ink); font-weight: 700; }
.nav > a, .menu > summary, .bell, .gs-box, .topbar .shop-menu > summary, .shop-switch { border-radius: var(--pill); }
.search, .olist-search { border-radius: var(--pill); }
input, textarea, select { border-radius: 14px; }
.home-cta { border-radius: var(--radius); }

/* A moody car picture behind the greeting (Tablero) and on the login panel: drawn stand-ins, swap them for photos
   in public/brand/photos/ (same names). */
.hero {
  position: relative; overflow: hidden; min-height: 170px; padding: 1.75rem 2rem; margin-bottom: 1.4rem; border-radius: var(--radius);
  background: radial-gradient(120% 140% at 95% 0%, #5A5E65 0%, var(--sidebar-bg) 62%); border: 1px solid var(--border);
  display: flex; align-items: center;
}
.hero > div { position: relative; z-index: 1; max-width: 60%; }
.hero h1 { color: #fff; margin: 0 0 .3rem; }
.hero p { color: var(--sidebar-text); margin: 0; font-size: 1.05rem; }
.hero-car { position: absolute; right: -1.5rem; bottom: -1.25rem; height: 125%; width: auto; opacity: .95; pointer-events: none; }
@media (max-width: 760px) {
  .hero { min-height: 0; padding: 1.25rem 1.25rem 7.5rem; }
  .hero > div { max-width: none; }
  .hero-car { height: 9rem; right: -1rem; bottom: -1rem; }
}
.auth-car { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; object-fit: cover; object-position: center bottom; opacity: .9; pointer-events: none; }
.auth-brand > :not(.auth-car) { position: relative; z-index: 1; }
@media (max-width: 900px) { .auth-car { display: none; } }

/* Tablero: the columns sit between the page and the cards; each card has its exact status as a small label. */
.column { background: var(--column); border: 1px solid var(--border); }
.column-head h2 { color: var(--text); font-size: .95rem; }
.column-statuses { margin: -.45rem .3rem .6rem; font-size: .76rem; font-weight: 600; color: var(--muted); }
.column-empty { color: var(--muted); border-color: var(--border-strong); }
.col-tools-btn { color: var(--muted); }
.order-card { border-top: 3px solid var(--s, var(--border)); }
.order-card-actions { justify-content: space-between; }
.order-card .move-form { flex: 0 1 auto; min-width: 0; }
.order-card .move-form select {
  width: auto; max-width: 100%; min-height: 30px; padding: .2rem 1.7rem .2rem .75rem; border-radius: var(--pill); border: 0;
  background-color: var(--s-soft); color: var(--s-text, var(--text)); font-size: .78rem; font-weight: 700; background-position: right .55rem center;
}
.card-status { font-size: .78rem; }
@media (pointer: coarse) { .order-card .move-form select { min-height: 40px; font-size: 16px; } }

/* The short list that asks for the exact status when a card is dropped on a column with several. */
.status-pick-list { display: grid; gap: .45rem; margin: .5rem 0 1rem; }
.status-pick {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .15rem .65rem; width: 100%; text-align: left;
  padding: .75rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer;
}
.status-pick .dot { background: var(--s); }
.status-pick strong { font-weight: 700; }
.status-pick small { grid-column: 2; color: var(--muted); font-size: .8rem; }
.status-pick:hover:not(:disabled), .status-pick:focus-visible { border-color: var(--s-text); background: var(--s-soft); }
.status-pick:disabled { cursor: not-allowed; }
.status-pick:disabled strong { text-decoration: line-through; text-decoration-color: var(--muted); }

/* Ajustes: tiles in three groups, each with a colored icon badge and one line on what it is for. */
.settings-groups { display: grid; gap: 1.2rem; margin-bottom: 1.25rem; }
.settings-group-title { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .55rem; }
.settings-tile { align-items: center; gap: .9rem; padding: .95rem 1.05rem; }
.notice.settings-tile > .tile-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.notice.settings-tile > .tile-text { flex: 1 1 auto; }
.tile-blue { background: var(--tile-blue); color: var(--tile-blue-icon); }
.tile-teal { background: var(--tile-teal); color: var(--tile-teal-icon); }
.tile-green { background: var(--tile-green); color: var(--tile-green-icon); }
.tile-violet { background: var(--tile-violet); color: var(--tile-violet-icon); }
.tile-slate { background: var(--tile-slate); color: var(--tile-slate-icon); }
.tile-rose { background: var(--tile-rose); color: var(--tile-rose-icon); }
.tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.tile-text strong { font-weight: 700; }
.tile-text small { color: var(--muted); font-weight: 500; font-size: .84rem; line-height: 1.35; }
.how-it-works > summary { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; list-style: none; }
.how-it-works > summary::-webkit-details-marker { display: none; }
.how-it-works[open] > summary { margin-bottom: .5rem; }
.how-it-works .storage-terms { margin-top: 0; }

/* Admin Mekora → Talleres: the count cards filter the list; the column titles sort it. */
.stats-filters { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stats-filters .stat.is-selected { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text), var(--shadow); }
.th-sort { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover, .th-sort.is-on { color: var(--text); }
.table th[aria-sort="ascending"], .table th[aria-sort="descending"] { color: var(--text); }

/* Small things */
.sticky-actions .btn-ghost { background: var(--card); }
.burst-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.burst-form .burst-actions { background: var(--card); }
.auth-panel { background: var(--card); }
.auth-preview-row:nth-child(2), .auth-preview-row:nth-child(3) { opacity: 1; }
.line-empty { color: var(--faint); }
.list-row > .icon { color: var(--faint); }
.ev-status { --ev: var(--s-text, var(--s)); }
.sec .od-label { color: var(--sec); }
.od-thumb b { background: rgba(21, 23, 26, .72); }
.bottom-nav .bn-more > summary.active, .bottom-nav .bn-more > summary.active .icon { color: var(--text); background: none; }
.ui-dialog::backdrop { background: rgba(10, 12, 14, .6); }
.mech > .back { display: inline-flex; }

/* The Hoja de entrega before Listo: shown, but its signing buttons wait (they are disabled). */
.sign-doc.is-locked > p { color: var(--muted); }

/* Narrow Tablero columns: the title gets its own line (whole words, never "Recibid-o"); the count and the sort
   button sit under it. Manrope's letters are wider, so this starts a little earlier than before. */
.board .column-head h2 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@container (max-width: 160px) {
  .board .column-head { flex-wrap: wrap; row-gap: .3rem; }
  .board .column-head h2 { flex: 1 1 100%; order: -1; font-size: .82rem; }
  .board .column-head .count { margin-right: auto; }
}

/* ==========================================================
   Tablero (pilot redesign): a calm job board. A short header with the one orange action, today's numbers in one
   strip, quiet lanes whose first cards line up (subgrid), flat cards with a hairline footer, and license plates
   drawn like the real ones (white, with the blue band on top). Everything here is scoped to .tablero.
   ========================================================== */
.tablero-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin: .15rem 0 1.25rem; }
.tablero-greeting { min-width: 0; }
.tablero-greeting h1 { margin: 0; font-size: clamp(1.6rem, 2.1vw, 2rem); letter-spacing: -.03em; line-height: 1.1; }
.tablero-greeting p { margin: .3rem 0 0; color: var(--muted); font-size: .98rem; }
.tablero .home-cta { flex: 0 1 24rem; margin: 0; padding: .65rem .9rem .65rem .7rem; gap: .8rem; border-radius: 16px; }
.tablero .home-cta-icon { width: 42px; height: 42px; border-radius: 12px; }
.tablero .home-cta strong { font-size: 1.05rem; }
.tablero .home-cta small { font-size: .82rem; }

/* Today's numbers: one strip, four parts, hairlines between them. */
.tablero-strip { display: flex; align-items: stretch; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.today {
  flex: 1 1 34rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
}
.today-item { display: flex; flex-direction: column; gap: .15rem; padding: .75rem 1.1rem; color: var(--text); text-decoration: none; }
.today-item + .today-item { border-left: 1px solid var(--divider); }
a.today-item:hover { background: var(--btn-hover); }
.today-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.today-value { font-size: 1.6rem; font-weight: 750; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.today-label { font-size: .84rem; font-weight: 600; color: var(--muted); }
.today-item.is-alert .today-value { color: var(--danger); }
.tablero-panel {
  flex: 0 1 auto; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; color: var(--text); text-decoration: none;
}
.tablero-panel:hover { border-color: var(--border-hover); }
.tablero-panel > .icon:first-child { color: var(--brand-dark-2); }
.tablero-panel-text { display: flex; flex-direction: column; gap: .1rem; }
.tablero-panel-text strong { font-weight: 700; font-size: .95rem; }
.tablero-panel-text small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.tablero-pending {
  padding: .1rem .55rem; border-radius: var(--pill); font-size: .76rem; font-weight: 700; white-space: nowrap;
  background: var(--warning-soft); border: 1px solid var(--warning-border); color: var(--warning-text);
}
.tablero > .notice { margin-bottom: 1rem; }
.tablero .board-hint { margin: 0 0 .8rem; }

/* The board: lanes share the width; row 1 = the column titles, row 2 = the cards, so every first card lines up. */
.tablero .board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: auto 1fr;
  gap: 0 .75rem; overflow: visible; padding-bottom: 1rem;
}
/* A size container would switch the subgrid off, so the narrow-column checks (@container) look at the two parts instead. */
.tablero .board > .column {
  grid-row: span 2; display: grid; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); row-gap: 0;
  min-width: 0; min-height: 0; container-type: normal;
  padding: .3rem .55rem .6rem; background: var(--lane); border: 0; border-radius: 18px;
}
.tablero .board > .column.is-drop-target { background: var(--s-soft); box-shadow: inset 0 0 0 2px var(--s); }
.tablero .board > .column.is-drop-blocked { box-shadow: inset 0 0 0 2px var(--danger-border); }
.tablero .order-card.drag-ghost { position: fixed; box-shadow: var(--shadow-lg); border-color: var(--border-hover); }
.tablero .column-top, .tablero .column-body { min-width: 0; container-type: inline-size; }
.tablero .column-top { padding: .6rem .35rem .7rem; }
.tablero .column-head { padding: 0; gap: .5rem; }
.tablero .column-head .dot { width: 8px; height: 8px; box-shadow: none; }
.tablero .column-head h2 { flex: 0 1 auto; font-size: .95rem; font-weight: 700; line-height: 1.2; }
.tablero .count { margin-right: auto; background: none; padding: 0; font-size: .85rem; font-weight: 650; color: var(--muted); }
.tablero .column-statuses { margin: .3rem 0 0; font-size: .76rem; line-height: 1.35; font-weight: 550; color: var(--muted); }
.tablero .column-body { gap: .55rem; }
.tablero .column-empty { padding: 1.4rem .5rem; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--muted); }

/* Cards: flat, one hairline edge; the status lives in the pill at the bottom (no colored top line). */
.tablero .order-card { border: 1px solid var(--border); border-radius: 14px; box-shadow: none; transition: border-color .15s; }
.tablero .order-card:hover { border-color: var(--border-hover); box-shadow: none; transform: none; }
.tablero .order-card.is-stale { border-color: var(--danger-border); box-shadow: none; }
.tablero .order-card.is-stale:hover { border-color: var(--danger); box-shadow: none; }
.tablero .order-card-link { padding: .8rem .9rem .65rem; gap: .3rem; border-radius: 14px 14px 0 0; }
.tablero .order-card-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tablero .order-number { font-size: .8rem; font-weight: 650; color: var(--faint); }
.tablero .order-card-top .small { font-size: .78rem; }
.tablero .stale-badge { padding: 0; background: none; font-size: .78rem; color: var(--danger); }
.tablero .order-vehicle { font-size: 1rem; font-weight: 700; }
.tablero .order-meta { font-size: .84rem; }
.tablero .order-problem { font-size: .82rem; line-height: 1.4; }
/* Footer: only the exact status (its pill is the drop-down). WhatsApp sits in the card's top corner, on every width. */
.tablero .order-card { position: relative; }
.tablero .order-card:has(.icon-btn-whatsapp) .order-card-top { padding-right: 2rem; }
.tablero .order-card-actions { justify-content: flex-start; margin: 0 .9rem; padding: .55rem 0 .65rem; border-top: 1px solid var(--divider); }
/* The status pill is a label with the real drop-down stacked on top of it (invisible, but it gets the taps, the keys
   and the screen reader). So a long status wraps onto two lines instead of being cut. */
.tablero .move-form { position: relative; display: inline-flex; max-width: 100%; }
.tablero .move-label {
  display: flex; align-items: center; gap: .4rem; min-height: 28px; padding: .3rem .6rem; border-radius: 14px;
  background: var(--s-soft); color: var(--s-text, var(--text)); font-size: .76rem; font-weight: 700; line-height: 1.2;
}
.tablero .move-label .dot { width: 7px; height: 7px; }
.tablero .move-label .icon { flex-shrink: 0; margin-left: auto; opacity: .85; }
.tablero .order-card .move-form select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; cursor: pointer; }
@media (pointer: coarse) { .tablero .move-label { min-height: 40px; } }
.tablero .move-form:hover .move-label { filter: brightness(1.12); }
.tablero .move-form:focus-within .move-label { outline: 2px solid var(--focus); outline-offset: 2px; }
.tablero .order-card-actions .icon-btn-whatsapp { position: absolute; top: .5rem; right: .5rem; width: 30px; height: 30px; border-radius: 50%; background: transparent; }
.tablero .order-card-actions .icon-btn-whatsapp:hover { background: var(--whatsapp-soft); }

/* Narrow lanes (tablets): the title gets its own line, with the count and the sort button under it. */
@container (max-width: 160px) {
  .tablero .column-head h2 { flex: 1 1 100%; }
}
/* Narrow cards: a tighter footer; the narrowest drop the pill's dot so longer status names still fit. */
@container (max-width: 200px) {
  .tablero .order-card-actions { margin: 0 .6rem; }
  .tablero .move-label { padding: .3rem .5rem; gap: .35rem; font-size: .74rem; }
  .tablero .order-card-actions .icon-btn-whatsapp { top: .35rem; right: .35rem; width: 28px; height: 28px; }
}
@container (max-width: 150px) {
  .tablero .move-label .dot { display: none; }
}

/* License plates as they look on the street: white, dark letters, the blue band along the top. */
.tablero .plate {
  padding: .22rem .45rem .06rem; border: 1px solid var(--plate-text); border-radius: 4px;
  font-size: .72rem; letter-spacing: .08em; line-height: 1.2; box-shadow: inset 0 3px 0 var(--plate-blue);
}

/* Phones: the header stacks, the numbers go two by two, and the board shows one lane at a time (the next one peeks). */
@media (max-width: 760px) {
  .tablero-head { gap: .9rem; margin-bottom: 1rem; }
  .tablero .home-cta { flex: 1 1 100%; }
  .today { flex-basis: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-item:nth-child(3) { border-left: 0; }
  .today-item:nth-child(n+3) { border-top: 1px solid var(--divider); }
  .tablero-panel { flex: 1 1 100%; }
  .tablero .board {
    grid-auto-columns: calc(100% - 2.5rem); gap: 0 .6rem; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -1rem; padding: 0 1rem 1rem; scroll-padding: 0 1rem;
  }
  .tablero .board > .column { scroll-snap-align: start; }
}

/* ---------- Sign-in pages: password boxes, "Crear cuenta", "¿Olvidó su contraseña?" ---------- */
.field > label, .field-row > label { font-weight: 600; font-size: .9rem; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; }
.field-link {
  font-size: .86rem; font-weight: 600; color: var(--link);
  text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 3px;
}
.field-link:hover { text-decoration-color: currentColor; }

/* The eye button sits inside the box; one icon shows at a time. */
.password-input { position: relative; }
.password-input input { padding-right: 3.1rem; }
.password-toggle {
  position: absolute; top: 50%; right: .3rem; transform: translateY(-50%);
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.password-toggle:hover { background: var(--surface-2); color: var(--text); }
.password-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.password-toggle .icon + .icon, .password-toggle[aria-pressed="true"] .icon:first-child { display: none; }
.password-toggle[aria-pressed="true"] .icon + .icon { display: block; }
.caps-note { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .85rem; font-weight: 650; color: var(--warning-text); }
.caps-note[hidden] { display: none; }

/* Under the login form: the way in for a shop that doesn't use Mekora yet. */
.auth-alt { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--divider); display: grid; gap: .8rem; text-align: center; }
.auth-alt p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; text-wrap: balance; }
.auth-brand-copy h2 { text-wrap: balance; }
.auth-alt .hint { font-size: .85rem; }

/* Crear cuenta: a longer form, so the brand side stays put while the form scrolls. */
.auth-panel .auth-card-wide { max-width: 460px; }
.auth-split-long .auth-panel { align-items: flex-start; padding-block: 3.5rem; }
.auth-split-long .auth-brand { position: sticky; top: 0; height: 100vh; align-self: start; }
.plan-pick { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: .6rem; }
.plan-pick legend { padding: 0 0 .5rem; font-weight: 600; font-size: .9rem; }
.plan-choice {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .85rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.plan-choice:hover { border-color: var(--border-hover); }
.plan-choice:has(input:checked) { border-color: var(--selected); background: var(--selected-soft); }
.plan-choice:has(input:focus-visible) { box-shadow: var(--ring); }
.plan-choice input { flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; margin: .2rem 0 0; accent-color: var(--brand-dark); }
.plan-choice-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.plan-choice-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.plan-choice-head strong { font-size: 1.02rem; }
.plan-choice-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-choice-price small { font-weight: 500; color: var(--muted); font-size: .82rem; }
.plan-choice-pitch { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.plan-choice-facts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; color: var(--brand-dark-2); }
.plan-choice-facts > span { display: inline-flex; align-items: center; gap: .3rem; }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ¿Olvidó su contraseña?: the other way back in, then the way back to the login. */
.forgot-sent { display: grid; gap: .3rem; }
.forgot-sent p { margin: 0; font-weight: 500; line-height: 1.5; }
.forgot-spam { margin-top: .75rem; }
.auth-alt p strong { display: block; color: var(--text); font-weight: 650; }
.auth-help {
  margin-top: 1.5rem; padding: 1rem 1.1rem; display: grid; gap: .45rem;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
}
.auth-help h2 { font-size: 1rem; margin: 0; }
.auth-help p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.auth-help-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.auth-back { display: inline-flex; align-items: center; gap: .3rem; margin-top: 1.25rem; font-size: .92rem; }

@media (max-width: 900px) {
  .auth-split { grid-template-rows: auto 1fr; } /* the form side reaches the bottom of the screen */
  .auth-split-long .auth-brand { position: relative; height: auto; }
  .auth-split-long .auth-panel { padding-block: 2rem 3rem; }
}

/* ---------- "Instalar app": a small card for phones and tablets that opened Mekora in the browser ---------- */
.install-hint {
  position: fixed; z-index: 40; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(26rem, calc(100% - 1.5rem));
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem .9rem .65rem; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: install-in .35s var(--ease);
}
.install-hint[hidden] { display: none; }
@keyframes install-in { from { opacity: 0; transform: translate(-50%, 14px); } }
@media (prefers-reduced-motion: reduce) { .install-hint { animation: none; } }
.install-hint-icon { width: 36px; height: 36px; flex: none; }
.install-hint-body { display: grid; gap: .3rem; min-width: 0; padding-right: 1.6rem; } /* room for the ✕ */
.install-hint h2 { margin: 0; font-size: .98rem; line-height: 1.3; }
.install-hint p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.install-hint [hidden] { display: none; }
.install-steps { margin: .1rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .88rem; line-height: 1.55; }
.install-key {
  display: inline-flex; align-items: center; gap: .25rem; padding: 0 .45rem; white-space: nowrap;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-weight: 650;
}
.install-hint-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .2rem; }
.install-hint-close { position: absolute; top: .45rem; right: .45rem; width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; }
.install-hint-close:focus-visible { outline: none; box-shadow: var(--ring); }
/* Room under the page so the card never hides its last buttons. */
.has-install-hint .main { padding-bottom: calc(13rem + env(safe-area-inset-bottom)); }
.has-install-hint .auth-panel, .has-install-hint main.auth:not(:has(.auth-split)) { padding-bottom: 12rem; }
@media (max-width: 760px) {
  /* Inside the app it sits just above the phone's bottom bar. */
  .app:not(.admin-app) ~ .install-hint { bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
}
