/* ═══════════════════════════════════════════════════
   ORDER MANAGEMENT SYSTEM — Design System
   Premium bespoke tailoring aesthetic
   ═══════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    --ink: #1a2e1e;
    --ink-mid: #3a5c42;
    --ink-light: #7a9e7e;
    --line: #ddd8c4;
    --line-light: #eae6d4;
    --bg: #f2eed8;
    --bg-deep: #e8e3ca;
    --white: #faf8f0;
    --accent: #b8975a;
    --accent-hover: #9e7e3e;
    --accent-light: #f5f0e8;
    --danger: #c0392b;
    --danger-bg: #fdf3f2;
    --danger-border: #f5c6c2;
    --success: #2d6a4f;
    --success-bg: #edf7f2;
    --success-border: #a8d5bc;
    --take-in: #1a3a5c;
    --take-in-bg: #eef4fb;
    --let-out: #8b3a2a;
    --let-out-bg: #fdf0ee;
    --radius: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.15);
    --transition: 0.18s ease;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-light); }

/* ═══════════════════════
   TOPBAR
   ═══════════════════════ */
.topbar {
    height: 54px;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.topbar-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.brand-text {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--white);
    text-transform: uppercase;
}
.topbar-nav {
    display: flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.06);
    padding: 3px;
    border-radius: 6px;
}
.topbar-link {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    border-radius: 4px;
    transition: all var(--transition);
    letter-spacing: 0.03em;
}
.topbar-link:hover { color: rgba(255,255,255,0.8); }
.topbar-link.active { background: rgba(255,255,255,0.12); color: white; }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { font-size: 12px; color: rgba(255,255,255,0.45); }
.topbar-role { color: rgba(255,255,255,0.3); }
.topbar-store {
    font-size: 11px; color: var(--accent); font-weight: 600;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border: 1px solid rgba(184,151,90,0.3);
    border-radius: 3px;
}
.topbar-logout {
    font-size: 16px; color: rgba(255,255,255,0.3);
    cursor: pointer; transition: color var(--transition);
    text-decoration: none; line-height: 1;
}
.topbar-logout:hover { color: var(--danger); }

/* ═══════════════════════
   LOGIN PAGE
   ═══════════════════════ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2e1e 0%, #2a4a30 50%, #1a3d1e 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(184,151,90,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(184,151,90,0.05) 0%, transparent 40%);
    animation: loginGlow 15s ease-in-out infinite alternate;
}
@keyframes loginGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3%, -3%) rotate(5deg); }
}
.login-card {
    width: 420px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 80px rgba(184,151,90,0.1);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: loginSlide 0.5s ease-out;
}
@keyframes loginSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-header {
    padding: 36px 36px 28px;
    text-align: center;
    border-bottom: 1px solid var(--line-light);
}
.login-brand {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 6px;
}
.login-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.03em;
}
.login-body { padding: 32px 36px 36px; }
.login-field { margin-bottom: 20px; }
.login-label {
    display: block;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mid);
    font-weight: 600;
    margin-bottom: 8px;
}
.login-input {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184,151,90,0.12);
}
.login-btn {
    width: 100%;
    height: 46px;
    background: var(--ink);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 4px;
}
.login-btn:hover { background: #2e4e32; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.login-btn:active { transform: translateY(0); }
.login-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 12px;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.login-hint {
    margin-top: 20px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 11px;
    color: var(--ink-light);
    line-height: 1.7;
}
.login-hint strong { color: var(--ink-mid); font-weight: 600; }

/* ═══════════════════════
   DASHBOARD
   ═══════════════════════ */
.dashboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}
.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}
.dashboard-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.02em;
}
.dashboard-subtitle {
    font-size: 12px;
    color: var(--ink-light);
    margin-top: 2px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--line);
    transition: background var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:hover::after { background: var(--accent); }
.stat-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-light);
    font-weight: 600;
    margin-bottom: 8px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
}
.stat-sub {
    font-size: 11px;
    color: var(--ink-light);
    margin-top: 6px;
}

/* ═══════════════════════
   CARDS & TABLES
   ═══════════════════════ */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, var(--white) 0%, rgba(242,238,216,0.3) 100%);
}
.card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.02em;
}
.card-body { padding: 0; }

