* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F5F7;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;

    --border: #E5E7EB;
    --border-hover: #D1D5DB;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

.app-icon {
    font-size: 22px;
}

.toolbar-icon {
    font-size: 18px;
}

.breadcrumb-separator {
    font-size: 16px;
    color: var(--text-tertiary);
}

.inline-status-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Styles for the whole scrollbar */
::-webkit-scrollbar {
    width: 5px;
    /* width of the vertical scrollbar */
    height: 6px;
    /* height of the horizontal scrollbar */
}

/* Styles for the track (background) */
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

/* Styles for the thumb (handle) */
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--bg-secondary)70%, rgb(95, 95, 95));
    border-radius: 10px;
}

/* Styles for the thumb on hover */
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.theme-btn {
    position: absolute;
    right: 10px;
    top: 15px;
    border: none;
}

.theme-btn button {
    border: none !important;
    background: transparent !important;
}

.theme-btn span {
    font-size: 1.5rem;
}


/* ── Rule Tabs ── */
.rule-tab-btn {
    padding: 0.625rem 1.125rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.15s;
}

.rule-tab-btn:hover {
    color: var(--primary);
}

.rule-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ── Placement table editable inputs ── */
.pct-input {
    width: 68px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.8125rem;
    text-align: center;
    background: white;
    transition: border-color 0.15s;
}

.placement_top {
    background: color-mix(in srgb, red percentage, blue percentage)
}

.metric-cell-bid {
    background: var(--bg-secondary)
}

.pct-input:focus {
    outline: none;
    border-color: var(--primary);
}

.pct-input.changed {
    background: var(--primary);
    border-color: var(--success);
    font-weight: 600;
}

/* ── Changed data badge ── */
.changed-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #D1FAE5;
    color: #065F46;
}

.original-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #F3F4F6;
    color: #374151;
}

/* ── Rule results table ── */
.rule-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.rule-result-table th {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.rule-result-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
}

.rule-result-table tr:last-child td {
    border-bottom: none;
}

.val-arrow {
    color: var(--text-tertiary);
    margin: 0 4px;
}

