/* IDEnforcer Cloud Portal - Modern Design System */

:root {
    /* Dark Theme Colors */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3a;
    --bg-card: #1e2432;
    --text-primary: #e4e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    
    /* Light Theme Colors */
    --bg-primary-light: #ffffff;
    --bg-secondary-light: #f9fafb;
    --bg-tertiary-light: #f3f4f6;
    --bg-card-light: #ffffff;
    --text-primary-light: #111827;
    --text-secondary-light: #4b5563;
    --text-muted-light: #6b7280;
    --border-light: #e5e7eb;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    border: 1px solid var(--border);
}

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

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Form Controls (inputs, selects, textareas) */
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-tertiary);
}

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

/* Select dropdowns */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Textareas */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent-light);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.dashboard-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.dashboard-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Navigation */
.dashboard-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 4px 0;
    position: relative;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
}


.nav-tab {
    padding: 6px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    border-radius: 6px;
}

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

.nav-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

@media (max-width: 900px) {
    .nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

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

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

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
}

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

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

/* Buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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

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

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

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

/* Search and Filters */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: rgb(245, 158, 11);
}
.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: rgb(239, 68, 68);
}
.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: rgb(59, 130, 246);
}

.audit-table th,
.audit-table td {
    font-size: 12px;
    padding: 8px 10px;
}

.audit-table pre {
    font-size: 11px;
    max-height: 120px;
    overflow: auto;
}

.info-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.info-card h3 {
    margin-top: 0;
    font-size: 16px;
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px;
}

.pagination button,
.pagination a {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled),
.pagination a:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

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