/* Orders Table */
.orders-table {
    width: 100%;
    border-collapse: collapse;
}
.orders-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-light);
    font-weight: 600;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.orders-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-light);
    font-size: 13px;
    vertical-align: middle;
}
.orders-table tr { transition: background var(--transition); cursor: pointer; }
.orders-table tbody tr:hover { background: rgba(184,151,90,0.04); }
.orders-table tr:last-child td { border-bottom: none; }

.order-number {
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.03em;
    font-size: 12px;
}
.order-client {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--ink);
    letter-spacing: 0.02em;
}
.order-items-list {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.garment-pill {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink-mid);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.order-date { font-size: 12px; color: var(--ink-mid); }
.order-actions { display: flex; gap: 6px; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-draft { background: var(--bg); color: var(--ink-light); border: 1px solid var(--line); }
.badge-submitted { background: #e8f0fe; color: #1a56db; }
.badge-production { background: #fef3c7; color: #92400e; }
.badge-firstfit { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(184,151,90,0.3); }
.badge-secondfit { background: #f0fdf4; color: var(--success); }
.badge-ready { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-delivered { background: var(--ink); color: white; }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }

/* ═══════════════════════
   BUTTONS
   ═══════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 11px; }
.btn-lg { height: 42px; padding: 0 24px; font-size: 13px; }
.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { background: #2e4e32; color: white; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-gold { background: var(--accent); color: white; }
.btn-gold:hover { background: var(--accent-hover); color: white; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-mid); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #a93226; color: white; }
.btn-row { display: flex; gap: 8px; align-items: center; }

/* ═══════════════════════
   FORM ELEMENTS
   ═══════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-mid);
    font-weight: 600;
    display: flex; align-items: center; gap: 5px;
}
.req { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }
.field-input {
    height: 38px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,151,90,0.1); }
.field-input.filled { background: var(--bg); }
.field-textarea {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink);
    background: var(--white);
    outline: none;
    resize: none;
    transition: border-color var(--transition);
    line-height: 1.5;
}
.field-textarea:focus { border-color: var(--accent); }

/* Toggle Options (Checklist) */
.option-group { display: flex; flex-wrap: wrap; gap: 6px; }
.option-btn {
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--ink-mid);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    user-select: none;
    white-space: nowrap;
}
.option-btn:hover { border-color: var(--ink); color: var(--ink); }
.option-btn.active { background: var(--ink); border-color: var(--ink); color: white; font-weight: 500; }
.option-btn.active-gold { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

/* ═══════════════════════
   WIZARD / STEP LAYOUT
   ═══════════════════════ */
.wizard-layout {
    display: flex;
    height: calc(100vh - 54px);
    overflow: hidden;
}
.wizard-sidebar {
    width: 220px;
    background: var(--bg);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}
.wizard-sidebar-top { padding: 20px 0 10px; }
.wizard-sidebar-label {
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--ink-light);
    text-transform: uppercase;
    font-weight: 600;
    padding: 0 20px 10px;
}
.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}
.wizard-step:hover { background: rgba(0,0,0,0.025); }
.wizard-step.active { background: var(--white); }
.wizard-step.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.step-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--ink-light); font-weight: 600;
    flex-shrink: 0;
    transition: all 0.15s;
}
.wizard-step.done .step-dot { background: var(--accent); border-color: var(--accent); color: white; }
.wizard-step.active .step-dot { background: var(--ink); border-color: var(--ink); color: white; }
.step-text { font-size: 12px; color: var(--ink-light); line-height: 1.3; }
.wizard-step.active .step-text { color: var(--ink); font-weight: 500; }
.wizard-step.done .step-text { color: var(--ink-mid); }

.wizard-divider { border: none; border-top: 1px solid var(--line); margin: 10px 20px; }

/* Basket Summary in Sidebar */
.basket-summary { padding: 12px 20px; flex: 1; overflow-y: auto; }
.basket-pill {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 6px;
    transition: all var(--transition);
}
.basket-pill:hover { border-color: var(--ink-light); }
.basket-pill-name { font-size: 12px; color: var(--ink); font-weight: 500; }
.basket-pill-fabric { font-size: 10px; color: var(--ink-light); margin-top: 1px; }
.basket-pill-qty {
    font-size: 10px; color: var(--accent); font-weight: 600;
    background: var(--accent-light); padding: 2px 8px; border-radius: 10px;
}
.basket-pill.clickable { cursor: pointer; }
.basket-pill.clickable:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.basket-pill-price {
    font-size: 10px; color: var(--ink-mid); margin-top: 2px;
}

/* Payment Modal */
.payment-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.35);
    z-index: 500; display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.payment-modal {
    width: 460px; max-width: 90vw;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalSlide 0.2s ease-out;
}
@keyframes modalSlide { from { opacity:0;transform:translateY(12px); } to { opacity:1;transform:translateY(0); } }
.payment-modal-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(180deg, var(--white) 0%, rgba(242,238,216,0.3) 100%);
}
.payment-modal-title {
    font-family: var(--font-display); font-size: 18px; font-weight: 400;
    color: var(--ink); letter-spacing: 0.02em;
}
.payment-modal-close {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--white); cursor: pointer; font-size: 14px; color: var(--ink-light);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.12s;
}
.payment-modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.payment-modal-body { padding: 20px 22px; }
.payment-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    background: var(--bg);
}

