/* Shared UI theme for Spider_XHS Web App */
:root {
    /* Font Stack optimized for Chinese/English mix */
    --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Twemoji Country Flags", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Modern Color Palette - XHS Red Style */
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text: #0f172a;
    /* Darker for better contrast */
    --text-muted: #64748b;
    --border: #e2e8f0;

    --primary: #ff2442;
    --primary-hover: #e61e3c;
    --primary-light: #fff0f2;
    /* Slightly warmer light */
    --primary-border: #fecdd3;

    /* Legacy compatibility */
    --primary-blue: var(--primary);
    --primary-blue-hover: var(--primary-hover);
    --primary-blue-light: var(--primary-light);
    --primary-blue-border: var(--primary-border);

    --success: #10b981;
    --success-light: #d1fae5;

    --danger: #ef4444;
    --danger-light: #fee2e2;

    --warning: #f59e0b;
    --warning-light: #fef3c7;

    --neutral: #94a3b8;
    --neutral-light: #f1f5f9;

    /* Tighter Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Refined Shadows - Softer & Premium */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.03);

    --container-width: 1200px;
    /* Slightly narrower for readability */
    --sidebar-width: 240px;
    /* Slimmer sidebar */
    --header-height: 56px;
    /* Slimmer header */
    --focus-ring: 0 0 0 3px rgba(255, 36, 66, 0.15);

    --glow-1: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.06), transparent 40%);
    --glow-2: radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.06), transparent 35%);
    --glow-3: radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.04), transparent 45%);

    /* New UI Details */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    70% {
        transform: scale(0.9);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-bounce-in {
    animation: bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Icon Utilities - RESTORED GENERIC .icon */
.icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.icon-xs {
    width: 12px;
    height: 12px;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.icon-md {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 20px;
    height: 20px;
}

.icon-xl {
    width: 24px;
    height: 24px;
}

.icon-spin {
    animation: spin 2s linear infinite;
}

/* Hover Effects */
.hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Subtler scale */
.hover-scale:active {
    transform: scale(0.98);
}

.hover-rotate:hover .icon {
    transform: rotate(15deg);
}

.nav-item .icon {
    transition: transform 0.2s ease;
}

/* Loading Placeholder */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
    font-weight: 600;
    gap: 12px;
}

.loading-placeholder::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background: var(--surface-muted);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

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

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

.progress-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Empty State Refined */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: var(--border);
}

.empty-state h4 {
    margin: 0 0 8px;
    color: var(--text);
    font-weight: 700;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    max-width: 320px;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

/* Layout Utilities */
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral);
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
    margin: 16px 0;
}

.empty-state .icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: var(--border);
    stroke-width: 1.5;
}

.empty-state h4 {
    margin: 0 0 6px 0;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.empty-state p {
    margin: 0;
    font-size: 0.85rem;
    max-width: 280px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: var(--border);
    stroke-width: 1.5;
}

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

.empty-state-description {
    font-size: 0.85rem;
    max-width: 280px;
    margin-bottom: 20px;
}

/* Page Hero */
.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--surface) 0%, #fff6f7 100%);
    border: 1px solid var(--primary-border);
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.page-hero h3 {
    font-size: 20px;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.page-hero .eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 6px;
}

.page-hero .hero-note {
    display: flex;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 0;
}

@media (max-width: 768px) {
    .page-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --surface: #1e293b;
        --surface-muted: #334155;
        --text: #f8fafc;
        --text-muted: #94a3b8;
        --border: #334155;

        --primary-light: rgba(99, 102, 241, 0.15);
        --success-light: rgba(16, 185, 129, 0.15);
        --danger-light: rgba(239, 68, 68, 0.15);
        --warning-light: rgba(14, 165, 233, 0.15);
        --neutral-light: rgba(148, 163, 184, 0.15);
    }

    .card {
        background: var(--surface);
        backdrop-filter: none;
    }

    .sidebar,
    .top-header {
        background: var(--surface);
        box-shadow: none;
        backdrop-filter: none;
    }
}

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

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    background-image: var(--glow-1), var(--glow-2), var(--glow-3);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    /* Base size slightly smaller for interface */
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* Layout Containers */
.container,
.page-shell {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-shell {
    padding: 0 0 20px;
}

@media (max-width: 720px) {

    .container,
    .page-shell {
        width: 100%;
        padding: 0 12px;
    }
}

/* Micro Typography */
.eyebrow {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pill:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

.pill-primary {
    background: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary);
}

.pill-primary:hover {
    background: #ffe4e6;
    border-color: var(--primary);
}

.pill-muted {
    color: var(--text-muted);
}

/* Buttons */
.btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    /* Compact padding */
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--primary);
    color: white;
    line-height: 1.2;
}

