/* Blik - Centralized CSS System
 * Shadcn-inspired design system with zero noise, maximum signal
 */

/* ==================== CSS Variables ==================== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-body: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-horizontal: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    --insight-perception: #8b5cf6;
    --insight-skill: #3b82f6;
    --insight-strength: #10b981;
    --insight-development: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #94a3b8;
    --success: #10b981;
    --warning: #fbbf24;
    --danger: #f87171;
    --border: #334155;
    --bg-light: #1e293b;
    --bg-card: #1e293b;
    --bg-body: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --gradient-purple: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --gradient-horizontal: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
    --insight-perception: #a78bfa;
    --insight-skill: #60a5fa;
    --insight-strength: #34d399;
    --insight-development: #fbbf24;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ==================== Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== Layout: Setup Pages ==================== */
body.setup-page {
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.setup-container {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 60px 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.setup-title {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 20px;
}

.setup-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 40px;
}

.setup-status {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.setup-info {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.setup-info h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.setup-info ul {
    list-style: none;
}

.setup-info li {
    padding: 8px 0;
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
}

.setup-info li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--success);
}

.setup-footer {
    margin-top: 30px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ==================== Navigation ==================== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.navbar-content {
    max-width: 1600px;
    margin: 0 auto;
}

.navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

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

.navbar-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.navbar-nav.active {
    display: flex;
}

.navbar-nav li {
    width: 100%;
}

.navbar-nav a,
.nav-logout-btn,
.theme-toggle-btn {
    display: block;
    width: 100%;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9375rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-logout-btn,
.theme-toggle-btn {
    color: var(--secondary);
}

.navbar-nav a:hover,
.navbar-nav a.active,
.nav-logout-btn:hover,
.theme-toggle-btn:hover {
    color: var(--primary);
    background: var(--bg-light);
}

/* Desktop navbar */
@media (min-width: 768px) {
    .navbar {
        padding: 0.75rem 2rem;
    }

    .navbar-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .navbar-nav {
        display: flex;
        flex-direction: row;
        gap: 2rem;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-wrap: wrap;
    }

    .navbar-nav li {
        width: auto;
    }

    .navbar-nav a,
    .nav-logout-btn,
    .theme-toggle-btn {
        width: auto;
        padding: 0.75rem 0;
        background: none;
        border-radius: 0;
        border-bottom: 2px solid transparent;
    }

    .navbar-nav a:hover,
    .navbar-nav a.active {
        background: none;
        border-bottom-color: var(--primary);
    }

    .nav-logout-btn:hover,
    .theme-toggle-btn:hover {
        background: none;
        color: var(--primary);
    }
}

/* Tablet and larger desktop - prevent wrapping */
@media (min-width: 1024px) {
    .navbar-nav {
        flex-wrap: nowrap;
    }
}

/* ==================== Container ==================== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

@media (min-width: 1440px) {
    .container {
        padding: 2rem 3rem;
    }
}

/* ==================== Messages/Alerts ==================== */
.messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: #10b981;
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: #ef4444;
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: #f59e0b;
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: #3b82f6;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-block;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8125rem;
    white-space: nowrap;
}

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

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

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

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Setup page buttons */
.setup-button {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.3s ease;
    margin: 10px;
    border: none;
    cursor: pointer;
}

.setup-button:hover {
    background: #5568d3;
}

.setup-button.secondary {
    background: #6b7280;
}

.setup-button.secondary:hover {
    background: #4b5563;
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

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

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

.card-body {
    padding: 1.5rem;
}

/* ==================== Tables ==================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th {
    text-align: left;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

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

@media (min-width: 768px) {
    .table th {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .table td {
        padding: 1rem 0.75rem;
        font-size: 1rem;
    }
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

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

.badge-self {
    background: #dbeafe;
    color: #1e40af;
}

.badge-peer {
    background: #d1fae5;
    color: #065f46;
}

.badge-manager {
    background: #fef3c7;
    color: #92400e;
}

.badge-direct_report {
    background: #e0e7ff;
    color: #3730a3;
}

/* ==================== Progress Bars ==================== */
.progress {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.progress-container .progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-horizontal);
    transition: width 0.3s ease;
    border-radius: 4px;
}

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

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==================== Page Header ==================== */
.page-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
}

.page-description {
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}

/* ==================== Feedback Form ==================== */
.feedback-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.feedback-header {
    margin-bottom: 40px;
    text-align: center;
}

.feedback-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feedback-header .reviewee-name {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.feedback-header .category-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
}

.section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.section-header {
    margin-bottom: 32px;
    text-align: center;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.question {
    margin-bottom: 40px;
}

.question:last-child {
    margin-bottom: 0;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.question-text .required {
    color: var(--danger);
    margin-left: 4px;
}

.rating-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: stretch;
}

.rating-option {
    position: relative;
    flex: 0 0 auto;
    display: flex;
}

.rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.rating-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    min-width: 100px;
    justify-content: center;
    flex: 1;
}

.rating-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.rating-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
    max-width: 90px;
}

