:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-soft: #eef2ff;
    --accent: #06b6d4;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --ink: #172033;
    --muted: #64748b;
    --line: #e8edf4;
    --canvas: #f5f7fb;
    --card: #ffffff;
    --sidebar: #111827;
    --sidebar-2: #172033;
    --radius-lg: 22px;
    --radius-md: 15px;
    --shadow: 0 16px 45px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--canvas);
    color: var(--ink);
    font-size: 14px;
}

button, input, select, textarea { font: inherit; }

a { text-decoration: none; }

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: #d7deea;
    background:
        radial-gradient(circle at 12% 8%, rgba(79, 70, 229, .28), transparent 30%),
        linear-gradient(180deg, var(--sidebar), #0b1120 100%);
    border-right: 1px solid rgba(255, 255, 255, .05);
    transition: transform .25s ease;
}

.sidebar-brand {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    font-size: 20px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    box-shadow: 0 10px 30px rgba(79, 70, 229, .35);
}

.brand-name { color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-subtitle { color: #8fa0bb; font-size: 11px; margin-top: 1px; }
.sidebar-close { margin-left: auto; color: #cbd5e1; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 24px;
    scrollbar-width: thin;
}

.nav-caption {
    margin: 18px 12px 8px;
    color: #65758d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    margin: 3px 0;
    border-radius: 11px;
    color: #aebbd0;
    font-weight: 600;
    transition: all .18s ease;
}

.sidebar-link i { width: 21px; font-size: 16px; }
.sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, .06); transform: translateX(2px); }
.sidebar-link.active { color: #fff; background: linear-gradient(90deg, rgba(79, 70, 229, .88), rgba(79, 70, 229, .42)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-footer-card { display: flex; gap: 10px; padding: 12px; border-radius: 13px; background: rgba(255,255,255,.055); }
.sidebar-footer-card i { color: #67e8f9; font-size: 18px; }
.sidebar-footer-card strong { display: block; color: #e8edf5; font-size: 11px; }
.sidebar-footer-card span { display: block; color: #8391a8; font-size: 10px; line-height: 1.45; margin-top: 3px; }

.app-main { min-height: 100vh; margin-left: 270px; display: flex; flex-direction: column; }

.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 9px; font-weight: 800; margin-bottom: 3px; }
.page-heading { font-size: 22px; font-weight: 800; letter-spacing: -.035em; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; }
.topbar-user { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.user-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.tiny { font-size: 10px; }

.content-area { flex: 1; padding: 26px 28px 40px; }
.app-footer { display: flex; justify-content: space-between; padding: 18px 28px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }

.content-card {
    background: var(--card);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card-section { padding: 24px; }
.card-title { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.card-subtitle { color: var(--muted); font-size: 12px; margin-top: 5px; }

.stat-card {
    height: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    overflow: hidden;
    position: relative;
}

.stat-card::after { content: ''; position: absolute; width: 100px; height: 100px; border-radius: 50%; right: -38px; top: -42px; background: rgba(79,70,229,.06); }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stat-value { font-size: 28px; line-height: 1; font-weight: 800; letter-spacing: -.045em; margin-top: 11px; }
.stat-note { color: var(--muted); font-size: 11px; margin-top: 8px; }
.stat-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: var(--primary); font-size: 21px; background: var(--primary-soft); }
.stat-icon.cyan { color: #0891b2; background: #ecfeff; }
.stat-icon.green { color: #059669; background: #ecfdf5; }
.stat-icon.amber { color: #d97706; background: #fffbeb; }

.quick-action {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 15px;
    transition: all .18s ease;
}
.quick-action:hover { color: var(--primary); border-color: #c7d2fe; background: #fafbff; transform: translateY(-2px); box-shadow: 0 10px 25px rgba(79,70,229,.08); }
.quick-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }

.form-label { font-size: 11px; font-weight: 700; color: #344054; margin-bottom: 7px; }
.form-control, .form-select {
    min-height: 43px;
    border: 1px solid #dfe5ee;
    border-radius: 11px;
    color: var(--ink);
    font-size: 13px;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus { border-color: #9aa5ff; box-shadow: 0 0 0 3px rgba(79,70,229,.09) !important; }
textarea.form-control { min-height: 90px; }
.required::after { content: ' *'; color: var(--danger); }
.form-hint { color: var(--muted); font-size: 10px; margin-top: 6px; }

.section-label { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--primary-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.section-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #dfe3ff, transparent); }

.btn { border-radius: 11px; font-weight: 700; font-size: 12px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-soft-primary { color: var(--primary); background: var(--primary-soft); border: 1px solid #dfe3ff; }
.btn-soft-primary:hover { color: #fff; background: var(--primary); }
.btn-soft-danger { color: var(--danger); background: #fef2f2; border: 1px solid #fee2e2; }
.btn-soft-danger:hover { color: #fff; background: var(--danger); }
.btn-soft-secondary { color: #475569; background: #f8fafc; border: 1px solid var(--line); }
.btn-soft-secondary:hover { color: var(--ink); background: #eef2f6; }

.table-shell { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.search-wrap { position: relative; width: min(350px, 100%); }
.search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-wrap .form-control { padding-left: 40px; }
.table-responsive { min-height: 180px; }
.table { margin: 0; }
.table > :not(caption) > * > * { padding: 14px 16px; border-bottom-color: #edf1f6; vertical-align: middle; }
.table thead th { color: #64748b; background: #f8fafc; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.table tbody td { font-size: 12px; }
.table tbody tr:hover { background: #fbfcff; }
.table-empty { padding: 55px 20px !important; text-align: center; color: var(--muted); }
.table-empty i { display: block; font-size: 34px; color: #cbd5e1; margin-bottom: 10px; }
.action-group { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.action-group .btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }

.badge-soft { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; color: var(--primary); background: var(--primary-soft); }
.soft-badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.balance-dr { color: #059669; font-weight: 800; }
.balance-cr { color: #dc2626; font-weight: 800; }

.modal-content { border: 0; border-radius: 20px; box-shadow: 0 25px 70px rgba(15,23,42,.2); }
.modal-header { padding: 20px 22px; border-bottom-color: var(--line); }
.modal-body { padding: 22px; }
.modal-footer { padding: 15px 22px; border-top-color: var(--line); }
.modal-title { font-weight: 800; font-size: 17px; }

.variant-table th { white-space: nowrap; }
.variant-table .form-control, .variant-table .form-select { min-width: 120px; }
.variant-table .sku-input { min-width: 150px; }
.variant-table .barcode-input { min-width: 160px; }
.variant-table .price-input { min-width: 105px; }
.variant-table .remove-variant { width: 36px; height: 36px; display: grid; place-items: center; }

.placeholder-module { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 45px; text-align: center; }
.placeholder-icon { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 25px; color: var(--primary); background: linear-gradient(135deg, #eef2ff, #ecfeff); font-size: 31px; }
.placeholder-module h2 { margin: 18px 0 8px; font-weight: 800; letter-spacing: -.03em; }
.placeholder-module > p { max-width: 600px; color: var(--muted); line-height: 1.7; }
.placeholder-note { max-width: 680px; display: flex; gap: 10px; padding: 13px 15px; margin-top: 14px; border: 1px solid #dfe7f3; border-radius: 13px; color: #526174; background: #f8fafc; text-align: left; font-size: 11px; line-height: 1.55; }
.placeholder-note i { color: var(--primary); }

.hero-panel { padding: 25px; color: #fff; background: linear-gradient(125deg, #3730a3, #4f46e5 54%, #0891b2); position: relative; overflow: hidden; }
.hero-panel::after { content: ''; position: absolute; width: 260px; height: 260px; right: -90px; top: -115px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero-panel h2 { font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.hero-panel p { max-width: 650px; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.7; }
.hero-panel .btn { position: relative; z-index: 1; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }
    .sidebar-backdrop.show { display: block; }
    .app-main { margin-left: 0; }
    .content-area { padding: 20px 16px 32px; }
    .topbar { padding: 13px 16px; }
    .app-footer { padding: 16px; }
}

@media (max-width: 575.98px) {
    .page-heading { font-size: 18px; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .search-wrap { width: 100%; }
    .card-section { padding: 18px; }
    .placeholder-module { padding: 28px 18px; min-height: 400px; }
    .app-footer { gap: 10px; flex-direction: column; }
}
