:root {
    --bg-main: #0a0f1d;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #24344d;
    --bg-input: #0f172a;
    --border: #334155;
    --border-subtle: rgba(255, 255, 255, 0.08);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-light: rgba(16, 185, 129, 0.15);
    
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: rgba(245, 158, 11, 0.15);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: rgba(239, 68, 68, 0.15);

    --purple: #a855f7;
    --purple-light: rgba(168, 85, 247, 0.15);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-sub: #64748b;
    
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-subtle);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);
}

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

body.admin-body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────
   Admin Layout with Hover-Expand Sidebar
   ───────────────────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Collapsible Hover-to-Expand Sidebar */
.sidebar {
    width: 76px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 100;
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.32s ease;
    overflow: hidden;
    will-change: width, box-shadow;
}

.sidebar:hover {
    width: 280px;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border);
}

.sidebar-brand {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-subtle);
    min-width: 280px;
}

.brand-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.brand-text-group {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar:hover .brand-text-group {
    opacity: 1;
    transform: translateX(0);
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-main);
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Version Status Card */
.sidebar-version-card {
    margin: 14px 12px 8px 12px;
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 256px;
}

.version-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulseGlow 2s infinite ease-in-out;
    flex-shrink: 0;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.version-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.sidebar:hover .version-info {
    opacity: 1;
    transform: translateX(0);
}

.version-lbl {
    font-size: 10px;
    color: var(--text-sub);
    text-transform: uppercase;
    font-weight: 700;
}

.version-num {
    font-size: 13px;
    color: var(--text-main);
    font-family: monospace;
}

.version-badge {
    font-size: 10px;
    font-weight: 700;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    opacity: 0;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}

.sidebar:hover .version-badge {
    opacity: 1;
}

/* Sidebar Nav */
.sidebar-nav {
    padding: 14px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-sub);
    padding: 10px 10px 4px 10px;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sidebar:hover .nav-section-title {
    opacity: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    min-width: 256px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.05));
    color: #a5b4fc;
    border-left: 3px solid var(--primary);
    font-weight: 700;
}

.nav-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
}

.nav-label {
    flex: 1;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.sidebar:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.nav-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar:hover .nav-pill {
    opacity: 1;
}

.active-pill {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
    min-width: 280px;
}

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

.user-profile .avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.sidebar:hover .user-meta {
    opacity: 1;
    transform: translateX(0);
}

.user-meta .user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.user-meta .user-role {
    font-size: 11px;
    color: var(--text-sub);
}

.btn-logout {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.05);
}

/* ─────────────────────────────────────────────────────────────
   Main Content Area
   ───────────────────────────────────────────────────────────── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-main);
}

/* Topbar */
.topbar {
    padding: 20px 32px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-title-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.content-container {
    padding: 32px;
    flex: 1;
}

/* Flash Messages */
.flash-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alert-icon { font-size: 18px; }
.alert-text { flex: 1; }
.alert-close {
    background: none;
    border: none;
    color: currentColor;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.alert-close:hover { opacity: 1; }

.alert-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-info { background: rgba(99, 102, 241, 0.15); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.3); }

/* ─────────────────────────────────────────────────────────────
   Cards & Metrics
   ───────────────────────────────────────────────────────────── */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
    transition: border-color 0.2s;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.card-body {
    padding: 24px;
}

/* Header Banner / Metrics */
.header-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    flex: 1;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sub);
}

.metric-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.version-tag {
    font-family: monospace;
    color: #a5b4fc;
}

.metric-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Diff Badges */
.badge-diff-pending {
    font-size: 16px;
    color: #fbbf24;
    font-weight: 800;
    font-family: monospace;
}

.badge-diff-synced {
    font-size: 16px;
    color: #34d399;
    font-weight: 800;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.badge-primary { background: var(--primary-light); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-success { background: var(--success-light); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: var(--warning-light); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: var(--danger-light); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.badge-announcement { background: var(--purple-light); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 6px;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}

.switch-label {
    display: flex;
    flex-direction: column;
}

.label-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.label-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ─────────────────────────────────────────────────────────────
   Announcements Broadcaster & Live Preview Simulator
   ───────────────────────────────────────────────────────────── */
.announcements-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: start;
}

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

.preview-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-body {
    padding: 32px 20px;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0b0f19 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

/* Modal Simulation Box */
.modal-sim-overlay {
    width: 100%;
    max-width: 420px;
}

.modal-sim-box {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.sim-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.sim-close {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.modal-sim-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.sim-icon-circle {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 4px;
    transition: all 0.25s ease;
}

.sim-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.sim-message {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    word-break: break-word;
}

.sim-date {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
}

.modal-sim-footer {
    margin-top: 8px;
}

.sim-btn {
    width: 100%;
    padding: 11px;
    border-radius: var(--radius);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.info-tip-card {
    padding: 20px 24px;
    background: rgba(30, 41, 59, 0.4);
}

.info-tip-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: #a5b4fc;
    margin-bottom: 10px;
}

.info-tip-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-tip-card li {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    position: relative;
    padding-left: 14px;
}

.info-tip-card li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* ─────────────────────────────────────────────────────────────
   Explorer Toolbar & Table
   ───────────────────────────────────────────────────────────── */
.explorer-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
}

.crumb-link {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
    transition: all 0.2s;
}

.crumb-link:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.crumb-separator {
    color: var(--text-sub);
}

.crumb-current {
    font-weight: 700;
    color: var(--text-main);
    padding: 4px 8px;
}

.explorer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
}

.explorer-toolbar {
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.explorer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    text-align: left;
}

.explorer-table th {
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
}

.explorer-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
    transition: background 0.15s ease;
}

.explorer-table tbody tr {
    transition: background-color 0.15s ease;
}

.explorer-table tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.06);
}

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

