/* ============================================================
   Catering 1.0 — Admin Design System
   Identity: copper / gold / cream / dark brown
   Fonts: Cormorant Garamond (display) + Outfit (UI)
   ============================================================ */

:root {
    /* Palette (identity) */
    --copper: #C8956C;
    --copper-dark: #A9744C;
    --copper-soft: rgba(200, 149, 108, 0.12);
    --gold: #D4AF37;
    --ink: #2A2118;
    --ink-2: #4A3F35;
    --sidebar-bg: #211A14;
    --sidebar-bg2: #2E241B;
    --cream: #FAF6F1;
    --paper: #FFFFFF;
    --line: #EBE3D8;
    --line-2: #F3EDE4;
    --muted: #8A7B6B;
    --muted-2: #5F5548;

    /* Semantic */
    --success: #5B8A38;
    --success-bg: #EEF5E6;
    --warning: #C49A3D;
    --warning-bg: #FBF3DF;
    --danger: #C05746;
    --danger-bg: #FAEAE7;
    --info: #4A7A9E;
    --info-bg: #E9F1F7;

    /* Shape & depth */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(42, 33, 24, 0.05);
    --shadow-md: 0 4px 16px rgba(42, 33, 24, 0.08);
    --shadow-lg: 0 12px 40px rgba(42, 33, 24, 0.14);

    --font-ui: 'Outfit', system-ui, sans-serif;
    --font-display: 'Cormorant Garamond', serif;

    --sidebar-w: 264px;
    --topbar-h: 62px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* Legacy aliases (older inline styles reference these) */
    --admin-primary: var(--copper-dark);
    --admin-primary-dark: #8A5D3B;
    --admin-primary-light: var(--copper);
    --admin-sidebar: var(--sidebar-bg);
    --admin-sidebar-hover: var(--sidebar-bg2);
    --admin-bg: var(--cream);
    --admin-card: var(--paper);
    --admin-text: var(--ink);
    --admin-text-light: var(--muted-2);
    --admin-border: var(--line);
    --admin-success: var(--success);
    --admin-warning: var(--warning);
    --admin-danger: var(--danger);
    --admin-info: var(--info);
    --admin-radius: var(--r-md);
    --admin-shadow: var(--shadow-sm);
    --admin-transition: all 0.2s ease;
    --primary: var(--copper-dark);
    --primary-light: var(--copper-soft);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body.admin-body {
    font-family: var(--font-ui);
    background:
        radial-gradient(1200px 400px at 80% -10%, rgba(200,149,108,0.07), transparent),
        var(--cream);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--copper-dark); text-decoration: none; }
a:hover { color: var(--copper); }

::selection { background: rgba(200,149,108,0.25); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D9CDBE; border-radius: 8px; border: 2px solid var(--cream); }
::-webkit-scrollbar-thumb:hover { background: var(--copper); }

/* ============ Sidebar ============ */
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg2));
    display: flex;
    flex-direction: column;
    z-index: 90;
    transition: transform 0.3s var(--ease);
}