.val-new {
    color: var(--success);
    font-weight: 600;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.app-container {
    display: grid;
    grid-template-columns: 260px 500px;
    gap: 0px;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0px;
    background: var(--bg-secondary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.client-selector-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.client-selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.client-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.client-select:hover {
    border-color: var(--primary);
}

.client-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.nav-section {
    padding: 1.5rem 0;
    flex: 1;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
}

/* Top Bar */
.topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: top;
    position: sticky;
    top: 0px;
    z-index: 210;
    margin: 0px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 252px;
}

.date-range-picker:hover {
    border-color: var(--primary);
}

.date-range-picker.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Date Range Dropdown */
.date-range-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    z-index: 100;
    min-width: 320px;
    display: none;
}

.date-range-dropdown.active {
    display: block !important;
}

.date-range-header {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.date-inputs {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.date-input-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.date-input:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

.date-range-info {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.date-quick-ranges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-range-btn {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.quick-range-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.date-range-actions {
    display: flex;
    gap: 0.5rem;
}

.sync-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.sync-btn:hover {
    background: var(--primary-dark);
}

.sync-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Content Area */
.content-area {
    padding: 1rem 1.25rem;
}

.content-area .view-content {
    max-width: 100%;
}

/* Main Tabs */
.main-tabs {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.tab-nav-item {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.tab-nav-item:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
}

.tab-nav-item.active {
    color: var(--primary);
    background: white;
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.stat-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.5rem;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Filters Bar */
.filters-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow: visible;
}

.filters-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.filter-group {
    flex: 0 1 auto;
    min-width: 140px;
    max-width: 220px;
    position: relative;
}

.filter-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filters-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Table Container */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.bulk-actions-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--primary);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.05);
}

.data-table td {
    padding: 1rem;
}

.checkbox-cell {
    width: 40px;
}

.checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.keyword-cell {
    font-weight: 500;
    color: var(--text-primary);
}

.metric-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

/* Editable Bid Input */
.bid-input {
    width: 80px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    background: white;
    transition: all 0.2s;
}

.bid-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.bid-input:hover {
    border-color: var(--primary);
}

.bid-input.saving {
    background: var(--bg-tertiary);
    border-color: var(--success);
}

.bid-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bid-save-indicator {
    font-size: 0.75rem;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: white;
    color: #059669;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

.bid-input.pending-change {
    border-color: #F59E0B !important;
    background: #FFFBEB !important;
}

.bid-save-indicator.visible {
    opacity: 1;
}

/* Status Toggle */
.status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
}

.status-toggle:hover {
    transform: scale(1.05);
}

.status-toggle.enabled {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-toggle.paused {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-toggle-icon {
    font-size: 0.75rem;
    font-weight: 700;
}

.status-toggle-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Column Checkbox Styling */
.column-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    user-select: none;
}

.column-checkbox-label:hover {
    background: rgba(99, 102, 241, 0.1);
}

.column-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.column-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.column-checkbox-label:has(.column-checkbox:disabled) {
    opacity: 0.7;
    cursor: not-allowed;
}

.column-checkbox-label:has(.column-checkbox:disabled):hover {
    background: var(--bg-tertiary);
}

/* Hidden column style */
.data-table th.hidden-column,
.data-table td.hidden-column {
    display: none;
}

/* Compare Period Row */
.compare-row {
    background: rgba(99, 102, 241, 0.03);
    border-top: 1px dashed var(--border) !important;
}

.compare-row td {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

.compare-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.compare-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.compare-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.compare-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.compare-change.neutral {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.quick-compare-btn {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.quick-compare-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quick-compare-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Bid Adjustment Card */
.adjustment-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.adjustment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.adjustment-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.adjustment-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.adjustment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.adjustment-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.adjustment-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.adjustment-input {
    width: 80px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.adjustment-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Product Ad Card */
.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.5rem;
    align-items: start;
}

.product-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.product-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 2rem;
}

.product-info {
    flex: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-details {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.product-detail {
    font-size: 0.8125rem;
}

.product-detail-label {
    color: var(--text-secondary);
}

.product-detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

.product-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.product-metric {
    text-align: center;
}

.product-metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.product-metric-value {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 1rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    gap: 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state-text {
    font-size: 0.875rem;
}

/* No Client Selected Empty State */
.no-client-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.no-client-selected-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.no-client-selected-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-client-selected-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.no-client-selected-steps {
    display: grid;
    width: 100%;
    max-width: 100%;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: left;
    align-items: stretch;
}

.no-client-step {
    min-width: 0;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.no-client-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.no-client-step-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-client-step-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.dashboard-content.hidden {
    display: none;
}



/* =====================================================================
   Responsive layout and visual polish overrides
   ===================================================================== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #60A5FA;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --info: #0284C7;
    --bg-primary: #F3F7FB;
    --bg-secondary: rgba(255, 255, 255, 0.92);
    --bg-tertiary: #EAF1F8;
    --text-primary: #10233F;
    --text-secondary: #526277;
    --text-tertiary: #7A879A;
    --border: #D8E2EC;
    --border-hover: #B8C8D9;
    --shadow-sm: 0 10px 24px -20px rgba(15, 23, 42, 0.32);
    --shadow-md: 0 24px 48px -32px rgba(15, 23, 42, 0.3);
    --shadow-lg: 0 36px 72px -40px rgba(15, 23, 42, 0.38);
}

html {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32%),
        linear-gradient(180deg, #F8FBFF 0%, #EEF4F9 100%);
}

body {
    min-width: 320px;
    color: var(--text-primary);
    background: transparent;
}


.sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 252, 0.95) 100%);
    box-shadow: 18px 0 50px -42px rgba(15, 23, 42, 0.6);
}



.sidebar-close,
.mobile-nav-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: #919191;
    border: none;
    background: transparent;
}

.mobile-nav-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 9999px;
    background: currentColor;
}

.mobile-nav-toggle:hover,
.sidebar-close:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}


.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 540px);
    gap: 1rem 1.25rem;
    align-items: start;
    padding: 1.1rem 1.4rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 30px -28px rgba(15, 23, 42, 0.85);
}

.topbar-left,
.topbar-title-group,
.topbar-right {
    min-width: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.topbar-title-group {
    display: grid;
    gap: 0.2rem;
}

.page-title {
    letter-spacing: -0.03em;
}

.breadcrumb {
    flex-wrap: wrap;
}

.topbar-right {
    position: relative;
    margin-right: auto;
}

.toolbar-grid {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}


.toolbar-btn,
.sync-btn,
.date-range-picker {
    width: 100%;
    min-height: 35px;
    border-radius: 12px;
}

.toolbar-btn {
    justify-content: center;
}

.date-range-picker {
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.96);
}


.view-content {
    width: 100%;
    min-width: 0;
}

.view-content>.stats-grid,
.view-content>.main-tabs,
.view-content>.filters-bar,
.view-content>.table-container,
.view-content>.adjustment-card,
.view-content>.product-card,
.view-content>.no-client-selected,
.view-content>div {
    max-width: 100%;
}

.stats-grid,
.main-tabs,
.filters-bar,
.table-container,
.adjustment-card,
.product-card,
.no-client-selected {
    width: 100%;
    max-width: none;
    border-color: rgba(216, 226, 236, 0.92);
    box-shadow: var(--shadow-sm);
}

.stat-card,
.main-tabs,
.filters-bar,
.table-container,
.adjustment-card,
.product-card,
.no-client-selected,
.modal {
    background: rgba(255, 255, 255, 0.94);
}

.stat-card {
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover,
.adjustment-card:hover,
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.main-tabs,
.filters-bar,
.table-container,
.adjustment-card,
.product-card,
.no-client-selected,
.modal {
    border-radius: 18px;
}

.tab-navigation {
    background: linear-gradient(180deg, #F6FAFD 0%, #EEF4F9 100%);
}

.btn,
.sync-btn,
.action-btn,
.pagination-btn,
.quick-range-btn,
.quick-compare-btn,
.client-select,
.filter-input,
.filter-select,
.bid-input,
.adjustment-input,
.date-input {
    border-radius: 12px;
}

.btn,
.sync-btn,
.action-btn,
.pagination-btn {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.sync-btn:hover,
.action-btn:hover,
.pagination-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.data-table {
    table-layout: auto;
}

.data-table th,
.data-table td {
    vertical-align: middle;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: 180;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}


/* Desktop/mobile toggle visibility and topbar alignment fixes */
.sidebar-close {
    display: none;
}

.topbar {
    grid-template-columns: minmax(0, 1fr) auto;
}

.topbar-right {
    justify-self: end;
    width: min(100%, 540px);
}


@media (max-width: 768px) {
    .topbar {
        padding: 1rem;
    }


    .toolbar-grid {
        overflow: auto;
    }

    .toolbar-btn {
        width: 180px;
    }

    .app-container {
        grid-template-columns: 1fr;
    }


    .date-range-dropdown {
        right: 0;
        left: 0;
        min-width: 0;
        width: min(100%, 100vw - 2rem);
    }

    .content-area {
        padding: 1rem;
    }

    .adjustment-content {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filters-row,
    .pagination,
    .topbar-left,
    .topbar-right {
        gap: 0.75rem;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-controls {
        justify-content: space-between;
    }

    .tab-navigation {
        display: grid;
        grid-template-columns: 1fr;
    }

    .no-client-selected {
        padding: 1.5rem;
        min-height: auto;
    }
}

@media (max-width: 540px) {
    .page-title {
        font-size: 1.2rem;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 1.65rem;
    }

    .table-header,
    .bulk-actions,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .stats-grid {
        grid-template-columns: 2fr;
    }
}


/* Responsive */
@media (max-width: 1024px) {

    .stats-grid {
        grid-template-columns: repeat(1fr 1fr 1fr);
    }


    .mobile-nav-toggle,
    .sidebar-close {
        display: inline-flex !important;
    }

    .topbar-right {
        justify-self: stretch;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 500;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        z-index: 100;
    }

    .filters-row {
        flex-direction: column;
    }

    .topbar {
        padding: 1rem;
        grid-template-columns: 1fr;
    }

    .content-area {
        padding: 1rem;
    }

    .tab-navigation {
        overflow-x: auto;
    }

    .product-card {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1025px) {

    .mobile-nav-toggle,
    .sidebar-close,
    .sidebar-backdrop {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .topbar {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        gap: 1.25rem !important;
        flex-wrap: wrap;
    }

    .topbar-right {
        display: block !important;
        margin-left: 0 !important;
        width: auto !important;
        max-width: none !important;
        justify-self: auto !important;
    }

    .toolbar-grid {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-start !important;
        gap: 0.75rem !important;
    }

    .toolbar-item,
    .toolbar-item-wide,
    .toolbar-btn,
    .sync-btn,
    .date-range-picker {
        width: auto !important;
        min-width: 0 !important;
    }
}

/* Final sidebar breakpoint cleanup */
@media (min-width: 769px) {
    .app-container {
        grid-template-columns: 260px minmax(0, 1fr) !important;
    }

    .sidebar {
        position: sticky !important;
        top: 0 !important;
        left: auto !important;
        transform: none !important;
        width: 260px !important;
        max-width: 260px !important;
        height: 100vh !important;
        z-index: 200 !important;
        display: flex !important;
    }

    .mobile-nav-toggle,
    .sidebar-close,
    .sidebar-backdrop {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        transform: translateX(-100%) !important;
        width: min(320px, calc(100vw - 2.5rem)) !important;
        max-width: calc(100vw - 2.5rem) !important;
        z-index: 500 !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .mobile-nav-toggle,
    .sidebar-close {
        display: inline-flex !important;
    }
}

/* Theme toggle */
body.theme-dark {
    --bg-primary: #0B1220;
    --bg-secondary: #0F172A;
    --bg-tertiary: #162238;
    --text-primary: #E5EDF8;
    --text-secondary: #A7B4C8;
    --text-tertiary: #7F8BA0;
    --border: #22314B;
    --border-hover: #334766;
    --shadow-sm: 0 12px 28px -20px rgba(2, 8, 23, 0.82);
    --shadow-md: 0 24px 48px -24px rgba(2, 8, 23, 0.9);
    --shadow-lg: 0 36px 72px -30px rgba(2, 8, 23, 0.96);
}

body.theme-dark,
body.theme-dark html {
    background: linear-gradient(180deg, #08111F 0%, #0B1220 100%);
}

body.theme-dark .sidebar,
body.theme-dark .topbar,
body.theme-dark .stat-card,
body.theme-dark .main-tabs,
body.theme-dark .filters-bar,
body.theme-dark .table-container,
body.theme-dark .adjustment-card,
body.theme-dark .product-card,
body.theme-dark .no-client-selected,
body.theme-dark .modal {
    background: rgba(15, 23, 42, 0.94) !important;
    color: var(--text-primary);
}

body.theme-dark .sidebar-header,
body.theme-dark .topbar,
body.theme-dark .table-header,
body.theme-dark .bulk-actions,
body.theme-dark .data-table th,
body.theme-dark .data-table td,
body.theme-dark .tab-navigation,
body.theme-dark .client-selector-section {
    border-color: var(--border);
}

body.theme-dark .client-select,
body.theme-dark .filter-input,
body.theme-dark .filter-select,
body.theme-dark .date-input,
body.theme-dark .date-range-picker,
body.theme-dark .btn-secondary,
body.theme-dark .quick-range-btn,
body.theme-dark .quick-compare-btn,
body.theme-dark .adjustment-input,
body.theme-dark .bid-input,
body.theme-dark .action-btn,
body.theme-dark .pagination-btn {
    background: #111C31;
    color: var(--text-primary);
    border-color: var(--border);
}

body.theme-dark .btn-secondary:hover,
body.theme-dark .quick-range-btn:hover,
body.theme-dark .quick-compare-btn:hover,
body.theme-dark .action-btn:hover,
body.theme-dark .pagination-btn:hover:not(:disabled) {
    background: #1A2944;
}

body.theme-dark .data-table thead,
body.theme-dark .tab-navigation,
body.theme-dark .bulk-actions,
body.theme-dark .date-range-info,
body.theme-dark .column-checkbox-label,
body.theme-dark .adjustment-item,
body.theme-dark .compare-row td {
    background: #111C31;
}

body.theme-dark .data-table tbody tr:hover,
body.theme-dark .data-table tbody tr.selected {
    background: rgba(37, 99, 235, 0.12);
}

body.theme-dark .logo-text,
body.theme-dark .page-title,
body.theme-dark .no-client-selected-title,
body.theme-dark .no-client-step-title,
body.theme-dark .table-title,
body.theme-dark .adjustment-title {
    color: var(--text-primary);
}

body.theme-dark .breadcrumb,
body.theme-dark .no-client-selected-text,
body.theme-dark .no-client-step-desc,
body.theme-dark .pagination-info,
body.theme-dark .filter-label,
body.theme-dark .client-selector-label,
body.theme-dark .nav-section-title,
body.theme-dark .date-range-header,
body.theme-dark .date-range-info {
    color: var(--text-secondary);
}

/* ── Multi-Select Dropdown ─────────────────────────────────────────── */
.multi-select {
    position: relative;
    min-width: 140px;
    max-width: 220px;
}
.multi-select-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 0.8125rem;
    color: var(--text-primary);
    cursor: pointer;
    min-height: 36px;
    user-select: none;
    transition: border-color 0.15s;
}
.multi-select-toggle:hover { border-color: var(--border-hover); }
.multi-select-toggle.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.multi-select-toggle .ms-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi-select-toggle .ms-arrow { font-size: 0.6rem; color: var(--text-tertiary); transition: transform 0.2s; }
.multi-select-toggle.active .ms-arrow { transform: rotate(180deg); }
.multi-select-toggle .ms-badge {
    background: var(--primary); color: #fff; font-size: 0.6875rem; font-weight: 700;
    padding: 1px 6px; border-radius: 9999px; min-width: 18px; text-align: center;
}
.multi-select-dropdown {
    display: none !important;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    width: max-content;
    max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 500;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.multi-select-dropdown.open { display: block !important; }
.multi-select-dropdown .ms-search {
    position: sticky; top: 0; background: var(--bg-secondary);
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--border);
}
.multi-select-dropdown .ms-search input {
    width: 100%; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.78rem; background: var(--bg-tertiary); color: var(--text-primary); outline: none;
}
.multi-select-dropdown .ms-search input:focus { border-color: var(--primary); }
.multi-select-dropdown .ms-option {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.625rem;
    font-size: 0.8rem; color: var(--text-primary);
    cursor: pointer; transition: background 0.1s;
}
.multi-select-dropdown .ms-option:hover { background: var(--bg-tertiary); }
.multi-select-dropdown .ms-option input[type="checkbox"] { accent-color: var(--primary); margin: 0; }
.multi-select-dropdown .ms-option.hidden { display: none; }
.multi-select-dropdown .ms-actions {
    position: sticky; bottom: 0; background: var(--bg-secondary);
    padding: 0.375rem 0.5rem;
    border-top: 1px solid var(--border);
    display: flex; gap: 0.35rem; justify-content: flex-end;
}
.multi-select-dropdown .ms-actions button {
    padding: 2px 8px; font-size: 0.72rem; border: 1px solid var(--border);
    border-radius: 4px; background: var(--bg-tertiary); color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s;
}
.multi-select-dropdown .ms-actions button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
/* Marketplace multi-select dropdown */
.mp-multiselect { position: relative; }
.mp-multiselect-trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.75rem; border: 1px solid var(--border);
    border-radius: 8px; background: var(--bg-primary); cursor: pointer;
    font-size: 0.8125rem; color: var(--text-primary); transition: border-color 0.15s;
    min-height: 36px;
}
.mp-multiselect-trigger:hover { border-color: var(--primary); }
.mp-arrow { font-size: 0.7rem; color: var(--text-tertiary); transition: transform 0.2s; }
.mp-multiselect.open .mp-arrow { transform: rotate(180deg); }
.mp-multiselect-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200; max-height: 280px; overflow-y: auto;
}
.mp-option {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.75rem; cursor: pointer; font-size: 0.8125rem;
    transition: background 0.1s; color: var(--text-primary);
}
.mp-option:hover { background: var(--bg-tertiary); }
.mp-option input[type="checkbox"] { accent-color: var(--primary); margin: 0; width: 15px; height: 15px; }
.mp-option .mp-flag { font-size: 1rem; min-width: 20px; text-align: center; }
.mp-option .mp-label { flex: 1; }
.mp-option .mp-currency { font-size: 0.7rem; color: var(--text-tertiary); padding: 1px 5px; background: var(--bg-tertiary); border-radius: 4px; }