/* ========================================
   AdView SSP Developer Portal
   Unified Design System
   ======================================== */

/* ========================================
   CSS Variables - Design Tokens
   ======================================== */
:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;
    
    /* Neutral Colors */
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --bg-hover: #f1f5f9;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Chart Colors */
    --chart-1: #3b82f6;
    --chart-2: #10b981;
    --chart-3: #f59e0b;
    --chart-4: #8b5cf6;
    --chart-5: #ec4899;
    --chart-6: #06b6d4;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    
    /* Font Sizes */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 24px;
    --text-4xl: 28px;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
}

/* ========================================
   Accessibility - Focus States
   ======================================== */
/* Global Focus Ring */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Focus Ring for Interactive Elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip to Main Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border: #64748b;
        --text-secondary: #334155;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ARIA Live Region Styles */
[aria-live="polite"],
[aria-live="assertive"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========================================
   Top Bar / Header
   ======================================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: background-color var(--transition-fast);
}

.menu-toggle:hover {
    background-color: var(--background);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: var(--text-2xl);
    color: var(--text-primary);
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
}

.top-bar-center {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    background: var(--background);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--background);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    position: relative;
    margin-left: 8px;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-btn:hover {
    background: var(--background);
    border-color: var(--text-muted);
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--chart-4));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-name {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
}

.user-dropdown.active {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.dropdown-header .label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-header .value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: var(--text-base);
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--background);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-light);
}

/* ========================================
   App Container & Sidebar
   ======================================== */
.app-container {
    display: flex;
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 900;
    transition: transform var(--transition-slow);
}

.sidebar-nav {
    padding: 16px 12px;
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-weight: 500;
    transition: all var(--transition-fast);
}

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

.nav-item.active > .nav-link {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    text-align: center;
    flex-shrink: 0;
}

svg.nav-icon {
    display: inline-block;
    vertical-align: middle;
}

.nav-text {
    flex: 1;
}

.nav-arrow {
    transition: transform var(--transition-fast);
    font-size: 12px;
}

.nav-item.has-submenu.open > .nav-link .nav-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    padding-left: 32px;
    margin-top: 4px;
}

.nav-item.has-submenu.open > .submenu {
    display: block;
}

.submenu li {
    list-style: none;
    margin-bottom: 2px;
}

.submenu li a {
    display: block;
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.submenu li a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.submenu li.active a {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: calc(100vh - var(--topbar-height) - 60px);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-title-section {
    flex: 1;
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.page-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.data-update-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: var(--text-base);
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

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

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

.btn-secondary:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--background);
    color: var(--text-primary);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 12px 20px;
    font-size: var(--text-md);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--background);
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    padding: 12px;
    resize: vertical;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: var(--text-xs);
    color: var(--danger);
    margin-top: 6px;
}

/* Select */
.select-input {
    height: 40px;
    padding: 0 36px 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-fast);
}

.select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Date Input */
.date-input {
    height: 40px;
    padding: 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
}

.date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Checkbox & Radio */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.checkbox-label input,
.radio-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-group.vertical,
.radio-group.vertical {
    flex-direction: column;
    gap: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: var(--radius-full);
    transition: background var(--transition);
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--surface);
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Tabs
   ======================================== */
.tabs-container {
    margin-bottom: 24px;
}

.tabs {
    display: inline-flex;
    background: var(--background);
    border-radius: var(--radius);
    padding: 4px;
    gap: 4px;
}

.tab {
    position: relative;
    padding: 10px 24px;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Module Level Tabs (Underline Style) */
.module-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.module-tab {
    padding: 12px 20px;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.module-tab:hover {
    color: var(--text-primary);
    background: var(--background);
}

.module-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Sub Tabs */
.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.sub-tab {
    padding: 8px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--background);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sub-tab:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.sub-tab.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: box-shadow var(--transition);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow var(--transition);
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
}

.kpi-badge.estimated {
    background: var(--warning-light);
    color: var(--warning);
}

.kpi-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
}

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

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

.kpi-compare {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
}

/* ========================================
   Filter Bar
   ======================================== */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rules-section .filters-bar {
    padding: 20px 20px 0 20px;
    margin-bottom: 16px;
}

.search-filter {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-filter .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-filter input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    background: var(--surface);
    transition: all var(--transition-fast);
}

.search-filter input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: nowrap;
}

.filter-select {
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    appearance: none;
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 120px;
}

.summary-stat .stat-number {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-stat .stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Summary Stat Cards with Icons */
.summary-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.summary-stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--text-light);
}

.summary-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: white;
    flex-shrink: 0;
}

.summary-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.summary-stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-stat-card {
        padding: 16px;
    }
    
    .summary-stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .summary-stat-value {
        font-size: var(--text-xl);
    }
}

/* Date Range Selector */
.date-range-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.date-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--background);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.date-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.date-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.custom-date-picker {
    display: none;
    align-items: center;
    gap: 12px;
}

.custom-date-picker.show {
    display: flex;
}

.timezone-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--background);
    border-radius: var(--radius);
}

/* ========================================
   Data Tables
   ======================================== */
.data-table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

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

.table-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--background);
    padding: 14px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    font-size: var(--text-base);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Cell Components */
.app-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.app-info .app-name {
    font-weight: 500;
    color: var(--text-primary);
}

.app-info .app-id {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.bidder-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bidder-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    color: white;
    background: var(--primary);
    border-radius: var(--radius);
}

.bidder-name {
    font-weight: 500;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chart-4), var(--chart-5));
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.status-active {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-badge.status-paused {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.status-badge.status-pending {
    background: var(--info-light);
    color: var(--primary-dark);
}

.status-badge.status-inactive {
    background: var(--background);
    color: var(--text-muted);
}

/* Finance Status Badges */
.status-badge.status-completed {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-badge.status-completed::before {
    background: var(--success);
}

.status-badge.status-processing {
    background: var(--info-light);
    color: var(--primary-dark);
}

.status-badge.status-processing::before {
    background: var(--primary);
}

.status-badge.status-failed {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.status-badge.status-failed::before {
    background: var(--danger);
}

/* Platform Badges - Plain text style */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text-primary);
}

/* Format Badges - Plain text style */
.format-badge {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text-primary);
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.role-badge.role-owner {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.role-badge.role-admin {
    background: var(--info-light);
    color: var(--primary-dark);
}

.role-badge.role-viewer {
    background: var(--background);
    color: var(--text-muted);
}

/* ========================================
   Charts
   ======================================== */
.chart-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-selector label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

/* Pie Chart */
.pie-chart-container {
    width: 100%;
    height: 180px;
    margin-bottom: 16px;
    overflow: hidden;
}

.pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ========================================
   Ranking Lists
   ======================================== */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.ranking-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-width: 0;
    overflow: hidden;
}

.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ranking-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--background);
    border-radius: var(--radius);
    transition: background-color var(--transition-fast);
}

.ranking-item:hover {
    background: var(--border-light);
}

.rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: 50%;
}

.ranking-item:nth-child(1) .rank {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.ranking-item:nth-child(2) .rank {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}

.ranking-item:nth-child(3) .rank {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

.item-name {
    flex: 1;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.app-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.country-flag {
    font-size: 20px;
    line-height: 1;
}

.placement-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 14px;
    border-radius: var(--radius);
    flex-shrink: 0;
}

/* Bidder Performance Card */
.bidder-performance-card {
    grid-column: span 2;
}

.bidder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bidder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.bidder-item:hover {
    background: var(--bg-hover);
}

.bidder-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: 50%;
    flex-shrink: 0;
}

.bidder-item .bidder-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.bidder-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bidder-details .bidder-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.bidder-stats {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.bidder-revenue {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .bidder-performance-card {
        grid-column: span 1;
    }
}

/* ========================================
   Modals
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal-overlay.active,
.modal-overlay.show {
    display: flex;
}

.modal {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: #ffffff;
}

.modal-title {
    font-size: 20px;
    font-size: var(--text-xl, 20px);
    font-weight: 600;
    color: #111827;
    color: var(--text-primary, #111827);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    border-radius: var(--radius, 8px);
    color: #9ca3af;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    background: var(--background, #f3f4f6);
    color: #111827;
    color: var(--text-primary, #111827);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: #ffffff;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    border-top: 1px solid var(--border, #e5e7eb);
    background: #f9fafb;
    background: var(--background, #f9fafb);
}

.modal-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ========================================
   Drawers (Legacy - kept for compatibility)
   Note: Main drawer styles are in "Drawer Styles (Enhanced)" section
   ======================================== */
/* Legacy drawer styles removed - using enhanced version below */

/* ========================================
   Pagination
   ======================================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

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

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.pagination-pages {
    display: flex;
    gap: 4px;
}

.pagination-page {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-page:hover {
    background: var(--background);
    border-color: var(--text-muted);
}

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

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: 50%;
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 320px;
    margin-bottom: 20px;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.error-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-light);
    border-radius: 50%;
    color: var(--danger);
    margin-bottom: 20px;
}

.error-state-icon svg {
    width: 40px;
    height: 40px;
}

.error-state-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-state-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: 20px;
}

/* No Search Results State */
.no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.no-results-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: 50%;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.no-results-state-icon svg {
    width: 40px;
    height: 40px;
}

.no-results-state-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.no-results-state-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: 20px;
}

/* ========================================
   Info Sections
   ======================================== */
.info-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.info-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.info-value.highlight {
    color: var(--primary);
}

.info-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.info-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--info-light);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--primary-dark);
    margin-top: 16px;
}

