:root {
    --accent-primary: #0ea5e9;
    --accent-secondary: #6366f1;
    --accent-hover: #0284c7;

    --bg-dark: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-highlight: rgba(0, 0, 0, 0.15);

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --shadow-glass: 0 4px 24px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(14, 165, 233, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Margin Utilities */
.mb-3 {
    margin-bottom: 16px !important;
}

.mb-4 {
    margin-bottom: 24px !important;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    top: -100px;
    left: -100px;
    opacity: 0.15;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
    opacity: 0.1;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 100px) scale(1.1);
    }
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.glass-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 24px 0;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent-primary), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

/* Layout Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    border-right: 1px solid var(--border-color);
    z-index: 40;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 8px;
    text-align: center;
}

.brand-block img {
    height: 46px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 224, 255, 0.3));
}

.brand-block h1 {
    font-size: 1.2rem;
    margin: 0;
    letter-spacing: 0.5px;
}

.brand-block p {
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.nav-link i {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.05);
}

.nav-link:hover i {
    transform: scale(1.1);
    color: var(--accent-primary);
}

.nav-link.active {
    color: #000;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--accent-primary);
}

.nav-link.active i {
    color: var(--accent-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Main Area */
.main-area {
    flex: 1;
    padding: 32px 40px;
    min-width: 0;
    position: relative;
    z-index: 10;
}

.content-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.topbar-kicker {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#sectionTitle {
    font-size: 2rem;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
}

.admin-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-weight: 500;
}

.admin-avatar i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.mobile-nav-toggle {
    display: none;
}

/* Tabs */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grids & Layouts */
.grid-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    align-items: start;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.column-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards */
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.card-header h5 i {
    color: var(--accent-primary);
    font-size: 1.3rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px;
}