.btn:hover,
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.25);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-ghost:hover {
    background: var(--surface-muted);
    color: var(--text);
    box-shadow: none;
    transform: none;
}

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

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

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

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--text-muted);
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 10px 20px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    /* Reduced specific padding */
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.card h2,
.card h3 {
    margin-bottom: 16px;
    font-size: 1.05rem;
}

/* Inputs */
input,
select,
textarea,
.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
}

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

.badge-success {
    background: var(--success-light);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-danger {
    background: var(--danger-light);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background: var(--warning-light);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-neutral {
    background: var(--neutral-light);
    color: var(--text-muted);
    border-color: var(--border);
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
    padding: 0;
    /* Full bleed layout looks more premium */
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-radius: 0;
    /* Remove radius for sidebar */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: none;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--surface-muted);
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 12px 12px 6px;
    opacity: 0.8;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    text-decoration: none;
    font-size: 13px;
    position: relative;
}

.nav-item:hover {
    background: var(--surface-muted);
    color: var(--text);
    transform: none;
    /* Removed transform for cleaner feel */
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: none;
    font-weight: 600;
}

.nav-item.active .icon {
    color: var(--primary);
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    transition: all 0.2s;
    stroke-width: 2;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--surface-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.top-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 36px;
    /* Slightly tighter padding */
    position: relative;
}

.content-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 20%),
        radial-gradient(circle at 12% 18%, rgba(99, 102, 241, 0.06), transparent 35%),
        radial-gradient(circle at 88% 12%, rgba(14, 165, 233, 0.06), transparent 28%);
    pointer-events: none;
    z-index: 0;
}

.content-body>* {
    position: relative;
    z-index: 1;
}

/* Toast */
.toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    width: 320px;
    max-width: calc(100% - 32px);
}

.toast {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    animation: slideIn 0.2s ease-out;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}

.toast-icon {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.toast-success .toast-icon {
    background: #16a34a;
    box-shadow: 0 0 0 4px var(--success-light);
}

.toast-error .toast-icon {
    background: #ef4444;
    box-shadow: 0 0 0 4px var(--danger-light);
}

.toast-info .toast-icon {
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.toast-warning .toast-icon {
    background: #0ea5e9;
    box-shadow: 0 0 0 4px var(--warning-light);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
}

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1500;
}

.confirm-dialog {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 24px;
}

.confirm-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.confirm-message {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Table Styles - Simplified */
table {
    width: 100%;
    border-collapse: collapse;
    /* Collapsed for cleaner look */
    border-spacing: 0;
}

thead th {
    background: var(--surface-muted);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13px;
}

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

tbody tr:hover td {
    background: var(--surface-muted);
}

/* Utilities */
.hidden {
    display: none !important;
}
.ml-auto {
    margin-left: auto;
}
.mt-8 {
    margin-top: 8px;
}
.text-danger {
    color: var(--danger);
}
.code-input {
    font-family: monospace;
    font-size: 0.9em;
}
.hint-block {
    margin-top: 4px;
    display: block;
}
.parsed-token-info {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
}
.parsed-token-info.success {
    background: #f0f9ff;
    border-color: #0ea5e9;
}
.parsed-token-info.error {
    background: #fef2f2;
    border-color: var(--danger);
}
.parsed-info-header {
    color: #0369a1;
    margin-bottom: 8px;
}
.parsed-info-header.error {
    color: var(--danger);
}
.parsed-info-header.success {
    color: #0369a1;
}
.parsed-info-content {
    font-family: monospace;
    font-size: 0.85em;
    color: #0c4a6e;
}
.text-center {
    text-align: center;
}
.text-muted {
    color: var(--text-muted);
}
.text-success {
    color: var(--success);
}
.msg-info {
    color: var(--primary);
}
.msg-success {
    color: var(--success);
}
.msg-error {
    color: var(--danger);
}
.settings-msg.success {
    color: var(--success);
}
.settings-msg.error {
    color: var(--danger);
}
.settings-msg.loading {
    color: var(--primary);
}
.table-placeholder {
    text-align: center;
    padding: 12px 8px;
}
.table-placeholder.error {
    color: var(--danger);
}

/* Animation Delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Generic Component Utilities */
.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.aigc-step-hidden {
    display: none;
}
.actions-gap-lg {
    gap: 10px;
}
.justify-end {
    justify-content: flex-end;
}
.justify-between {
    justify-content: space-between;
}

.w-120 {
    width: 120px;
}

.info-box {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    padding: 12px;
    border-radius: var(--radius-md);
}

.info-box-text {
    color: #0369a1;
    font-size: 0.9em;
}

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

.mb-16 {
    margin-bottom: 16px;
}

/* ==========================================================================
   Modal Styles (Global)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-card-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

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

.modal-card form,
.modal-card .stack {
    padding: 24px;
}

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

.modal-msg {
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.modal-msg.error {
    color: var(--danger);
}

.modal-msg.success {
    color: var(--success);
}

.modal-card > h3 {
    padding: 24px 24px 0;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}