.info-note i {
    margin-top: 2px;
}

.warning-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--warning-dark);
    margin-top: 16px;
}

/* ========================================
   Settings Sections
   ======================================== */
.settings-section {
    margin-bottom: 32px;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.settings-row:first-child {
    padding-top: 0;
}

.settings-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
}

.settings-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-base);
    color: var(--text-primary);
}

/* Notification Settings */
.notification-settings {
    display: flex;
    flex-direction: column;
}

.notification-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.notification-row:last-child {
    border-bottom: none;
}

.notification-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-title {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
}

.notification-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ========================================
   Actions
   ======================================== */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--background);
    border-color: var(--text-muted);
}

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

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

.more-actions-btn {
    padding: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.more-actions-btn:hover {
    background: var(--background);
}

.actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 100;
    display: none;
}

.actions-dropdown.show {
    display: block;
}

.actions-dropdown-item {
    display: block;
    padding: 10px 14px;
    font-size: var(--text-base);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.actions-dropdown-item:hover {
    background: var(--background);
}

.actions-dropdown-item.danger {
    color: var(--danger);
}

.actions-dropdown-item.danger:hover {
    background: var(--danger-light);
}

/* ========================================
   Copy Button
   ======================================== */
.copy-btn {
    padding: 4px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.bundle-id {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 32px;
    margin-left: var(--sidebar-width);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-right {
    text-align: right;
}

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

.text-nowrap {
    white-space: nowrap;
}

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

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-primary {
    color: var(--primary);
}

.text-bold {
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ========================================
   Animations
   ======================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--background) 25%, var(--border-light) 50%, var(--background) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

/* Skeleton Variants */
.skeleton-text {
    height: 14px;
    border-radius: 4px;
}

.skeleton-text-lg {
    height: 20px;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 12px;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-badge {
    width: 60px;
    height: 22px;
    border-radius: 4px;
}

.skeleton-button {
    width: 80px;
    height: 32px;
    border-radius: var(--radius);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius);
}

/* Skeleton Table Row */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.skeleton-row .skeleton-cell {
    flex: 1;
}

.skeleton-row .skeleton-cell-sm {
    flex: 0 0 80px;
}

.skeleton-row .skeleton-cell-md {
    flex: 0 0 120px;
}

/* Skeleton Table */
.skeleton-table {
    width: 100%;
}

.skeleton-table-header {
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.skeleton-table-header .skeleton {
    height: 12px;
}

/* Page Level Loading - NProgress Style */
.nprogress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.3s ease;
}

.nprogress-bar.loading {
    animation: nprogress 2s ease-in-out infinite;
}

@keyframes nprogress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Component Level Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

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

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

/* Button Loading State */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.is-loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

/* Batch Operation Progress */
.batch-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--info-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--primary-dark);
}

.batch-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.batch-progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   Detail Page Styles
   ======================================== */
.detail-header {
    margin-bottom: 24px;
}

.detail-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.detail-subtitle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.detail-separator {
    color: var(--text-muted);
}

.bundle-id-text {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.detail-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.detail-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.id-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.id-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--background);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-actions .more-actions {
    position: relative;
}

/* Review Status Badges */
.review-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.review-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.review-badge.review-unreviewed {
    background: var(--background);
    color: var(--text-muted);
}

.review-badge.review-unreviewed::before {
    background: var(--text-muted);
}

.review-badge.review-under_review {
    background: var(--info-light);
    color: var(--primary-dark);
}

.review-badge.review-under_review::before {
    background: var(--primary);
}

.review-badge.review-approved {
    background: var(--success-light);
    color: var(--success-dark);
}

.review-badge.review-approved::before {
    background: var(--success);
}

.review-badge.review-rejected {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.review-badge.review-rejected::before {
    background: var(--danger);
}



/* KPI Mini Cards */
.kpi-cards-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.kpi-card-mini {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.kpi-card-mini .kpi-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kpi-card-mini .kpi-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-period-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* Info Section Improvements */
.info-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.info-section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row .info-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 140px;
}

.info-row .info-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
    flex: 1;
}

.info-row .info-value.code-value {
    font-family: var(--font-mono);
}

/* Generic Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-muted {
    background: var(--background);
    color: var(--text-muted);
}

/* Placements Link Section */
.placements-link {
    display: flex;
    gap: 12px;
}

/* Form Improvements */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled,
.form-input:read-only {
    background: var(--background);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.locked-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--warning-dark);
    background: var(--warning-light);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

/* Modal Sizes */
.modal.modal-large {
    max-width: 640px;
}

.modal.modal-small {
    max-width: 440px;
}

/* Drawer Sizes */
.drawer.drawer-large {
    width: 560px;
}

/* Delete Warning */
.delete-warning-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--danger);
}

.delete-warning {
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}

.delete-app-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
}



/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary);
}

/* Required asterisk */
.required {
    color: var(--danger);
}

/* More Actions in drawer */
.more-actions {
    position: relative;
}

/* App Link in detail */
.app-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary);
    transition: color var(--transition-fast);
}

.app-link:hover {
    color: var(--primary-hover);
}

/* Floor Price Display */
.floor-price-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--background);
    border-radius: var(--radius);
}

.floor-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.floor-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

/* Input with Prefix */
.input-with-prefix {
    display: flex;
    align-items: center;
}