.pagination .active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    /* Prevent horizontal overflow at page level */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .dashboard-content {
        padding: 16px;
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    /* Navigation Mobile Fixes */
    .dashboard-nav {
        padding: 0 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg-secondary);
    }
    
    .nav-tabs {
        padding: 8px 0;
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--border) var(--bg-secondary);
    }
    
    .nav-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-tabs::-webkit-scrollbar-track {
        background: var(--bg-secondary);
    }
    
    .nav-tabs::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 12px;
        flex-shrink: 0;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    /* Profile Page Mobile Fixes */
    .info-card {
        overflow-x: hidden !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 16px !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .info-card > * {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Demographics and other info rows - stack vertically on mobile */
    .info-card > div[style*="display: grid"] > div[style*="display: flex"],
    .info-card > div[style*="display: grid"] > div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        padding: 12px 0 !important;
    }
    
    .info-card > div[style*="display: grid"] > div[style*="display: flex"] > span:first-child,
    .info-card > div[style*="display: grid"] > div[style*="display: flex"][style*="justify-content: space-between"] > span:first-child {
        font-weight: 600;
        margin-bottom: 4px;
        width: 100%;
    }
    
    .info-card > div[style*="display: grid"] > div[style*="display: flex"] > span:last-child,
    .info-card > div[style*="display: grid"] > div[style*="display: flex"][style*="justify-content: space-between"] > span:last-child {
        word-break: break-word;
        overflow-wrap: break-word;
        width: 100%;
    }
    
    /* Grid containers inside info-card */
    .info-card [style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* All flex containers inside info-card - default to wrapping */
    .info-card [style*="display: flex"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* IMPORTANT: Stack all flex containers with space-between or align-items:center */
    /* This catches: "display: flex; align-items: center; justify-content: space-between" */
    .info-card [style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .info-card [style*="align-items: center"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    /* But preserve flex-wrap: wrap containers (like flags) - must come after above rules */
    .info-card [style*="flex-wrap: wrap"] {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }
    
    /* Flex-direction: column should stay column */
    .info-card [style*="flex-direction: column"] {
        flex-direction: column !important;
    }
    
    /* All nested divs with flex inside info-card */
    .info-card div[style*="display: flex"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure spans inside flex containers don't overflow */
    .info-card [style*="display: flex"] > span {
        max-width: 100% !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Divider sections */
    .info-card div[style*="padding-bottom: 20px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Form groups inside info-card */
    .info-card .form-group {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    /* Input fields inside info-card */
    .info-card input,
    .info-card textarea,
    .info-card select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Background containers inside info-card */
    .info-card [style*="background: var(--bg-secondary)"] {
        max-width: 100% !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
    }
    
    /* Monospace text - break long IDs */
    .info-card [style*="font-family: monospace"] {
        word-break: break-all !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }
    
    /* Scrollable containers */
    .info-card [style*="overflow-y: auto"] {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Address field - full width */
    .info-card > div[style*="display: grid"] > div[style*="padding: 8px 0"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Profile page grid containers */
    [style*="grid-template-columns: repeat(auto-fit, minmax(320px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Profile page flex containers with nowrap */
    [style*="flex-wrap: nowrap"] {
        flex-wrap: wrap !important;
    }
    
    /* Profile header mobile fixes */
    .card-header [style*="display: flex"][style*="flex-wrap: nowrap"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .card-header [style*="flex: 1"] {
        width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Profile header info row */
    .card-header [style*="gap: 16px 24px"] {
        gap: 12px !important;
        flex-direction: column !important;
    }
    
    .card-header [style*="gap: 16px 24px"] > span {
        width: 100% !important;
        display: block !important;
    }
    
    /* Card padding mobile */
    .card {
        padding: 16px !important;
        margin: 0 0 16px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Dashboard content wrapper */
    .dashboard-content {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* All containers should not overflow */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    [style*="padding: 24px"] {
        padding: 16px !important;
    }
    
    [style*="padding: 20px"] {
        padding: 16px !important;
    }
    
    /* Ensure grid containers don't overflow */
    [style*="display: grid"] {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Profile image mobile */
    [style*="width: 80px"][style*="height: 80px"] {
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Form inputs mobile */
    input[style*="width: 100%"],
    textarea[style*="width: 100%"],
    select[style*="width: 100%"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Buttons mobile */
    button[style*="width: 100%"] {
        width: 100% !important;
        margin-bottom: 8px;
    }
    
    /* Overflow containers */
    [style*="overflow-y: auto"] {
        max-width: 100% !important;
    }
    
    /* Monospace text containers */
    [style*="font-family: monospace"] {
        word-break: break-all !important;
        overflow-wrap: break-word !important;
    }
    
    /* Gap adjustments */
    [style*="gap: 20px"] {
        gap: 12px !important;
    }
    
    [style*="gap: 24px"] {
        gap: 16px !important;
    }
    
    /* Grid template columns mobile fixes */
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    [style*="grid-template-columns: repeat(auto-fill, minmax(250px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Modal mobile fixes */
    [id*="modal"][style*="width: 90%"] {
        width: 95% !important;
        margin: 20px auto !important;
        padding: 16px !important;
    }
    
    [id*="modal"] [style*="max-width: 800px"] {
        max-width: 100% !important;
    }
    
    /* Flex justify-content space-between mobile */
    [style*="justify-content: space-between"] {
        flex-wrap: wrap !important;
    }
    
    /* Text overflow handling */
    [style*="text-overflow: ellipsis"][style*="white-space: nowrap"] {
        max-width: 100% !important;
    }
    
    /* Image containers */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Form groups mobile */
    .form-group {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Badge containers */
    .badge {
        word-break: break-word !important;
        max-width: 100% !important;
    }
    
    /* Profile header specific */
    .card-header > div > div[style*="flex-shrink: 0"] {
        width: 100% !important;
        text-align: center;
        margin-bottom: 12px;
    }
    
    /* Ensure all flex containers wrap on mobile (unless explicitly nowrap) */
    [style*="display: flex"] {
        flex-wrap: wrap !important;
    }
    
    /* But allow nowrap if explicitly set (will be overridden by earlier rules for specific cases) */
    [style*="flex-wrap: nowrap"] {
        flex-wrap: wrap !important;
    }
    
    /* Table Mobile Fixes - Card Layout */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: var(--bg-secondary);
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }
    
    /* Rewards Table Mobile - Card Layout */
    @media (max-width: 640px) {
        .table-responsive table,
        .table-responsive thead,
        .table-responsive tbody,
        .table-responsive th,
        .table-responsive td,
        .table-responsive tr {
            display: block;
        }
        
        .table-responsive thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }
        
        .table-responsive tr {
            border: 1px solid var(--border);
            border-radius: 8px;
            margin-bottom: 12px;
            padding: 12px;
            background: var(--bg-card);
        }
        
        .table-responsive td {
            border: none;
            position: relative;
            padding: 8px 8px 8px 40% !important;
            text-align: left;
            word-wrap: break-word;
        }
        
        .table-responsive td:before {
            content: attr(data-label);
            position: absolute;
            left: 8px;
            width: 35%;
            padding-right: 10px;
            white-space: nowrap;
            font-weight: 600;
            color: var(--text-secondary);
            font-size: 12px;
            text-transform: uppercase;
        }
        
        .table-responsive td:last-child {
            border-bottom: none;
        }
    }
    
    .table-container {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-lg);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

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

