/* ============================================
   BEHAVIOUR MATRIX - Modern Design System
   A professional, clean, and accessible UI
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Brand Colors */
    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-primary-light: #eef2ff;
    --brand-primary-dark: #4338ca;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --brand-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-success-light: #ecfdf5;
    --color-success-dark: #065f46;

    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-warning-light: #fffbeb;
    --color-warning-dark: #92400e;

    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-light: #fef2f2;
    --color-danger-dark: #991b1b;

    --color-info: #0ea5e9;
    --color-info-light: #f0f9ff;

    /* Neutral Palette */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Functional Colors */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --text-light: var(--gray-400);
    --text-inverse: #ffffff;

    --bg-page: var(--gray-50);
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: var(--gray-100);

    --border-color: var(--gray-200);
    --border-hover: var(--gray-300);
    --border-focus: var(--brand-primary);

    /* Spacing Scale (8px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-focus: 0 0 0 3px rgba(99, 102, 241, 0.15);
    --shadow-focus-danger: 0 0 0 3px rgba(239, 68, 68, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

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

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Z-index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-toast: 700;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Page wrapper for proper layout */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.025em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

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

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

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

/* ============================================
   Container and Layout
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }

main {
    flex: 1;
    padding: var(--space-8) 0;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    padding: var(--space-10) 0;
    margin-bottom: var(--space-8);
}

.page-header h1 {
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.page-header .subtitle,
.subtitle {
    font-size: var(--text-lg);
    color: var(--text-muted);
    font-weight: 400;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

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

.card-elevated {
    box-shadow: var(--shadow-lg);
    border: none;
}

.card h2, .card h3 {
    margin-bottom: var(--space-4);
}

.card p {
    margin-bottom: var(--space-4);
}

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

/* Card Variants */
.card-gradient {
    background: var(--brand-gradient);
    color: var(--text-inverse);
    border: none;
}

.card-gradient h1, .card-gradient h2, .card-gradient h3,
.card-gradient p {
    color: var(--text-inverse);
}

.card-gradient p {
    opacity: 0.9;
}

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

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

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

/* Primary Button */
.btn-primary, .btn {
    background: var(--brand-gradient);
    color: var(--text-inverse);
}

.btn-primary:hover, .btn:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

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

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

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

.btn-danger:focus-visible {
    box-shadow: var(--shadow-focus-danger);
}

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

.btn-success:hover {
    background: var(--color-success-hover);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

.btn-xl {
    padding: var(--space-5) var(--space-8);
    font-size: var(--text-lg);
}

/* Full Width */
.btn-block {
    width: 100%;
}

/* Icon Button */
.btn-icon {
    padding: var(--space-2);
    width: 36px;
    height: 36px;
}

.btn-icon-lg {
    width: 44px;
    height: 44px;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-family: inherit;
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--border-hover);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-focus);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--gray-100);
    color: var(--text-muted);
    cursor: not-allowed;
}

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

.form-group small {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Form Grid */
.form-grid {
    display: grid;
    gap: var(--space-5);
}

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

.form-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Messages & Alerts
   ============================================ */
.message, .alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    display: none;
    animation: slideIn var(--transition-base) ease-out;
}

