/* ==========================================================================
   CDN Administration Design System - Premium Dark Glassmorphism
   ========================================================================== */

:root {
    --bg-base: #060813;
    --panel-bg: rgba(13, 17, 30, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-glow: rgba(0, 180, 216, 0.05);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #00b4d8;
    --primary-rgb: 0, 180, 216;
    --primary-glow: rgba(0, 180, 216, 0.35);
    
    --purple: #8338ec;
    --purple-rgb: 131, 56, 236;
    --purple-glow: rgba(131, 56, 236, 0.35);
    
    --green: #06d6a0;
    --green-glow: rgba(6, 214, 160, 0.25);
    
    --red: #ef476f;
    --red-glow: rgba(239, 71, 111, 0.25);
    
    --font-header: 'Outfit', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'Consolas', 'Fira Code', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Background Neon Blobs — no filter:blur() to keep GPU compositor load minimal */
.bg-glow {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    /* filter:blur() removed — radial-gradient falloff is already soft at this size */
}
.bg-glow-purple {
    background: radial-gradient(circle, var(--purple-glow) 0%, rgba(0,0,0,0) 75%);
    top: -300px;
    right: -150px;
}
.bg-glow-blue {
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(0,0,0,0) 75%);
    bottom: -300px;
    left: -150px;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animate-scale-up {
    animation: scaleUp 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.animate-pulse {
    animation: pulse 2s infinite;
}
.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.5); }
    70% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 8px rgba(6, 214, 160, 0); }
    100% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(6, 214, 160, 0); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Glow Text & Elements */
.text-glow-blue {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}
.text-glow-purple {
    color: var(--purple);
    text-shadow: 0 0 10px var(--purple-glow);
}
.glow-purple {
    color: var(--purple);
    filter: drop-shadow(0 0 8px var(--purple-glow));
}
.glow-blue {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* Helper Class */
.hidden {
    display: none !important;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-header);
    font-weight: 500;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0096c7 100%);
    color: #fff;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
    filter: brightness(1.1);
}
.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 71, 111, 0.1);
    border: 1px solid rgba(239, 71, 111, 0.2);
    color: var(--red);
}
.btn-danger:hover {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 14px 0 var(--red-glow);
}

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

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Auth Layout (Setup & Login)
   ========================================================================== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

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

.logo-badge {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.auth-header h2 {
    font-family: var(--font-header);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Forms */
.auth-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: var(--font-header);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    padding: 12px 16px 12px 42px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: var(--transition-fast);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
    background: rgba(0, 0, 0, 0.35);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.input-wrapper input:focus + .input-icon {
    color: var(--primary);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ==========================================================================
   App Layout (Sidebar + Main)
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    border-radius: 0 24px 24px 0;
    border-left: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--panel-border);
}

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

.brand-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 180, 216, 0.1);
    border: 1px solid rgba(0, 180, 216, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.brand-name {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 17px;
    display: block;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* Sidebar Nav */
.sidebar-nav {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: var(--font-header);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.15) 0%, rgba(0, 180, 216, 0.05) 100%);
    border-left: 3px solid var(--primary);
    color: var(--primary);
    padding-left: 13px; /* account for border width to prevent jump */
}

.badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
}

.badge-purple {
    background: rgba(131, 56, 236, 0.2);
    border: 1px solid rgba(131, 56, 236, 0.3);
    color: #b583ff;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.avatar i {
    width: 16px;
    height: 16px;
}

.user-info .details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-info .name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-info .role {
    font-size: 11px;
    color: var(--green);
}

.logout-button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.logout-button:hover {
    background: rgba(239, 71, 111, 0.1);
    color: var(--red);
}

/* Main Content Wrapper */
.main-content {
    flex-grow: 1;
    padding: 32px 40px;
    max-height: 100vh;
    overflow-y: auto;
    position: relative;
}

/* Top Navbar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.top-nav h1 {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green {
    background-color: var(--green);
}

.status-text {
    color: var(--text-secondary);
}

/* ==========================================================================
   Tab panes
   ========================================================================== */
