:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --border: #e2e4e9;
    --text: #1f2430;
    --text-muted: #6b7280;
    --primary: #2b5fd9;
    --primary-dark: #1e46ab;
    --danger: #d63b3b;
    --success: #1f9d55;
    --warning: #b8860b;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #171a21;
    color: #cfd3dc;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: nowrap;
    transition: width .4s cubic-bezier(.65,0,.35,1), padding .4s cubic-bezier(.65,0,.35,1), opacity .3s ease;
    /* Pinned to the viewport - without this, a flex sibling (.main) taller than the
       screen (long product tables, the shop filters column) stretches .sidebar to
       match it, and the toggle button at its bottom ends up far below the fold. */
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
}

html.layout-modern .sidebar {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
}

.sidebar .brand {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 0 20px 20px;
    display: block;
    border-bottom: 1px solid #2a2e38;
    margin-bottom: 12px;
}

.sidebar nav a {
    display: block;
    padding: 10px 20px;
    color: #cfd3dc;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: #262b36;
    color: #fff;
    text-decoration: none;
}

.sidebar .user-box {
    padding: 14px 20px;
    border-top: 1px solid #2a2e38;
    margin-top: 12px;
    font-size: 13px;
}

.sidebar-modern-toggle {
    margin: auto 16px 16px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #2a2e38;
    background: #1e222c;
    color: #cfd3dc;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}
.sidebar-modern-toggle:hover { background: #262b36; color: #fff; }

/* --- Modern (macOS-style) bottom dock, toggled via the sidebar button --- */
.dock {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 150%);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(23, 26, 33, .82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
    z-index: 1000;
    transition: transform .5s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
}
html.layout-modern .dock { transform: translate(-50%, 0); pointer-events: auto; }

.dock-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: rgba(255,255,255,.07);
    border: none;
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    color: #fff;
    opacity: 0;
    transform: translateY(14px) scale(.9);
    transition: transform .18s cubic-bezier(.34,1.56,.64,1), background .18s ease, opacity .35s ease, transform .35s ease;
}
html.layout-modern .dock-icon { opacity: 1; transform: translateY(0) scale(1); }
.dock-icon:nth-child(1) { transition-delay: .03s; }
.dock-icon:nth-child(2) { transition-delay: .06s; }
.dock-icon:nth-child(3) { transition-delay: .09s; }
.dock-icon:nth-child(4) { transition-delay: .12s; }
.dock-icon:nth-child(5) { transition-delay: .15s; }
.dock-icon:nth-child(6) { transition-delay: .18s; }
.dock-icon:nth-child(7) { transition-delay: .21s; }
.dock-icon:nth-child(8) { transition-delay: .24s; }

.dock-icon:hover { background: rgba(255,255,255,.18); transform: translateY(-10px) scale(1.18); }
.dock-icon.active { background: rgba(255,255,255,.24); }

.dock-icon::after {
    content: attr(data-label);
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1f2430;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
.dock-icon:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.dock-divider { width: 1px; height: 32px; align-self: center; background: rgba(255,255,255,.18); margin: 0 2px; }

.main { flex: 1; min-width: 0; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content { padding: 24px; }

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    animation: couponIn .35s cubic-bezier(.22,.61,.36,1) both;
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,24,33,.08); }

.stat-card-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    border-radius: 9px;
    margin-bottom: 12px;
}
.stat-card.is-blue .stat-card-icon { background: #e8eefc; }
.stat-card.is-green .stat-card-icon { background: #e6f6ec; }
.stat-card.is-violet .stat-card-icon { background: #efe9fc; }

.stat-card .value { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.stat-card .label { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.stat-card .sublabel { color: var(--text-muted); font-size: 11px; margin-top: 6px; }

/* --- Dashboard sales chart, compact --- */
.chart-card { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.chart-hero { flex-shrink: 0; min-width: 140px; }
.chart-hero .hero-value { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.chart-hero .hero-label { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.chart-hero .hero-sub { color: var(--text-muted); font-size: 11.5px; margin-top: 10px; }
.chart-plot { flex: 1; min-width: 260px; }

/* --- Top-sellers ranked list --- */
.top-list { display: flex; flex-direction: column; }
.top-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 4px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    animation: couponIn .3s ease both;
}
.top-row:last-child { border-bottom: none; }
.top-row:hover { background: #fafbfc; }
.top-rank {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: #eef0f4; color: var(--text-muted);
}
.top-rank.is-1 { background: #fde68a; color: #7c5a00; }
.top-rank.is-2 { background: #e2e5ea; color: #4b5361; }
.top-rank.is-3 { background: #f2cba3; color: #7a4414; }
.top-info { flex: 1; min-width: 0; }
.top-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bar-track { height: 5px; border-radius: 100px; background: #eef0f4; margin-top: 6px; overflow: hidden; }
.top-bar-fill { height: 100%; border-radius: 100px; background: var(--primary); }
.top-figures { flex-shrink: 0; text-align: right; font-size: 12.5px; }
.top-figures .qty { font-weight: 700; }
.top-figures .revenue { color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbfc; }

.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #f0f1f3; }
.thumb-lg { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: #f0f1f3; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    background: #eef0f4;
    color: var(--text-muted);
}
.badge.green { background: #e6f6ec; color: var(--success); }
.badge.red { background: #fbe9e9; color: var(--danger); }
.badge.yellow { background: #fbf2df; color: var(--warning); }
.badge.blue { background: #e8eefc; color: var(--primary); }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
}
.btn:hover { background: #f1f2f5; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
   
}

form.inline { display: inline; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.wh-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.wh-card {
    width: 108px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background: #fafbfc;
}
.wh-card .wh-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; display: block; }
.wh-card .wh-qty {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}
.wh-card .wh-pos-wrap { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.wh-card .wh-pos-label { font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); display: block; margin-bottom: 3px; }
.wh-card .wh-pos {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.wh-card .wh-pos:focus, .wh-card .wh-qty:focus { color: var(--text); outline: 1px solid var(--primary); }
.wh-card.wh-readonly { background: #eef0f4; }
.wh-card.wh-readonly .wh-qty { background: #eef0f4; color: var(--text-muted); }

.shop-layout { display: flex; gap: 24px; align-items: flex-start; }
.shop-filters {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    top: 16px;
}
.filter-group { margin: 14px 0; }
.filter-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 0 0 8px; }
.filter-scroll { max-height: 160px; overflow-y: auto; padding-right: 4px; }
.filter-group .checkbox-row { margin-bottom: 5px; }
.filter-group .checkbox-row span { font-size: 13px; }
.filter-group .checkbox-row.is-disabled { opacity: .45; }
.filter-group .checkbox-row.is-disabled input { cursor: not-allowed; }

.shop-main { flex: 1; min-width: 0; }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1100px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .shop-grid { grid-template-columns: 1fr; } }

.shop-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    color: var(--text);
}
.shop-card:hover { border-color: var(--primary); text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.shop-card-image { position: relative; aspect-ratio: 1 / 1; background: #f2f3f5; }
.shop-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-card-sale-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 100px;
}
.shop-card-info { padding: 12px 14px 16px; }
.shop-card-brand { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 4px; }
.shop-card-title { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.shop-card-price { font-size: 15px; font-weight: 700; }
.shop-card-price .was { font-weight: 500; color: var(--text-muted); text-decoration: line-through; margin-right: 6px; }

.stock-btn { cursor: pointer; border: none; font-family: inherit; }
.stock-btn:hover { filter: brightness(0.95); }

dialog.stock-modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 90vw;
    width: 720px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
dialog.stock-modal::backdrop { background: rgba(15,17,23,.55); }
.stock-modal-inner { padding: 20px; max-height: 80vh; overflow-y: auto; }

.stock-qty-in { color: var(--success); font-weight: 600; }
.stock-qty-out { color: var(--danger); font-weight: 600; }

.cat-current { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.cat-editor summary { margin-bottom: 8px; }

.cat-tree {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
}
.cat-row { padding: 3px 0; }
.cat-row .checkbox-row { gap: 6px; }
.cat-row .checkbox-row span { font-size: 14px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #e6f6ec; color: var(--success); border: 1px solid #bfe7cd; }
.alert-error { background: #fbe9e9; color: var(--danger); border: 1px solid #f2c2c2; }

.errors { margin: 0 0 16px; padding: 10px 14px; background: #fbe9e9; color: var(--danger); border: 1px solid #f2c2c2; border-radius: 6px; }
.errors ul { margin: 0; padding-left: 18px; }

.pagination { margin-top: 16px; }
.pagination nav { display: flex; gap: 4px; flex-wrap: wrap; }

.permission-group { margin-bottom: 14px; }
.permission-group h3 { font-size: 13px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.login-box {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.login-box h1 { text-align: center; margin-bottom: 24px; }

.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; }

.order-notes-toggle summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    list-style: none;
}
.order-notes-toggle summary::-webkit-details-marker { display: none; }
.order-notes-toggle summary::before { content: '▸ '; }
.order-notes-toggle[open] summary::before { content: '▾ '; }

.order-notes-list { max-height: 440px; overflow-y: auto; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.order-note {
    padding: 10px 14px;
    border-radius: 10px;
    background: #eef0f4;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    max-width: 92%;
}
.order-note.is-system { background: #f4f5f7; border: 1px dashed var(--border); }
.order-note.is-user { background: #e8eefc; align-self: flex-end; }
.order-note .order-note-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.order-note .order-note-meta .order-note-author { color: var(--text); }
.order-note .order-note-content { font-size: 13px; line-height: 1.5; word-break: break-word; }
.order-note .order-note-content p { margin: 0 0 8px; }
.order-note .order-note-content p:last-child { margin-bottom: 0; }

/* --- Coupons: ticket-style cards --- */
@keyframes couponIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes couponPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(31,157,85,.35); }
    50% { box-shadow: 0 0 0 6px rgba(31,157,85,0); }
}

.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 4px; }

.coupon-card {
    position: relative;
    display: flex;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(20, 24, 33, .06);
    overflow: hidden;
    animation: couponIn .4s cubic-bezier(.22,.61,.36,1) both;
    transition: transform .2s ease, box-shadow .2s ease;
}
.coupon-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20, 24, 33, .12); }

.coupon-amount {
    flex-shrink: 0;
    width: 118px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 18px 8px;
    color: #fff;
    text-align: center;
}
.coupon-amount.is-percent { background: linear-gradient(160deg, #8b7cf6, #5b4fd1); }
.coupon-amount.is-fixed { background: linear-gradient(160deg, #2fd08a, #0ea968); }
.coupon-amount-value { font-size: 26px; font-weight: 800; line-height: 1; }
.coupon-amount-unit { font-size: 13px; font-weight: 600; opacity: .9; }
.coupon-amount-icon { font-size: 15px; margin-top: 4px; opacity: .85; }

.coupon-divider {
    position: relative;
    border-left: 2px dashed rgba(20, 24, 33, .12);
}
.coupon-notch {
    position: absolute;
    left: -9px;
    width: 18px;
    height: 18px;
    background: var(--bg);
    border-radius: 50%;
    z-index: 1;
}
.coupon-notch-top { top: -9px; }
.coupon-notch-bottom { bottom: -9px; }

.coupon-body { flex: 1; min-width: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.coupon-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    word-break: break-all;
}
.coupon-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.coupon-meta-row .badge.valid-pulse { animation: couponPulse 2.2s ease-in-out infinite; }

.coupon-usage { display: flex; flex-direction: column; gap: 4px; }
.coupon-usage-bar { width: 100%; height: 6px; border-radius: 100px; background: #eef0f4; overflow: hidden; }
.coupon-usage-fill { height: 100%; border-radius: 100px; background: var(--success); transition: width .3s ease; }
.coupon-usage-fill.is-warm { background: var(--warning); }
.coupon-usage-fill.is-hot { background: var(--danger); }

.coupon-actions { display: flex; gap: 8px; margin-top: auto; }

.coupon-preview-wrap { margin-bottom: 22px; }
.coupon-preview-wrap .coupon-card { max-width: 360px; }

/* --- Exporty hub --- */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 4px; }

.export-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 20px;
    color: var(--text);
    animation: couponIn .4s cubic-bezier(.22,.61,.36,1) both;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.export-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20,24,33,.12); border-color: var(--primary); text-decoration: none; }
.export-card-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border-radius: 12px;
    background: linear-gradient(160deg, #e8eefc, #d7e2fb);
    margin-bottom: 14px;
}
.export-card h3 { margin: 0 0 6px; font-size: 15px; }
.export-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

.export-card.is-placeholder { opacity: .55; cursor: default; }
.export-card.is-placeholder:hover { transform: none; box-shadow: none; border-color: var(--border); }

/* --- CSV export tool --- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.export-tab { animation: couponIn .3s ease both; }

.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.col-grid.col-grid-meta { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fafbfc; }
.col-grid .checkbox-row span { font-size: 13px; }
.col-grid .checkbox-row.is-locked { opacity: .8; }
.col-grid .checkbox-row.is-locked span { color: var(--text-muted); font-weight: 600; }

/* --- Dashboard sales chart tooltip --- */
.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: #1f2430;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 10;
}
.chart-tooltip-label { color: #cfd3dc; font-size: 11px; margin-bottom: 2px; }
.chart-tooltip-value { font-weight: 700; }

/* --- Orders list toolbar: column settings + bulk actions --- */
.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 34px;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #eef3ff;
    border: 1px solid #c9d8fb;
    border-radius: 8px;
    animation: couponIn .2s ease both;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-count { font-size: 13px; }
.bulk-bar .bulk-arrow { color: var(--text-muted); }
.bulk-bar select { width: auto; font-size: 13px; padding: 5px 8px; }

.column-settings { position: relative; margin-left: auto; }

.column-settings-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(20,24,33,.14);
    padding: 14px;
}
.column-settings-panel[hidden] { display: none; }
.column-settings-hint { margin: 0 0 10px; font-size: 12px; color: var(--text-muted); }

.column-settings-list { list-style: none; margin: 0 0 12px; padding: 0; }
.column-settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
}
.column-settings-row:hover { background: #fafbfc; border-color: var(--border); }
.column-settings-row.is-dragging { opacity: .4; }
.column-settings-row.is-locked { opacity: .75; }
.column-settings-row .checkbox-row { flex: 1; gap: 8px; }
.column-settings-row .checkbox-row span { font-size: 13px; }
.column-settings-row .drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 13px;
    user-select: none;
    line-height: 1;
}
.column-settings-row.is-locked .drag-handle { cursor: not-allowed; visibility: hidden; }
.column-settings-actions { display: flex; gap: 8px; }

th.col-check, td.col-check { width: 34px; text-align: center; padding-left: 8px; padding-right: 8px; }
th.col-check input, td.col-check input { width: auto; cursor: pointer; }

/* --- Order detail: carrier / label actions --- */
.carrier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.carrier-box { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fafbfc; }
.carrier-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.carrier-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.carrier-actions form { display: inline; }

/* --- Presentation build: app launcher + empty states --- */
.page-head { margin-bottom: 20px; }
.page-head p { color: var(--text-muted); margin: 4px 0 0; }

.launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.launcher-tile {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    color: var(--text);
    animation: couponIn .4s cubic-bezier(.22,.61,.36,1) both;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.launcher-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(20,24,33,.12);
    border-color: var(--primary);
    text-decoration: none;
}
.launcher-tile-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    border-radius: 14px;
    background: linear-gradient(160deg, #e8eefc, #d7e2fb);
    margin-bottom: 14px;
}
.launcher-tile h3 { margin: 0 0 4px; font-size: 15px; }
.launcher-tile p { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.empty-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 16px;
}
.empty-state-icon {
    font-size: 44px;
    margin-bottom: 12px;
}
.empty-state h2 { margin: 0 0 6px; }
.empty-state p { color: var(--text-muted); max-width: 420px; margin: 0 auto 4px; }
.demo-pill {
    display: inline-block;
    margin-bottom: 18px;
    padding: 4px 12px;
    border-radius: 100px;
    background: #fbf2df;
    color: var(--warning);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