.rating-option input[type="radio"]:checked + .rating-label {
    border-color: var(--primary);
    background: var(--bg-light);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.rating-option input[type="radio"]:focus + .rating-label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.rating-label:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

/* Likert Scale Styling */
.likert-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.likert-option {
    position: relative;
}

.likert-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.likert-label {
    display: block;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    font-size: 1rem;
    text-align: center;
}

.likert-option input[type="radio"]:checked + .likert-label {
    border-color: var(--primary);
    background: var(--bg-light);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
    font-weight: 500;
}

.likert-option input[type="radio"]:focus + .likert-label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.likert-label:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

@media (min-width: 768px) {
    .likert-group {
        max-width: 700px;
    }
}

.text-input {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-card);
    resize: vertical;
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    padding: 24px;
    margin: 40px -20px -20px;
    border-top: 2px solid var(--border);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.form-actions .btn {
    padding: 14px 32px;
    font-size: 1rem;
}

.form-actions .btn-primary {
    flex: 1;
    max-width: none;
}

.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.error-list {
    margin: 8px 0 0 20px;
}

.complete-container {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    padding: 40px 20px;
}

.complete-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.complete-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.complete-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== Report Views ==================== */
.report-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.report-header {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.report-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.report-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.report-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

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

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-card-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.summary-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.section-report {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.question-report {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.question-report:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.question-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.category-results {
    display: grid;
    gap: 16px;
}

.category-result {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
}

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

.category-name {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

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

.rating-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.rating-bar-container {
    flex: 1;
    background: var(--border);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--gradient-horizontal);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.response-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.text-responses {
    margin-top: 12px;
}

.text-response {
    background: var(--bg-card);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    color: var(--text-primary);
    line-height: 1.6;
}

.insufficient-data {
    color: var(--text-tertiary);
    font-style: italic;
    padding: 12px;
}

.actions {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 12px;
}

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

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .action-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1280px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

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

.font-mono { font-family: monospace; }

.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }
.gap-sm { gap: 0.75rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.grid { display: grid; }

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

@media (max-width: 767px) {
    .stat-number {
        font-size: 2rem;
    }
}

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

.stat-card-content {
    text-align: center;
}

.stat-card-content .stat-number.primary {
    color: var(--primary);
}

.stat-card-content .stat-number.warning {
    color: var(--warning);
}

.stat-card-content .stat-number.success {
    color: var(--success);
}

.stat-card-content .stat-number.secondary {
    color: var(--secondary);
}

/* ==================== Misc Components ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-tertiary);
}

.help-text {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

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

.copy-feedback {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.copy-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Setup Wizard Styles
   ============================================ */

.setup-page .header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.setup-page .header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: white;
}

.setup-page .header p {
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

.setup-page .progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 4px;
    margin-top: 20px;
    border-radius: 2px;
    overflow: hidden;
}

.setup-page .progress-fill {
    background: white;
    height: 100%;
    transition: width 0.3s ease;
}

.setup-page .content {
    padding: 40px;
    background: var(--bg-primary);
}

.setup-page .help-text {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.setup-page .form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setup-page .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setup-page .button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.setup-page .errorlist {
    list-style: none;
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

[data-theme="dark"] .setup-page .errorlist {
    color: #f87171;
}

.setup-page .errorlist li {
    margin-bottom: 3px;
}

.setup-page .step-indicator {
    text-align: center;
    font-size: 14px;
    color: white;
    opacity: 0.9;
    margin-top: 10px;
}

.setup-page .next-steps {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.setup-page .next-steps h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.setup-page .next-steps ul {
    list-style: none;
}

.setup-page .next-steps li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.setup-page .next-steps li:last-child {
    border-bottom: none;
}

.setup-page .next-steps a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.setup-page .next-steps a:hover {
    text-decoration: underline;
}

.setup-page .setup-container {
    background: var(--bg-primary);
}

.setup-page .page-title {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
}

.setup-page .page-description {
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-size: 14px;
}

.setup-page .info-card {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.setup-page .info-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--text-primary);
}

.setup-page .info-card p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.setup-page .separator {
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.setup-page .config-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.setup-page .config-summary h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.setup-page .config-summary table {
    width: 100%;
}

.setup-page .config-summary td {
    padding: 8px 0;
}

.setup-page .config-summary td:first-child {
    color: var(--text-secondary);
}

.setup-page .config-summary td:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.setup-page .success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success);
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== Mobile Utilities ==================== */
@media (max-width: 767px) {
    .d-md-none {
        display: block !important;
    }

    .d-none {
        display: none !important;
    }

    .d-md-block {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }
}

/* ==================== Mobile Card Components ==================== */
.mobile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.mobile-card-header > div:first-child {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.mobile-card-body {
    padding: 1rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    gap: 1rem;
}

.mobile-card-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.mobile-card-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 90px;
    flex-shrink: 0;
}

.mobile-card-row > span:last-child {
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ==================== Responsive Spacing ==================== */
@media (max-width: 767px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .page-header button {
        width: 100%;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .btn {
        font-size: 0.9375rem;
        padding: 0.625rem 1rem;
    }

    .btn-sm {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

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

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

@media (max-width: 640px) {
    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.pagination-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-link:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-info {
    padding: 0 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
    .card-footer {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .pagination {
        width: 100%;
        justify-content: center;
    }
}