.tab-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 120px);
}
/* Dashboard scrolls freely — the main-content wrapper handles the overflow */
#tab-dashboard {
    height: auto;
    min-height: 0;
}
#tab-dashboard .pane-card {
    min-height: 30rem;
    overflow: auto;
}

/* File Manager Toolbar */
.toolbar {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.toolbar-left {
    flex-grow: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 16px 10px 40px;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.toolbar-right {
    display: flex;
    gap: 12px;
}

/* Breadcrumbs */
.breadcrumbs-container {
    padding: 4px 10px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.crumb {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.crumb:hover {
    color: var(--primary);
}

.crumb.active {
    color: var(--text-muted);
    pointer-events: none;
}

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

/* Files Grid and Workspace */
.files-wrapper {
    position: relative;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    min-height: 400px;
    flex-grow: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.08);
}

/* Drag and Drop Zone */
.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: rgba(6, 8, 19, 0.85);
    border: 2px dashed var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.files-wrapper.dragover .drop-zone {
    opacity: 1;
    pointer-events: auto;
}

.drop-zone-content {
    text-align: center;
}

.drop-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.drop-zone h3 {
    font-family: var(--font-header);
    font-size: 20px;
    margin-bottom: 6px;
}

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

/* Files Loading & Empty States */
.files-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.05);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-state-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    border: none;
}

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

.empty-state-panel h3 {
    font-family: var(--font-header);
    font-size: 18px;
    margin-bottom: 6px;
}

.empty-state-panel p {
    color: var(--text-secondary);
    max-width: 320px;
    font-size: 13.5px;
}

/* Grid layout for files */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 24px;
}

/* File / Folder Card */
.file-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.file-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.file-icon-wrapper {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.file-card:hover .file-icon-wrapper {
    background: rgba(255, 255, 255, 0.03);
}

.file-icon {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
}

/* Directory specific styles */
.file-card.card-dir .file-icon {
    color: #ffb703;
    filter: drop-shadow(0 4px 6px rgba(255, 183, 3, 0.15));
}

.file-card.card-dir:hover {
    border-color: rgba(255, 183, 3, 0.25);
    box-shadow: 0 4px 20px 0 rgba(255, 183, 3, 0.05);
}

/* Preview Image styles */
.file-card .thumbnail-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.file-name {
    width: 100%;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.file-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* Internal title subtitle: shows the real GUID filename under the display name */
.file-realname {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
    opacity: 0.65;
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

.muted {
    color: var(--text-muted);
    font-weight: 400;
}

/* Card Hover actions overlay */
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition-fast);
}

.file-card:hover .card-actions {
    opacity: 1;
}

.action-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(6, 8, 19, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn i {
    width: 13px;
    height: 13px;
}

.action-btn:hover {
    color: #fff;
}

.action-btn.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.action-btn.btn-pin:hover {
    background: var(--purple);
    border-color: var(--purple);
    box-shadow: 0 0 8px var(--purple-glow);
}

.action-btn.btn-delete-item:hover {
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 0 8px var(--red-glow);
}

/* Upload progress panel bottom-right */
.upload-progress-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    z-index: 100;
    padding: 16px;
}

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

.progress-header h4 {
    font-family: var(--font-header);
    font-size: 13.5px;
    font-weight: 600;
}

.progress-count {
    font-size: 11px;
    color: var(--text-muted);
}

.progress-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-item {
    font-size: 12px;
}

.progress-item-name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: 3px;
    transition: width 0.1s ease;
}

/* ==========================================================================
   Cron Script Triggers Section
   ========================================================================= */
.grid-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    height: 100%;
    align-items: stretch;
}

.pane-card {
    padding: 24px;
    overflow: hidden;
}

.card-large {
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 16px;
}

.header-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon i {
    width: 20px;
    height: 20px;
}

.card-header h3 {
    font-family: var(--font-header);
    font-size: 18px;
    font-weight: 600;
}

