@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* assets/css/style.css — modern, slim, professional design system */
:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-d: #1d4ed8;
    --primary-light: #eff6ff;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --secondary: #475569;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Lucide Icon Standard Styling */
svg.lucide, [data-lucide] {
    display: inline-block;
    vertical-align: middle;
    width: 15px;
    height: 15px;
    stroke-width: 1.85px;
    flex-shrink: 0;
}

.muted { color: var(--muted); }

/* Slim, Modern Navigation Header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 20px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}
.brand-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}
.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.15s ease;
}
.nav-link:hover {
    color: var(--text);
    background: var(--border-light);
}
.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}
.nav-link.active svg {
    color: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.btn-logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-logout-link:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Layout */
.container {
    max-width: 1240px;
    margin: 20px auto 40px;
    padding: 0 20px;
}
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    background: #f1f5f9;
    color: var(--text);
    transition: all 0.15s ease;
    gap: 6px;
    line-height: 1;
}
.btn:hover { filter: brightness(0.97); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 6px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* Condensed Metrics Strip */
.stats-strip {
    display: flex;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 10px 18px;
}
.stat-item {
    display: flex;
    align-items: baseline;
    gap: 7px;
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-value {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.stat-meta {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--muted);
}
.stat-sep {
    width: 1px;
    height: 14px;
    background: var(--border);
}
.stat-alert-count {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--border-light);
    color: var(--muted);
}
.kpi-alert .stat-alert-count {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-search { flex: 1; min-width: 220px; }

.pill-group { display: flex; gap: 4px; flex-wrap: wrap; }
.pill {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.pill:hover { background: #f8fafc; border-color: #cbd5e1; }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill-green.active { background: #16a34a; border-color: #16a34a; }
.pill-red.active { background: #dc2626; border-color: #dc2626; }
.pill-gray.active { background: #64748b; border-color: #64748b; }
.pill-blue.active { background: #2563eb; border-color: #2563eb; }

.filter-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    min-width: 160px;
}

.search-wrap { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

/* Table Wrap */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--panel);
}
table.dataTable thead th {
    background: #0f172a;
    color: #f8fafc;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: none;
    padding: 12px 14px;
    white-space: nowrap;
}
table.dataTable tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
table.dataTable tbody tr:nth-child(even) { background: #fafbfc; }
table.dataTable tbody tr:hover { background: #f1f5f9; }

/* Table cells */
.cell-product { display: flex; align-items: center; gap: 10px; }
.cell-product-info { display: flex; flex-direction: column; gap: 2px; }
.cell-product-name { font-weight: 600; color: var(--text); }
.cell-product-name:hover { color: var(--primary); text-decoration: underline; }
.cell-product-category { font-size: 11.5px; color: var(--muted); }
.cell-source { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.cell-shopee { display: flex; align-items: center; gap: 6px; }
.cell-shopee-price { font-weight: 600; }
.cell-shopee-link { color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.cell-shopee-link:hover { text-decoration: underline; }

.thumb-placeholder-cell {
    width: 36px; height: 36px;
    border-radius: 6px;
    background: var(--border-light);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.thumb {
    width: 36px; height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #f8fafc;
    display: block;
}

/* Badges and chips */
.qty-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 8px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 11.5px;
}
.qty-high { background: #dcfce7; color: #166534; }
.qty-mid { background: #fef9c3; color: #854d0e; }
.qty-low { background: #fee2e2; color: #991b1b; }

.status-chip {
    display: inline-flex; align-items: center;
    padding: 3px 8px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 11.5px;
}
.status-active { background: #dcfce7; color: #166534; }
.status-low { background: #fef9c3; color: #854d0e; }
.status-out { background: #fee2e2; color: #991b1b; }
.status-notlisted { background: #f1f5f9; color: #64748b; }
.status-listed { background: #dbeafe; color: #1e40af; }

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 16px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 11.5px;
    font-weight: 600;
}

/* Action buttons */
.cell-actions { display: flex; gap: 4px; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.btn-icon:hover { background: #f1f5f9; color: var(--text); border-color: var(--border); }
.btn-icon-danger:hover { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }

/* Table footer */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 12px;
    flex-wrap: wrap;
}
.table-footer-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.table-footer-right { display: flex; align-items: center; }
.entries-select { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.entries-select select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; font-family: inherit; background: #fff; color: var(--text); }
.table-info { font-size: 12.5px; color: var(--muted); }

.pagination { display: flex; align-items: center; gap: 3px; }
.pagination button {
    min-width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0 6px;
}
.pagination button:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.card-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.card-compact { padding: 16px; }
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}
.card-header-row .card-title { margin-bottom: 0; }

/* Product Detail Hero & Tabs */
.product-hero {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.product-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 280px;
}
.product-hero-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: #f8fafc;
    flex-shrink: 0;
}
.product-hero-thumb-empty {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    flex-shrink: 0;
}
.product-hero-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.product-hero-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.product-hero-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.product-hero-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text);
}
.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 18px;
}
.overview-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.overview-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.overview-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}
.overview-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 16px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.overview-section-title:first-child { margin-top: 0; }

.status-profit { color: #16a34a; font-weight: 700; }
.status-loss { color: #dc2626; font-weight: 700; }
.status-break_even { color: #f59e0b; font-weight: 700; }
.profit-positive { color: #16a34a; }
.profit-negative { color: #dc2626; }

.link-arrow {
    color: var(--primary);
    text-decoration: none;
    font-size: 12.5px;
    word-break: break-all;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.link-arrow:hover { text-decoration: underline; }

/* Sales Table */
.sales-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sales-table th { text-align: left; padding: 10px 12px; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--border); background: #f8fafc; }
.sales-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.sales-table tbody tr:nth-child(even) { background: #fafbfc; }
.sales-table tbody tr:hover { background: #f1f5f9; }

/* Competitor Section */
.competitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.competitor-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    background: #fafbfc;
    transition: box-shadow 0.15s ease;
}
.competitor-card:hover { box-shadow: var(--shadow); border-color: #cbd5e1; }
.competitor-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.competitor-name { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.competitor-price { font-size: 18px; font-weight: 700; color: var(--primary); margin: 2px 0; }
.competitor-actions { display: flex; gap: 6px; margin-top: 10px; }
.competitor-actions input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 12.5px; }

.comp-price-alert {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}
.alert-cheaper { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-higher { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-equal { background: #f1f5f9; color: #475569; }

.add-competitor { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.add-competitor h5 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }

.form-inline-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.form-inline-row > div { flex: 1; min-width: 120px; }
.form-inline-row label { margin-top: 0; margin-bottom: 4px; }

/* Sourcers Directory Styles */
.sourcers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.sourcer-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.15s ease;
}
.sourcer-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow);
}
.sourcer-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.sourcer-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sourcer-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.sourcer-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}
.sourcer-link:hover { text-decoration: underline; }
.sourcer-actions {
    display: flex;
    gap: 2px;
}
.sourcer-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}
.sourcer-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sourcer-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.item-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary-d);
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 500;
}
.sourcer-notes-text {
    font-size: 12.5px;
    color: var(--text);
    background: #fafbfc;
    border-left: 3px solid #cbd5e1;
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    white-space: pre-wrap;
}

/* Pricing Simulator & Competitor Badges */
.badge-local { background: #dcfce7; color: #166534; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; }
.badge-overseas { background: #e0e7ff; color: #3730a3; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; }
.badge-rating { background: #fef9c3; color: #854d0e; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; }
.badge-sales { background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; }

.pricing-sim-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}
.pricing-sim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
.sim-stat-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.sim-stat-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sim-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

/* Pricing Roadmap & Profit Calculators */
.pricing-roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.tier-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}
.tier-box:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.tier-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.tier-box-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.tier-box-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 4px 0 2px;
}
.tier-box-sub {
    font-size: 11.5px;
    color: var(--muted);
}
.tier-box-profit {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
}
.tier-box-highlight {
    border-color: #93c5fd;
    background: #f8fafc;
}
.tier-box-current {
    border: 2px solid var(--primary);
    background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
}
.tier-box-current:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.2);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.calc-panel {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.calc-panel-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Shopee SG Fee Calculator Styles */
.shopee-badge {
    background: #ffedd5;
    color: #c2410c;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.shopee-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}
.shopee-preset-btn {
    font-size: 11.5px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}
.shopee-preset-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.shopee-preset-btn.active {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
    font-weight: 600;
}

.solver-mode-pills {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.solver-mode-pill {
    flex: 1;
    font-size: 10.5px;
    font-weight: 500;
    padding: 5px 4px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s ease;
}
.solver-mode-pill:hover {
    color: var(--text);
}
.solver-mode-pill.active {
    background: #fff;
    color: var(--text);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.deduction-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
}
.deduction-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
}
.deduction-row:last-child {
    border-bottom: none;
}
.deduction-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 4px;
    margin-top: 4px;
    border-top: 2px solid var(--border);
    font-weight: 700;
}

/* Modals */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.45); backdrop-filter: blur(2px); }
.modal-dialog {
    position: relative;
    background: var(--panel);
    border-radius: var(--radius-lg);
    width: 460px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; padding: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal form { padding: 18px; }

/* Forms */
label { display: block; font-weight: 600; margin: 8px 0 4px; font-size: 12.5px; color: var(--text); }
input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
input[type="file"] { padding: 5px; }

.category-select-wrap { display: flex; gap: 6px; align-items: flex-end; }
.category-select-wrap select { flex: 1; }
.category-add-row { display: flex; gap: 6px; align-items: center; }
.category-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.category-item-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fafbfc;
}
.category-name-cell { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 8px;
    color: #fff;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    font-size: 13px;
}
.toast-success { background: #15803d; }
.toast-error { background: var(--danger); }
.toast-info { background: #1e293b; }

/* Login Page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 360px;
    box-shadow: var(--shadow-md);
}
.login-box h1 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.login-box p { margin: 0; color: var(--muted); font-size: 13px; }
.login-box form { margin-top: 18px; }
.login-box .btn { width: 100%; margin-top: 18px; }
.alert { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 12.5px; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* Chart and Empty States */
.chart-placeholder {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}
.chart-placeholder-icon { margin-bottom: 6px; opacity: 0.4; }
.chart-placeholder-text { font-size: 13px; font-weight: 500; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state-icon { margin-bottom: 8px; opacity: 0.4; width: 36px; height: 36px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.empty-state-text { font-size: 12.5px; margin: 0; }

/* Spin animation for loading icons */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .topbar-inner { height: auto; padding: 10px 16px; flex-direction: column; align-items: stretch; gap: 10px; }
    .topbar-left { justify-content: space-between; }
    .topbar-actions { justify-content: flex-end; flex-wrap: wrap; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-search { min-width: 100%; }
    .table-footer { flex-direction: column; align-items: stretch; }
    .table-footer-right { justify-content: center; }
    .dashboard-kpi-grid { grid-template-columns: 1fr 1fr; }
    .sourcers-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .dashboard-kpi-grid { grid-template-columns: 1fr; }
    .topnav span { display: none; }
}
