/* AM Cell Store - Estilos responsive (sin scroll horizontal) */
:root {
    --bg: #f0f4f9;
    --card: #ffffff;
    --primary: #4293E1;
    --primary-dark: #2f7bc4;
    --primary-soft: rgba(66, 147, 225, 0.14);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.12);
    --error: #e2445c;
    --error-soft: rgba(226, 68, 92, 0.12);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.14);
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 16px rgba(30, 41, 59, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --header-bg: rgba(255, 255, 255, 0.94);
    --muted-bg: #f8fafc;
    --nav-active-bg: #dbeafe;
    --bottom-nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font);
    background:
        radial-gradient(1100px 380px at 8% -8%, rgba(66, 147, 225, 0.12), transparent 55%),
        radial-gradient(800px 320px at 92% 0%, rgba(22, 163, 74, 0.07), transparent 50%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

img, svg, video, canvas { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 12px 28px;
    overflow-x: hidden;
}

/* Views */
.view { display: none; min-height: 100vh; min-height: 100dvh; width: 100%; max-width: 100%; overflow-x: hidden; }
.view.active { display: block; }
#boot-view.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
.boot-card { text-align: center; padding: 40px 16px; }
.boot-spinner {
    width: 40px; height: 40px; margin: 0 auto 16px;
    border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-wrap {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; width: 100%;
}
.login-card {
    width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
    border-radius: 18px; box-shadow: var(--shadow); padding: 28px 20px;
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .logo-mark {
    width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 18px;
}
.login-brand h1 { font-size: clamp(1.25rem, 4vw, 1.5rem); font-weight: 800; }
.login-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

.form-group { margin-bottom: 14px; min-width: 0; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
    width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); font: inherit; outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.form-hint { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; word-break: break-word; }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 0.9rem; word-break: break-word; }
.alert-error { background: var(--error-soft); color: #b91c1c; }
.alert-success { background: var(--success-soft); color: #15803d; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; transition: 0.15s ease;
    max-width: 100%; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-warning { background: #f1c40f; color: #111; }
.btn-sm { padding: 6px 10px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Header */
.app-header {
    position: sticky; top: 0; z-index: 40; background: var(--header-bg);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
    width: 100%; max-width: 100%; overflow-x: hidden;
}
.header-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 10px 12px; max-width: 1280px; margin: 0 auto;
    width: 100%; min-width: 0;
}
.brand, button.brand {
    display: flex; align-items: center; gap: 8px; font-weight: 800;
    border: none; background: transparent; cursor: pointer; font: inherit; color: inherit;
    min-width: 0; flex-shrink: 1;
}
.brand span:last-child, button.brand > span:last-child {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw;
}
.brand .mark {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.header-meta {
    display: flex; align-items: center; gap: 8px; color: var(--text-secondary);
    font-size: 0.8rem; flex-wrap: wrap; justify-content: flex-end; min-width: 0;
}
.header-meta #clock,
.header-meta #user-chip {
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-nav {
    display: flex; justify-content: flex-start; gap: 4px; padding: 6px 8px 10px;
    overflow-x: auto; overflow-y: hidden; max-width: 100%; margin: 0 auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; height: 0; }
.nav-link {
    border: none; background: transparent; color: var(--text-secondary);
    padding: 8px 12px; border-radius: 999px; font: inherit; font-weight: 600;
    font-size: 0.85rem; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.nav-link:hover { background: var(--muted-bg); color: var(--text); }
.nav-link.active { background: var(--nav-active-bg); color: var(--primary-dark); }

/* Pages */
.page { display: none; width: 100%; max-width: 100%; overflow-x: hidden; }
.page.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-header h2 { font-size: clamp(1.15rem, 4vw, 1.35rem); font-weight: 800; min-width: 0; word-break: break-word; }
.page-header .btn { flex-shrink: 0; }

/* Cards / stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow); min-width: 0; overflow: hidden;
}
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: clamp(1.05rem, 3.5vw, 1.35rem); font-weight: 800; word-break: break-word; }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; max-width: 100%;
}
.card-header {
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-title { font-weight: 700; }
.card-body { padding: 14px; min-width: 0; }
.toolbar {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; width: 100%;
}
.toolbar .form-input,
.toolbar .form-select {
    flex: 1 1 160px;
    max-width: 100%;
    min-width: 0;
}

/* Tables: solo escritorio ancho */
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}
table.data th, table.data td {
    padding: 10px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}
table.data th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--text-secondary); background: var(--muted-bg);
}
table.data tr:hover td { background: #f8fbff; }
.badge {
    display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
    max-width: 100%; white-space: normal; text-align: center;
}
.badge-ok { background: var(--success-soft); color: #15803d; }
.badge-warn { background: var(--warning-soft); color: #b45309; }
.badge-err { background: var(--error-soft); color: #b91c1c; }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); }
.empty { text-align: center; color: var(--text-secondary); padding: 28px 12px; }

.mobile-cards { display: none; gap: 10px; width: 100%; }
.mobile-card {
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: #fff;
    width: 100%; max-width: 100%; overflow: hidden;
}
.mobile-card .title { font-weight: 700; margin-bottom: 4px; word-break: break-word; }
.mobile-card .meta { font-size: 0.85rem; color: var(--text-secondary); word-break: break-word; }
.mobile-card .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* POS shell (layout tipo documento + carrito) */
.pos-shell { width: 100%; max-width: 100%; overflow: hidden; }
.pos-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.pos-topbar h2 { font-size: clamp(1.15rem, 4vw, 1.35rem); font-weight: 800; }
.pos-doc-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pos-doc-btn {
    padding: 8px 14px; border: 2px solid var(--border); background: #fff;
    border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; color: var(--text);
}
.pos-doc-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-doc-btn.quote.active { background: #f1c40f; border-color: #f1c40f; color: #111; }
.pos-main {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 400px);
    gap: 12px;
    align-items: stretch;
    min-height: min(70vh, 640px);
}
.pos-products-pane, .pos-cart-pane {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); min-width: 0; overflow: hidden;
    display: flex; flex-direction: column;
}
.pos-products-pane { padding: 12px; }
.pos-search { margin-bottom: 12px; }
.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
    gap: 10px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    max-height: min(62vh, 560px);
}
.pos-product-card {
    border: 1px solid var(--border); border-radius: 12px; padding: 14px 10px;
    background: #fff; cursor: pointer; text-align: center; min-width: 0;
}
.pos-product-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); transform: translateY(-2px); }
.pos-product-ico { font-size: 1.8rem; margin-bottom: 6px; }
.pos-product-name { font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; word-break: break-word; }
.pos-product-price { color: var(--success); font-weight: 800; }
.pos-product-stock { color: var(--text-secondary); font-size: 0.75rem; margin-top: 4px; }
.pos-cart-head {
    padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 1.05rem;
}
.pos-cart-body {
    flex: 1; overflow: auto; padding: 12px; -webkit-overflow-scrolling: touch;
    max-height: min(42vh, 360px);
}
.pos-cart-item {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--muted-bg);
}
.pos-cart-item-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pos-cart-item-head strong { min-width: 0; word-break: break-word; }
.pos-remove {
    border: none; background: transparent; color: var(--error); font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.pos-cart-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-disc-info { color: #b45309; font-size: 0.78rem; text-align: right; min-height: 1em; margin: 4px 0; }
.pos-cart-item-total { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.pos-cart-foot { padding: 12px 14px 14px; border-top: 1px solid var(--border); background: #fff; }
.pos-pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-totals-box { margin: 8px 0 12px; }
.pos-tot-row { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0; font-size: 0.92rem; }
.pos-tot-row.disc { color: #b45309; }
.pos-tot-row.final { font-size: 1.15rem; font-weight: 800; margin-top: 8px; padding-top: 10px; border-top: 2px solid var(--border); color: var(--primary-dark); }
.pos-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pos-actions .btn { flex: 1 1 120px; }

@media (max-width: 1100px) {
    .pos-main { grid-template-columns: 1fr; min-height: 0; }
    .pos-products-grid { max-height: 38vh; }
    .pos-cart-body { max-height: none; }
    .pos-cart-pane { order: 2; }
    .pos-products-pane { order: 1; }
}
@media (max-width: 700px) {
    .pos-pay-row, .pos-cart-controls { grid-template-columns: 1fr; }
    .pos-topbar { flex-direction: column; align-items: stretch; }
    .pos-doc-btn { flex: 1; text-align: center; }
    .pos-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* POS legacy aliases (por si quedan clases viejas) */
.pos-layout { display: contents; }
.pos-products { display: contents; }
.pos-item { display: none; }


/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 80;
    display: flex; align-items: flex-end; justify-content: center; padding: 0;
    width: 100%; max-width: 100vw; overflow: hidden;
}
.modal-backdrop.center { align-items: center; padding: 12px; }
.modal {
    background: var(--card);
    width: 100%;
    max-width: min(560px, 100%);
    max-height: min(92vh, 92dvh);
    overflow: auto;
    overflow-x: hidden;
    border-radius: 16px 16px 0 0;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}
.modal-backdrop.center .modal { border-radius: 16px; max-width: min(720px, calc(100vw - 24px)); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1;
}
.modal-header h3 { font-size: 1.05rem; min-width: 0; word-break: break-word; }
.modal-body { padding: 14px; min-width: 0; overflow-x: hidden; }
.modal-actions {
    display: flex; gap: 8px; justify-content: stretch; margin-top: 16px; flex-wrap: wrap;
}
.modal-actions .btn { flex: 1 1 auto; min-width: 110px; }
.icon-btn { border: none; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); flex-shrink: 0; }

/* Mobile bottom nav */
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    width: 100%; max-width: 100vw;
}
.bottom-nav-item {
    flex: 1; border: none; background: transparent; padding: 6px 2px;
    font: inherit; font-size: 0.65rem; color: var(--text-secondary); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
}
.bottom-nav-item span:last-child {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bottom-nav-item.active { color: var(--primary); font-weight: 700; }
.bottom-nav-item .ico { font-size: 1.1rem; }
.more-sheet {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 70;
    display: flex; align-items: flex-end; width: 100%; max-width: 100vw; overflow: hidden;
}
.more-sheet-inner {
    background: var(--card); width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; padding: 16px;
    max-height: min(75vh, 75dvh); overflow: auto; overflow-x: hidden;
}
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-item {
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 6px;
    text-align: center; background: #fff; cursor: pointer; font-weight: 600; font-size: 0.78rem;
    word-break: break-word; min-width: 0;
}

/* ---------- Menú radial (hub) ---------- */
#hub-view.active {
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at center, #182742, #0a1220 60%, #05080f);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}
.hub-top {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 14px; flex-shrink: 0; z-index: 60; width: 100%; min-width: 0;
}
.hub-user {
    font-weight: 600; font-size: 0.9rem; opacity: 0.95;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-logout {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; border-radius: 10px; flex-shrink: 0;
}
.hub-logout:hover { background: rgba(255,75,92,0.85); border-color: transparent; }

.radial-menu-container {
    --orbit-radius: min(280px, calc((100vw - 24px) / 2 - 52px));
    --module-size: min(96px, 22vw);
    position: relative;
    flex: 1;
    width: min(100vw, calc(var(--orbit-radius) * 2 + var(--module-size)));
    max-width: 100vw;
    height: min(100%, calc(var(--orbit-radius) * 2 + var(--module-size)));
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.radial-center {
    position: absolute;
    width: min(200px, 42vw);
    height: min(200px, 42vw);
    border-radius: 50%;
    background: linear-gradient(145deg, #4293E1, #2563eb);
    display: flex; justify-content: center; align-items: center;
    text-align: center; font-size: clamp(13px, 3.6vw, 22px); font-weight: 800;
    box-shadow: 0 0 80px rgba(66, 147, 225, 0.55), 0 0 140px rgba(37, 99, 235, 0.2);
    z-index: 50; transition: 0.25s ease; cursor: default; user-select: none;
    line-height: 1.25; padding: 10px;
}
.radial-center small {
    display: block; font-size: clamp(9px, 2.4vw, 13px); font-weight: 500; opacity: 0.85; margin-top: 6px;
}

.orbit { position: absolute; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; }
.orbit .radial-module { pointer-events: auto; z-index: 60; }

.radial-module {
    position: absolute;
    top: 50%; left: 50%;
    width: var(--module-size); height: var(--module-size);
    margin-top: calc(var(--module-size) / -2);
    margin-left: calc(var(--module-size) / -2);
    border-radius: 50%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    font-size: clamp(8px, 2.2vw, 11px); font-weight: 700; text-align: center; padding: 4px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    transition: box-shadow 0.2s ease;
    user-select: none;
    color: #fff;
    line-height: 1.1;
    overflow: hidden;
}
.radial-module .rm-ico { font-size: clamp(16px, 4.5vw, 26px); margin-bottom: 2px; line-height: 1; }
.radial-module:hover,
.radial-module:active {
    box-shadow: 0 0 35px currentColor, 0 0 55px currentColor;
    z-index: 100;
}

.rm-blue   { background: rgba(36, 107, 253, 0.92); }
.rm-green  { background: rgba(26, 188, 156, 0.92); }
.rm-orange { background: rgba(255, 140, 0, 0.92); }
.rm-red    { background: rgba(255, 75, 92, 0.92); }
.rm-purple { background: rgba(142, 68, 173, 0.92); }
.rm-yellow { background: rgba(241, 196, 15, 0.92); color: #222 !important; }
.rm-cyan   { background: rgba(0, 207, 232, 0.92); }
.rm-gray   { background: rgba(93, 109, 126, 0.92); }
.rm-pink   { background: rgba(255, 95, 162, 0.92); }
.rm-teal   { background: rgba(22, 160, 133, 0.92); }
.rm-indigo { background: rgba(57, 73, 171, 0.92); }
.rm-lime   { background: rgba(124, 179, 66, 0.92); }
.rm-gold   { background: rgba(201, 162, 39, 0.92); }
.rm-brown  { background: rgba(141, 110, 99, 0.92); }

/* Taller / reparaciones */
.repair-tabs {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; width: 100%;
}
.repair-tab {
    border: 1px solid var(--border); background: #fff; color: var(--text-secondary);
    padding: 7px 10px; border-radius: 999px; font: inherit; font-size: 0.78rem;
    font-weight: 600; cursor: pointer; max-width: 100%;
}
.repair-tab.active { background: var(--primary-soft); color: var(--primary-dark); border-color: #93c5fd; }
.tab-count {
    display: inline-block; min-width: 1.2em; padding: 0 5px; margin-left: 2px;
    border-radius: 999px; background: rgba(0,0,0,0.06); font-size: 0.72rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 999px; font-size: 0.82rem; cursor: pointer; background: #fff;
}
.repair-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.parts-list { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.repair-badge--received { background: var(--primary-soft); color: var(--primary-dark); }
.repair-badge--diagnosing { background: #dbeafe; color: #1d4ed8; }
.repair-badge--waiting_parts { background: var(--warning-soft); color: #b45309; }
.repair-badge--in_repair { background: #ede9fe; color: #6d28d9; }
.repair-badge--ready { background: var(--success-soft); color: #15803d; }
.repair-badge--delivered { background: var(--muted-bg); color: var(--text-secondary); }
.repair-badge--cancelled { background: var(--error-soft); color: #b91c1c; }

#toast-root {
    max-width: calc(100vw - 24px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto;
}

/* ===== Tablet / móvil: sin tablas, sin scroll X ===== */
@media (max-width: 1100px) {
    .header-nav { display: none; }
    .bottom-nav { display: flex; }
    #app-view .container { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 16px); }
    .table-wrap { display: none !important; }
    .mobile-cards { display: grid !important; }
    .pos-layout { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .repair-detail-grid { grid-template-columns: 1fr; }
    .header-meta #clock { display: none; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .container { padding: 12px 10px 24px; }
    .header-top { padding: 8px 10px; }
    .header-meta #user-chip { display: none; }
    .brand span:last-child, button.brand > span:last-child { max-width: 34vw; font-size: 0.92rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .modal-backdrop.center { align-items: flex-end; padding: 0; }
    .modal-backdrop.center .modal {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        max-height: min(92vh, 92dvh);
    }
    .pos-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 42vh;
    }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header .btn { width: 100%; }
    .hub-top { padding: 10px 12px; }
    .radial-menu-container {
        --orbit-radius: min(148px, calc((100vw - 16px) / 2 - 40px));
        --module-size: min(72px, 19vw);
    }
}

@media (max-width: 400px) {
    .radial-menu-container {
        --orbit-radius: min(128px, calc((100vw - 12px) / 2 - 36px));
        --module-size: min(64px, 18vw);
    }
    .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .btn { padding: 9px 12px; }
}

/* Desktop amplio: tablas visibles */
@media (min-width: 1101px) {
    .mobile-cards { display: none !important; }
    .table-wrap { display: block; }
    .bottom-nav { display: none; }
    .container { padding: 20px 16px 40px; }
}