/* Pricing Summary */
.pricing-summary {
    background: var(--white); border: 1.5px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden;
}
.pricing-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-bottom: 1px solid var(--line-light);
    font-size: 12px; color: var(--ink-mid);
}
.pricing-row:last-child { border-bottom: none; }
.pricing-row-label { display: flex; align-items: center; gap: 6px; }
.pricing-row-val { font-weight: 600; color: var(--ink); font-size: 13px; }
.pricing-row.total {
    background: var(--ink); color: rgba(255,255,255,0.7);
    padding: 12px 16px; font-weight: 500;
}
.pricing-row.total .pricing-row-val {
    color: white; font-size: 16px; font-family: var(--font-display); letter-spacing: 0.04em;
}
.pricing-row.discount { color: var(--success); }
.pricing-row.discount .pricing-row-val { color: var(--success); }
.price-input {
    width: 120px; height: 32px; border: 1.5px solid var(--line); border-radius: var(--radius);
    padding: 0 10px; font-family: var(--font-body); font-size: 13px; text-align: right;
    color: var(--ink); background: var(--white); outline: none;
    transition: border-color var(--transition);
}
.price-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,151,90,0.1); }
.price-input-sm { width: 80px; }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Client bar */
.client-bar {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--line);
}
.client-bar-label { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-light); margin-bottom: 3px; }
.client-bar-name { font-family: var(--font-display); font-size: 15px; color: var(--ink); letter-spacing: 0.03em; }

/* Wizard Content */
.wizard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.screen { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.screen.active { display: flex; }

.screen-header {
    padding: 18px 28px 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.screen-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}
.screen-subtitle { font-size: 12px; color: var(--ink-light); }

.screen-body {
    flex: 1; overflow-y: auto; padding: 22px 28px;
}

/* Screen Footer */
.screen-footer {
    height: 58px;
    border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; flex-shrink: 0;
    background: var(--white);
}
.footer-info { font-size: 12px; color: var(--ink-light); }
.footer-info strong { color: var(--ink); }

/* ═══════════════════════
   ITEM TABS
   ═══════════════════════ */
.item-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    padding: 0 28px;
    background: var(--white);
    overflow-x: auto;
}
.item-tab {
    padding: 11px 16px;
    font-size: 12px;
    cursor: pointer;
    color: var(--ink-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.12s;
    white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.item-tab:hover { color: var(--ink); }
.item-tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background 0.15s; }
.item-tab.done .tab-dot { background: var(--accent); }
.item-tab.active .tab-dot { background: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════
   SECTION SEPARATORS
   ═══════════════════════ */
.sep { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; }
.sep:first-child { margin-top: 0; }
.sep-label {
    font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-light); font-weight: 600; white-space: nowrap;
}
.sep-line { flex: 1; height: 1px; background: var(--line); }

/* ═══════════════════════
   BANNERS
   ═══════════════════════ */
.banner {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.6;
    display: flex; gap: 8px; align-items: flex-start;
    margin-bottom: 14px;
}
.banner-info { background: var(--accent-light); border: 1px solid #ddd0b0; color: #7a5c2e; }
.banner-warn { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.banner-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }

/* ═══════════════════════
   PRESET CARDS
   ═══════════════════════ */
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.preset-card {
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--white);
}
.preset-card:hover { border-color: var(--ink); box-shadow: var(--shadow-sm); }
.preset-card.active { border-color: var(--ink); background: var(--ink); }
.preset-card-name {
    font-family: var(--font-display);
    font-size: 15px; color: var(--ink); font-weight: 500; letter-spacing: 0.04em;
}
.preset-card.active .preset-card-name { color: white; }
.preset-card-desc { font-size: 11px; color: var(--ink-light); margin-top: 3px; line-height: 1.4; }
.preset-card.active .preset-card-desc { color: rgba(255,255,255,0.5); }

/* ═══════════════════════
   QUANTITY CONTROLS
   ═══════════════════════ */
.qty-control { display: flex; align-items: center; }
.qty-btn {
    width: 32px; height: 32px;
    border: 1.5px solid var(--line);
    background: var(--white);
    font-size: 16px; font-weight: 300;
    cursor: pointer; color: var(--ink-mid);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.12s; line-height: 1;
    font-family: var(--font-body);
}
.qty-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.qty-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.qty-btn:hover { background: var(--bg); color: var(--ink); }
.qty-btn:active { background: var(--ink); color: white; }
.qty-val {
    width: 40px; height: 32px;
    border: 1.5px solid var(--line); border-left: none; border-right: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--ink); font-weight: 600;
    background: var(--white);
}
.qty-val.has-value { background: var(--ink); color: white; }