.sidebar-header { padding: 20px 20px 14px; }
.sidebar-header h2 {
    font-family: var(--font-display);
    color: #F5EDE3;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}
.sidebar-header h2 em { color: var(--copper); font-style: normal; }
.sidebar-header small { color: rgba(245, 237, 227, 0.45); font-size: 0.84rem; letter-spacing: 1.2px; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.sidebar-nav::-webkit-scrollbar-thumb { border-color: var(--sidebar-bg); background: #4A3B2C; }

.nav-section { margin-top: 14px; }
.nav-section-title {
    font-size: 0.8rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(245, 237, 227, 0.35);
    padding: 0 10px 6px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(245, 237, 227, 0.72);
    padding: 11px 12px;
    border-radius: var(--r-sm);
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; opacity: 0.8; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #F5EDE3; transform: translateX(2px); }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(200,149,108,0.22), rgba(200,149,108,0.08));
    color: #F1D9C3;
    font-weight: 500;
    box-shadow: inset 2px 0 0 var(--copper);
}
.sidebar-nav a .badge {
    margin-left: auto;
    background: var(--copper);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 2px 7px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--copper), var(--copper-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem;
    flex-shrink: 0;
}
.user-info .name { color: #F5EDE3; font-size: 0.92rem; font-weight: 500; }
.user-info .role { color: rgba(245, 237, 227, 0.4); font-size: 0.75rem; text-transform: capitalize; }

/* ============ Main / Topbar ============ */
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 26px;
    background: rgba(250, 246, 241, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.page-title h1 { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.breadcrumb { font-size: 0.84rem; color: var(--muted); letter-spacing: 0.4px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
    position: relative;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: var(--muted-2);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.topbar-btn:hover { background: var(--paper); border-color: var(--line); color: var(--copper-dark); box-shadow: var(--shadow-sm); }
.notif-dot {
    position: absolute; top: 7px; right: 7px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--cream);
}

/* Global search trigger */
.search-trigger {
    display: flex; align-items: center; gap: 10px;
    min-width: 220px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.15s;
}
.search-trigger:hover { border-color: var(--copper); box-shadow: var(--shadow-sm); }
.search-trigger kbd {
    margin-left: auto;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 6px;
    color: var(--muted-2);
}

.admin-content { padding: 24px 26px 60px; flex: 1; animation: contentIn 0.35s var(--ease); }
@keyframes contentIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ Cards ============ */
.admin-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    overflow: hidden;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line-2);
}
.admin-card-header h2 { font-size: 0.98rem; font-weight: 600; color: var(--ink); }
.admin-card-body { padding: 20px; }

/* ============ KPI tiles ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--copper-soft);
    color: var(--copper-dark);
}
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.purple { background: #F0EAF7; color: #7C5CB0; }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-info h3 { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.3px; }
.stat-info p { font-size: 0.84rem; color: var(--muted); margin-top: 1px; }

/* ============ Buttons ============ */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: var(--font-ui);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    line-height: 1;
    white-space: nowrap;
}
.btn-admin:active { transform: scale(0.97); }
.btn-admin-primary {
    background: linear-gradient(135deg, var(--copper), var(--copper-dark));
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(169, 116, 76, 0.35);
}
.btn-admin-primary:hover { box-shadow: 0 4px 14px rgba(169, 116, 76, 0.45); filter: brightness(1.04); }
.btn-admin-secondary { background: var(--paper); color: var(--ink-2) !important; border-color: var(--line); }
.btn-admin-secondary:hover { border-color: var(--copper); color: var(--copper-dark) !important; }
.btn-admin-success { background: var(--success); color: #fff !important; }
.btn-admin-success:hover { filter: brightness(1.08); }
.btn-admin-danger { background: var(--paper); color: var(--danger) !important; border-color: #EAC8C2; }
.btn-admin-danger:hover { background: var(--danger); color: #fff !important; }
.btn-admin-ghost { background: transparent; color: var(--muted-2) !important; }
.btn-admin-ghost:hover { background: var(--copper-soft); color: var(--copper-dark) !important; }
.btn-admin-sm { padding: 9px 14px; font-size: 0.85rem; border-radius: 9px; }
.btn-admin-lg { padding: 12px 22px; font-size: 0.95rem; }
.btn-admin[disabled] { opacity: 0.55; pointer-events: none; }

/* ============ Forms ============ */
.admin-form label { display: block; font-size: 0.85rem; font-weight: 550; color: var(--ink-2); margin-bottom: 5px; letter-spacing: 0.2px; }
.admin-form label small { color: var(--muted); font-weight: 400; }
.form-group { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--paper);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(200, 149, 108, 0.15); }
.form-control::placeholder { color: #C4B8A9; }
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }
.form-check { display: flex !important; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem !important; font-weight: 450 !important; }
.form-check input { width: 16px; height: 16px; accent-color: var(--copper); cursor: pointer; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box i { position: absolute; left: 12px; color: var(--muted); font-size: 0.8rem; pointer-events: none; }
.search-box input {
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: var(--font-ui);
    font-size: 0.83rem;
    min-width: 210px;
    background: var(--paper);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(200,149,108,0.15); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============ Tables ============ */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table thead th {
    text-align: left;
    padding: 10px 20px;
    font-size: 0.75rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    background: #FCFAF7;
    white-space: nowrap;
}
.admin-table tbody td { padding: 12px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tbody tr { transition: background 0.12s; }
.admin-table tbody tr:hover { background: #FCF8F3; }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ============ Badges & chips ============ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.active { background: var(--success-bg); color: var(--success); }
.status-badge.inactive { background: var(--danger-bg); color: var(--danger); }
.status-badge.pending { background: var(--warning-bg); color: #8E6D22; }
.status-badge.confirmed { background: var(--info-bg); color: var(--info); }
.status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.cancelled { background: #EFEBE6; color: var(--muted-2); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 550;
    white-space: nowrap;
}
.chip i { font-size: 0.84rem; }
.chip-ok { background: var(--success-bg); color: var(--success); }
.chip-warn { background: var(--warning-bg); color: #8E6D22; }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-muted { background: var(--line-2); color: var(--muted-2); }

/* ============ Action buttons ============ */
.action-btns { display: flex; gap: 6px; }
.action-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.82rem;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--muted-2);
    cursor: pointer;
    transition: all 0.15s;
}
.action-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.action-btn.view:hover { color: var(--info); border-color: var(--info); }
.action-btn.edit:hover { color: var(--copper-dark); border-color: var(--copper); }
.action-btn.delete:hover { color: var(--danger); border-color: var(--danger); }

/* ============ Alerts (inline) ============ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 0.85rem;
    margin-bottom: 18px;
    border: 1px solid;
}
.alert-success { background: var(--success-bg); color: #3F6226; border-color: #D4E5C4; }
.alert-danger, .alert-error { background: var(--danger-bg); color: #93402F; border-color: #EFD0C9; }
.alert-warning { background: var(--warning-bg); color: #8E6D22; border-color: #EFDFB9; }
.alert-info { background: var(--info-bg); color: #375F7D; border-color: #CBDEEC; }

/* ============ Toasts ============ */
.toast-stack {
    position: fixed;
    right: 20px; bottom: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 300;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    background: var(--ink);
    color: #F5EDE3;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.84rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s var(--ease);
    max-width: 380px;
}
.toast i { flex-shrink: 0; }
.toast.success i { color: #A3C97F; }
.toast.danger i { color: #E8967F; }
.toast.warning i { color: #E5C36A; }
.toast.out { animation: toastOut 0.25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ============ Command palette ============ */
.cp-overlay {
    position: fixed; inset: 0;
    background: rgba(42, 33, 24, 0.4);
    backdrop-filter: blur(3px);
    z-index: 400;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.cp-overlay.open { display: flex; animation: fadeIn 0.15s; }
@keyframes fadeIn { from { opacity: 0; } }
.cp {
    width: min(620px, 92vw);
    background: var(--paper);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: cpIn 0.2s var(--ease);
}
@keyframes cpIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
.cp-input {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-2);
}
.cp-input i { color: var(--copper); }
.cp-input input {
    flex: 1; border: none; outline: none;
    font-family: var(--font-ui); font-size: 1rem;
    color: var(--ink); background: transparent;
}
.cp-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cp-group { font-size: 0.84rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.cp-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.87rem;
    color: var(--ink-2);
}
.cp-item i { width: 18px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.cp-item small { margin-left: auto; color: var(--muted); font-size: 0.84rem; }
.cp-item:hover, .cp-item.sel { background: var(--copper-soft); color: var(--ink); }
.cp-item.sel i { color: var(--copper-dark); }
.cp-empty { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 26px; }

/* ============ Pipeline (kanban) ============ */
.pipeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(215px, 1fr));
    gap: 14px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 10px;
}
.pipe-col {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    min-height: 180px;
    display: flex;
    flex-direction: column;
}
.pipe-col.drag-over { border-color: var(--copper); background: var(--copper-soft); }
.pipe-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted-2);
    border-bottom: 1px solid var(--line-2);
}
.pipe-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.pipe-head .count { margin-left: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 1px 8px; font-size: 0.75rem; color: var(--muted-2); }
.pipe-sum { font-size: 0.75rem; color: var(--muted); padding: 6px 14px; border-bottom: 1px solid var(--line-2); }
.pipe-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pipe-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 13px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s var(--ease), box-shadow 0.15s;
    display: block;
    color: var(--ink);
}
.pipe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #DCCDBB; color: var(--ink); }
.pipe-card.dragging { opacity: 0.5; transform: rotate(1.5deg); }
.pipe-card .pc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pipe-card .pc-code { font-size: 0.75rem; font-weight: 650; color: var(--copper-dark); letter-spacing: 0.4px; }
.pipe-card .pc-total { font-size: 0.92rem; font-weight: 650; }
.pipe-card .pc-name { font-size: 0.95rem; font-weight: 550; margin: 3px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-card .pc-meta { font-size: 0.84rem; color: var(--muted); display: flex; gap: 10px; }
.pipe-card .pc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pipe-empty { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 18px 8px; border: 1px dashed var(--line); border-radius: var(--r-md); }

/* ============ Status stepper ============ */
.stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.stepper .st {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.84rem; font-weight: 550;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 30px;
}
.stepper .st .ic {
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--line-2); color: var(--muted);
    font-size: 0.84rem;
}
.stepper .st.done .ic { background: var(--success-bg); color: var(--success); }
.stepper .st.done { color: var(--success); }
.stepper .st.now .ic { background: var(--copper); color: #fff; box-shadow: 0 0 0 4px var(--copper-soft); }
.stepper .st.now { color: var(--copper-dark); font-weight: 650; }
.stepper .st-line { width: 22px; height: 1px; background: var(--line); }

/* ============ Quote builder ============ */
.qb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.qb-col-catalog { display: flex; flex-direction: column; min-height: 0; }

/* Semáforo de disponibilidad (no mueve el layout) */
.sem-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #D9CDBE;
    margin-left: 7px;
    vertical-align: middle;
    transition: background 0.2s, box-shadow 0.2s;
    cursor: help;
}
.sem-dot.libre { background: var(--success); box-shadow: 0 0 0 3px rgba(91,138,56,0.18); }
.sem-dot.moderado { background: var(--warning); box-shadow: 0 0 0 3px rgba(196,154,61,0.2); }
.sem-dot.alto { background: var(--danger); box-shadow: 0 0 0 3px rgba(192,87,70,0.2); }
.qb-catalog-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.qb-cat-chip {
    padding: 6px 13px;
    border-radius: 30px;
    border: 1px solid var(--line);
    background: var(--paper);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted-2);
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.15s;
}
.qb-cat-chip:hover { border-color: var(--copper); color: var(--copper-dark); }
.qb-cat-chip.active { background: var(--ink); border-color: var(--ink); color: #F5EDE3; }
.qb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; }
.qb-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 13px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    position: relative;
}
.qb-item:hover { border-color: var(--copper); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.qb-item.in-quote { border-color: var(--copper); background: #FDF9F4; box-shadow: inset 0 0 0 1px var(--copper); }
.qb-item .qi-cat { font-size: 0.84rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.qb-item .qi-name { font-size: 0.82rem; font-weight: 550; margin: 3px 0; line-height: 1.25; padding-right: 18px; }
.qb-item .qi-price { font-size: 0.8rem; font-weight: 650; color: var(--copper-dark); }
.qb-item .qi-price small { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.qb-item .qi-margin { font-size: 0.84rem; margin-top: 3px; color: var(--muted); }
.qb-item .qi-add {
    position: absolute; top: 9px; right: 9px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--copper-soft); color: var(--copper-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.84rem;
    transition: all 0.15s;
}
.qb-item:hover .qi-add, .qb-item.in-quote .qi-add { background: var(--copper); color: #fff; }
.qb-pkg { grid-column: 1 / -1; background: linear-gradient(120deg, #FDF9F4, var(--paper)); }
.qb-pkg .qi-includes { font-size: 0.75rem; color: var(--muted-2); margin-top: 3px; }

/* Catalog: sections by category with compact rows */
.qb-sections { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.qb-section {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    flex-shrink: 0;
}
.qb-sec-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    background: #FCFAF7;
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--ink-2);
    text-align: left;
}
.qb-sec-head:hover { color: var(--copper-dark); }
.qb-sec-head .count {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.75rem;
    color: var(--muted-2);
    font-weight: 500;
}
.qb-sec-head .chev { margin-left: auto; font-size: 0.84rem; color: var(--muted); transition: transform 0.2s var(--ease); }
.qb-section.collapsed .qb-sec-body { display: none; }
.qb-section.collapsed .chev { transform: rotate(-90deg); }

.qb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    border-top: 1px solid var(--line-2);
    cursor: pointer;
    transition: background 0.12s;
}
.qb-row:hover { background: #FCF8F3; }
.qb-row:hover .qi-add { background: var(--copper); color: #fff; }
.qb-row.in-quote { background: #FDF9F4; box-shadow: inset 3px 0 0 var(--copper); }
.qb-row.in-quote .qi-add { background: var(--copper); color: #fff; }
.qb-row .qi-add { position: static; flex-shrink: 0; }
.qr-name { flex: 1; min-width: 0; font-size: 0.8rem; font-weight: 500; color: var(--ink); line-height: 1.3; }
.qr-name small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-price { text-align: right; font-weight: 650; font-size: 0.84rem; color: var(--copper-dark); white-space: nowrap; line-height: 1.2; }
.qr-price small { display: block; color: var(--muted); font-weight: 400; font-size: 0.84rem; }
.qr-margin { font-size: 0.84rem; color: var(--muted); text-align: right; line-height: 1.35; white-space: nowrap; }
@media (max-width: 700px) { .qr-margin { display: none; } }

.qb-summary { min-height: 0; }
.qb-summary .admin-card { margin-bottom: 12px; }

/* Desktop: the page itself doesn't scroll — each column scrolls on its own */
@media (min-width: 1181px) {
    body.qb-lock { overflow: hidden; height: 100vh; }
    body.qb-lock .admin-main { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
    body.qb-lock .admin-content { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 16px 22px 16px; }
    body.qb-lock .qb-layout { flex: 1; min-height: 0; align-items: stretch; }
    body.qb-lock .qb-sections { flex: 1; overflow-y: auto; padding-right: 4px; padding-bottom: 8px; }
    body.qb-lock .qb-summary { overflow-y: auto; padding-right: 4px; padding-bottom: 8px; }
}
.qb-lines { max-height: 32vh; overflow-y: auto; }
.qb-line {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-2);
    font-size: 0.8rem;
}
.qb-line:last-child { border-bottom: none; }
.qb-line .ql-name { flex: 1; min-width: 0; }
.qb-line .ql-name span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.qb-line .ql-name small { color: var(--muted); font-size: 0.75rem; }
.qb-line .ql-qty { display: flex; align-items: center; gap: 4px; }
.qb-line .ql-qty button {
    width: 20px; height: 20px; border-radius: 6px;
    border: 1px solid var(--line); background: var(--paper);
    color: var(--muted-2); cursor: pointer; font-size: 0.84rem;
    display: flex; align-items: center; justify-content: center;
}
.qb-line .ql-qty button:hover { border-color: var(--copper); color: var(--copper-dark); }
.qb-line .ql-qty b { min-width: 26px; text-align: center; font-size: 0.82rem; }
.qb-line .ql-price input {
    width: 82px; text-align: right;
    border: 1px solid transparent; border-radius: 6px;
    font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600;
    padding: 3px 5px; background: transparent; color: var(--ink);
}
.qb-line .ql-price input:hover { border-color: var(--line); }
.qb-line .ql-price input:focus { outline: none; border-color: var(--copper); background: var(--paper); }
.qb-line .ql-x { color: var(--muted); cursor: pointer; font-size: 0.84rem; padding: 4px; border-radius: 6px; }
.qb-line .ql-x:hover { color: var(--danger); background: var(--danger-bg); }

/* Discount $ / % segmented toggle */
.disc-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.disc-toggle button {
    border: none;
    background: var(--paper);
    color: var(--muted-2);
    font-family: var(--font-ui);
    font-size: 0.84rem;
    font-weight: 650;
    width: 26px; height: 22px;
    cursor: pointer;
    transition: all 0.12s;
}
.disc-toggle button + button { border-left: 1px solid var(--line); }
.disc-toggle button.active { background: var(--ink); color: #F5EDE3; }
.disc-toggle button:not(.active):hover { color: var(--copper-dark); }

.qb-totals { font-size: 0.84rem; }
.qb-totals .row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted-2); }
.qb-totals .row.grand { font-size: 1.15rem; font-weight: 700; color: var(--ink); border-top: 2px solid var(--copper); margin-top: 6px; padding-top: 10px; }
.qb-margin-bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.qb-margin-bar div { height: 100%; border-radius: 4px; transition: width 0.3s var(--ease), background 0.3s; }

/* ============ Calendar ============ */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 6px 0; font-weight: 600; }
.cal-day {
    min-height: 96px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 7px 8px;
    font-size: 0.84rem;
    transition: box-shadow 0.15s, border-color 0.15s;
    position: relative;
}
.cal-day:hover { box-shadow: var(--shadow-md); border-color: var(--copper); }
.cal-day.other { background: transparent; border-color: var(--line-2); }
.cal-day.today { border-color: var(--copper); box-shadow: inset 0 0 0 1px var(--copper); }
.cal-day .d { font-weight: 650; color: var(--muted-2); font-size: 0.8rem; }
.cal-day.today .d { color: var(--copper-dark); }
.cal-ev {
    display: block;
    margin-top: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 550;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #fff !important;
}
.cal-ev.s-cotizacion { background: var(--warning); }
.cal-ev.s-confirmado { background: var(--info); }
.cal-ev.s-en_preparacion, .cal-ev.s-en_curso { background: var(--copper); }
.cal-ev.s-completado { background: var(--success); }
.cal-ev.s-cancelado { background: #B9AFA3; text-decoration: line-through; }
.cal-load { position: absolute; top: 7px; right: 8px; }

/* ============ Timeline / activity ============ */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute; left: -20px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--copper);
}
.tl-item .tl-time { font-size: 0.75rem; color: var(--muted); }
.tl-item .tl-text { font-size: 0.82rem; color: var(--ink-2); }
.tl-item .tl-text b { color: var(--ink); font-weight: 600; }

/* ============ Action queue (dashboard) ============ */
.aq-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--paper);
    margin-bottom: 8px;
    transition: all 0.15s;
    color: var(--ink);
}
.aq-item:hover { border-color: var(--copper); box-shadow: var(--shadow-sm); transform: translateX(2px); color: var(--ink); }
.aq-ico {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
}
.aq-ico.warn { background: var(--warning-bg); color: var(--warning); }
.aq-ico.danger { background: var(--danger-bg); color: var(--danger); }
.aq-ico.info { background: var(--info-bg); color: var(--info); }
.aq-ico.ok { background: var(--success-bg); color: var(--success); }
.aq-item .aq-txt { flex: 1; min-width: 0; }
.aq-item .aq-txt b { display: block; font-size: 0.83rem; font-weight: 550; }
.aq-item .aq-txt small { color: var(--muted); font-size: 0.84rem; }
.aq-item > i.fa-chevron-right { color: var(--muted); font-size: 0.75rem; }

/* ============ Misc ============ */
.img-preview { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--line-2); }
.pagination { display: flex; gap: 6px; padding: 16px 20px; }
.pagination a, .pagination .current {
    min-width: 30px; height: 30px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 0.84rem;
    border: 1px solid var(--line); color: var(--muted-2);
}
.pagination a:hover { border-color: var(--copper); color: var(--copper-dark); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty-state { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty-state i { font-size: 1.9rem; margin-bottom: 10px; opacity: 0.4; }
.empty-state h3 { font-size: 0.95rem; color: var(--muted-2); font-weight: 550; margin-bottom: 4px; }
.empty-state p { font-size: 0.84rem; }

.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, #F9F5EF 50%, var(--line-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.filter-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

/* ============ Login ============ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(800px 500px at 20% 0%, rgba(200,149,108,0.14), transparent),
        radial-gradient(700px 400px at 90% 100%, rgba(212,175,55,0.08), transparent),
        var(--cream);
    font-family: var(--font-ui);
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 390px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-family: var(--font-display); font-size: 2rem; color: var(--ink); }
.login-logo h1 em { color: var(--copper); font-style: normal; }
.login-logo p { color: var(--muted); font-size: 0.84rem; letter-spacing: 1.4px; text-transform: uppercase; margin-top: 4px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card label { display: block; font-size: 0.82rem; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--copper), var(--copper-dark));
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.92rem;
    font-weight: 550;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(169, 116, 76, 0.35);
    transition: all 0.2s;
}
.btn-login:hover { filter: brightness(1.05); box-shadow: 0 6px 18px rgba(169,116,76,0.45); }

/* ============ Responsive ============ */
.sidebar-toggle { display: none; }

@media (max-width: 1180px) {
    .qb-layout { grid-template-columns: 1fr; }
    .qb-summary { position: static; }
    .pipeline { grid-template-columns: repeat(5, 240px); }
}

@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .admin-sidebar.open { transform: none; }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .search-trigger { min-width: 0; }
    .search-trigger .st-label, .search-trigger kbd { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .admin-content { padding: 16px 14px 60px; }
    .admin-topbar { padding: 0 14px; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .cal-day { min-height: 64px; }

    /* iOS: inputs de 16px evitan el auto-zoom de Safari al enfocar */
    .form-control, .search-box input, select.form-control, textarea.form-control { font-size: 16px !important; }
    .cp-input input { font-size: 16px; }

    /* Áreas táctiles cómodas (~44px de alto) */
    .btn-admin { min-height: 42px; padding: 10px 16px; }
    .btn-admin-sm { min-height: 38px; padding: 8px 13px; font-size: 0.82rem; }
    .action-btn { width: 38px; height: 38px; font-size: 0.85rem; }
    .topbar-btn { width: 42px; height: 42px; }
    .qb-row { padding: 10px 12px; }
    .qb-sec-head { padding: 12px; min-height: 44px; }
    .qb-line .ql-qty button { width: 30px; height: 30px; }
    .aq-item { padding: 13px 14px; }
    .pagination a, .pagination .current { min-width: 38px; height: 38px; }
}

/* Sidebar backdrop for mobile */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(42,33,24,0.4); z-index: 85; display: none; }
.sidebar-backdrop.show { display: block; }

/* ============================================================
   COTIZADOR v2 — escala desktop + experiencia móvil tipo app
   ============================================================ */

/* Focus visible para navegación por teclado */
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.form-control:focus-visible, .search-box input:focus-visible { outline: none; }

/* ---- Layout desktop: 60/40 con más aire ---- */
.qb-layout { grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr); gap: 22px; }

/* ---- Herramientas del catálogo ---- */
.qb-tools { margin-bottom: 14px; }
.qb-search-row { display: flex; gap: 10px; margin-bottom: 12px; }
.qb-searchbig { flex: 1; }
.qb-searchbig i { font-size: 1rem; left: 16px; }
.qb-searchbig input {
    width: 100%;
    height: 50px;
    font-size: 1rem;
    padding: 0 16px 0 44px;
    border-radius: 13px;
    min-width: 0;
}
.qb-collapse-btn {
    width: 50px; height: 50px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 13px;
    color: var(--muted-2);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.qb-collapse-btn:hover { border-color: var(--copper); color: var(--copper-dark); }

/* Categorías: carrusel horizontal de una sola línea */
.qb-cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.qb-cats::-webkit-scrollbar { display: none; }
.qb-cat-chip {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 0.9rem;
    min-height: 42px;
    border-radius: 30px;
}

/* ---- Filas del catálogo: legibles y con aire ---- */
.qb-sec-head { padding: 14px 18px; font-size: 1rem; min-height: 52px; gap: 12px; }
.qb-sec-head .count { font-size: 0.8rem; padding: 2px 10px; }
.qb-row { padding: 13px 18px; gap: 14px; }
.qr-name { font-size: 1.02rem; font-weight: 600; }
.qr-name small { font-size: 0.84rem; font-weight: 400; margin-top: 3px; white-space: normal; line-height: 1.4; }
.qr-price { font-size: 1.02rem; }
.qr-price small { font-size: 0.78rem; }
.qr-margin { font-size: 0.78rem; line-height: 1.4; }
.qb-row .qi-add {
    width: 42px; height: 42px;
    font-size: 0.95rem;
    border-radius: 50%;
}

/* ---- Formulario: invitados con stepper propio ---- */
.qb-guests { display: flex; gap: 8px; align-items: stretch; }
.qb-guests button {
    width: 52px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 10px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--copper-dark);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.qb-guests button:hover { border-color: var(--copper); background: var(--copper-soft); }
.qb-guests input { text-align: center; font-weight: 650; }

/* Detalles adicionales (progressive disclosure) */
.qb-more summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-top: 4px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 0.92rem;
    font-weight: 550;
    color: var(--copper-dark);
    min-height: 46px;
}
.qb-more summary::-webkit-details-marker { display: none; }
.qb-more summary .chev-mini { margin-left: auto; font-size: 0.8rem; color: var(--muted); transition: transform 0.2s var(--ease); }
.qb-more[open] summary .chev-mini { transform: rotate(180deg); }

/* ---- Líneas de la cotización ---- */
.qb-line { padding: 12px 0; gap: 11px; }
.qb-line .ql-name span { font-size: 0.98rem; font-weight: 550; }
.qb-line .ql-name small { font-size: 0.8rem; }
.qb-line .ql-qty button { width: 32px; height: 32px; border-radius: 8px; font-size: 0.75rem; }
.qb-line .ql-qty input { height: 32px; }
.qb-line .ql-price input { width: 92px; font-size: 0.9rem; padding: 6px; }
.qb-line .ql-x { font-size: 0.9rem; padding: 8px; }

/* ---- Totales: el TOTAL manda ---- */
.qb-totals { font-size: 0.95rem; }
.qb-totals .row { padding: 7px 0; }
.qb-grand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ink);
    border-radius: 14px;
    padding: 14px 18px;
    margin-top: 12px;
}
.qb-grand-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--copper);
    font-weight: 650;
}
.qb-grand-per { display: block; font-size: 0.8rem; color: rgba(245,237,227,0.6); margin-top: 2px; }
.qb-grand-amount { font-size: 1.7rem; font-weight: 700; color: #F5EDE3; letter-spacing: -0.5px; }

/* ---- Acciones: jerarquía clara ---- */
.qb-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.qb-btn-main { width: 100%; justify-content: center; padding: 15px; font-size: 1.02rem; }
.qb-btn-alt { width: 100%; justify-content: center; padding: 12px; font-size: 0.92rem; }

/* ---- CTA móvil y hoja: ocultos en desktop ---- */
.qb-cta { display: none; }
.qb-sheet-head { display: none; }
.qb-added-flash { display: none; }

/* ============================================================
   MÓVIL (≤1180px): catálogo a pantalla completa + hoja deslizante
   ============================================================ */
@media (max-width: 1180px) {
    .qb-layout { display: block; }
    .qb-col-catalog { padding-bottom: 110px; }

    /* Búsqueda y categorías siempre a la mano */
    .qb-tools {
        position: sticky;
        top: var(--topbar-h);
        z-index: 40;
        background: var(--cream);
        padding: 10px 0 8px;
        margin: 0 0 10px;
    }

    /* La cotización es una hoja a pantalla completa */
    .qb-summary {
        position: fixed;
        inset: 0;
        z-index: 220;
        background: var(--cream);
        transform: translateY(104%);
        transition: transform 0.35s var(--ease);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 14px calc(28px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
    }
    body.qb-sheet-open .qb-summary { transform: none; }
    body.qb-sheet-open { overflow: hidden; }

    .qb-sheet-head {
        display: flex;
        align-items: center;
        gap: 14px;
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--cream);
        padding: calc(12px + env(safe-area-inset-top)) 0 12px;
        margin-bottom: 4px;
    }
    .qb-sheet-close {
        width: 46px; height: 46px;
        border: 1px solid var(--line);
        background: var(--paper);
        border-radius: 13px;
        color: var(--ink);
        font-size: 1.05rem;
        cursor: pointer;
        flex-shrink: 0;
    }
    .qb-sheet-head b { display: block; font-size: 1.15rem; }
    .qb-sheet-head small { color: var(--muted-2); font-size: 0.85rem; }

    /* Dentro de la hoja las líneas crecen libres */
    .qb-lines { max-height: none; }

    /* CTA flotante: el puente Catálogo - Cotización */
    .qb-cta {
        display: flex;
        align-items: center;
        gap: 11px;
        position: fixed;
        left: 14px; right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        height: 60px;
        z-index: 210;
        background: var(--ink);
        color: #F5EDE3;
        border: none;
        border-radius: 17px;
        padding: 0 20px;
        font-family: var(--font-ui);
        font-size: 1.02rem;
        font-weight: 550;
        cursor: pointer;
        box-shadow: 0 10px 30px rgba(42, 33, 24, 0.35);
    }
    .qb-cta i { color: var(--copper); font-size: 1.1rem; }
    .qb-cta-count {
        background: var(--copper);
        color: #fff;
        min-width: 26px; height: 26px;
        border-radius: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        font-weight: 700;
        padding: 0 8px;
    }
    .qb-cta-total { margin-left: auto; font-size: 1.15rem; font-weight: 700; color: var(--copper); }
    .qb-cta.empty { background: #4A3F35; }
    .qb-cta.empty .qb-cta-total { color: rgba(245,237,227,0.5); }
    .qb-cta.pulse { animation: ctaPulse 0.45s var(--ease); }

    /* Confirmación efímera al agregar */
    .qb-added-flash {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        left: 50%;
        bottom: calc(88px + env(safe-area-inset-bottom));
        transform: translateX(-50%) translateY(8px);
        background: var(--success);
        color: #fff;
        padding: 10px 18px;
        border-radius: 30px;
        font-size: 0.92rem;
        font-weight: 550;
        z-index: 215;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s, transform 0.25s var(--ease);
        max-width: calc(100vw - 40px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .qb-added-flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes ctaPulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.035); box-shadow: 0 10px 34px rgba(200,149,108,0.5); }
    100% { transform: scale(1); }
}

/* Header móvil: CTA de Nueva cotización como icono */
@media (max-width: 900px) {
    .nc-btn { width: 42px; height: 42px !important; padding: 0 !important; justify-content: center; border-radius: 50%; }
    .nc-btn .nc-label { display: none; }
    .page-title h1 { font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
    .breadcrumb { display: none; }
}

/* Líneas de cotización en móvil: nombre arriba, controles abajo */
@media (max-width: 1180px) {
    .qb-line { flex-wrap: wrap; row-gap: 10px; }
    .qb-line .ql-name { flex: 1 1 100%; min-width: 100%; }
    .qb-line .ql-name span { white-space: normal; }
    .qb-line .ql-qty { gap: 6px; }
    .qb-line .ql-qty button { width: 38px; height: 38px; }
    .qb-line .ql-qty input { height: 38px; width: 58px !important; font-size: 0.95rem !important; }
    .qb-line .ql-price { margin-left: auto; }
    .qb-line .ql-price input { width: 100px; height: 38px; font-size: 0.95rem; }
    .qb-line .ql-x { padding: 10px; }
}
