:root {
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --accent: #2563eb;
    --surface: #ffffff;
    --page: #f4f7fb;
    --text: #172033;
    --muted: #6b7280;
    --border: #e5eaf1;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--page);
    font-family: "Manrope", sans-serif;
    font-size: 14px;
}
a { text-decoration: none; }
.place-items-center { place-items: center; }
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: 260px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, #111827, #0b1220);
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 16px; }
.sidebar-brand small { margin-top: 2px; color: #94a3b8; font-size: 11px; }
.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--accent);
    box-shadow: 0 10px 24px rgba(37,99,235,.35);
    font-size: 20px;
}
.sidebar-nav { flex: 1; padding: 18px 12px; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin-bottom: 4px;
    padding: 10px 13px;
    color: #aeb9ca;
    border-radius: 11px;
    font-weight: 600;
    transition: .18s ease;
}
.sidebar-link i { width: 22px; font-size: 17px; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-link.active { color: #fff; background: var(--accent); box-shadow: 0 8px 20px rgba(37,99,235,.25); }
.main-content { margin-left: 260px; min-height: 100vh; }
.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font-size: 22px; font-weight: 800; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user strong, .topbar-user small { display: block; }
.topbar-user strong { font-size: 13px; }
.topbar-user small { color: var(--muted); font-size: 11px; }
.user-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #172033;
    border-radius: 50%;
    font-weight: 800;
}
.content-area { padding: 26px 28px 48px; }
.card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(31,41,55,.04);
}
.card-header { padding: 18px 20px; background: #fff; border-bottom-color: var(--border); border-radius: 16px 16px 0 0 !important; }
.card-body { padding: 20px; }
.stat-card { height: 100%; overflow: hidden; }
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 21px;
}
.stat-card .stat-value { margin-top: 18px; font-size: 27px; font-weight: 800; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .9rem .75rem; border-color: var(--border); vertical-align: middle; }
.table thead th { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; white-space: nowrap; }
.table-responsive { border-radius: 12px; }
.form-control, .form-select {
    min-height: 43px;
    border-color: #dce3ec;
    border-radius: 10px;
    font-size: 13px;
}
.form-control:focus, .form-select:focus { border-color: #7aa2f7; box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); }
.form-label { margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.btn { border-radius: 10px; font-weight: 700; font-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.badge { padding: .48em .7em; border-radius: 7px; font-weight: 700; }
.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty-state i { display: block; margin-bottom: 12px; font-size: 38px; color: #b7c1cf; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 160px; }
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 7px; bottom: 7px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content: ''; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.public-page { min-height: 100vh; background: radial-gradient(circle at top left, #e8efff, transparent 35%), #f7f9fc; }
.public-container { width: min(940px, calc(100% - 28px)); margin: 0 auto; padding: 42px 0 70px; }
.public-logo { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 24px; color: var(--text); }
.public-hero { margin-bottom: 24px; }
.public-hero h1 { max-width: 760px; font-size: clamp(28px, 5vw, 48px); font-weight: 800; line-height: 1.1; }
.public-hero p { max-width: 680px; color: var(--muted); font-size: 16px; }
.item-row { padding: 16px; border: 1px solid var(--border); border-radius: 13px; background: #fafcff; }
.order-totals { background: #f8fafc; border: 1px solid var(--border); border-radius: 13px; padding: 16px; }
.order-total-line { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 7px; }
.order-total-line:last-child { margin-bottom: 0; }
.text-wrap-anywhere { overflow-wrap: anywhere; }

@media (max-width: 991.98px) {
    .sidebar { width: 278px !important; }
    .main-content { margin-left: 0; }
    .topbar { padding: 12px 16px; }
    .content-area { padding: 18px 14px 38px; }
}
@media (max-width: 575.98px) {
    .topbar h1 { font-size: 18px; }
    .card-header, .card-body { padding: 15px; }
    .filter-bar > * { width: 100%; }
    .filter-bar .form-control, .filter-bar .form-select { min-width: 0; }
    .public-container { padding-top: 24px; }
}