.card-header p {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.script-list-container {
    flex-grow: 1;
    overflow-y: auto;
}

/* Table Style */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.data-table th {
    font-family: var(--font-header);
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.1);
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color var(--transition-fast);
}
.sortable-th::after {
    content: ' ⇅';
    font-size: 0.7em;
    opacity: 0.35;
    margin-left: 2px;
}
.sortable-th:hover { color: var(--text-primary); }
.sortable-th.sort-asc::after  { content: ' ▲'; opacity: 1; color: var(--primary); }
.sortable-th.sort-desc::after { content: ' ▼'; opacity: 1; color: var(--primary); }

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.data-table code {
    font-family: var(--font-mono);
    background: rgba(0,0,0,0.2);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Inner panel empty states */
.inner-panel {
    border: none;
    padding: 40px 20px;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Activity logs layout */
.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.logs-container {
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-item {
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: var(--transition-fast);
}

.log-item:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.02);
}

.log-item-details {
    overflow: hidden;
}

.log-item-title {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 2px;
}

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

.log-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(6, 214, 160, 0.15);
    color: var(--green);
    border: 1px solid rgba(6, 214, 160, 0.25);
}

.badge-danger {
    background: rgba(239, 71, 111, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 71, 111, 0.25);
}

/* ml-auto utility */
.ml-auto {
    margin-left: auto;
}

/* ==========================================================================
   Settings section
   ========================================================================== */
.max-width-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    gap: 20px;
}

