/* =============================================
   ProductMetrics Design System
   ============================================= */

:root {
    /* Brand Colors */
    --primary: #008F72;
    --primary-dark: #007A61;
    --primary-soft: #E8F7F2;
    --primary-lighter: #F0FBF7;

    --gold: #D4A72C;
    --gold-soft: #FFF7DD;
    --gold-dark: #B8901E;

    --blue: #2563EB;
    --blue-soft: #EFF6FF;
    --blue-dark: #1D4ED8;

    --red: #DC2626;
    --red-soft: #FEF2F2;
    --red-dark: #B91C1C;

    --success: #008F72;
    --warning: #D4A72C;
    --error: #DC2626;

    /* Neutral Surfaces */
    --bg: #F4F7FA;
    --surface: #FFFFFF;
    --surface-alt: #F8FAFC;
    --surface-hover: #F1F5F9;

    /* Text */
    --text: #0F172A;
    --text-secondary: #64748B;
    --muted: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border: #DCE3EA;
    --border-light: #E8EDF2;
    --border-dark: #C1CBD6;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.12);

    /* Transitions */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { font-size: 14px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* =============================================
   App Shell Layout
   ============================================= */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.brand-mark {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}

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

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

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

.nav-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: currentColor;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
}

.nav-badge {
    background: var(--primary);
    color: var(--text-inverse);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.sidebar-status {
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

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

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.status-dot-active {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 143, 114, 0.15);
}

.status-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.status-meta {
    font-size: 11px;
    color: var(--muted);
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 16px;
    right: 12px;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.sidebar-toggle:hover {
    background: var(--surface-hover);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* =============================================
   Header
   ============================================= */
.app-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

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

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.breadcrumb-link {
    color: var(--muted);
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

.breadcrumb-sep {
    color: var(--muted);
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

.header-env {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 3px 10px;
}

.env-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
}

.env-dot-local { background: var(--gold); box-shadow: 0 0 0 2px rgba(212, 167, 44, 0.2); }
.env-dot-production { background: var(--primary); box-shadow: 0 0 0 2px rgba(0, 143, 114, 0.2); }
.env-dot-staging { background: var(--blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); }

.env-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

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

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
}

.header-search input {
    width: 280px;
    height: 36px;
    padding: 0 40px 0 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text);
    background: var(--surface-alt);
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 143, 114, 0.1);
    width: 340px;
}

.search-kbd {
    position: absolute;
    right: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: inherit;
}

.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    transition: all var(--transition-fast);
}

.header-icon-btn:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-dark);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--surface);
}

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

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

.header-user:hover {
    background: var(--surface-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 11px;
    color: var(--muted);
    text-transform: capitalize;
}

.user-chevron {
    color: var(--muted);
    transition: transform var(--transition-fast);
}

.header-user.open .user-chevron {
    transform: rotate(180deg);
}

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

.header-user.open .user-dropdown {
    display: block;
    animation: dropdownIn 150ms ease-out;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

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

.dropdown-item-danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

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

/* =============================================
   Page Content
   ============================================= */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

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

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

.page-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

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

/* =============================================
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 143, 114, 0.25);
}

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

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-dark);
}

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

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

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

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

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.card-body {
    padding: 20px;
}

/* =============================================
   Badges
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge-blue { background: var(--blue-soft); color: var(--blue-dark); }
.badge-red { background: var(--red-soft); color: var(--red-dark); }
.badge-neutral { background: var(--surface-hover); color: var(--text-secondary); }

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}

.score-high { background: var(--primary-soft); color: var(--primary-dark); }
.score-gold { background: var(--gold-soft); color: var(--gold-dark); }
.score-neutral { background: var(--surface-hover); color: var(--muted); }

.comp-low { background: var(--primary-soft); color: var(--primary-dark); }
.comp-medium { background: var(--gold-soft); color: var(--gold-dark); }
.comp-high { background: var(--red-soft); color: var(--red-dark); }

/* =============================================
   Tables
   ============================================= */
.data-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--surface-alt);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.data-table thead th.sortable:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.data-table thead th .sort-indicator {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.3;
    font-size: 10px;
}

.data-table thead th.sorted .sort-indicator {
    opacity: 1;
    color: var(--primary);
}

.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

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

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

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

.product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
}

.product-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.product-thumb svg {
    color: var(--muted);
}

.product-info {
    min-width: 0;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    line-height: 1.3;
}

.product-brand {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

.asin-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.num-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.growth-positive { color: var(--primary); font-weight: 600; }
.growth-negative { color: var(--red); font-weight: 600; }

/* Table actions */
.table-actions {
    display: flex;
    gap: 4px;
}

.table-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

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

.table-action-btn.danger:hover {
    color: var(--red);
    background: var(--red-soft);
    border-color: var(--red-soft);
}

/* =============================================
   Filter Bar
   ============================================= */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-select,
.filter-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: all var(--transition-fast);
    min-width: 120px;
}

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

.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.filter-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.filter-chip-remove:hover {
    opacity: 1;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-self: flex-end;
}

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

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    margin-bottom: 14px;
}

.empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 13px;
    color: var(--muted);
    max-width: 320px;
    line-height: 1.5;
}

/* =============================================
   Toast Notifications
   ============================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    min-width: 280px;
    max-width: 400px;
    animation: toastIn 200ms ease-out;
}

.toast.success { border-left: 3px solid var(--primary); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

.toast.removing {
    animation: toastOut 200ms ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px); }
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-alt);
}

.pagination-info {
    font-size: 12px;
    color: var(--muted);
}

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

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all var(--transition-fast);
    padding: 0 6px;
}

.page-btn:hover:not(:disabled) {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border-dark);
}

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

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

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 150ms ease-out;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 200ms ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

/* =============================================
   Skeleton Loaders
   ============================================= */
.skeleton {
    background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface-hover) 50%, var(--surface-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* =============================================
   Utility
   ============================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