/* ═══════════════════════
   FABRIC CARD
   ═══════════════════════ */
.fabric-card {
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px;
}
.fabric-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fabric-card-name { font-size: 13px; color: var(--ink); font-weight: 500; }
.fabric-card-meta { font-size: 11px; color: var(--ink-mid); }

/* Tags */
.tag {
    font-size: 9px; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 2px;
    font-weight: 600; text-transform: uppercase; display: inline-block;
}
.tag-ok { background: var(--success-bg); color: var(--success); }
.tag-pending { background: var(--danger-bg); color: var(--danger); }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-info { background: var(--accent-light); color: var(--accent); }

/* ═══════════════════════
   MEASUREMENT GRID
   ═══════════════════════ */
.meas-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px;
}
.meas-cell {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px 12px;
}
.meas-cell-label {
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-light); margin-bottom: 4px; font-weight: 600;
}
.meas-cell-val {
    font-family: var(--font-display); font-size: 20px; color: var(--ink); font-weight: 500;
}
.meas-cell-unit { font-size: 9px; color: var(--ink-light); margin-left: 2px; }
.meas-cell.empty .meas-cell-val { color: #ddd; }

/* Fit Pills */
.fit-pill {
    height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px;
    font-size: 11px; color: var(--ink-mid); cursor: pointer; transition: all 0.12s;
    display: inline-flex; align-items: center; background: var(--white); user-select: none;
}
.fit-pill:hover { border-color: var(--ink); color: var(--ink); }
.fit-pill.active { background: var(--ink); border-color: var(--ink); color: white; }

/* ═══════════════════════
   REVIEW CARDS
   ═══════════════════════ */
.review-card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden;
}
.review-card-head {
    padding: 10px 16px;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-mid); font-weight: 600;
}
.review-card-head .edit-link {
    font-size: 11px; color: var(--accent); cursor: pointer;
    text-transform: none; letter-spacing: 0; font-weight: 400;
}
.review-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
}
.review-cell {
    padding: 10px 16px;
    border-right: 1px solid var(--line-light);
    border-bottom: 1px solid var(--line-light);
}
.review-cell:nth-child(4n) { border-right: none; }
.review-cell-label {
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-light); margin-bottom: 3px;
}
.review-cell-val { font-size: 13px; color: var(--ink); font-weight: 500; }
.review-cell-val.warn { color: var(--danger); font-weight: 400; font-size: 11px; }

/* ═══════════════════════
   SUCCESS SCREEN
   ═══════════════════════ */
.success-screen {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex: 1; gap: 14px; text-align: center; padding: 40px;
}
.success-circle {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--success);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: white;
    animation: successPop 0.4s ease-out;
}
@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.success-title {
    font-family: var(--font-display); font-size: 30px; color: var(--ink); font-weight: 400;
}
.success-sub {
    font-size: 13px; color: var(--ink-light); max-width: 400px; line-height: 1.7;
}
.success-ref {
    font-family: var(--font-display); font-size: 17px;
    letter-spacing: 0.14em; color: var(--ink);
    padding: 10px 24px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--bg);
}

/* ═══════════════════════
   ADJUSTMENT CONTROLS (First Fit)
   ═══════════════════════ */