.settings-label {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.settings-value code {
    font-family: var(--font-mono);
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    font-size: 13px;
    word-break: break-all;
}

.onboarding-guide {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.onboarding-guide p {
    margin-bottom: 16px;
}

.guide-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-list li {
    margin-bottom: 4px;
}

.guide-list strong {
    color: var(--text-primary);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(4, 6, 12, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-large {
    max-width: 780px;
}

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

.modal-header h3 {
    font-family: var(--font-header);
    font-size: 18px;
    font-weight: 700;
}

.modal-header p {
    font-size: 11.5px;
    color: var(--text-muted);
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form input[type="text"] {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-body);
}

.modal-form input[type="text"]:focus {
    border-color: var(--primary);
}

.input-readonly {
    background: rgba(255,255,255,0.02) !important;
    border-color: rgba(255,255,255,0.04) !important;
    color: var(--text-muted) !important;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.warning-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--red);
    font-size: 12px;
    margin-top: 14px;
}

.text-glow-red {
    text-shadow: 0 0 10px var(--red-glow);
}

/* Script execution terminal modal */
.run-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-badge {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--panel-border);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

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

.stat-val {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
}

.code-terminal {
    background: #02040a;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: #090d16;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red { background-color: var(--red); }
.terminal-dot.yellow { background-color: #ffb703; }
.terminal-dot.green { background-color: var(--green); }

.terminal-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
    font-family: var(--font-mono);
}

.terminal-content {
    padding: 16px;
    max-height: 380px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #a5d6ff;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================= */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 280px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success {
    background: rgba(13, 24, 25, 0.85);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: #adfae6;
}

.toast.toast-error {
    background: rgba(28, 14, 20, 0.85);
    border: 1px solid rgba(239, 71, 111, 0.3);
    color: #ffc2d1;
}

.toast.toast-info {
    background: rgba(12, 22, 33, 0.85);
    border: 1px solid rgba(0, 180, 216, 0.3);
    color: #c9eef5;
}

.toast i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================= */
@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .logs-container {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-radius: 0 0 16px 16px;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    .nav-item {
        white-space: nowrap;
    }
    .main-content {
        padding: 20px;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-left {
        max-width: 100%;
    }
}

/* ==========================================================================
   New Features: Dashboard, Editor, Users, Audit (added)
   ========================================================================== */

/* --- Dashboard stat cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
}
.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon i { width: 26px; height: 26px; color: #fff; }
.stat-blue   { background: linear-gradient(135deg, rgba(0,180,216,.25), rgba(0,180,216,.08)); border: 1px solid rgba(0,180,216,.3); }
.stat-purple { background: linear-gradient(135deg, rgba(131,56,236,.25), rgba(131,56,236,.08)); border: 1px solid rgba(131,56,236,.3); }
.stat-green  { background: linear-gradient(135deg, rgba(6,214,160,.25), rgba(6,214,160,.08)); border: 1px solid rgba(6,214,160,.3); }
.stat-card-value {
    display: block;
    font-family: var(--font-header);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-card-label { display: block; color: var(--text-secondary); font-size: 0.85rem; }

/* --- Storage type breakdown --- */
.type-breakdown { display: flex; flex-direction: column; gap: 12px; }
.type-row {
    display: grid;
    grid-template-columns: 90px 1fr 160px;
    align-items: center;
    gap: 14px;
}
.type-label { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.85rem; }
.type-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.type-bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.type-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.type-meta { text-align: right; color: var(--text-secondary); font-size: 0.82rem; }
.muted { color: var(--text-muted); }

/* Access stats rows — wider path column, clickable */
.access-stat-row {
    display: grid;
    grid-template-columns: 1fr 90px 110px;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 3px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    transition: background var(--transition-fast);
}
.access-stat-row:hover { background: rgba(255,255,255,0.06); }
.access-stat-label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

/* --- Badges --- */
.badge-muted { background: rgba(148,163,184,.15); color: var(--text-secondary); }

/* --- Editor modal --- */
.modal-xl {
    max-width: 1100px;
    width: 92vw;
    height: 86vh;
    display: flex;
    flex-direction: column;
}
.editor-header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.editor-status { font-size: 0.8rem; color: var(--text-secondary); min-width: 160px; text-align: right; }
.icon-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; }
.editor-body { flex: 1; padding: 0 !important; overflow: hidden; display: flex; }
.editor-body .CodeMirror {
    flex: 1;
    height: 100% !important;
    font-family: var(--font-mono);
    font-size: 14px;
    border-radius: 0 0 16px 16px;
}

/* --- Select inputs --- */
.modal-form select,
select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
select option { background: #0d111e; color: var(--text-primary); }

/* --- Data table tweaks for users/audit --- */
#tab-audit .data-table td,
#tab-users .data-table td { vertical-align: middle; }
#tab-audit .data-table code { font-size: 0.8rem; }

/* ==========================================================================
   New Features v2: Trash, Cron, Preview, Owner, Disable, GUID (added)
   ========================================================================== */

/* GUID upload toggle */
.guid-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    user-select: none;
    transition: var(--transition-fast);
}
.guid-toggle:hover { border-color: var(--primary); color: var(--text-primary); }
.guid-toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.guid-toggle i { width: 16px; height: 16px; }

/* Owner badge on cards */
.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(131,56,236,.18);
    color: #c4a7f5;
    font-size: 0.7rem;
}
.owner-badge i { width: 11px; height: 11px; }

/* Disabled file styling */
.card-disabled { opacity: 0.55; filter: grayscale(0.6); }
.disabled-tag {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--red);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.file-icon-wrapper { position: relative; }
.row-disabled { opacity: 0.5; }

/* Media preview */
.preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 70vh;
    overflow: auto;
    padding: 12px;
}
.preview-media {
    max-width: 100%;
    max-height: 68vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

/* Crontab line cell */
.crontab-line {
    display: inline-block;
    max-width: 360px;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.74rem;
    color: var(--green);
    background: rgba(6,214,160,.08);
    padding: 4px 8px;
    border-radius: 6px;
}

/* ==========================================================================
   New Features v3: Kebab menu, styled inputs/checkboxes, list view (added)
   ========================================================================== */

/* --- Styled text/password/textarea inputs inside modals & forms --- */
.modal-form input[type="text"],
.modal-form input[type="password"],
.modal-form input[type="url"],
.modal-form input[type="number"],
.modal-form input[type="email"],
input[type="email"],
.modal-form textarea,
#change-password-form input,
.inline-edit-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}
.modal-form input:focus,
#change-password-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(255,255,255,.06);
}
.modal-form label,
#change-password-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* --- Custom checkbox --- */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.checkbox-row input[type="checkbox"],
.guid-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--panel-border);
    border-radius: 6px;
    background: rgba(255,255,255,.04);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition-fast);
}
.checkbox-row input[type="checkbox"]:checked,
.guid-toggle input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.checkbox-row input[type="checkbox"]:checked::after,
.guid-toggle input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #04121a;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* --- Kebab menu trigger + floating context menu --- */
.kebab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    transition: var(--transition-fast);
}
.kebab-btn:hover { background: rgba(255,255,255,.08); color: var(--text-primary); }

