/**
 * PreheatMail - Nordic/Scandinavian Design System
 * Clean, minimal, professional
 * 
 * @version 2.0.0
 */

/* ============================================
   CSS Variables - Nordic Palette
   ============================================ */
:root {
    /* Backgrounds */
    --bg-primary: #FAFAFA;
    --bg-secondary: #F5F5F4;
    --bg-card: #FFFFFF;
    --bg-hover: #F0EFED;
    
    /* Text */
    --text-primary: #1C1C1C;
    --text-secondary: #737373;
    --text-tertiary: #A3A3A3;
    --text-inverse: #FFFFFF;
    
    /* Brand */
    --accent: #C4A484;
    --accent-hover: #A68B6A;
    --accent-light: #E8E0D5;
    --accent-subtle: rgba(196, 164, 132, 0.1);
    
    /* Status */
    --success: #7D8471;
    --success-light: rgba(125, 132, 113, 0.1);
    --error: #B85C5C;
    --error-light: rgba(184, 92, 92, 0.1);
    --warning: #C9A66B;
    --warning-light: rgba(201, 166, 107, 0.1);
    --info: #6B8FA3;
    --info-light: rgba(107, 143, 163, 0.1);
    
    /* Borders */
    --border: #E5E5E5;
    --border-light: #F0F0F0;
    --border-focus: #C4A484;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
}

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

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

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

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

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

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

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* ============================================
   Layout - Auth Pages (Login/Register)
   ============================================ */
.auth-layout {
    min-height: 100vh;
    display: flex;
}

.auth-visual {
    flex: 1;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--accent-light) 100%);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-subtle) 0%, transparent 70%);
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.auth-visual img {
    max-width: 300px;
    margin-bottom: var(--space-xl);
}

.auth-visual h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.auth-visual p {
    color: var(--text-secondary);
}

.auth-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: var(--bg-card);
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

.auth-logo-text {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-xl);
}

@media (min-width: 1024px) {
    .auth-visual {
        display: flex;
    }
}

/* ============================================
   Layout - Dashboard
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
}

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

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-logo img {
    height: 32px;
    width: auto;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
    font-weight: 400;
}

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

.nav-link.active {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    font-weight: 500;
}

.nav-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.nav-link.active i {
    opacity: 1;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--accent-hover);
    font-size: var(--font-size-sm);
}

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

.user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: var(--space-lg);
    transition: margin-left var(--transition-base);
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .mobile-toggle {
        display: none !important;
    }
}

.mobile-toggle {
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 99;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.mobile-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
}

.sidebar.show + .sidebar-overlay {
    display: block;
}

@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

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

.page-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

@media (min-width: 768px) {
    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .page-actions {
        margin-top: 0;
    }
}

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

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

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

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

.card-body {
    /* Default padding handled by .card */
}

.card-footer {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

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

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

.stat-change {
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.stat-icon.accent {
    background: var(--accent-subtle);
    color: var(--accent);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

/* Primary */
.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

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

/* Secondary */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

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

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

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

/* Danger */
.btn-danger {
    background: var(--error);
    color: var(--text-inverse);
    border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
    background: #A34E4E;
    border-color: #A34E4E;
}

/* Success */
.btn-success {
    background: var(--success);
    color: var(--text-inverse);
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #6B7362;
    border-color: #6B7362;
}

/* Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--font-size-base);
}

.btn-icon {
    padding: 0.625rem;
    width: 40px;
    height: 40px;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    padding: 0.375rem;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-md);
}

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

.form-label-optional {
    font-weight: 400;
    color: var(--text-tertiary);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

.form-control:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--error-light);
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--error);
    margin-top: var(--space-xs);
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input[type="radio"] {
    border-radius: var(--radius-full);
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

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

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

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

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

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

/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    appearance: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th {
    text-align: left;
    padding: var(--space-md);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

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

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

.table-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-secondary);
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-default {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-accent {
    background: var(--accent-subtle);
    color: var(--accent-hover);
}

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

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

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

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

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.pending { background: var(--warning); }
.status-dot.error { background: var(--error); }
.status-dot.inactive { background: var(--text-tertiary); }

/* ============================================
   Alerts
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

.alert-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.alert-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

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

.alert-error {
    background: var(--error-light);
    color: var(--error);
}

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

.alert-info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
}

.modal-backdrop.show .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    margin: 0;
}

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

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

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

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

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    border-radius: var(--radius-full);
    color: var(--accent);
    font-size: 1.5rem;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto var(--space-lg);
}

/* ============================================
   Loading & Progress
   ============================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

.progress {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.error { background: var(--error); }

/* ============================================
   Action Cards (for Warmup Config)
   ============================================ */
.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

.action-card:hover {
    border-color: var(--accent);
}

.action-card.disabled {
    opacity: 0.5;
    background: var(--bg-secondary);
}

.action-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.action-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.action-card-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.action-card-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   Pool Email Cards
   ============================================ */
.email-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.email-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.email-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--accent-hover);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

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

.email-address {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-meta {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.email-actions {
    display: flex;
    gap: var(--space-xs);
}

/* ============================================
   Schedule Visualization
   ============================================ */
.schedule-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.schedule-active {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.schedule-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

/* ============================================
   Grid Utilities
   ============================================ */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Spacing Utilities
   ============================================ */
.m-0 { margin: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

/* ============================================
   Flex Utilities
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-1 { flex: 1; }

/* ============================================
   Display Utilities
   ============================================ */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

@media (max-width: 768px) {
    .hide-mobile { display: none; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none; }
}

/* ============================================
   Text Utilities
   ============================================ */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Border Utilities
   ============================================ */
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   Background Utilities
   ============================================ */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-card { background: var(--bg-card); }
.bg-accent-subtle { background: var(--accent-subtle); }

/* ============================================
   Dropdown Component
   ============================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 180px;
    padding: 8px 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    text-align: left;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.dropdown-item i {
    font-size: 16px;
    color: var(--text-secondary);
}

.dropdown-item:hover i {
    color: var(--text-primary);
}

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

/* Close dropdown when clicking outside */
.dropdown-menu form {
    margin: 0;
}

.dropdown-menu form button.dropdown-item {
    width: 100%;
}
