@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Palette - Refined Teal */
    --primary: #14b8a6;
    --primary-dark: #0d9488;
    --primary-darker: #0f766e;
    --primary-light: #2dd4bf;
    --primary-50: rgba(20, 184, 166, 0.08);
    --primary-100: rgba(20, 184, 166, 0.15);
    --primary-200: rgba(20, 184, 166, 0.25);

    /* Surface & Background - Deep Slate */
    --bg: #0a0e14;
    --bg-subtle: #0f1318;
    --surface: #141820;
    --surface-2: #1a1f2a;
    --surface-3: #222836;
    --surface-hover: #1e2330;

    /* Border & Dividers */
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.1);
    --divider: rgba(255, 255, 255, 0.04);

    /* Text */
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-faint: #475569;

    /* Semantic Colors */
    --danger: #f43f5e;
    --danger-50: rgba(244, 63, 94, 0.1);
    --success: #10b981;
    --success-50: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-50: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-50: rgba(59, 130, 246, 0.1);

    /* Sidebar */
    --sidebar-bg: #0f1318;
    --sidebar-text: #94a3b8;
    --sidebar-active: #14b8a6;
    --sidebar-active-bg: rgba(20, 184, 166, 0.08);
    --sidebar-hover: rgba(255, 255, 255, 0.03);

    /* Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows - Refined */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45), 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(20, 184, 166, 0.15);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

[x-cloak] { display: none !important; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Layout */
.app-container, .app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
    transition: transform 0.3s var(--ease);
    transform: translateX(-100%);
}

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

/* Pinned sidebar: always visible, pushes content */
.sidebar-pinned .sidebar {
    transform: translateX(0);
}

.main-content {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s var(--ease);
}

.sidebar-pinned .main-content {
    margin-left: 260px;
}

.sidebar-pinned .sidebar-overlay {
    display: none !important;
}

.content-wrapper {
    padding: 1.75rem;
    flex: 1;
}

/* Sidebar */
.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
    flex: 1;
}

.sidebar-pin-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
    opacity: 0.6;
}

.sidebar-pin-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    opacity: 1;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    margin: 0.125rem 0.75rem;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    border-radius: var(--radius-sm);
    border-left: none;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: opacity 0.15s var(--ease);
    flex-shrink: 0;
}

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

.nav-link:hover svg {
    opacity: 0.9;
}

.nav-link.active {
    color: var(--primary);
    background-color: var(--sidebar-active-bg);
    font-weight: 500;
}

.nav-link.active svg {
    color: var(--primary);
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* Header */
.top-bar, .top-header {
    height: 60px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
    background-color: rgba(20, 24, 32, 0.85);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
}
.sidebar-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: dropdown-in 0.15s var(--ease);
}

@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-menu:hover .user-dropdown,
.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all 0.12s var(--ease);
}

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

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

/* Main Area */
.content-area {
    padding: 1.75rem;
    flex: 1;
}

/* Cards */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all 0.2s var(--ease);
}

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

.stat-info h3 {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    line-height: 1;
    letter-spacing: -0.025em;
}

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

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }
.stat-trend.neutral { color: var(--text-muted); }

/* Forms */
.form-group {
    margin-bottom: 1.125rem;
}

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

.form-control, .form-select {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    transition: all 0.15s var(--ease);
}

.form-control:hover, .form-select:hover {
    border-color: var(--border-strong);
}

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

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

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

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    line-height: 1.4;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(20, 184, 166, 0.2);
}

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

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

.btn-danger {
    background-color: var(--danger-50);
    color: var(--danger);
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

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

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

.btn-sm {
    padding: 0.3125rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 0.375rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--primary-50);
    color: var(--primary);
    margin-bottom: 1rem;
}

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

.empty-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 400px;
    margin-bottom: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

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

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

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-secondary);
}