#context-menu {
    position: fixed;
    z-index: 4000;
    min-width: 210px;
    background: rgba(17, 22, 38, 0.97);
    backdrop-filter: blur(18px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,.55);
    padding: 6px;
    animation: scaleUp 0.12s ease;
}
#context-menu.hidden { display: none; }
.ctx-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.ctx-item:hover { background: rgba(255,255,255,.07); }
.ctx-item i { width: 16px; height: 16px; color: var(--text-secondary); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger i { color: var(--red); }
.ctx-divider { height: 1px; background: var(--panel-border); margin: 5px 4px; }

/* --- Card footer (grid view) --- */
.card-footer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

/* --- View toggle --- */
.view-toggle { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 10px; overflow: hidden; }
.view-toggle button {
    background: none; border: none; color: var(--text-secondary);
    padding: 9px 12px; cursor: pointer; display: inline-flex; transition: var(--transition-fast);
}
.view-toggle button.active { background: var(--primary); color: #04121a; }
.view-toggle button i { width: 16px; height: 16px; }

/* --- Tags --- */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    margin: 2px 3px 2px 0;
    border-radius: 20px;
    background: rgba(0,180,216,.14);
    color: #7fd9ef;
    font-size: 0.7rem;
}
.tag-chip .tag-x { cursor: pointer; opacity: .7; }
.tag-chip .tag-x:hover { opacity: 1; }
.card-tags { display: flex; flex-wrap: wrap; margin-top: 6px; min-height: 4px; }

/* --- List view --- */
.files-grid.list-view { display: flex; flex-direction: column; gap: 6px; }
.list-view .file-card {
    display: grid;
    grid-template-columns: 48px 1.6fr 2fr auto;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    text-align: left;
}
.list-view .file-icon-wrapper { width: 44px; height: 44px; margin: 0; }
.list-view .file-icon-wrapper .thumbnail-preview { width: 44px; height: 44px; border-radius: 8px; }
.list-view .file-icon { width: 24px; height: 24px; }
.list-view .file-name { margin: 0; font-size: 0.92rem; }
.list-view .file-info { margin: 0; }
.list-view .list-link {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-view .list-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.list-view .card-tags { margin-top: 2px; }

/* --- Settings editable rows --- */
.settings-edit-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.settings-edit-row input { flex: 1; }
.code-block {
    display: block;
    background: rgba(6,214,160,.08);
    color: var(--green);
    padding: 12px 14px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    word-break: break-all;
    border: 1px solid rgba(6,214,160,.2);
}

/* Make glass panels in specific single-panel tabs fill height as flex column so children scroll */
#tab-cron > .glass-panel,
#tab-trash > .glass-panel,
#tab-users > .glass-panel,
#tab-audit > .glass-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Sticky opaque table headers to prevent underlying rows from overlapping content */
.data-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #0b0e1a; /* Matches panel-bg (rgba(13,17,30,0.65)) over bg-base (#060813) */
    box-shadow: inset 0 -1px 0 var(--panel-border);
}

/* User Role Badge blue */
.badge-blue {
    background: rgba(0, 180, 216, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 180, 216, 0.25);
}

/* List View URL read-only input styling */
.url-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    color: var(--text-secondary) !important;
    font-family: var(--font-mono) !important;
    font-size: 11px !important;
    outline: none !important;
    cursor: pointer !important;
    text-overflow: ellipsis;
    transition: var(--transition-fast) !important;
}
.url-input:focus {
    border-color: var(--primary) !important;
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.45) !important;
}

/* Folder settings badges in list-view */
.folder-settings-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.folder-settings-badges .status-badge {
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

/* Permissions table wrapper select dropdown style */
.permissions-table-wrapper select.perm-select {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}
.permissions-table-wrapper select.perm-select:focus {
    border-color: var(--primary);
}