.adj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.adj-grid-2 { grid-template-columns: repeat(2, 1fr); }
.adj-card {
    background: var(--bg); border: 1.5px solid var(--line);
    border-radius: var(--radius-lg); padding: 14px 16px;
    transition: all 0.15s;
}
.adj-card.take-in { border-color: var(--take-in); background: var(--take-in-bg); }
.adj-card.let-out { border-color: var(--let-out); background: var(--let-out-bg); }
.adj-label {
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--ink-light); font-weight: 600; margin-bottom: 10px;
}
.adj-card.take-in .adj-label { color: var(--take-in); }
.adj-card.let-out .adj-label { color: var(--let-out); }
.adj-control { display: flex; align-items: center; justify-content: center; }
.adj-btn {
    width: 38px; height: 38px;
    border: 1.5px solid var(--line); background: var(--white);
    font-size: 18px; font-weight: 300; cursor: pointer; color: var(--ink-mid);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.1s; font-family: var(--font-body);
}
.adj-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.adj-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.adj-btn:hover { background: var(--bg); color: var(--ink); }
.adj-btn:active { background: var(--ink); color: white; }
.adj-val {
    min-width: 80px; height: 38px;
    border: 1.5px solid var(--line); border-left: none; border-right: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--ink-light); font-weight: 400;
    background: var(--white);
}
.adj-val.negative { color: var(--take-in); font-weight: 600; background: var(--take-in-bg); }
.adj-val.positive { color: var(--let-out); font-weight: 600; background: var(--let-out-bg); }
.adj-direction {
    margin-top: 8px; text-align: center;
    font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; min-height: 14px;
}
.adj-direction.take-in { color: var(--take-in); }
.adj-direction.let-out { color: var(--let-out); }

/* Toggle */
.toggle-switch {
    width: 34px; height: 18px; border-radius: 9px;
    background: var(--line); cursor: pointer; position: relative;
    transition: background 0.15s; border: none;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: white; transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on { background: var(--success); }
.toggle-switch.on::after { transform: translateX(16px); }

/* ═══════════════════════
   PRINT SHEETS
   ═══════════════════════ */
.print-layout { padding: 24px; background: #d8d3cc; min-height: calc(100vh - 54px); }
.print-bar {
    max-width: 820px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.print-bar-title {
    font-family: var(--font-display); font-size: 15px;
    letter-spacing: 0.12em; color: #555; text-transform: uppercase;
}
.sheet-tabs {
    display: flex; gap: 4px;
    background: rgba(0,0,0,0.1); padding: 3px; border-radius: 6px;
}
.sheet-tab {
    padding: 6px 14px; font-size: 11px; font-weight: 500;
    letter-spacing: 0.05em; border-radius: 4px; cursor: pointer;
    color: rgba(0,0,0,0.4); transition: all 0.15s; border: none;
    background: transparent; font-family: var(--font-body);
}
.sheet-tab:hover { color: rgba(0,0,0,0.7); }
.sheet-tab.active { background: white; color: #1a1a1a; box-shadow: var(--shadow-sm); }

.sheet-wrap { max-width: 820px; margin: 0 auto; display: none; }
.sheet-wrap.active { display: block; }
.sheet {
    width: 100%; background: white; box-shadow: var(--shadow-lg);
    padding: 36px 40px 40px; position: relative;
}

/* ═══════════════════════
   UTILITIES
   ═══════════════════════ */
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-light); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* ═══════════════════════
   TOAST
   ═══════════════════════ */
.toast-container {
    position: fixed; top: 70px; right: 24px;
    z-index: 1000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    color: white;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast.hiding { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ═══════════════════════
   RESPONSIVE
   ═══════════════════════ */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .wizard-sidebar { width: 190px; }
}
@media (max-width: 768px) {
    .topbar { padding: 0 16px; }
    .topbar-nav { display: none; }
    .dashboard { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .wizard-sidebar { width: 60px; }
    .step-text, .basket-summary, .client-bar, .wizard-sidebar-label { display: none; }
    .wizard-step { padding: 10px 0; justify-content: center; }
    .screen-header { padding: 14px 16px 10px; }
    .screen-body { padding: 16px; }
    .screen-footer { padding: 0 16px; }
    .preset-grid { grid-template-columns: 1fr 1fr; }
    .meas-grid { grid-template-columns: repeat(3, 1fr); }
    .adj-grid { grid-template-columns: 1fr 1fr; }
    .review-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
    body { background: white; }
    .topbar, .topbar-nav, .print-bar { display: none !important; }
    .print-layout { padding: 0; background: white; }
    .sheet-wrap { display: block !important; max-width: 100%; margin: 0; }
    .sheet { box-shadow: none; padding: 15mm 18mm; }
    .sheet + .sheet { page-break-before: always; }
}
