/* ============================================
   CreatorHub - Premium Design System
   ============================================ */

/* --- CSS Custom Properties (Theme System) --- */
:root {
    /* Light Theme */
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f9;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f1f3f9;
    --bg-hover: rgba(99, 102, 241, 0.04);

    --text-primary: #1a1d2e;
    --text-secondary: #5a5f7a;
    --text-tertiary: #9499b8;
    --text-inverse: #ffffff;

    --border-color: #e8eaf0;
    --border-subtle: #f1f3f9;
    --border-glass: rgba(0, 0, 0, 0.06);

    --accent-primary: #6366f1;
    --accent-primary-hover: #5558e6;
    --accent-primary-light: rgba(99, 102, 241, 0.08);
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f1119;
    --bg-secondary: #161822;
    --bg-tertiary: #1c1f2e;
    --bg-glass: rgba(22, 24, 34, 0.8);
    --bg-sidebar: #12141e;
    --bg-card: #161822;
    --bg-input: #1c1f2e;
    --bg-hover: rgba(99, 102, 241, 0.08);

    --text-primary: #e8eaf0;
    --text-secondary: #9499b8;
    --text-tertiary: #5a5f7a;
    --text-inverse: #0f1119;

    --border-color: #252838;
    --border-subtle: #1c1f2e;
    --border-glass: rgba(255, 255, 255, 0.06);

    --accent-primary-light: rgba(99, 102, 241, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 6px 24px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

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

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
    opacity: 0.5;
}

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

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-smooth), width var(--transition-smooth), background-color var(--transition-smooth);
    overflow: hidden;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    flex-shrink: 0;
    display: flex;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.sidebar-collapse {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-collapse:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section + .nav-section {
    margin-top: 20px;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 12px 6px;
    user-select: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

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

.nav-item.active {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

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

.nav-badge--alert {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    line-height: 1.3;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left var(--transition-smooth);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-glass);
    transition: background-color var(--transition-smooth);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 520px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.header-search {
    position: relative;
    flex: 1;
}

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

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 80px 0 40px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

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

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-secondary);
}

.search-shortcut {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

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

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

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

.header-btn-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

/* Theme Toggle */
.theme-toggle .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-dark {
    display: block;
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
    padding: 28px 32px;
    max-width: 1400px;
}

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

.page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

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

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

/* ============================================
   CARD (通用分析面板)
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.stat-card-icon--blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-info);
}

.stat-card-icon--green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.stat-card-icon--purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
}

.stat-card-icon--orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.stat-card-icon--emerald {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.stat-card--gmv {
    border-left: 3px solid var(--accent-success);
}

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

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-card-change {
    font-size: 0.75rem;
    font-weight: 500;
}

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

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

/* ============================================
   REGION & COUNTRY FILTERS
   ============================================ */

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

.region-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* BD Selector */
.bd-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bd-selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.bd-select {
    min-width: 200px;
    font-weight: 500;
}

/* Region Tabs */
.region-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
}

.region-tab {
    padding: 6px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
}

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

.region-tab.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Country Bar */
.country-bar {
    margin-bottom: 16px;
}

.country-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.country-chip {
    padding: 5px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.country-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.country-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.country-group-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding: 4px 2px 4px 8px;
    display: inline-flex;
    align-items: center;
    opacity: 0.7;
}

/* Table Header Extensions */
.table-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* BD Badge */
.bd-badge {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-radius: 20px;
    white-space: nowrap;
}

/* Country Cell */
.country-cell {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

/* BD Cell */
.bd-cell {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* ============================================
   FILTER SECTION
   ============================================ */

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

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.filter-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.filter-select {
    padding: 8px 32px 8px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    font-family: var(--font-sans);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239499b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   TABLE CONTAINER
   ============================================ */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

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

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

.table-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

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

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

.data-table thead th {
    padding: 12px 24px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    user-select: none;
}

.data-table tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-primary);
}

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

.table-row {
    transition: background-color var(--transition-fast);
}

.table-row:hover {
    background-color: var(--bg-hover);
}

/* Creator Info Cell */
.creator-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.creator-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

/* Clickable avatar link */
.creator-info-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: var(--radius-md);
    transition: opacity 0.15s;
}
.creator-info-link:hover { opacity: 0.85; }
.creator-info-link:hover .creator-avatar {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.creator-info-link .creator-avatar {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.creator-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.3;
}

.creator-handle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.3;
    margin-top: 1px;
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category--beauty { background: rgba(244, 114, 182, 0.1); color: #ec4899; }
.category--tech { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.category--fashion { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.category--food { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.category--fitness { background: rgba(16, 185, 129, 0.1); color: #10b981; }

/* Number Cells */
.num-cell {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Engagement Rate */
.engagement-rate {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.engagement-rate.high { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.engagement-rate.medium { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.engagement-rate.low { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status--active { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.status--negotiating { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.status--completed { background: rgba(59, 130, 246, 0.1); color: var(--accent-info); }
.status--pending { background: rgba(148, 153, 184, 0.1); color: var(--text-secondary); }

/* Tags */
.tag-list {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag--pink { background: rgba(236, 72, 153, 0.08); color: #ec4899; }
.tag--blue { background: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.tag--green { background: rgba(16, 185, 129, 0.08); color: #10b981; }
.tag--purple { background: rgba(139, 92, 246, 0.08); color: #8b5cf6; }
.tag--orange { background: rgba(245, 158, 11, 0.08); color: #f59e0b; }
.tag--yellow { background: rgba(250, 204, 21, 0.12); color: #ca8a04; }

/* Row Actions */
.row-actions {
    display: flex;
    gap: 4px;
}

.row-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.row-action-btn.row-action-delete:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--accent-danger);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

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

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

.pagination-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

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

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

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

.pagination-ellipsis {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .page-content {
        padding: 20px 16px;
    }

    .page-header {
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .header-search {
        display: none;
    }

    .region-bar-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .bd-selector {
        width: 100%;
    }

    .bd-select {
        flex: 1;
    }

    .region-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .country-chips {
        gap: 4px;
    }

    .country-chip {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-chips {
        gap: 6px;
    }

    .filter-chip {
        font-size: 0.75rem;
        padding: 5px 12px;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody td {
        display: block;
        padding: 12px 16px;
        text-align: right;
        border-bottom: 1px solid var(--border-subtle);
    }

    .data-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--text-tertiary);
        text-transform: uppercase;
        font-size: 0.6875rem;
        letter-spacing: 0.05em;
    }

    .table-row {
        display: block;
        padding: 4px 0;
    }

    .pagination {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}

/* ============================================
   COMPLETENESS BAR & INCOMPLETE ROWS
   ============================================ */

.completeness-bar {
    width: 80px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.completeness-fill {
    height: 100%;
    background: var(--accent-success);
    border-radius: 3px;
    transition: width var(--transition-smooth);
}

.completeness-fill--warn {
    background: var(--accent-warning);
}

.completeness-fill--danger {
    background: var(--accent-danger);
}

.completeness-text {
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

.completeness-text.good { color: var(--accent-success); }
.completeness-text.warn { color: var(--accent-warning); }
.completeness-text.danger { color: var(--accent-danger); }

.row-incomplete {
    background: rgba(245, 158, 11, 0.03);
}

.row-incomplete:hover {
    background: rgba(245, 158, 11, 0.08) !important;
}

.low-complete-warning {
    font-size: 0.75rem;
    color: var(--accent-warning);
    font-weight: 500;
    margin-right: 8px;
    cursor: help;
}

/* Row Action Fill Button */
.row-action-edit.row-action-fill {
    color: var(--accent-warning);
}

.row-action-edit.row-action-fill:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

/* ============================================
   SMART IMPORT MODAL
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
}

.modal-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s var(--transition-smooth);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 24px 24px 16px;
    position: relative;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.modal-body {
    padding: 0 24px 20px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-footer-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.modal-footer-actions {
    display: flex;
    gap: 8px;
}

/* Import Input */
.import-input-area {
    margin-bottom: 16px;
}

.import-input-wrapper {
    position: relative;
}

.import-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    pointer-events: none;
}

.import-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.import-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-secondary);
}

.import-input::placeholder {
    color: var(--text-tertiary);
}

.import-quick-tip {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.tip-icon {
    font-size: 0.8125rem;
}

/* Import Preview */
.import-preview {
    margin-top: 16px;
    animation: fadeInUp 0.3s var(--transition-smooth);
}

.preview-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.preview-creator {
    display: flex;
    align-items: center;
    gap: 14px;
}

.preview-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.preview-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.preview-stat { font-weight: 500; }
.preview-dot { color: var(--text-tertiary); }

/* Quick Fields */
.preview-quick-fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-field {
    flex: 1;
    min-width: 140px;
}

.quick-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quick-label .required {
    color: var(--accent-danger);
}

.quick-select, .quick-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.quick-select:focus, .quick-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* Auto Info */
.auto-info-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.auto-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.auto-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.auto-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auto-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   INFO PANEL (SLIDE-IN DRAWER)
   ============================================ */

.panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 190;
}

.panel-overlay.open {
    display: block;
}

.info-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 195;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    box-shadow: var(--shadow-xl);
}

.info-panel.open {
    transform: translateX(0);
}

.panel-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    flex-shrink: 0;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: 0.8125rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-top: 2px;
}

.panel-readonly-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 20px;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.panel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.panel-close:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

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

.panel-section {
    margin-bottom: 24px;
}

.panel-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-field {
    margin-bottom: 12px;
}

.panel-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.panel-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.panel-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-secondary);
}

.panel-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239499b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.panel-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    resize: vertical;
    transition: all var(--transition-fast);
}

.panel-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-secondary);
}

/* Panel Tags */
.panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.panel-tag {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.panel-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.panel-tag.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    transition: transform var(--transition-smooth);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 1rem;
}

/* 6-column stats grid for 6 cards */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   PLATFORM BADGES
   ============================================ */

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .platform-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

/* ============================================
   LEVEL BADGES
   ============================================ */

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.level-s {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.25));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15);
}

.level-a {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.level-b {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.level-c {
    background: rgba(148, 153, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   STATUS CELL (Flow-based status)
   ============================================ */

.status-cell {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status--active { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.status--contacting { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.status--new { background: rgba(99, 102, 241, 0.1); color: var(--accent-primary); }
.status--dormant { background: rgba(148, 153, 184, 0.1); color: var(--text-secondary); }
.status--lost { background: rgba(239, 68, 68, 0.08); color: var(--accent-danger); }

/* ============================================
   MODAL TABS
   ============================================ */

.modal-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
}

.modal-tab {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
    text-align: center;
}

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

.modal-tab.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.modal-tab-content {
    display: none;
}

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

.modal-panel--sm {
    max-width: 420px;
}

/* ============================================
   IMPORT PLATFORM HINT
   ============================================ */

.import-platform-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.import-platform-hint .platform-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
}

/* ============================================
   LEVEL PICKER (Modal)
   ============================================ */

.level-picker {
    display: flex;
    gap: 4px;
}

.level-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.level-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.level-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ============================================
   PRODUCT PICKER
   ============================================ */

.product-picker {
    position: relative;
}

.product-search {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.product-search:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.product-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.product-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.product-dropdown-item:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.product-dropdown-item.new-item {
    color: var(--accent-success);
    font-weight: 600;
}

.product-selected {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.product-selected-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-selected-remove {
    cursor: pointer;
    font-weight: 700;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.product-selected-remove:hover {
    opacity: 1;
}

.btn-product-add {
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    margin-left: 8px;
}

.btn-product-add:hover {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary);
}

/* ============================================
   PRODUCT MANAGER MODAL
   ============================================ */

.product-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.product-add-row .quick-input {
    flex: 1;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.product-list-item:hover {
    background: var(--accent-primary-light);
}

.product-list-item-name {
    font-weight: 600;
}

.product-list-item-category {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.product-list-item-actions {
    display: flex;
    gap: 6px;
}

.product-list-item-btn {
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.product-list-item-btn:hover {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.product-list-item-btn.btn-edit:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ============================================
   BATCH IMPORT
   ============================================ */

.batch-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.batch-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.batch-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    resize: vertical;
    transition: all var(--transition-fast);
    line-height: 1.8;
}

.batch-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-secondary);
}

.batch-textarea::placeholder {
    color: var(--text-tertiary);
}

.batch-quick-settings {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.batch-preview {
    animation: fadeInUp 0.3s var(--transition-smooth);
}

.batch-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.batch-preview-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.batch-preview-hint {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.batch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.batch-item:hover {
    background: var(--accent-primary-light);
}

.batch-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.batch-item-info {
    flex: 1;
    min-width: 0;
}

.batch-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.batch-item-meta {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.batch-item-status {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

/* ============================================
   PANEL LEVEL PICKER
   ============================================ */

.panel-level-picker {
    display: flex;
    gap: 6px;
}

.panel-level-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    text-align: center;
}

.panel-level-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.panel-level-btn.active, .panel-level-btn.level-s.active {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.panel-level-btn.level-a.active {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.3);
}

.panel-level-btn.level-b.active {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.panel-level-btn.level-c.active {
    background: rgba(148, 153, 184, 0.12);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ============================================
   STATUS FLOW (Panel)
   ============================================ */

.status-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.status-step {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
}

.status-step:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.status-step.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.status-arrow {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

/* ============================================
   BUTTON ADD STYLE
   ============================================ */

.btn-add {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-add:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* ============================================
   P0: DUPLICATE DETECTION
   ============================================ */

.duplicate-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.duplicate-warning-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.duplicate-warning-body {
    flex: 1;
}

.duplicate-warning-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent-danger);
    margin-bottom: 4px;
}

.duplicate-warning-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.duplicate-warning-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-warning-outline {
    background: transparent;
    border: 1px solid var(--accent-warning);
    color: var(--accent-warning);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-warning-outline:hover {
    background: rgba(245, 158, 11, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* ============================================
   P0: FOLLOWUP INDICATORS (TABLE)
   ============================================ */

.followup-indicator {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    display: inline-block;
    white-space: nowrap;
}

.followup-indicator--urgent {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-danger);
    animation: pulse-urgent 2s infinite;
}

.followup-indicator--warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-warning);
}

.followup-indicator--ok {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-success);
}

.followup-indicator--dormant {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}

.followup-indicator--urgent::before,
.followup-indicator--warning::before {
    content: '';
}

@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   P0: NOTIFICATION PANEL
   ============================================ */

.header-btn--notify {
    position: relative;
}

.header-btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-urgent 2s infinite;
}

.notify-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    max-height: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow-y: auto;
    display: none;
    margin-top: 8px;
}

.notify-panel.open {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

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

.notify-panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notify-panel-markall {
    font-size: 0.75rem;
    color: var(--accent-primary);
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.notify-panel-markall:hover {
    background: rgba(99, 102, 241, 0.08);
}

.notify-list {
    padding: 8px;
}

.notify-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: default;
}

.notify-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.notify-item--urgent {
    background: rgba(239, 68, 68, 0.04);
}

.notify-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.notify-item-body {
    flex: 1;
    min-width: 0;
}

.notify-item-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.notify-item-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

.notify-item-time {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    display: block;
}

.notify-item-btn {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.notify-item-btn:hover {
    background: rgba(99, 102, 241, 0.16);
}

/* ============================================
   P0: FOLLOWUP SECTION (INFO PANEL)
   ============================================ */

.panel-section--followup {
    background: rgba(245, 158, 11, 0.04);
    border-radius: 10px;
    padding: 14px 16px;
}

.followup-status {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.followup-timer {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.followup-timer-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.followup-timer-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.followup-timer-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 2px;
}

.followup-timer-badge.urgent {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-danger);
}

.followup-quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.followup-btn {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.followup-btn--done {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.followup-btn--done:hover {
    background: rgba(16, 185, 129, 0.18);
}

.followup-btn--remind {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.followup-btn--remind:hover {
    background: rgba(245, 158, 11, 0.18);
}

.followup-btn--skip {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-primary);
}

.followup-btn--skip:hover {
    background: rgba(99, 102, 241, 0.14);
}

.followup-history {
    border-top: 1px solid var(--border-tertiary);
    padding-top: 8px;
}

.followup-entry {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.75rem;
}

.followup-entry-date {
    color: var(--text-tertiary);
    font-weight: 500;
    min-width: 36px;
}

.followup-entry-action {
    color: var(--text-secondary);
}

/* ============================================
   P0: COMMUNICATION LOG (INFO PANEL)
   ============================================ */

.panel-section--comms {
    background: rgba(99, 102, 241, 0.04);
    border-radius: 10px;
    padding: 14px 16px;
}

.comms-timeline {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comms-entry {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-tertiary);
}

.comms-entry:last-child {
    border-bottom: none;
}

.comms-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comms-entry-channel {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

.channel-whatsapp {
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
}

.channel-tiktok {
    background: rgba(238, 29, 82, 0.12);
    color: #EE0252;
}

.channel-email {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}

.channel-phone {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-success);
}

.channel-wechat {
    background: rgba(7, 193, 96, 0.12);
    color: #07C160;
}

.channel-other {
    background: rgba(156, 163, 175, 0.12);
    color: var(--text-secondary);
}

.comms-entry-date {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.comms-entry-by {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.comms-entry-body {
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.comms-entry-next {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-top: 2px;
}

.comms-add {
    border-top: 1px solid var(--border-tertiary);
    padding-top: 10px;
}

.comms-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comms-add-channel {
    font-size: 0.8125rem;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-tertiary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-width: 100px;
}

.comms-add-content {
    flex: 1;
    font-size: 0.8125rem;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-tertiary);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.comms-add-content:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.comms-add-next {
    margin-top: 6px;
}

.comms-add-next-input {
    width: 100%;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-tertiary);
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ============================================
   STAT CARD VARIANTS
   ============================================ */

.stat-card--alert {
    border-left: 3px solid var(--accent-danger);
}

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

.stat-card-icon--black {
    background: rgba(100, 100, 110, 0.1);
    color: var(--text-secondary);
}

.stat-card--blacklist {
    border-left: 3px solid var(--text-tertiary);
}

.stat-card--selected {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ============================================
   DATA FRESHNESS CELL
   ============================================ */

.freshness-cell {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.freshness--fresh {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-success);
}

.freshness--stale {
    background: rgba(245, 158, 11, 0.08);
    color: var(--accent-warning);
}

.freshness--old {
    background: rgba(239, 68, 68, 0.08);
    color: var(--accent-danger);
}

/* ============================================
   BLACKLIST STYLES
   ============================================ */

.row-blacklisted {
    background: rgba(239, 68, 68, 0.03);
    border-left: 3px solid var(--accent-danger);
}

.row-blacklisted:hover {
    background: rgba(239, 68, 68, 0.07) !important;
}

.blacklist-warn-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.blacklist-tag {
    margin-left: 4px;
    font-size: 0.75rem;
}

.status--blacklisted {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.filter-chip--blacklist {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-danger) !important;
}

.filter-chip--blacklist.active {
    background: var(--accent-danger) !important;
    color: white !important;
    border-color: var(--accent-danger) !important;
}

/* Blacklist panel section */
.panel-section--blacklist {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.03);
}

.blacklist-reason label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.blacklist-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.blacklist-hint {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.btn-danger-outline {
    background: transparent;
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

/* ============================================
   CONTACT TEMPLATES
   ============================================ */

.panel-section--templates {
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

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

.template-item {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.template-item:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.template-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.template-item-type {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.template-item-lang {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 4px;
}

.template-item-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.template-copy-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.template-copy-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.template-custom {
    margin-top: 10px;
}

/* ============================================
   ENHANCEMENTS: Animations & Accessibility
   ============================================ */

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

.stat-card {
    animation: fadeInUp 0.4s var(--transition-smooth) both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

.table-row {
    animation: fadeInUp 0.3s var(--transition-smooth) both;
}

.table-row:nth-child(1) { animation-delay: 0.05s; }
.table-row:nth-child(2) { animation-delay: 0.1s; }
.table-row:nth-child(3) { animation-delay: 0.15s; }
.table-row:nth-child(4) { animation-delay: 0.2s; }
.table-row:nth-child(5) { animation-delay: 0.25s; }
.table-row:nth-child(6) { animation-delay: 0.3s; }
.table-row:nth-child(7) { animation-delay: 0.35s; }

/* Loading shimmer */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ============================================
   DARK THEME OVERRIDE — ALL POPUPS & SELECTS
   Force black bg + white text on all overlays
   regardless of current theme mode
   ============================================ */

/* Modal overlay always dark */
.modal-panel {
    --_bg: #161822;
    --_text: #e8eaf0;
    --_text2: #9499b8;
    --_text3: #5a5f7a;
    --_border: #252838;
    --_input-bg: #1c1f2e;
    --_hover: rgba(99, 102, 241, 0.12);
    background: var(--_bg) !important;
    color: var(--_text) !important;
    border-color: var(--_border) !important;
}

.modal-panel .modal-title { color: var(--_text) !important; }
.modal-panel .modal-subtitle { color: var(--_text3) !important; }
.modal-panel .modal-close { background: var(--_input-bg) !important; color: var(--_text2) !important; }
.modal-panel .modal-close:hover { background: var(--_hover) !important; color: var(--accent-primary) !important; }
.modal-panel .modal-footer { border-color: var(--_border) !important; }
.modal-panel .modal-footer-hint { color: var(--_text3) !important; }
.modal-panel .modal-tab { color: var(--_text3) !important; }
.modal-panel .modal-tab:hover { color: var(--_text2) !important; }
.modal-panel .modal-tab.active { color: var(--accent-primary) !important; border-color: var(--accent-primary) !important; }

/* Modal inputs & selects */
.modal-panel .import-input,
.modal-panel .quick-select,
.modal-panel .quick-input,
.modal-panel .batch-textarea,
.modal-panel .panel-textarea,
.modal-panel .panel-input,
.modal-panel select {
    background: var(--_input-bg) !important;
    color: var(--_text) !important;
    border-color: var(--_border) !important;
}
.modal-panel .import-input::placeholder,
.modal-panel .batch-textarea::placeholder,
.modal-panel .quick-input::placeholder,
.modal-panel .panel-input::placeholder,
.modal-panel .panel-textarea::placeholder { color: var(--_text3) !important; }
.modal-panel .import-input:focus,
.modal-panel .quick-select:focus,
.modal-panel .quick-input:focus,
.modal-panel .batch-textarea:focus,
.modal-panel .panel-input:focus,
.modal-panel .panel-textarea:focus,
.modal-panel select:focus {
    background: var(--_bg) !important;
    border-color: var(--accent-primary) !important;
}
.modal-panel .quick-select,
.modal-panel select,
.modal-panel .panel-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239499b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
}

/* Modal panel tags — always dark */
.modal-panel .panel-tags { }
.modal-panel .panel-tag {
    background: var(--_input-bg) !important;
    color: var(--_text2) !important;
    border-color: var(--_border) !important;
    cursor: pointer !important;
}
.modal-panel .panel-tag:hover {
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
    background: var(--_hover) !important;
}
.modal-panel .panel-tag.active {
    background: var(--accent-primary) !important;
    color: #fff !important;
    border-color: var(--accent-primary) !important;
}

/* Modal preview sections */
.modal-panel .preview-section,
.modal-panel .batch-preview,
.modal-panel .auto-info-item { background: var(--_input-bg) !important; }
.modal-panel .batch-item { background: var(--_input-bg) !important; border-color: var(--_border) !important; }
.modal-panel .batch-item:hover { background: var(--_hover) !important; }
.modal-panel .batch-item-name { color: var(--_text) !important; }
.modal-panel .batch-item-meta { color: var(--_text3) !important; }
.modal-panel .batch-preview-title { color: var(--_text) !important; }
.modal-panel .batch-preview-hint { color: var(--_text3) !important; }
.modal-panel .preview-name { color: var(--_text) !important; }
.modal-panel .preview-stat { color: var(--_text2) !important; }
.modal-panel .preview-dot { color: var(--_text3) !important; }
.modal-panel .auto-label { color: var(--_text3) !important; }
.modal-panel .auto-value { color: var(--_text) !important; }
.modal-panel .auto-info-title { color: var(--_text3) !important; }
.modal-panel .quick-label { color: var(--_text2) !important; }
.modal-panel .import-quick-tip { color: var(--_text3) !important; }
.modal-panel .batch-label { color: var(--_text2) !important; }
.modal-panel .import-platform-hint { color: var(--_text2) !important; }
.modal-panel .level-btn { color: var(--_text2) !important; border-color: var(--_border) !important; background: var(--_input-bg) !important; }
.modal-panel .level-btn:hover { color: var(--accent-primary) !important; border-color: var(--accent-primary) !important; }
.modal-panel .level-btn.active { background: var(--accent-primary) !important; color: #fff !important; border-color: var(--accent-primary) !important; }

/* Modal duplicate warning */
.modal-panel .duplicate-warning { background: rgba(245, 158, 11, 0.08) !important; border-color: rgba(245, 158, 11, 0.25) !important; }
.modal-panel .duplicate-warning-title { color: var(--_text) !important; }
.modal-panel .duplicate-warning-detail { color: var(--_text2) !important; }

/* Modal buttons */
.modal-panel .btn-secondary { background: var(--_input-bg) !important; color: var(--_text2) !important; border-color: var(--_border) !important; }
.modal-panel .btn-secondary:hover { background: var(--_hover) !important; color: var(--_text) !important; }

/* ============================================
   INFO PANEL — always dark
   ============================================ */
.info-panel {
    --_bg: #161822;
    --_text: #e8eaf0;
    --_text2: #9499b8;
    --_text3: #5a5f7a;
    --_border: #252838;
    --_input-bg: #1c1f2e;
    --_hover: rgba(99, 102, 241, 0.12);
    background: var(--_bg) !important;
    color: var(--_text) !important;
    border-color: var(--_border) !important;
}
.info-panel .panel-header { border-color: var(--_border) !important; }
.info-panel .panel-title { color: var(--_text) !important; }
.info-panel .panel-subtitle { color: var(--accent-primary) !important; }
.info-panel .panel-readonly-badge { background: var(--_input-bg) !important; color: var(--_text3) !important; }
.info-panel .panel-close { background: var(--_input-bg) !important; color: var(--_text2) !important; }
.info-panel .panel-close:hover { background: var(--_hover) !important; }
.info-panel .panel-section-title { color: var(--_text) !important; }
.info-panel .panel-section-hint { color: var(--_text3) !important; }
.info-panel .panel-field label { color: var(--_text2) !important; }

/* Panel inputs */
.info-panel .panel-input,
.info-panel .panel-select,
.info-panel .panel-textarea,
.info-panel select {
    background: var(--_input-bg) !important;
    color: var(--_text) !important;
    border-color: var(--_border) !important;
}
.info-panel .panel-input::placeholder,
.info-panel .panel-textarea::placeholder { color: var(--_text3) !important; }
.info-panel .panel-input:focus,
.info-panel .panel-select:focus,
.info-panel .panel-textarea:focus,
.info-panel select:focus {
    background: var(--_bg) !important;
    border-color: var(--accent-primary) !important;
}
.info-panel .panel-select,
.info-panel select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239499b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
}

/* Panel tags */
.info-panel .panel-tag { background: var(--_input-bg) !important; color: var(--_text2) !important; border-color: var(--_border) !important; }
.info-panel .panel-tag:hover { border-color: var(--accent-primary) !important; color: var(--accent-primary) !important; }
.info-panel .panel-tag.active { background: var(--accent-primary) !important; color: #fff !important; border-color: var(--accent-primary) !important; }
.info-panel .panel-custom-tag-input { background: var(--_input-bg) !important; color: var(--_text) !important; border-color: var(--_border) !important; }

/* Panel status flow */
.info-panel .status-flow-btn { background: var(--_input-bg) !important; color: var(--_text2) !important; border-color: var(--_border) !important; }
.info-panel .status-flow-btn:hover { border-color: var(--accent-primary) !important; color: var(--accent-primary) !important; }
.info-panel .status-flow-btn.active { background: var(--accent-primary) !important; color: #fff !important; border-color: var(--accent-primary) !important; }

/* Collaboration edit modal tags — guaranteed clickable */
#collabEditTags .panel-tag {
    cursor: pointer !important;
    user-select: none !important;
    position: relative !important;
    z-index: 1 !important;
}
#collabEditTags .panel-tag:hover {
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
    background: rgba(99, 102, 241, 0.12) !important;
}
#collabEditTags .panel-tag.active {
    background: var(--accent-primary) !important;
    color: #fff !important;
    border-color: var(--accent-primary) !important;
}

/* ============================================
   COLLABORATION MODALS — always dark
   ============================================ */
.followup-modal-overlay,
.comm-edit-modal-overlay {
    background: rgba(0,0,0,0.6) !important;
}
.followup-modal,
.comm-edit-modal {
    background: #161822 !important;
    color: #e8eaf0 !important;
    border: 1px solid #252838 !important;
}
.followup-modal h2,
.followup-modal h3,
.followup-modal h4,
.followup-modal .modal-header .modal-title,
.comm-edit-modal h2,
.comm-edit-modal h3 { color: #e8eaf0 !important; }
.followup-modal label,
.comm-edit-modal label { color: #9499b8 !important; }
.followup-modal input,
.followup-modal select,
.followup-modal textarea,
.comm-edit-modal input,
.comm-edit-modal select,
.comm-edit-modal textarea {
    background: #1c1f2e !important;
    color: #e8eaf0 !important;
    border-color: #252838 !important;
}
.followup-modal input:focus,
.followup-modal select:focus,
.followup-modal textarea:focus,
.comm-edit-modal input:focus,
.comm-edit-modal select:focus,
.comm-edit-modal textarea:focus {
    border-color: #6366f1 !important;
}
.followup-modal select,
.comm-edit-modal select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239499b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
    -webkit-appearance: none;
    appearance: none;
}
.followup-modal input::placeholder,
.followup-modal textarea::placeholder,
.comm-edit-modal input::placeholder,
.comm-edit-modal textarea::placeholder { color: #5a5f7a !important; }
.followup-modal .comm-timeline,
.comm-edit-modal .comm-timeline { background: #1c1f2e !important; border-color: #252838 !important; }
.followup-modal .comm-log-item,
.comm-edit-modal .comm-log-item { background: #1c1f2e !important; border-color: #252838 !important; color: #e8eaf0 !important; }

/* Comm history panel in collaborations */
.comm-history-panel {
    background: #1c1f2e !important;
    color: #9499b8 !important;
}
.comm-history-panel .comm-timeline-item { color: #e8eaf0 !important; }
.comm-history-panel .comm-timeline-time { color: #5a5f7a !important; }

/* ============================================
   NOTIFICATION PANEL — always dark
   ============================================ */
.notify-panel {
    background: #161822 !important;
    border-color: #252838 !important;
    color: #e8eaf0 !important;
}
.notify-panel .notify-panel-header { border-color: #252838 !important; }
.notify-panel .notify-panel-title { color: #e8eaf0 !important; }
.notify-panel .notify-panel-markall { color: #9499b8 !important; }
.notify-panel .notify-item { border-color: #252838 !important; }
.notify-panel .notify-item:hover { background: rgba(99, 102, 241, 0.08) !important; }
.notify-panel .notify-item-title { color: #e8eaf0 !important; }
.notify-panel .notify-item-text { color: #9499b8 !important; }
.notify-panel .notify-item-time { color: #5a5f7a !important; }

/* ============================================
   GLOBAL SELECT ELEMENTS — dark on all pages
   ============================================ */
select,
.filter-select,
.bd-select {
    background-color: #1c1f2e !important;
    color: #e8eaf0 !important;
    border-color: #252838 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239499b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
    -webkit-appearance: none;
    appearance: none;
}
select:focus,
.filter-select:focus,
.bd-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* select options */
option {
    background: #1c1f2e !important;
    color: #e8eaf0 !important;
}
optgroup {
    background: #161822 !important;
    color: #9499b8 !important;
    font-weight: 600;
}
/* Focus visible */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

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

/* ============================================
   BATCH ACTION BAR
   ============================================ */

.batch-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    animation: fadeInUp 0.3s var(--transition-smooth);
}

.batch-action-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #161822;
    border: 1px solid #252838;
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.batch-selected-count {
    font-size: 0.875rem;
    color: #e8eaf0;
    white-space: nowrap;
}

.batch-selected-count strong {
    color: var(--accent-primary);
    font-size: 1rem;
}

.batch-action-buttons {
    display: flex;
    gap: 8px;
}

.batch-action-buttons .btn-sm {
    font-size: 0.8125rem;
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.batch-action-buttons .btn-danger {
    background: var(--accent-danger);
    color: #fff;
    border: none;
}

.batch-action-buttons .btn-danger:hover {
    background: #dc2626;
}

.batch-action-buttons .btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox in table */
.creator-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

#selectAll {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

/* ============================================
   INFO PANEL — Grouped Section Layout
   ============================================ */

.info-section {
    margin: 0;
    padding: 0;
}

.info-section + .info-section {
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.info-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 12px 16px 6px;
}

.info-row {
    display: flex;
    align-items: baseline;
    padding: 6px 16px;
    gap: 12px;
    transition: background 0.15s;
}

.info-row:hover {
    background: var(--bg-hover, rgba(255,255,255,0.02));
}

.info-row-label {
    flex: 0 0 auto;
    width: 72px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.info-row-value {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-primary);
    word-break: break-word;
}

[data-theme="dark"] .info-section + .info-section {
    border-top-color: rgba(255,255,255,0.06);
}

/* Mobile: compact spacing */
@media (max-width: 768px) {
    .info-section-title {
        padding: 10px 12px 4px;
    }
    .info-row {
        padding: 5px 12px;
    }
    .info-row-label {
        width: 64px;
        font-size: 0.6875rem;
    }
    .info-row-value {
        font-size: 0.75rem;
    }
}