.input-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.input-with-prefix .form-input {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Toggle Group Improvements */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Form Toggle Style */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Responsive KPI Cards */
@media (max-width: 640px) {
    .kpi-cards-mini {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1279px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .footer {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .user-name {
        display: none;
    }
    
    .kpi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .top-bar {
        padding: 0 16px;
    }
    
    .top-bar-center {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .footer {
        padding: 16px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .kpi-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-presets {
        flex-wrap: wrap;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .tabs {
        width: 100%;
    }
    
    .tab {
        flex: 1;
        justify-content: center;
    }
    
    .modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .drawer {
        width: 100%;
    }
    
    .data-table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Form Page Styles (Standalone Pages)
   ======================================== */
.page-header-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header-form .page-title-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page-header-form .breadcrumb {
    margin-bottom: 12px;
}

.page-header-form .page-title {
    margin: 0 0 4px 0;
}

.page-header-form .page-subtitle {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.page-header-form .page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-top: 32px;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.form-page-container {
    max-width: 900px;
}

.form-page {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.form-page .form-section {
    padding: 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.form-page .form-section:last-of-type {
    border-bottom: none;
}

.form-section-header {
    margin-bottom: 20px;
}

.form-section-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* Radio Card Group */
.radio-group.horizontal {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-card {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 130px;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all var(--transition-fast);
    text-align: center;
}

.radio-card-content svg {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.radio-card-content span {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.radio-card input:checked + .radio-card-content {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-card input:checked + .radio-card-content svg {
    color: var(--primary);
}

.radio-card input:checked + .radio-card-content span {
    color: var(--primary-dark);
}

.radio-card:hover .radio-card-content {
    border-color: var(--text-muted);
}

.radio-card input:checked:hover + .radio-card-content {
    border-color: var(--primary);
}

/* Disabled/Locked Radio Cards */
.radio-card.disabled {
    cursor: not-allowed;
}

.radio-card.disabled .radio-card-content {
    opacity: 0.6;
    background: var(--background);
}

.radio-card.disabled:hover .radio-card-content {
    border-color: var(--border);
}

.radio-group.locked .radio-card {
    cursor: not-allowed;
}

.radio-group.locked .radio-card .radio-card-content {
    opacity: 0.6;
    background: var(--background);
}

.radio-group.locked .radio-card:hover .radio-card-content {
    border-color: var(--border);
}

.radio-group.locked .radio-card input:checked + .radio-card-content {
    opacity: 1;
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Locked Input */
.form-input-locked {
    background: var(--background) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed !important;
}

/* Multi-Select Component */
.multi-select-container {
    position: relative;
}

.multi-select-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.multi-select-input:hover {
    border-color: var(--text-muted);
}

.multi-select-input.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.multi-select-placeholder {
    font-size: var(--text-base);
    color: var(--text-muted);
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.multi-select-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    color: var(--primary);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.multi-select-tag-remove:hover {
    background: var(--primary);
    color: white;
}

.multi-select-arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.multi-select-input.active .multi-select-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow: hidden;
}

.multi-select-dropdown.show {
    display: block;
}

.multi-select-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.multi-select-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.multi-select-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: var(--text-base);
    color: var(--text-primary);
    outline: none;
}

.multi-select-search input::placeholder {
    color: var(--text-muted);
}

.multi-select-options {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.multi-select-option:hover {
    background: var(--background);
}

.multi-select-option.selected {
    background: var(--primary-light);
}

.multi-select-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.multi-select-option.selected .multi-select-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.multi-select-option-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* Category Group Styles */
.category-group {
    border-bottom: 1px solid var(--border-light);
}

.category-group:last-child {
    border-bottom: none;
}

.category-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.category-group-header:hover {
    background-color: var(--bg-secondary);
}

.category-group-header.selected {
    background-color: rgba(59, 130, 246, 0.08);
}

.category-group-header.selected .multi-select-checkbox {
    background-color: var(--primary);
    border-color: var(--primary);
}

.category-group-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.category-group-toggle:hover {
    background-color: var(--bg-tertiary);
}

.category-group-toggle .toggle-icon {
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.category-group.expanded .category-group-toggle .toggle-icon {
    transform: rotate(180deg);
}

.category-group-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.category-subcategories {
    display: none;
    padding-left: 20px;
    background-color: var(--bg-secondary);
}

.category-group.expanded .category-subcategories {
    display: block;
}

.multi-select-option.subcategory {
    padding: 8px 12px;
    padding-left: 32px;
    border-bottom: 1px solid var(--border-light);
}

.multi-select-option.subcategory:last-child {
    border-bottom: none;
}

.multi-select-option.subcategory .multi-select-option-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.multi-select-option.subcategory.selected .multi-select-option-text {
    color: var(--text-primary);
}

/* Toggle with Description */
.toggle-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-description {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Checkbox Card */
.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-card:hover {
    border-color: var(--text-muted);
}

.checkbox-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-card input:checked ~ .checkbox-content .checkbox-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.checkbox-card input:checked ~ .checkbox-content {
    border-color: var(--primary);
}

.checkbox-content {
    display: flex;
    gap: 12px;
    width: 100%;
}

.checkbox-icon {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    color: transparent;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-title {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Form Actions Bottom (Always visible at bottom of form) */
.form-actions-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 24px;
    margin-top: 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    position: sticky;
    bottom: 0;
}

.form-actions-bottom .btn {
    min-width: 120px;
}

/* Form Actions Mobile (Legacy - for backwards compatibility) */
.form-actions-mobile {
    display: none;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    gap: 12px;
}

@media (max-width: 767px) {
    .form-actions-bottom {
        flex-direction: column-reverse;
        padding: 16px;
    }
    
    .form-actions-bottom .btn {
        width: 100%;
        min-width: auto;
    }
    
    .form-actions-mobile {
        display: flex;
    }
    
    .page-header-form .page-actions {
        display: none;
    }
    
    .form-page-container {
        max-width: 100%;
    }
    
    .radio-group.horizontal {
        flex-direction: column;
    }
    
    .radio-card {
        min-width: 100%;
    }
}

/* ========================================
   Detail Page Styles (Standalone Pages)
   ======================================== */
.page-header-detail {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.page-header-detail .breadcrumb {
    margin-bottom: 12px;
}

.page-header-detail .page-title-section {
    flex: 1;
    margin-bottom: 16px;
}

.page-header-detail .page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
}

.page-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.page-title-row .page-title {
    margin: 0;
}

.status-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toggle Status Button - Fixed Width */
.btn-toggle-status {
    min-width: 100px;
    justify-content: center;
}

.btn-toggle-status .btn-text {
    min-width: 50px;
    text-align: left;
}

.status-badge.status-active {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-badge.status-paused {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.status-badge.status-pending {
    background: var(--info-light);
    color: var(--primary-dark);
}

.status-badge.status-review {
    border-radius: var(--radius-sm);
}

.status-badge.status-review::before {
    display: none;
}

.status-badge.status-approved {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-badge.status-rejected {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.status-badge.status-under_review {
    background: var(--info-light);
    color: var(--primary-dark);
}

.status-badge.status-unreviewed {
    background: var(--background);
    color: var(--text-muted);
}

.page-subtitle .platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.page-subtitle .separator {
    color: var(--text-muted);
    margin: 0 4px;
}

.page-subtitle .bundle-id,
.page-subtitle .app-id {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.page-subtitle .bundle-id:hover,
.page-subtitle .app-id:hover {
    color: var(--primary);
}

.btn-icon-only {
    width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Detail Page Container */
.detail-page-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Stats Cards Row */
.stats-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Detail Section */
.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.detail-section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.detail-section-body {
    padding: 20px;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

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

.detail-value.copyable {
    cursor: pointer;
    font-family: var(--font-mono);
    transition: color var(--transition-fast);
}

.detail-value.copyable:hover {
    color: var(--primary);
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 500;
}

.detail-link:hover {
    color: var(--primary-hover);
}

/* Category Tags */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-right: 8px;
    margin-bottom: 4px;
}

/* Compliance Badges */
.compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
}

.compliance-badge.compliance-enabled {
    background: var(--success-light);
    color: var(--success-dark);
}

.compliance-badge.compliance-disabled {
    background: var(--background);
    color: var(--text-muted);
}

.compliance-badge.compliance-confirmed {
    background: var(--success-light);
    color: var(--success-dark);
}

/* Mini Table */
.mini-table-container {
    overflow-x: auto;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table th,
.mini-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.mini-table th {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--background);
}

.mini-table td {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.mini-table tbody tr:hover {
    background: var(--background);
}

.mini-table tbody tr:last-child td {
    border-bottom: none;
}

/* Empty State Small */
.empty-state-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    text-align: center;
}

.empty-icon-small {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.empty-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* View All Link */
.view-all-link {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.view-all-link a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary);
}

.view-all-link a:hover {
    color: var(--primary-hover);
}

/* Code Block */
.code-block {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.code-content {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: auto;
    margin: 0;
}

.code-highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Integration Links */
.integration-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.integration-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary);
    transition: color var(--transition-fast);
}

.integration-link:hover {
    color: var(--primary-hover);
}

/* Small Button Variant */
.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: var(--text-sm);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--background);
    color: var(--text-primary);
}

/* Detail Page Two Column Layout */
.detail-two-column {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.detail-column-main {
    min-width: 0;
}

.detail-column-side {
    min-width: 0;
}

/* Detail Section */
.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.detail-section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.detail-section-body {
    padding: 20px;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.detail-value.text-muted {
    color: var(--text-muted);
    font-weight: 400;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
}

.detail-link:hover {
    color: var(--primary-hover);
}

/* Category Tags */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius-sm);
    margin-right: 6px;
    margin-bottom: 6px;
}

/* Compliance Badges */
.compliance-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.compliance-badge.compliance-enabled,
.compliance-badge.compliance-confirmed {
    background: var(--success-light);
    color: var(--success-dark);
}

.compliance-badge.compliance-disabled {
    background: var(--background);
    color: var(--text-muted);
}

/* Stats Cards Row */
.stats-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: white;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Quick Stats List */
.quick-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius);
}

.quick-stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.quick-stat-value {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

/* Page Meta Row */
.page-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.page-meta-row .separator {
    color: var(--text-light);
}

.app-id-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-id-inline code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--background);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Mini Table */
.mini-table-container {
    overflow-x: auto;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.mini-table td {
    padding: 12px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

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

.placement-name {
    font-weight: 500;
    color: var(--text-primary);
}

.placement-id {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

/* Empty State Small */
.empty-state-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}

.empty-icon-small {
    color: var(--text-light);
    margin-bottom: 12px;
}

.empty-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* View All Link */
.view-all-link {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.view-all-link a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary);
}

.view-all-link a:hover {
    text-decoration: underline;
}

/* Actions Dropdown */
.actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
}

.actions-dropdown.show {
    display: block;
}

.actions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.actions-dropdown-item:hover {
    background: var(--background);
}

.actions-dropdown-item.danger {
    color: var(--danger);
}

.actions-dropdown-item.danger:hover {
    background: var(--danger-light);
}

/* Button Icon Only */
.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No Results State */
.no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

/* Responsive for Detail Page */
@media (max-width: 1280px) {
    .detail-two-column {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 1023px) {
    .detail-two-column {
        grid-template-columns: 1fr;
    }
    
    .stats-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 767px) {
    .stats-cards-row {
        grid-template-columns: 1fr;
    }
    
    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-meta-row {
        flex-wrap: wrap;
    }
    
    .page-header-detail .page-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-header-detail .page-actions .btn {
        flex: 1;
        min-width: 100px;
    }
    
    .detail-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ========================================
   Placement Form Enhancements
   ======================================== */

/* Readonly Badges */
.readonly-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge.badge-outline {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Radio Group Vertical */
.radio-group.vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.radio-item:hover {
    border-color: var(--text-muted);
}

.radio-item input[type="radio"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.radio-item input[type="radio"]:checked ~ .radio-label {
    color: var(--text-primary);
}

.radio-item:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-label strong {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.radio-description {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Form Row Group (side by side inputs) */
.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 767px) {
    .form-row-group {
        grid-template-columns: 1fr;
    }
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.info-box svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.info-box-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.info-box-info {
    background: var(--info-light);
    color: var(--primary-dark);
}

/* Native Assets Table */
.native-assets-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.native-asset-row {
    display: grid;
    grid-template-columns: 140px 200px 1fr;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}

.native-asset-row:last-child {
    border-bottom: none;
}

.native-asset-row.disabled {
    background: var(--background);
    opacity: 0.6;
}

.asset-info {
    display: flex;
    align-items: center;
}

.asset-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.asset-controls {
    display: flex;
    gap: 16px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.asset-config {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.form-label-inline {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.form-input-sm {
    width: 70px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    text-align: center;
}

.form-input-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-select-sm {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: var(--surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e") no-repeat right 8px center / 14px;
    cursor: pointer;
}
.form-select-sm1 {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    cursor: pointer;
}
.form-select-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-select-sm1:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.unit {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.config-note {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 1023px) {
    .native-asset-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .asset-controls {
        justify-content: flex-start;
    }
}



/* Template Radio Specific */
.template-radio {
    position: relative;
}

.template-radio .radio-label {
    align-items: flex-start;
}

.template-radio .radio-label strong {
    text-align: left;
}

.template-radio .radio-description {
    max-width: 500px;
    text-align: left;
}

/* Video Settings Radio Options */
#videoSettings .radio-item .radio-label {
    align-items: flex-start;
}

#videoSettings .radio-item .radio-label strong {
    text-align: left;
}

#videoSettings .radio-item .radio-description {
    text-align: left;
}

/* Native Settings Radio Options */
#nativeSettings .radio-item .radio-label {
    align-items: flex-start;
}

#nativeSettings .radio-item .radio-label strong {
    text-align: left;
}

#nativeSettings .radio-item .radio-description {
    text-align: left;
}

/* Locked Field Styles */
.locked-field {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.locked-field .form-input-locked {
    background: var(--background);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.locked-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.format-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Native Assets Readonly Display */
.native-assets-readonly {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.assets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.asset-item .asset-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    min-width: 100px;
}

.asset-item .asset-config-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-left: auto;
}

.badge-success-sm {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--success-light);
    color: var(--success-dark);
    border-radius: var(--radius-sm);
}

.badge-muted-sm {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--background);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

/* ========================================
   Bidders Page Styles
   ======================================== */

/* Secondary Tabs */
.secondary-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.secondary-tab {
    padding: 10px 20px;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--background);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.secondary-tab:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.secondary-tab.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Tab Panels */
.tab-panel {
    display: none;
}

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

/* Bidder Cards - Configured List */
.bidder-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bidder-card.configured {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all var(--transition);
}

.bidder-card.configured:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--text-light);
}

.bidder-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.bidder-card .bidder-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bidder-card .bidder-name {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.bidder-card .bidder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bidder-card .meta-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--background);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.bidder-card .meta-badge.prefm {
    background: var(--info-light);
    color: var(--info);
}

.bidder-card-body {
    margin-bottom: 16px;
}

.bidder-card .config-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.bidder-card .summary-item {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.bidder-card .summary-label {
    color: var(--text-muted);
    margin-right: 4px;
}

.bidder-card .summary-item.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

.bidder-card .config-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.bidder-card-actions {
    display: flex;
    gap: 8px;
}

/* Status badges for bidders */
.status-badge.status-active {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-badge.status-active::before {
    background: var(--success);
}

.status-badge.status-disabled {
    background: var(--background);
    color: var(--text-muted);
}

.status-badge.status-disabled::before {
    background: var(--text-muted);
}

/* Bidder Cards - Available Grid */
.bidder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.bidder-card.available {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.bidder-card.available:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--text-light);
}

.bidder-card.available .configured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--success-light);
    color: var(--success-dark);
    border-radius: var(--radius-sm);
}

.bidder-card.available .bidder-card-header {
    margin-bottom: 16px;
}

.bidder-card.available .bidder-name {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.bidder-card.available .bidder-card-body {
    flex: 1;
    margin-bottom: 16px;
}

.bidder-meta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
}

.meta-row .meta-label {
    color: var(--text-muted);
}

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

.bidder-card-footer {
    margin-top: auto;
}

.btn-block {
    width: 100%;
}

/* Outline button */
.btn-outline {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--background);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* ========================================
   Drawer Styles (Enhanced)
   ======================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drawer {
    width: 480px;
    max-width: 100%;
    height: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.drawer-overlay.show .drawer {
    transform: translateX(0);
}

.drawer.drawer-wide {
    width: 640px;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.drawer-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.drawer-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.drawer-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}

/* Drawer Sections */
.drawer-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.drawer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 16px 0;
}

.bidder-info-header {
    background: var(--background);
    border-radius: var(--radius);
    padding: 16px;
}

.bidder-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.bidder-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.bidder-meta-inline .meta-item {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.bidder-meta-inline .meta-item strong {
    color: var(--text-primary);
}

/* Form Input Styles */
.form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 12px;
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.required {
    color: var(--danger);
}

/* Checkbox and Radio Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--text-base);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-text {
    color: var(--text-primary);
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--text-base);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.radio-text {
    color: var(--text-primary);
}

/* ========================================
   Mapping Tables (App & Placement)
   ======================================== */
.mapping-section {
    margin-top: 16px;
}

.mapping-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mapping-search {
    position: relative;
    flex: 1;
    max-width: 280px;
}

.mapping-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.mapping-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all var(--transition-fast);
}

.mapping-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.mapping-actions {
    display: flex;
    gap: 8px;
}

.mapping-table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.mapping-table th {
    position: sticky;
    top: 0;
    background: var(--background);
    padding: 12px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    z-index: 1;
}

.mapping-table td {
    padding: 12px 16px;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.mapping-table tbody tr:last-child td {
    border-bottom: none;
}

.mapping-table tbody tr:hover {
    background: var(--background);
}

.mapping-table .value-col {
    width: 180px;
}

.mapping-input {
    height: 34px;
    font-size: var(--text-sm);
}

/* App Cell in Mapping Table */
.app-cell .app-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--background);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    flex-shrink: 0;
}

.app-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-details .app-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-details .app-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Placement Cell in Mapping Table */
.placement-cell .placement-info {
    display: flex;
    flex-direction: column;
}

.placement-info .placement-name {
    font-weight: 500;
    color: var(--text-primary);
}

.placement-info .placement-id {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}



/* Mapping Summary */
.mapping-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.mapped-count {
    color: var(--text-secondary);
}

.mapped-count strong {
    color: var(--text-primary);
}

.mapping-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* ========================================
   Accordion (for Placement Mapping)
   ======================================== */
.placement-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--background);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.accordion-header:hover {
    background: var(--border-light);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.accordion-arrow {
    transition: transform var(--transition);
    color: var(--text-muted);
}

.accordion-item.expanded .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-title .app-name {
    font-weight: 600;
}

.accordion-title .app-platform {
    color: var(--text-muted);
    font-weight: 400;
}

.mapped-badge {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.accordion-body {
    background: var(--surface);
}

.accordion-body .placement-table {
    border: none;
    border-radius: 0;
}

.accordion-body .mapping-table th {
    background: var(--surface);
    border-top: 1px solid var(--border-light);
}

/* ========================================
   Modal Styles
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

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

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* CSV Upload Area */
.csv-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    transition: all var(--transition);
}

.csv-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.csv-upload-area svg {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.csv-upload-area p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.csv-upload-area .or-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 12px 0;
}

.csv-upload-area .file-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 16px;
}

/* CSV Preview */
.csv-preview-content h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.preview-table th {
    background: var(--background);
    padding: 10px 12px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.preview-table td {
    padding: 10px 12px;
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-light);
}

.more-rows {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.csv-summary {
    background: var(--background);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.csv-summary ul {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}

.csv-summary li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: 4px 0;
}

.csv-summary li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.csv-summary .summary-parsed::before {
    background: var(--info);
}

.csv-summary .summary-updated::before {
    background: var(--warning);
}

.csv-summary .summary-added::before {
    background: var(--success);
}

.csv-summary .summary-cleared::before {
    background: var(--danger);
}

.csv-summary .summary-unchanged::before {
    background: var(--text-muted);
}

.csv-errors {
    background: var(--danger-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.csv-errors h4 {
    color: var(--danger-dark);
}

.csv-errors ul {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}

.csv-errors li {
    font-size: var(--text-sm);
    color: var(--danger-dark);
    padding: 4px 0;
}

.csv-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--warning-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--warning-dark);
}

.csv-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    animation: slideInRight 0.3s ease;
}

.toast.success {
    background: var(--success-dark);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Orders Page Styles
   ======================================== */

/* Order Name Cell */
.order-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.order-name-cell .order-description {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Bidders Cell */
.bidders-cell {
    max-width: 200px;
}

.bidders-cell .text-muted {
    color: var(--text-muted);
    font-style: italic;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    background: var(--background);
    color: var(--text-secondary);
    border-radius: 10px;
    margin-left: 4px;
}

/* Target Scope & Geo Display */
.target-scope,
.geo-targeting {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Bidder Select Wrapper */
.bidder-select-wrapper {
    position: relative;
}

.bidder-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bidder-select-trigger:hover {
    border-color: var(--border-dark);
}

.bidder-select-trigger .placeholder {
    color: var(--text-muted);
}

.bidder-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    max-height: 320px;
    overflow: hidden;
}

.bidder-select-dropdown.show {
    display: block;
}

.bidder-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.bidder-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    outline: none;
}

.bidder-options-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
}

.bidder-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bidder-option:hover {
    background: var(--background);
}

.bidder-option.selected {
    background: var(--primary-light);
}

.bidder-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bidder-option.disabled:hover {
    background: transparent;
}

.bidder-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.bidder-option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bidder-option .bidder-name {
    font-weight: 500;
    color: var(--text-primary);
}

.bidder-option .bidder-tcf {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.bidder-option .bidder-assigned {
    font-size: var(--text-xs);
    color: var(--warning-dark);
}

.bidder-options-divider {
    padding: 8px 12px;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.bidder-options-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.bidder-options-empty a {
    color: var(--primary);
}

/* Selected Tags */
.selected-bidders-tags,
.selected-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
}

.selected-tag .tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.selected-tag .tag-remove:hover {
    opacity: 1;
}

.country-tag {
    background: var(--background);
    color: var(--text-primary);
}

.country-tag .country-flag {
    font-size: 14px;
}

/* Bidder Settings Table */
.bidder-settings-table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

.bidder-settings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.bidder-settings-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--background);
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.bidder-settings-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.bidder-settings-table .bidder-name {
    font-weight: 500;
    color: var(--text-primary);
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-with-suffix .form-input {
    width: 80px;
}

.input-suffix {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.form-input-sm {
    padding: 6px 10px;
    font-size: var(--text-sm);
}

.settings-hints {
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius);
    margin-top: 16px;
}

.hint-item {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.hint-item:last-child {
    margin-bottom: 0;
}

.hint-item strong {
    color: var(--text-primary);
}

/* Target Tree */
.target-tree-wrapper {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.target-tree-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.target-tree-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    outline: none;
}

.target-tree {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.tree-node {
    padding: 4px 0;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius);
    transition: background var(--transition-fast);
}

.tree-node-header:hover {
    background: var(--background);
}

.tree-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.app-node.expanded > .tree-node-header .tree-expand {
    transform: rotate(180deg);
}

.tree-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tree-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.tree-icon {
    font-size: 16px;
}

.tree-label {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.tree-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.tree-format {
    font-size: 11px;
    padding: 2px 6px;
}

.tree-children {
    display: none;
    padding-left: 48px;
}

.app-node.expanded > .tree-children {
    display: block;
}

.placement-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius);
}

.placement-node:hover {
    background: var(--background);
}

.selection-summary {
    padding: 10px 14px;
    background: var(--background);
    border-top: 1px solid var(--border);
}

.selected-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Country Select */
.country-select-wrapper {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.country-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.country-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    outline: none;
}

.country-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.country-option:hover {
    background: var(--background);
}

.country-flag {
    font-size: 18px;
}

.country-name {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.country-code {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.country-options-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Warning Text */
.warning-text {
    color: var(--warning-dark);
    font-size: var(--text-sm);
}

/* Order Name Display in Modal */
.order-name-display {
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 12px;
}

/* ========================================
   Orders Page Action Buttons (Enhanced)
   ======================================== */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-buttons .btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-buttons .btn-icon:hover {
    background: var(--background);
    border-color: var(--border);
    color: var(--text-primary);
}

.action-buttons .btn-icon:active {
    background: var(--border-light);
}

.action-buttons .btn-icon svg {
    width: 16px;
    height: 16px;
}

.action-buttons .btn-icon-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger-light);
    color: var(--danger);
}

/* ========================================
   Form Textarea (consistent with form-input)
   ======================================== */
.form-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 14px;
    font-size: var(--text-base);
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    resize: vertical;
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea:disabled {
    background: var(--background);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ========================================
   Radio Group Layout Fixes
   ======================================== */
.drawer-section .radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    padding-left: 4px;
}

.drawer-section .radio-group.vertical {
    flex-direction: column;
    gap: 10px;
}

.drawer-section .radio-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.drawer-section .radio-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--text-primary);
    padding: 6px 0;
}

.drawer-section .radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.drawer-section .radio-text {
    line-height: 1.4;
    white-space: nowrap;
}

/* ========================================
   Wider Drawer for Orders
   ======================================== */
.drawer.drawer-wide {
    width: 720px;
}

.drawer.drawer-extra-wide {
    width: 800px;
}

/* Toast Enhancements */
.toast.show {
    animation: slideInRight 0.3s ease forwards;
}

.toast:not(.show) {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: white;
}

/* Responsive adjustments for Bidders page */
@media (max-width: 768px) {
    .bidder-grid {
        grid-template-columns: 1fr;
    }
    
    .mapping-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mapping-search {
        max-width: none;
    }
    
    .mapping-actions {
        justify-content: flex-end;
    }
    
    .drawer {
        width: 100%;
    }
    
    .drawer.drawer-wide {
        width: 100%;
    }
    
    .secondary-tabs {
        flex-direction: column;
    }
    
    .bidder-card-actions {
        flex-direction: column;
    }
    
    .bidder-card-actions .btn {
        width: 100%;
    }
    
    /* Orders responsive */
    .bidder-settings-table-wrapper {
        margin: 12px -16px;
        padding: 0 16px;
    }
    
    .bidder-settings-table th,
    .bidder-settings-table td {
        padding: 8px;
    }
    
    .input-with-suffix .form-input {
        width: 60px;
    }
}

/* ========================================
   Creative Block Page Styles
   ======================================== */

/* Settings Card */
.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.settings-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.settings-card-title svg {
    color: var(--text-muted);
}

.settings-card-body {
    padding: 20px;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-section-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.settings-section-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.settings-section-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    background: var(--info-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.settings-section-info svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Radio Cards for Enforcement Mode */
.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-cards .radio-card {
    display: block;
    min-width: 100%;
    max-width: none;
    cursor: pointer;
}

.radio-cards .radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-cards .radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.radio-cards .radio-card:hover .radio-card-content {
    border-color: var(--text-muted);
}

.radio-cards .radio-card.selected .radio-card-content {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-cards .radio-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.radio-cards .radio-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition-fast);
}

.radio-cards .radio-card.selected .radio-indicator {
    border-color: var(--primary);
}

.radio-cards .radio-card.selected .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.radio-cards .radio-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.radio-cards .radio-card-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    padding-left: 28px;
    line-height: 1.5;
}

.radio-cards .radio-card.selected .radio-card-desc {
    color: var(--primary-dark);
}

/* Bidder Blocking Table */
.bidder-blocking-table-wrapper {
    overflow-x: auto;
    margin-bottom: 12px;
}

.bidder-blocking-table {
    width: 100%;
    border-collapse: collapse;
}

.bidder-blocking-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.bidder-blocking-table th.text-center {
    text-align: center;
}

.bidder-blocking-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.bidder-blocking-table tr:last-child td {
    border-bottom: none;
}

.bidder-name-cell .bidder-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    transition: all var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Blocking Summary */
.blocking-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: 8px 0;
}

.blocking-summary .summary-divider {
    color: var(--text-light);
}

.blocking-summary .summary-item strong {
    color: var(--text-primary);
}

/* Rules Section */
.rules-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

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

.rules-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rules-count {
    font-weight: 400;
    color: var(--text-muted);
}

/* Content Filters */
.content-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 320px;
    padding: 0 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input-wrapper .search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    height: 38px;
    border: none;
    background: transparent;
    font-size: var(--text-base);
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    width: auto;
    min-width: 140px;
    padding-right: 32px;
}

/* Rules Table in section */
.rules-section .data-table-container {
    border: none;
    border-radius: 0;
}

.rules-section .data-table {
    border: none;
}

/* Rule Name Link */
.rule-name-link {
    font-weight: 500;
    color: var(--primary);
    transition: color var(--transition-fast);
}

.rule-name-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Block Type Badges */
.block-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-right: 4px;
    margin-bottom: 4px;
}

.badge-domain {
    background: #dbeafe;
    color: #1e40af;
}

.badge-category {
    background: #fce7f3;
    color: #9d174d;
}

.badge-attribute {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-bundle {
    background: #d1fae5;
    color: #065f46;
}

/* Scope Badges */
.scope-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-right: 4px;
    margin-bottom: 4px;
}

.scope-all {
    background: var(--background);
    color: var(--text-secondary);
}

.scope-app {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.scope-more {
    background: var(--background);
    color: var(--text-muted);
}

/* Rules Pagination */
.rules-section .pagination {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    justify-content: center;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state svg {
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    max-width: 360px;
}

/* Drawer Section Title */
.drawer-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.drawer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.drawer-section .section-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.drawer-section .section-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

/* Block Dimension */
.block-dimension {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.block-dimension:last-child {
    margin-bottom: 0;
}

.dimension-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dimension-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dimension-count {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Tag Input */
.tag-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tag-input-wrapper .form-input {
    flex: 1;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
}

.tags-container:empty {
    display: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.tag-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.tag-remove:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Category Select */
.category-select-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.category-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.category-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.category-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    color: var(--text-primary);
    outline: none;
}

.category-search-input::placeholder {
    color: var(--text-muted);
}

.category-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.category-item:hover {
    background: var(--background);
}

.category-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.category-id {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    min-width: 60px;
}

.category-name {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.category-sensitive .category-name {
    color: var(--warning-dark);
}

.sensitive-tag {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    background: var(--warning-light);
    color: var(--warning-dark);
    border-radius: var(--radius-sm);
}

.empty-list {
    padding: 20px;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Attribute Grid */
.attribute-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.attribute-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.attribute-item:hover {
    border-color: var(--text-muted);
}

.attribute-item:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
}

.attribute-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.attribute-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* Target Apps Wrapper */
.target-apps-wrapper {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.apps-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.apps-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.apps-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    color: var(--text-primary);
    outline: none;
}

.apps-search-input::placeholder {
    color: var(--text-muted);
}

.apps-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.app-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.app-item:hover {
    background: var(--background);
}

.app-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.app-item .app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--background);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.app-item .app-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.app-item .app-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.app-item .app-bundle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.selected-apps-summary {
    padding: 10px 14px;
    background: var(--background);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Warning Content in Modal */
.warning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 0;
}

.warning-content svg {
    margin-bottom: 16px;
}

.warning-content p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.warning-content p:last-child {
    margin-bottom: 0;
}

.warning-content strong {
    color: var(--text-primary);
}

/* Responsive for Creative Block */
@media (max-width: 1023px) {
    .content-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-wrapper {
        max-width: none;
    }
    
    .filter-group {
        justify-content: flex-start;
    }
    
    .attribute-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .settings-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .settings-card-header .btn {
        width: 100%;
    }
    
    .content-filters .filter-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .content-filters .filter-select {
        flex: 1;
        min-width: 120px;
    }
    
    .bidder-blocking-table {
        min-width: 500px;
    }
    
    .tag-input-wrapper {
        flex-direction: column;
    }
    
    .tag-input-wrapper .btn {
        width: 100%;
    }
}

/* ========================================
   Finance Module Styles
   ======================================== */

/* Tab Panel */
.tab-panel {
    display: none;
}

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

/* Module Tabs Enhancement for Finance */
.module-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--background);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.module-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.module-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.module-tab:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.module-tab.active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* Finance KPI Cards */
.finance-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.finance-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.finance-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    color: var(--primary);
    flex-shrink: 0;
}

.finance-kpi-icon.pending {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.finance-kpi-icon.success {
    background: var(--success-light);
    color: var(--success-dark);
}

.finance-kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.finance-kpi-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.finance-kpi-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.finance-kpi-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Payment Info Bar */
.payment-info-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.payment-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
}

.payment-info-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.payment-info-item .info-label {
    color: var(--text-secondary);
}

.payment-info-item .info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.payment-info-item .info-value.highlight {
    color: var(--primary);
}

.payment-info-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* Content Toolbar */
.content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

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

.date-range-picker svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.date-range-text {
    font-weight: 500;
}

.date-range-picker {
    position: relative;
}

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

.date-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.date-picker-option {
    padding: 10px 14px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.date-picker-option:hover {
    background: var(--surface-hover);
}

/* Chart Card */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.chart-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.chart-card-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-card-body {
    padding: 20px;
}

/* Section Header */
.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Info Note */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--info-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--primary-dark);
    margin-top: 20px;
}

.info-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Warning Note */
.warning-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--warning-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--warning-dark);
    margin-top: 24px;
}

.warning-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.detail-value {
    font-size: var(--text-base);
    color: var(--text-primary);
}

.detail-value.masked {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.detail-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 400;
}

/* Settings Row */
.settings-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-row-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 120px;
}

.settings-row-value {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Method Badge */
.method-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--background);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.method-badge svg {
    color: var(--text-secondary);
}

.method-badge.method-wire {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.method-badge.method-wire svg {
    color: var(--primary);
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--success-dark);
}

.verified-badge svg {
    color: var(--success);
}

/* Tax Status Badge */
.tax-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
}

.tax-status-badge.status-approved {
    background: var(--success-light);
    color: var(--success-dark);
}

.tax-status-badge.status-pending {
    background: var(--warning-light);
    color: var(--warning-dark);
}

/* Edit Form */
.edit-form {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Copy Button */
.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Link Download */
.link-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.link-download:hover {
    color: var(--primary-hover);
}

/* Code Style */
.code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

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

.btn-pagination {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform var(--transition);
    overflow: hidden;
}

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

.modal.modal-lg {
    max-width: 640px;
}

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 20px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.modal-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--warning-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--warning-dark);
    margin-top: 20px;
}

.modal-warning svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Payment Method Options */
.payment-method-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method-option {
    display: block;
    cursor: pointer;
}

.payment-method-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.method-option-content {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.payment-method-option:hover .method-option-content {
    border-color: var(--text-muted);
}

.payment-method-option.selected .method-option-content {
    border-color: var(--primary);
    background: var(--primary-light);
}

.method-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.method-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.payment-method-option.selected .method-radio {
    border-color: var(--primary);
}

.payment-method-option.selected .method-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.method-option-header svg {
    color: var(--text-secondary);
}

.method-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.method-option-body {
    padding-left: 30px;
}

.method-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.method-details {
    display: flex;
    gap: 16px;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Form Section Title */
.form-section-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.form-section-title:first-child {
    margin-top: 0;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.radio-group.vertical {
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.radio-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* Checkbox Group */
.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Signature Section */
.signature-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.signature-fields {
    margin-top: 16px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    color: var(--text-primary);
    transform: translateX(120%);
    transition: transform var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast-success svg {
    color: var(--success);
}

.toast-error svg {
    color: var(--danger);
}

/* Page Footer */
.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-right a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-right a:hover {
    color: var(--text-primary);
}

/* Finance Responsive */
@media (max-width: 1023px) {
    .finance-kpi-row {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .module-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .module-tab {
        justify-content: center;
    }
    
    .payment-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .payment-info-divider {
        display: none;
    }
    
    .content-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .toolbar-left,
    .toolbar-right {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 12px;
    }
    
    .toolbar-left .form-select {
        min-width: 120px;
        flex: 0 0 auto;
    }
    
    .toolbar-right .btn {
        white-space: nowrap;
    }
    
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .page-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
}

/* ========================================
   Settings Page - Complete Redesign
   ======================================== */

/* Module Tabs with Icons */
.module-tabs .module-tab {
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-tabs .module-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Tab Panel */
.tab-panel {
    display: none;
}

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

/* Settings Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Input */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: var(--text-base);
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}

/* Required Asterisk */
.required {
    color: var(--danger);
}

/* Form Static Value */
.form-static-value {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    color: var(--text-primary);
}

.form-static-value .code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Copy Button */
.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* Security Row */
.security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.security-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.security-row:first-child {
    padding-top: 0;
}

.security-info {
    flex: 1;
}

.security-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.security-value {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Compliance Section */
.compliance-section {
    padding-bottom: 16px;
}

.compliance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.compliance-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.compliance-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.compliance-desc p {
    margin: 0 0 8px 0;
}

.compliance-desc p:last-child {
    margin-bottom: 0;
}

.compliance-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
}

.compliance-status.status-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.compliance-status.status-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

/* Traffic Setting */
.traffic-setting {
    padding-bottom: 16px;
}

.traffic-setting-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.traffic-setting-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 20px 0;
}

/* Slider */
.slider-container {
    margin-bottom: 16px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow-md);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.slider-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.slider-input {
    width: 80px !important;
    text-align: center;
}

.slider-suffix {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

/* Info Note */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--info-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--primary-dark);
    line-height: 1.5;
}

.info-note svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Recommended Note */
.recommended-note {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Warning Note */
.warning-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--warning-light);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--warning-dark);
    line-height: 1.5;
}

.warning-note svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Content Header */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-text {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Team Table Enhancements */
.email-text {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.current-badge {
    display: inline-flex;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-left: 8px;
}

.type-badge {
    display: inline-flex;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.type-badge.type-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.type-badge.type-secondary {
    background: var(--background);
    color: var(--text-secondary);
}

/* ads.txt Content Styles */
.ads-txt-content {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ads-txt-content pre {
    margin: 0;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

/* Implementation Steps */
.implementation-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

.step-content h4 {
    margin: 0 0 4px 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.step-content p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-content code {
    background: var(--background);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Outline Danger Button */
.btn-outline {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--text-muted);
}

.btn-danger-outline {
    color: var(--danger);
    border-color: var(--danger-light);
}

.btn-danger-outline:hover:not(:disabled) {
    background: var(--danger-light);
    border-color: var(--danger);
}

/* Code Style */
.code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--background);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Modal Enhancements */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal.modal-lg {
    max-width: 600px;
}

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Warning Content in Modal */
.warning-content {
    text-align: center;
    padding: 8px 0;
}

.warning-content svg {
    margin-bottom: 16px;
}

.warning-content p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.warning-content p:last-child {
    margin-bottom: 0;
}

/* Sessions List */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius);
}

.session-item.current {
    background: var(--primary-light);
}

.session-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.session-item.current .session-icon {
    color: var(--primary);
}

.session-info {
    flex: 1;
}

.session-device {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.session-details {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 16px);
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success svg {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error svg {
    color: var(--danger);
}

/* User Dropdown Show State */
.user-dropdown.show {
    display: block;
}

.user-dropdown .dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Notification Menu */
.notification-menu {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
}

.notification-dropdown.show {
    display: block;
}

.notification-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.notification-dropdown .dropdown-header .label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: normal;
}

.notification-dropdown .mark-all-read {
    background: none;
    border: none;
    font-size: var(--text-xs);
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.notification-dropdown .mark-all-read:hover {
    background: var(--primary-light);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    transition: background-color var(--transition-fast);
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: var(--background);
}

.notification-item.unread {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.notification-item.unread:hover {
    background: rgba(var(--primary-rgb), 0.15);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.notification-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.notification-icon.info {
    background: var(--primary-light);
    color: var(--primary);
}

.notification-icon.error {
    background: var(--danger-light);
    color: var(--danger);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.notification-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.dropdown-footer {
    display: block;
    text-align: center;
    padding: 12px 16px;
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.dropdown-footer:hover {
    background: var(--background);
}

/* ========================================
   Notification Center Modal
   ======================================== */
.modal.modal-large {
    max-width: 680px;
}

.notification-center-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.notification-center-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.notification-tabs {
    display: flex;
    gap: 4px;
}

.notification-tabs .tab-btn {
    padding: 8px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-tabs .tab-btn:hover {
    background: var(--background);
    color: var(--text-primary);
}

.notification-tabs .tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
}

.notification-actions .btn-text {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-actions .btn-text:hover {
    background: var(--background);
    color: var(--primary);
}

.notification-center-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-center-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 24px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
}

.notification-center-item:hover {
    background: var(--background);
}

.notification-center-item.unread {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.notification-center-item.unread:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

.notification-center-item .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-center-item .notification-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.notification-center-item .notification-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.notification-center-item .notification-icon.info {
    background: var(--primary-light);
    color: var(--primary);
}

.notification-center-item .notification-icon.error {
    background: var(--danger-light);
    color: var(--danger);
}

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

.notification-center-item .notification-title {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.notification-center-item .notification-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.notification-center-item .notification-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.notification-center-item .notification-meta .category {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.notification-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-muted);
    text-align: center;
}

.notification-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.notification-empty-state p {
    font-size: var(--text-base);
    margin: 0;
}

/* Notification Detail Modal */
.notification-detail-content {
    padding: 0;
}

.notification-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.notification-detail-header .notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-detail-header .notification-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.notification-detail-header .notification-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.notification-detail-header .notification-icon.info {
    background: var(--primary-light);
    color: var(--primary);
}

.notification-detail-header .notification-icon.error {
    background: var(--danger-light);
    color: var(--danger);
}

.notification-detail-info h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.notification-detail-info .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.notification-detail-info .meta .category {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.notification-detail-body {
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

.notification-detail-body p {
    margin: 0 0 12px 0;
}

.notification-detail-body p:last-child {
    margin-bottom: 0;
}

.notification-detail-body .highlight {
    color: var(--primary);
    font-weight: 500;
}

.notification-detail-body .related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.notification-detail-body .related-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

  /* Language Submenu - Expands downward as drawer */
.dropdown-submenu {
  position: relative;
  }
  
.dropdown-submenu-toggle {
  justify-content: flex-start;
  }
  
.dropdown-submenu-toggle .submenu-arrow {
  margin-left: auto;
  opacity: 0.6;
  transition: transform 0.2s ease;
  }
  
.dropdown-submenu.open .dropdown-submenu-toggle .submenu-arrow {
  transform: rotate(90deg);
  }
  
.dropdown-submenu-content {
  display: none;
  background: var(--muted);
  border-radius: var(--radius);
  margin-top: 4px;
  margin-left: 8px;
  margin-right: 8px;
  padding: 4px;
  }
  
.dropdown-submenu.open .dropdown-submenu-content {
  display: block;
  }

.dropdown-submenu-content .dropdown-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  }

.dropdown-submenu-content .dropdown-item:last-child {
  margin-bottom: 0;
  }

.dropdown-submenu-content .dropdown-item:hover {
  background: var(--background);
  }



.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-option .lang-flag {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
}

.language-option.active .lang-flag {
    background: var(--primary);
    color: white;
}

.language-option.active {
    background: var(--primary-light);
    color: var(--primary);
}



/* Settings Page Responsive */
@media (max-width: 1023px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .module-tabs {
        overflow-x: auto;
        padding-bottom: 1px;
    }
    
    .module-tab {
        white-space: nowrap;
        flex: 1;
        justify-content: center;
    }
    
    .security-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .compliance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
    }
    
    .toast {
        transform: translateY(-100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* ========================================
   Onboarding Flow
   ======================================== */

/* Onboarding Progress Bar */
.onboarding-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    margin: -24px -24px 24px -24px;
    flex-wrap: wrap;
}

.onboarding-progress-bar .progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.onboarding-progress-bar .step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.onboarding-progress-bar .step-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.onboarding-progress-bar .progress-step.active .step-number {
    background: white;
    color: var(--primary);
}

.onboarding-progress-bar .progress-step.active .step-label {
    color: white;
    font-weight: 600;
}

.onboarding-progress-bar .progress-step.completed .step-number {
    background: rgba(255, 255, 255, 0.9);
    color: var(--success);
}

.onboarding-progress-bar .progress-step.completed .step-label {
    color: rgba(255, 255, 255, 0.9);
}

.onboarding-progress-bar .progress-line {
    width: 32px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.onboarding-progress-bar .progress-line.completed {
    background: rgba(255, 255, 255, 0.7);
}

.onboarding-progress-bar .skip-btn {
    margin-left: auto;
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    background: transparent;
}

.onboarding-progress-bar .skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
    .onboarding-progress-bar .step-label {
        display: none;
    }
    
    .onboarding-progress-bar .progress-line {
        width: 20px;
    }
}

@media (max-width: 600px) {
    .onboarding-progress-bar {
        padding: 12px 16px;
        gap: 4px;
    }
    
    .onboarding-progress-bar .progress-step {
        padding: 4px 8px;
    }
    
    .onboarding-progress-bar .step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .onboarding-progress-bar .progress-line {
        width: 12px;
    }
    
    .onboarding-progress-bar .skip-btn {
        margin-left: 8px;
        padding: 6px 12px;
        font-size: var(--text-xs);
    }
}

/* Onboarding Banner (Legacy - Page-based flow) */
.onboarding-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    padding: 0;
    margin: -24px -24px 24px -24px;
}

.onboarding-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 100%;
}

.onboarding-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.onboarding-step .step-indicator {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.onboarding-step .step-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.onboarding-step.active .step-indicator {
    background: white;
    color: var(--primary);
}

.onboarding-step.active .step-label {
    color: white;
    font-weight: 600;
}

.onboarding-step.completed .step-indicator {
    background: rgba(255, 255, 255, 0.9);
    color: var(--success);
}

.onboarding-step.completed .step-label {
    color: rgba(255, 255, 255, 0.9);
}

.step-connector {
    width: 32px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

.step-connector.completed {
    background: rgba(255, 255, 255, 0.7);
}

.onboarding-banner .btn-ghost {
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

.onboarding-banner .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Responsive for onboarding banner */
@media (max-width: 900px) {
    .onboarding-step .step-label {
        display: none;
    }
    
    .step-connector {
        width: 20px;
    }
}

@media (max-width: 600px) {
    .onboarding-banner-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .onboarding-steps {
        width: 100%;
        justify-content: center;
    }
    
    .onboarding-banner .btn-ghost {
        width: 100%;
        justify-content: center;
    }
}

/* Onboarding Overlay (Modal-based - legacy) */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.onboarding-overlay.show {
    opacity: 1;
    visibility: visible;
}

.onboarding-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition);
}

.onboarding-overlay.show .onboarding-card {
    transform: scale(1) translateY(0);
}

/* Onboarding Header */
.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.onboarding-step-indicator {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.onboarding-skip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.onboarding-skip:hover {
    color: var(--text-primary);
    background: var(--background);
}

/* Onboarding Content */
.onboarding-content {
    padding: 32px 24px;
    overflow-y: auto;
    flex: 1;
}

.onboarding-content.welcome-content {
    text-align: center;
    padding: 48px 32px;
}

.onboarding-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
}

.onboarding-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.onboarding-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.onboarding-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature List */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
    margin: 0 auto;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius);
}

.feature-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius);
    color: var(--primary);
    flex-shrink: 0;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
}

.feature-text {
    flex: 1;
}

.feature-text strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.feature-text span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Onboarding Form */
.onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.onboarding-form-section {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.onboarding-form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

/* Locked Field */
.locked-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.locked-field svg {
    color: var(--text-muted);
}

/* Integration Card */
.integration-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.integration-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.integration-card-content {
    flex: 1;
}

.integration-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.integration-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.integration-card-action {
    flex-shrink: 0;
}

/* Copyable Field */
.copyable-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.copyable-field-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-field-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-field-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Success State */
.onboarding-success {
    text-align: center;
    padding: 32px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-light);
    border-radius: 50%;
    margin: 0 auto 24px;
    color: var(--success);
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

/* Next Steps */
.next-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    text-align: left;
}

.next-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.next-step-item:hover {
    background: var(--primary-light);
}

.next-step-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.next-step-item:hover .next-step-icon {
    color: var(--primary);
}

.next-step-text {
    flex: 1;
}

.next-step-text strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.next-step-text span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Onboarding Footer */
.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.onboarding-progress {
    display: flex;
    gap: 6px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all var(--transition-fast);
}

.progress-dot.active {
    background: var(--primary);
    width: 20px;
    border-radius: 4px;
}

.progress-dot.completed {
    background: var(--primary);
}

.onboarding-actions {
    display: flex;
    gap: 12px;
}

/* Responsive */
@media (max-width: 600px) {
    .onboarding-card {
        max-width: 100%;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .onboarding-content.welcome-content {
        padding: 32px 20px;
    }
    
    .onboarding-footer {
        flex-direction: column;
        gap: 16px;
    }
    
    .onboarding-actions {
        width: 100%;
        flex-direction: column-reverse;
    }
    
    .onboarding-actions .btn {
        width: 100%;
    }
}

/* ========================================
   Access Denied Page
   ======================================== */
.access-denied-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text-primary);
}

.access-denied-header {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 16px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.access-denied-brand {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
}

.access-denied-language {
    position: relative;
    margin-left: auto;
}

.access-denied-language-trigger {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
    box-shadow: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.access-denied-language-trigger:hover,
.access-denied-language.open .access-denied-language-trigger {
    border-color: #94a3b8;
    background: #f8fafc;
}

.access-denied-language .access-denied-language-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 50%;
    width: 140px;
    margin: 0;
    padding: 8px;
    transform: translateX(50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.access-denied-language.open .access-denied-language-menu {
    display: block;
}

.access-denied-language-option {
    min-height: 38px;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    text-decoration: none;
}

.access-denied-language-option:hover {
    background: #f8fafc;
    color: #334155;
}

.access-denied-language-option.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.access-denied-logo {
    display: block;
    width: auto;
    height: 30px;
}

.access-denied-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.access-denied-card {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.access-denied-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
}

.access-denied-status {
    margin-bottom: 12px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--background);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.access-denied-card h1 {
    max-width: 480px;
    margin: 0 0 12px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
}

.access-denied-description {
    max-width: 500px;
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.6;
}

.access-denied-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 28px;
}

.access-denied-actions .btn {
    min-width: 150px;
    text-decoration: none;
}

.access-denied-help {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.access-denied-help svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.access-denied-footer {
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: var(--text-xs);
    text-align: center;
}

.access-denied-page .btn:focus-visible,
.access-denied-brand:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .access-denied-header {
        min-height: 64px;
        padding: 12px 20px;
    }

    .access-denied-language-trigger {
        min-height: 40px;
        padding: 8px 12px;
    }

    .access-denied-language .access-denied-language-menu {
        right: 0;
        width: 140px;
        transform: none;
    }

    .access-denied-main {
        align-items: flex-start;
        padding: 32px 16px;
    }

    .access-denied-card {
        padding: 32px 20px;
    }

    .access-denied-icon {
        width: 64px;
        height: 64px;
    }

    .access-denied-card h1 {
        font-size: 24px;
    }

    .access-denied-actions {
        flex-direction: column;
    }

    .access-denied-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .access-denied-page .btn {
        transition: none;
    }
}