/* Parent Directory Link Row */
.parent-row td {
    background: rgba(15, 23, 42, 0.3);
}

.parent-row:hover td {
    background: rgba(99, 102, 241, 0.1) !important;
}

.parent-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #818cf8;
    text-decoration: none;
    font-weight: 700;
}

.parent-link:hover {
    color: #a5b4fc;
}

/* Item Name & Icon Cell */
.item-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.item-icon-box.folder {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.item-icon-box.html {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.3));
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.item-icon-box.image {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.3));
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.item-icon-box.pdf {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3));
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.item-icon-box.doc {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.item-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.15s ease;
}

.item-name-link:hover {
    color: #818cf8;
}

.item-ext-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-tag {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12.5px;
    color: #cbd5e1;
    font-weight: 500;
}

.date-text {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
}

.btn-action:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.btn-action-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.empty-state {
    padding: 60px 24px;
    text-align: center;
}

.empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon {
    font-size: 44px;
    opacity: 0.8;
}

.empty-icon { font-size: 36px; }
.empty-text { font-size: 14px; color: var(--text-muted); font-weight: 600; }

/* Diff Details Card */
.diff-card {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-card) 100%);
}

.diff-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.diff-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: monospace;
    font-size: 12px;
}

.diff-type {
    display: inline-block;
    width: 18px;
    font-weight: 800;
    text-align: center;
}

.diff-type.add { color: #34d399; }
.diff-type.mod { color: #fbbf24; }
.diff-type.del { color: #f87171; }

/* ─────────────────────────────────────────────────────────────
   Settings Grid & Info Table
   ───────────────────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

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

.info-table {
    display: flex;
    flex-direction: column;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-key {
    color: var(--text-muted);
    font-weight: 600;
}

.info-val {
    color: var(--text-main);
    font-weight: 700;
}

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

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notice-box {
    padding: 14px 18px;
    border-radius: var(--radius);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

/* ─────────────────────────────────────────────────────────────
   Modals & Popups
   ───────────────────────────────────────────────────────────── */
.modal-overlay,
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 20, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.2);
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-sm {
    max-width: 440px;
}

.modal-dialog.modal-lg {
    max-width: 700px;
}

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

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    transform: scale(1.05);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(15, 23, 42, 0.7);
}

/* Upload Popup & Dropzone */
.target-path-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #c7d2fe;
    margin-bottom: 18px;
    word-break: break-all;
}

.target-path-badge code {
    color: #ffffff;
    font-weight: 700;
}

.drop-zone {
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(30, 41, 59, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.drop-icon {
    font-size: 42px;
    margin-bottom: 4px;
    display: inline-block;
    animation: bounceSlow 2s infinite ease-in-out;
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.drop-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.drop-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-browse:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

.selected-files-list {
    margin-top: 16px;
}

.selected-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.files-preview-box {
    max-height: 180px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-main);
}

.file-preview-name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-size {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    margin-left: 10px;
}

.upload-note {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    font-size: 12px;
    color: #fbbf24;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ─────────────────────────────────────────────────────────────
   Login Layout
   ───────────────────────────────────────────────────────────── */
.auth-wrapper,
.guest-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top center, #1e1b4b 0%, var(--bg-main) 70%);
}

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

.login-card {
    border-radius: 24px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.login-badge-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 16px auto;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.login-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.4);
}

.guest-flash {
    width: 100%;
    max-width: 420px;
    margin-bottom: 16px;
}

/* Utilities */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.text-success { color: #34d399; }
.text-warning { color: #fbbf24; }
.text-danger { color: #f87171; }
.text-muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }

/* ─────────────────────────────────────────────────────────────
   Multi-App Level Tabs
   ───────────────────────────────────────────────────────────── */
.level-tabs-container {
    margin-bottom: 20px;
}

.level-tabs {
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.level-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.level-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.level-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(129, 140, 248, 0.15));
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.tab-level-name {
    font-weight: 700;
    font-size: 15px;
}

.tab-version {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

.level-tab.active .tab-version {
    background: rgba(99, 102, 241, 0.4);
    color: #ffffff;
}

.tab-pill-diff {
    font-size: 11px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.tab-pill-synced {
    font-size: 11px;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   Multi-App Settings Cards
   ───────────────────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.app-summary-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.app-summary-card .info-row:last-child {
    border-bottom: none;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   Batch Selection & Floating Toolbar
   ───────────────────────────────────────────────────────────── */
.batch-action-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid var(--primary);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-full);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.batch-action-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.batch-count-badge {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cancel-selection {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-selection:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: var(--text-sub);
}

.btn-batch-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 7px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-batch-delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

/* Row selection highlight */
tr.selected-row {
    background: rgba(99, 102, 241, 0.12) !important;
}

tr.selected-row td {
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.item-checkbox {
    accent-color: var(--primary);
    cursor: pointer;
    width: 17px;
    height: 17px;
    border-radius: 4px;
}

/* Batch delete preview inside modal */
.batch-delete-preview-list {
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: var(--text-main);
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.batch-preview-item .icon {
    font-size: 14px;
}