.table tbody tr {
    transition: background-color 0.12s var(--ease);
}

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

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.badge-draft { background-color: rgba(100, 116, 139, 0.12); color: var(--text-muted); }
.badge-scheduled { background-color: var(--info-50); color: var(--info); }
.badge-sending { background-color: var(--primary-100); color: var(--primary); }
.badge-paused { background-color: var(--warning-50); color: var(--warning); }
.badge-sent { background-color: var(--success-50); color: var(--success); }
.badge-failed { background-color: var(--danger-50); color: var(--danger); }
.badge-active { background-color: var(--success-50); color: var(--success); }
.badge-inactive { background-color: rgba(100, 116, 139, 0.12); color: var(--text-muted); }
.badge-unsubscribed { background-color: var(--warning-50); color: var(--warning); }
.badge-bounced { background-color: var(--danger-50); color: var(--danger); }
.badge-danger { background-color: var(--danger-50); color: var(--danger); }
.badge-success { background-color: var(--success-50); color: var(--success); }
.badge-info { background-color: var(--info-50); color: var(--info); }
.badge-warning { background-color: var(--warning-50); color: var(--warning); }

/* Progress Bars */
.progress-container {
    width: 100%;
    height: 6px;
    background-color: var(--surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width 0.4s var(--ease);
}

.progress-bar.striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.1) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar.animated {
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s var(--ease);
    padding: 1rem;
}

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

.modal-dialog {
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.25s var(--ease);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-lg {
    max-width: 640px;
}

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

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

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s var(--ease);
}

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

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

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

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.875rem 1rem;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s var(--ease-bounce);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.removing {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

.toast-icon {
    flex-shrink: 0;
}
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

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

/* Auth Pages / Standalone */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at top, var(--surface) 0%, var(--bg) 70%);
}

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

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.auth-logo svg {
    width: 32px;
    height: 32px;
}

.auth-logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
}

/* Installer specific */
.installer-card {
    width: 100%;
    max-width: 560px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 2rem;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--border);
    z-index: 1;
}

.wizard-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 60px;
}

.wizard-step-circle {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background-color: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.25s var(--ease);
}

.wizard-step.active .wizard-step-circle {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-50);
}

.wizard-step.completed .wizard-step-circle {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.wizard-step-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.wizard-step.active .wizard-step-label {
    color: var(--text);
}

.req-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.req-item:last-child {
    border-bottom: none;
}

/* Utility Classes */
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.border-bottom { border-bottom: 1px solid var(--border); }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-primary { color: var(--primary) !important; }
.font-weight-600 { font-weight: 600; }
.d-flex { display: flex; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.flex-1 { flex: 1; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

/* Background Utilities */
.bg-primary { background-color: var(--primary); }
.bg-success { background-color: var(--success); }
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); }
.bg-info { background-color: var(--info); }

/* Alert Classes */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}

.alert-error {
    background-color: var(--danger-50);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

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

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

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

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

.btn-outline:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}

/* Spinner */
.spinner {
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

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

/* List Group */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
}

.list-group-flush .list-group-item {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 0.625rem 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.12s var(--ease);
}

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

.list-group-item.active {
    background-color: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-2, .col-4, .col-6, .col-8, .col-10, .col-12,
.col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 {
    padding: 0 0.75rem;
    box-sizing: border-box;
}

.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
    backdrop-filter: blur(4px);
}

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

/* Responsive */
@media (max-width: 768px) {
    .col-2, .col-4, .col-6, .col-8, .col-10, .col-12,
    .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }

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

    .content-wrapper {
        padding: 1rem;
    }

    .top-bar, .top-header {
        padding: 0 1rem;
    }

    /* On mobile, pinned sidebar becomes overlay */
    .sidebar-pinned .sidebar {
        transform: translateX(-100%);
    }

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

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

    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

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

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

.fade-in {
    animation: fadeIn 0.3s var(--ease);
}

.slide-up {
    animation: slideUp 0.3s var(--ease);
}

/* Print */
@media print {
    .sidebar, .top-bar, .sidebar-toggle, .sidebar-overlay {
        display: none !important;
    }

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

    .card {
        box-shadow: none;
        border: 1px solid var(--border-strong);
    }
}