.message.show, .alert.show {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

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

.message.error, .alert-error {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.message.info, .alert-info {
    background: var(--color-info-light);
    color: var(--brand-primary-dark);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Toast Messages */
.toast {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    min-width: 300px;
    max-width: 420px;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--brand-primary);
    animation: slideInRight var(--transition-base) ease-out;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

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

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

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-fast);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp var(--transition-slow) ease-out;
}

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

.modal-content.modal-xl {
    max-width: 800px;
}

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

.modal-header h2 {
    font-size: var(--text-xl);
    margin: 0;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

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

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

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

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

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

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

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

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

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
}

/* ============================================
   Loading States
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

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

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

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

.breadcrumb svg {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

/* ============================================
   Dashboard Specific
   ============================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.user-info {
    background: var(--gray-50);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-top: var(--space-4);
}

.user-info p {
    margin: var(--space-2) 0;
    font-size: var(--text-sm);
    display: flex;
    gap: var(--space-2);
}

.user-info strong {
    color: var(--text-primary);
    min-width: 100px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    border: 1px solid var(--border-color);
}

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

.stat-card-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* Users List */
.users-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.user-item:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

.user-item .user-details strong {
    display: block;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.user-item .user-details p {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.user-item .item-actions {
    display: flex;
    gap: var(--space-2);
}

/* User Role Badges */
.user-role {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role.admin {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.user-role.manager {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

.user-role.user {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Button Group */
.btn-group {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.btn-group .btn {
    flex: 1;
}

.btn-cancel {
    background: var(--gray-500);
    color: var(--text-inverse);
}

.btn-cancel:hover {
    background: var(--gray-600);
}

.btn-save {
    background: var(--color-success);
    color: var(--text-inverse);
}

.btn-save:hover {
    background: var(--color-success-hover);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-2xl);
}

.auth-card h1 {
    text-align: center;
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: var(--space-8);
}

.auth-card .btn-primary {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    margin-top: var(--space-2);
}

.auth-links {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.auth-links p {
    margin: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.auth-links a {
    font-weight: 500;
}

/* ============================================
   Landing Page / Hero
   ============================================ */
.hero {
    padding: var(--space-16) 0;
    text-align: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--text-inverse);
}

.hero h1 {
    font-size: var(--text-5xl);
    color: var(--text-inverse);
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: var(--text-xl);
    color: var(--gray-400);
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.hero .btn-lg {
    min-width: 160px;
}

/* Feature Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.feature-card {
    text-align: left;
    padding: var(--space-6);
}

.feature-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
}

.feature-card h3 {
    margin-bottom: var(--space-2);
}

.feature-card p {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.section-header h2 {
    margin: 0;
}

/* ============================================
   Item Cards (Generic List Items)
   ============================================ */
.item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-3);
}

.item-card:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.item-card:last-child {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
}

.item-title h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-base);
}

.item-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.item-actions {
    display: flex;
    gap: var(--space-2);
}

/* Clickable items */
.clickable {
    cursor: pointer;
}

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

/* ============================================
   Expandable Cards
   ============================================ */
.expandable-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-fast);
}

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

.expandable-header {
    padding: var(--space-5);
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-fast);
}

.expandable-header:hover {
    background: var(--gray-100);
}

.expandable-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.expandable-title h3 {
    margin: 0;
    font-size: var(--text-base);
}

.expandable-body {
    display: none;
    padding: var(--space-5);
    border-top: 1px solid var(--border-color);
}

.expandable-body.expanded {
    display: block;
}

.collapse-icon {
    transition: transform var(--transition-fast);
    color: var(--text-muted);
}

.collapse-icon.rotated {
    transform: rotate(180deg);
}

/* ============================================
   Inline Forms
   ============================================ */
.inline-form {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
}

.inline-form-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

/* ============================================
   Response Box
   ============================================ */
.response {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    border-left: 4px solid var(--brand-primary);
    display: none;
}

.response.show {
    display: block;
    animation: slideIn var(--transition-base);
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    color: var(--text-muted);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

footer a {
    color: var(--text-muted);
}

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

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    :root {
        --text-4xl: 2rem;
        --text-5xl: 2.5rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-xl); }

    .hero {
        padding: var(--space-12) 0;
    }

    .hero h1 {
        font-size: var(--text-4xl);
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero .btn-lg {
        width: 100%;
        max-width: 280px;
    }

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

    .modal-content {
        margin: var(--space-4);
        max-height: calc(100vh - var(--space-8));
    }

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

    .user-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-item .item-actions {
        width: 100%;
        margin-top: var(--space-3);
    }

    .user-item .item-actions .btn {
        flex: 1;
    }

    .auth-card {
        padding: var(--space-8);
    }
}

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

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }
}

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

.text-primary { color: var(--brand-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Backwards compatibility for btn-edit, btn-delete, btn-add */
.btn-edit {
    background: var(--brand-primary);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-delete {
    background: var(--color-danger);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-add {
    background: var(--color-success);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-add:hover {
    background: var(--color-success-hover);
}

/* Form field variant compatibility */
.form-field {
    margin-bottom: var(--space-4);
}

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

.form-field input,
.form-field textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-focus);
}