.card-body.no-pad {
    padding: 0;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.form-control,
.custom-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    background: #fff;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.row.g-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.col-md-4,
.col-md-3,
.col-md-2 {
    flex: 1;
    min-width: 200px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #0ea5e9;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: rgba(0, 224, 255, 0.1);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border-color: var(--warning);
}

.btn-outline-warning:hover {
    background: rgba(245, 158, 11, 0.1);
}

.btn-outline-secondary {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.table th,
.table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.03);
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.text-right {
    text-align: right !important;
}

.w-100 {
    width: 100% !important;
}

/* File Drop Area */
.upload-zone {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.file-drop-area:hover,
.file-drop-area:focus-within {
    border-color: var(--accent-primary);
    background: rgba(0, 224, 255, 0.05);
}

.file-icon {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.form-control-file {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.logo-preview-box {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px dashed var(--border-color);
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.brand-logo-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.brand-logo-actions .btn {
    flex: 1 1 180px;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(0, 224, 255, 0.2);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 224, 255, 0.3);
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Batch Bar & Utils */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px !important;
}

.batch-label {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.batch-select {
    width: 320px !important;
    min-width: 250px;
}

.batch-input {
    width: auto;
    padding: 6px 10px;
    font-size: 0.9rem;
}

.small-input {
    width: 80px;
}

.batch-sep {
    color: var(--border-color);
}

.flex-grow {
    flex: 1;
}

.ml-auto {
    margin-left: auto;
}

/* Checkboxes */
.glass-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.glass-checkbox:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.glass-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Login Page Specifics */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%);
    z-index: -1;
    animation: pulseBg 10s infinite alternate;
}

@keyframes pulseBg {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

.login-layout {
    width: 100%;
    max-width: 440px;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    text-align: center;
    position: relative;
    z-index: 10;
}

.login-brand {
    margin-bottom: 32px;
}

.login-logo {
    height: 60px;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 12px rgba(0, 224, 255, 0.4));
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon-wrapper .form-control {
    padding-left: 48px;
    height: 52px;
}

.btn-glow {
    height: 52px;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(0, 224, 255, 0.3);
}

/* Helpers from old CSS (Popovers, Toasts) */
.perm-popover-wrap {
    position: relative;
    display: inline-block;
}

.perm-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    min-width: 240px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 12px;
}

.perm-popover.open {
    display: block;
    animation: fadeIn 0.15s ease;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 224, 255, 0.3);
    z-index: 9999;
}

.key-cell {
    max-width: 220px;
}

.key-cell code {
    display: block;
    word-break: break-all;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    background: rgba(14, 165, 233, 0.1);
    padding: 6px;
    border-radius: 4px;
}

.key-actions {
    display: flex;
    gap: 6px;
}

.edit-group {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-input {
    padding: 4px 8px;
    font-size: 0.85rem;
}

code.glass-code {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .brand-logo-actions {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        transition: left 0.3s ease;
        background: rgba(15, 23, 42, 0.95);
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    .mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 30;
        display: none;
    }

    body.sidebar-open .mobile-backdrop {
        display: block;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .main-area {
        padding: 20px;
    }

    .login-layout {
        padding: 32px 24px;
    }
}

/* Utility Animations */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Chart Styles */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    padding: 20px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    padding: 24px;
}

.chart-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: var(--accent-primary);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-change {
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-card .stat-change.positive {
    color: var(--success);
}

.stat-card .stat-change.negative {
    color: var(--danger);
}

.stat-card .stat-change.neutral {
    color: var(--text-muted);
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.chart-header h5 i {
    color: var(--accent-primary);
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-btn:hover,
.chart-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Chart Legend Styles */
.chart-legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-top: 10px;
    margin-bottom: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* Immersive Fullscreen Mode */
body.layout-fullscreen-mode .sidebar,
body.layout-fullscreen-mode .content-topbar,
body.layout-fullscreen-mode #overviewStatsGrid {
    display: none !important;
}

body.layout-fullscreen-mode .main-area {
    padding: 20px !important;
    margin-left: 0 !important;
}

body.layout-fullscreen-mode .tab-pane {
    padding: 0 !important;
}

body.layout-fullscreen-mode .glass-card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

body.layout-fullscreen-mode .chart-container {
    height: calc(100vh - 120px) !important; /* 占据几乎全部屏幕高度 */
}

body.layout-fullscreen-mode .card-header {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

body.modal-active {
    overflow: hidden;
}

.script-meta-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1200;
}

.script-meta-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.script-meta-dialog {
    width: min(1120px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
    transform: translateY(18px) scale(0.98);
    transition: transform 0.2s ease;
}

.script-meta-modal.open .script-meta-dialog {
    transform: translateY(0) scale(1);
}

.script-meta-dialog .card-header,
.script-meta-dialog .card-body {
    background: #ffffff;
}

.script-meta-dialog .card-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.script-meta-title-wrap h5 {
    margin-bottom: 4px;
}

.script-meta-form {
    display: block;
}

.script-meta-fields {
    display: grid;
    gap: 18px;
}

.script-meta-field {
    width: 100%;
}

.script-meta-field .form-label {
    display: inline-block;
    margin-bottom: 10px;
}

#scriptMetaDescription {
    min-height: 180px;
    resize: vertical;
}

.script-meta-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.script-meta-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.script-meta-close:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--border-highlight);
    transform: scale(1.03);
}

.script-demo-preview {
    min-height: 320px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-md);
    background: #f8fafc;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
}

.script-demo-picker {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.script-demo-picker:hover {
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.08);
    transform: translateY(-1px);
}

.script-demo-picker:focus-visible {
    outline: 2px solid rgba(14, 165, 233, 0.45);
    outline-offset: 2px;
}

.script-demo-preview img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: 12px;
    object-fit: contain;
}

.script-demo-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.92);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
    z-index: 2;
}

.script-demo-remove:hover {
    background: #dc2626;
}

.script-demo-action-hint {
    position: absolute;
    left: 16px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.script-meta-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    gap: 12px;
    align-items: center;
}

.script-meta-actions-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.script-description-cell {
    max-width: 280px;
}

.script-description-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(226, 232, 240, 0.9);
    white-space: normal;
}

@media (max-width: 768px) {
    .script-meta-modal {
        padding: 12px;
    }

    .script-meta-dialog {
        max-height: calc(100vh - 24px);
    }

    .script-meta-header-actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .script-meta-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .script-meta-actions-right {
        justify-content: flex-end;
    }
}
