/* ==========================================================================
   CIUPI CRAFT PANEL - PREMIUM NETHER GLASS STYLE (CSS)
   ========================================================================== */

/* 1. VARIABILI DESIGN TOKENS */
:root {
    --bg-primary: #05060b;
    --bg-secondary: #0c0d15;
    --card-bg: rgba(18, 12, 24, 0.5);
    --card-border: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #4b5563;
    
    /* Neon Amethyst & Violet Accents */
    --accent-amethyst: #7a00ff;
    --accent-amethyst-rgb: 122, 0, 255;
    --accent-purple: #b5179e;
    --accent-purple-rgb: 181, 23, 158;
    --accent-cyan: #00e5ff;
    --accent-cyan-rgb: 0, 229, 255;
    --accent-emerald: #00e676;
    --accent-emerald-rgb: 0, 230, 118;
    --accent-sunset: #ef4444;
    --accent-sunset-rgb: 239, 68, 68;
    
    --sidebar-width: 260px;
    --header-height: 80px;
    
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-tech: 'Outfit', var(--font-sans);
}

/* 2. REGOLE GENERALI */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    position: relative;
}

/* 3. NETHER FLOW GLOW BACKGROUNDS */
.bg-glow {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.12;
    animation: drift-bg 30s ease-in-out infinite alternate;
}

.bg-glow-amethyst {
    background: radial-gradient(circle, var(--accent-amethyst) 0%, transparent 70%);
    top: -200px;
    left: -150px;
}

.bg-glow-purple {
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    bottom: -200px;
    right: -150px;
    animation-delay: -7s;
}

@keyframes drift-bg {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(120px, 80px) scale(1.15); }
}

/* 4. UTILITY DI TESTO E CLASSI UTILI */
.glow-amethyst {
    filter: drop-shadow(0 0 8px rgba(var(--accent-amethyst-rgb), 0.6));
    color: var(--accent-amethyst);
}

.glow-purple {
    filter: drop-shadow(0 0 8px rgba(var(--accent-purple-rgb), 0.6));
    color: var(--accent-purple);
}

.text-amethyst { color: var(--accent-amethyst); }
.text-purple { color: var(--accent-purple); }
.text-emerald { color: var(--accent-emerald); }
.text-sunset { color: var(--accent-sunset); }
.text-cyan { color: var(--accent-cyan); }
.text-gold { color: #ffd700; }
.text-muted { color: var(--text-secondary); }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }
.inline-icon {
    display: inline-block;
    vertical-align: middle;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.25rem;
}

/* 5. SIDEBAR NAVIGATION LAYOUT */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 8, 14, 0.8);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-right-color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 80px !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .sidebar.collapsed .sidebar-brand h1,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .user-badge-info,
    .sidebar.collapsed .btn-logout span {
        display: none !important;
    }
    
    .sidebar.collapsed .sidebar-brand {
        justify-content: center !important;
        gap: 0 !important;
        margin-bottom: 2rem !important;
    }
    
    .sidebar.collapsed .nav-item {
        justify-content: center !important;
        padding: 0.85rem !important;
    }
    
    .sidebar.collapsed .user-badge-sidebar {
        justify-content: center !important;
        padding: 0.6rem !important;
    }
    
    .sidebar.collapsed .btn-logout {
        justify-content: center !important;
        padding: 0.75rem !important;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(var(--accent-amethyst-rgb), 0.1);
    border: 1px solid rgba(var(--accent-amethyst-rgb), 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand h1 {
    font-family: var(--font-tech);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent-amethyst), #ff007c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

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

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    color: var(--accent-amethyst);
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    border: 1px solid rgba(var(--accent-amethyst-rgb), 0.2);
    box-shadow: 0 0 15px rgba(var(--accent-amethyst-rgb), 0.05);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.user-badge-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
}

.user-badge-sidebar i {
    width: 28px;
    height: 28px;
}

.user-badge-info {
    display: flex;
    flex-direction: column;
}

.user-badge-info span {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-badge-info small {
    font-size: 0.75rem;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--accent-sunset);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--accent-sunset);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* 6. MAIN CONTENT AREA */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 2.25rem;
    background: radial-gradient(circle at top right, rgba(20, 10, 30, 0.3), transparent);
}

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

.header-info h2 {
    font-family: var(--font-tech);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 0.55rem 1.1rem;
    border-radius: 30px;
    font-size: 0.85rem;
}

.quick-stat i {
    width: 16px;
    height: 16px;
}

.btn-sidebar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sidebar-toggle:hover {
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    color: var(--accent-amethyst);
    border-color: rgba(var(--accent-amethyst-rgb), 0.3);
    box-shadow: 0 0 12px rgba(var(--accent-amethyst-rgb), 0.2);
}

.btn-sidebar-toggle i {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .btn-sidebar-toggle {
        display: none !important;
    }
}

.btn-refresh {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    color: var(--accent-amethyst);
    border-color: rgba(var(--accent-amethyst-rgb), 0.3);
    box-shadow: 0 0 12px rgba(var(--accent-amethyst-rgb), 0.2);
}

.spin-animation {
    animation: spin 0.8s linear infinite;
}

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

/* 7. GLASS CARDS & BADGES */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    z-index: 1;
}

.glass:hover {
    border-color: rgba(var(--accent-amethyst-rgb), 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(var(--accent-amethyst-rgb), 0.06);
    transform: translateY(-2px);
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-amethyst {
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    border-color: rgba(var(--accent-amethyst-rgb), 0.25);
    color: var(--accent-amethyst);
    filter: drop-shadow(0 0 4px rgba(var(--accent-amethyst-rgb), 0.2));
}

.badge-cyan {
    background: rgba(var(--accent-cyan-rgb), 0.08);
    border-color: rgba(var(--accent-cyan-rgb), 0.25);
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 4px rgba(var(--accent-cyan-rgb), 0.2));
}

.badge-emerald {
    background: rgba(var(--accent-emerald-rgb), 0.08);
    border-color: rgba(var(--accent-emerald-rgb), 0.25);
    color: var(--accent-emerald);
    filter: drop-shadow(0 0 4px rgba(var(--accent-emerald-rgb), 0.2));
}

.badge-purple {
    background: rgba(var(--accent-purple-rgb), 0.08);
    border-color: rgba(var(--accent-purple-rgb), 0.25);
    color: var(--accent-purple);
    filter: drop-shadow(0 0 4px rgba(var(--accent-purple-rgb), 0.2));
}

.badge.online {
    background: rgba(0, 230, 118, 0.08);
    border-color: rgba(0, 230, 118, 0.25);
    color: var(--accent-emerald);
}

.badge.offline {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--accent-sunset);
}

.badge.waking {
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    border-color: rgba(var(--accent-amethyst-rgb), 0.25);
    color: var(--accent-amethyst);
    animation: breathing 1.5s infinite alternate;
}

@keyframes breathing {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.03); opacity: 1; }
}

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

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.offline {
    background-color: var(--accent-sunset);
    box-shadow: 0 0 8px var(--accent-sunset);
}

.status-dot.waking {
    background-color: var(--accent-amethyst);
    box-shadow: 0 0 8px var(--accent-amethyst);
}

/* 8. GRIGLIA SERVER E SMART CARDS */
.action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.panel-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.5rem;
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.5rem;
}

.server-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.4s;
    padding: 1.5rem; /* Aggiunto per simmetria e spaziatura interna */
}

.server-card.running {
    border-color: rgba(0, 230, 118, 0.15);
}

.server-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.server-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.server-card:hover .server-icon-wrapper {
    color: var(--accent-amethyst);
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    border-color: rgba(var(--accent-amethyst-rgb), 0.25);
    box-shadow: 0 0 15px rgba(var(--accent-amethyst-rgb), 0.1);
}

.server-actions-right {
    display: flex;
    gap: 0.2rem;
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon-sm:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon-sm.btn-danger:hover {
    color: var(--accent-sunset);
    background: rgba(var(--accent-sunset-rgb), 0.1);
}

.server-info {
    margin-top: 1rem;
}

.server-info h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-tech);
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
}

.server-type-ver {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Statistiche dinamiche ram/cpu per server cards */
.server-stats-hardware {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.stat-row-hw {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.35rem;
    width: 100%;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpu-bar {
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.ram-bar {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.stat-row-hw strong {
    color: var(--text-primary);
}

.server-card-bottom {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.server-card-bottom > * {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
}

/* 9. CONSOLE LOGS & TERMINALE RETRO */
.console-modal-content {
    max-width: 95vw !important;
    height: 95vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.console-body-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
}

.terminal-logs-screen {
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background: #020305;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #e5e7eb;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.8);
}

/* Colorazione righe console Minecraft */
.log-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line.log-info {
    /* fallback per testo non formattato */
}

.log-line.log-warn {
    background: rgba(245, 158, 11, 0.05);
}

.log-line.log-error {
    background: rgba(248, 113, 113, 0.08);
}

.log-time {
    color: #94a3b8;
}

.log-thread {
    color: #38bdf8;
}

.log-level {
    font-weight: 700;
}

.log-level-info {
    color: #4ade80;
}

.log-level-warn {
    color: #f59e0b;
}

.log-level-error {
    color: #ef4444;
}

.log-message {
    color: #e2e8f0;
}

.log-line.log-warn .log-message {
    color: #fcd34d;
}

.log-line.log-error .log-message {
    color: #fca5a5;
}

/* Caret blinking cursor */
.terminal-logs-screen::after {
    content: '█';
    display: inline-block;
    color: var(--accent-amethyst);
    animation: terminal-blink 1s steps(2, start) infinite;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

@keyframes terminal-blink {
    to { visibility: hidden; }
}

.terminal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Barra di input comandi console */
.console-command-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--accent-amethyst-rgb), 0.3);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

.console-prompt {
    color: var(--accent-amethyst);
    font-family: monospace;
    font-weight: 700;
    font-size: 1rem;
    user-select: none;
}

.console-command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Courier, monospace;
    font-size: 0.9rem;
    caret-color: var(--accent-amethyst);
}

.console-command-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
}

.console-command-input:disabled {
    opacity: 0.4;
}

/* Stile per i comandi inviati nel log */
.log-line.log-command {
    color: #50fa7b !important;
    font-weight: 600;
    border-left: 3px solid #50fa7b;
    padding-left: 8px;
}

/* Console Log logs generali della dashboard */
.log-card {
    background: rgba(4, 5, 8, 0.75) !important;
    padding: 1.5rem; /* Spaziatura dai bordi per simmetria */
}

.log-console {
    font-family: monospace;
    font-size: 0.85rem;
    height: 480px;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-item {
    display: flex;
    gap: 1rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    border-left: 3px solid var(--text-muted);
}

.log-item .log-time {
    color: var(--text-muted);
    min-width: 140px;
    user-select: none;
}

.log-item.log-user {
    border-left-color: var(--accent-amethyst);
    background: rgba(var(--accent-amethyst-rgb), 0.02);
}

.log-item.log-system {
    border-left-color: var(--accent-purple);
    background: rgba(var(--accent-purple-rgb), 0.02);
}

/* 10. GESTIONE UTENTI (DATA TABLES) */
.users-list-layout {
    overflow-x: auto;
    padding: 1.5rem; /* Spaziatura dai bordi per simmetria */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    font-family: var(--font-tech);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.data-table td {
    font-size: 0.95rem;
}

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

/* 11. LIMITI RISORSE (SLIDERS CPU E RAM) */
.resource-limits-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.resource-limits-box h4 {
    font-family: var(--font-tech);
    font-size: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.slider-header label {
    font-size: 0.85rem;
    font-weight: 500;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* 12. DRAG & DROP ZONE (MODPACK UPLOAD) */
.upload-dropzone {
    border: 2px dashed var(--card-border);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent-amethyst);
    background: rgba(var(--accent-amethyst-rgb), 0.04);
}

.upload-dropzone i, .upload-dropzone svg {
    width: 48px;
    height: 48px;
}

/* Barra di caricamento con gradiente viola */
.upload-progress-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-wrapper {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-amethyst), var(--accent-purple));
    border-radius: 4px;
    box-shadow: 0 0 8px var(--accent-amethyst);
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 13. SCHERMO DI LOGIN NEON */
.login-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, #120919 0%, #040508 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    width: 360px;
    max-width: 90vw;
    padding: 3rem 2rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pulse-cube {
    width: 48px;
    height: 48px;
    animation: cube-pulsing 2s ease-in-out infinite;
}

@keyframes cube-pulsing {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(var(--accent-amethyst-rgb), 0.6)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 15px rgba(var(--accent-amethyst-rgb), 0.9)); }
}

.login-header h2 {
    font-family: var(--font-tech);
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--accent-amethyst), #ff007c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.error-msg {
    color: var(--accent-sunset);
    font-size: 0.8rem;
    min-height: 1.2rem;
}

/* 14. ELEMENTI DI FORM E COMPONENTI DI INSERIMENTO */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Applica il tema corretto per i selettori di numero nativi (color-scheme) */
input[type="number"] {
    color-scheme: dark;
}

.theme-light input[type="number"] {
    color-scheme: light;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-amethyst);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 8px rgba(var(--accent-amethyst-rgb), 0.2);
}

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

/* Custom range inputs arancioni e viola */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

#srv-ram::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-amethyst);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-amethyst);
    transition: transform 0.1s ease;
}

#srv-cpu::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-purple);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-purple);
    transition: transform 0.1s ease;
}

#srv-ram::-webkit-slider-thumb:hover, #srv-cpu::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 15. BOTTONI & AZIONI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-small {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.btn-small:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

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

.btn-primary:hover {
    background: #6200cc;
    box-shadow: 0 0 15px rgba(var(--accent-amethyst-rgb), 0.4);
}

.btn-secondary {
    background: rgba(139, 0, 255, 0.08);
    border: 1px solid rgba(139, 0, 255, 0.25);
    color: var(--accent-purple);
}

.btn-secondary:hover {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 15px rgba(139, 0, 255, 0.4);
}

.btn-danger {
    background: var(--accent-sunset);
    border: 1px solid rgba(var(--accent-sunset-rgb), 0.3);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
    box-shadow: 0 0 15px rgba(var(--accent-sunset-rgb), 0.4);
}

.btn-warning {
    background: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    color: white;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-sunset);
}

.btn-danger-outline:hover {
    background: var(--accent-sunset);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn-text:hover {
    color: white;
}

.btn-glow-purple {
    position: relative;
}

.btn-glow-purple::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(var(--accent-purple-rgb), 0.6);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-glow-purple:hover::after {
    opacity: 0.8;
}

/* 16. MODALI (MODALS) SYSTEM */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(3, 4, 6, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: rgba(18, 12, 24, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: modal-slide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--font-tech);
    font-size: 1.3rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.btn-close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--card-border);
    flex-shrink: 0;
}

/* 17. RESPONSIVENESS */

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .sidebar-brand {
        display: flex;
        justify-content: center;
        margin-bottom: 0;
    }
    
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-item span {
        display: none;
    }
    
    .sidebar-footer {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 1rem;
        margin-top: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .user-badge-sidebar {
        margin-bottom: 0;
        padding: 0;
        background: transparent;
    }
    
    .nav-item {
        padding: 0.6rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   18. STILI WEB FILE MANAGER (CIUPI CRAFT EXPLORER)
   ========================================================================== */

.file-manager-modal-content {
    max-width: 95vw !important;
    height: 95vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.file-editor-modal-content {
    max-width: 95vw !important;
    height: 95vh !important;
    background: rgba(10, 8, 16, 0.95) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.file-manager-body-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    overflow: hidden;
}

.file-explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.file-breadcrumbs-container {
    font-family: var(--font-tech);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
}

.file-breadcrumbs-container span.crumb {
    cursor: pointer;
    color: var(--accent-amethyst);
    transition: all 0.2s ease;
}

.file-breadcrumbs-container span.crumb:hover {
    color: white;
    filter: drop-shadow(0 0 4px var(--accent-amethyst));
}

.file-breadcrumbs-container span.crumb.active-crumb {
    color: var(--text-primary);
    cursor: default;
    filter: none;
}

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

.file-manager-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-explorer-table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--card-border);
    padding: 1rem; /* Spaziatura dai bordi per simmetria */
}

.explorer-drag-target-zone {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    transition: all 0.3s ease;
}

.explorer-drag-target-zone.dragover {
    background: rgba(var(--accent-amethyst-rgb), 0.03);
    outline: 2px dashed rgba(var(--accent-amethyst-rgb), 0.4);
    outline-offset: -4px;
}

.folder-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.folder-row:hover {
    background: rgba(245, 158, 11, 0.04) !important;
}

.folder-row td i {
    color: #f59e0b !important;
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.35));
}

.folder-name {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s, filter 0.2s;
}

.folder-row:hover .folder-name {
    color: #fbbf24 !important;
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.35));
}

.file-row {
    transition: background-color 0.2s;
}

.file-row:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.file-name {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.file-row:hover .file-name {
    color: #f1f5f9;
}

.file-row.zip-file td i {
    color: #c084fc !important;
}

/* File Editor Area */
.file-editor-body-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    overflow: hidden;
}

.file-editor-area-text {
    display: none;
}

.CodeMirror {
    flex: 1;
    height: 100% !important;
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Courier, monospace;
    font-size: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
    line-height: 1.55;
    color: #e2e8f0;
    resize: none;
    outline: none;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.8);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.file-editor-area-text:focus {
    border-color: var(--accent-amethyst);
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.8), 0 0 10px rgba(var(--accent-amethyst-rgb), 0.15);
}

/* ==========================================================================
   19. SWITCH TOGGLE & BACKUP MODAL CUSTOM STYLES
   ========================================================================== */

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    border-color: rgba(var(--accent-purple-rgb), 0.4);
}

input:checked + .slider:before {
    background-color: var(--accent-purple);
    transform: translateX(22px);
    filter: drop-shadow(0 0 4px var(--accent-purple));
}

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

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

.btn-glow-purple {
    position: relative;
    box-shadow: 0 0 15px rgba(var(--accent-purple-rgb), 0.3);
}

.btn-glow-purple:hover {
    box-shadow: 0 0 22px rgba(var(--accent-purple-rgb), 0.6);
}

/* ==========================================================================
   20. THEME TOGGLE BUTTON & LIGHT MODE SUPPORT
   ========================================================================== */

.btn-theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-theme-toggle:hover {
    background: rgba(var(--accent-amethyst-rgb), 0.08);
    color: var(--accent-amethyst);
    border-color: rgba(var(--accent-amethyst-rgb), 0.3);
    box-shadow: 0 0 12px rgba(var(--accent-amethyst-rgb), 0.2);
}

/* Override delle variabili per il Light Mode */
.theme-light {
    --bg-primary: #f1f2f6;
    --bg-secondary: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(0, 0, 0, 0.08);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-amethyst: #6366f1;
    --accent-amethyst-rgb: 99, 102, 241;
    --accent-purple: #a855f7;
    --accent-purple-rgb: 168, 85, 247;
}

/* Adattamenti grafici Light Mode */
.theme-light .sidebar {
    background: rgba(255, 255, 255, 0.85);
}

.theme-light .bg-glow-amethyst {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.theme-light .bg-glow-purple {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
}

.theme-light .btn-logout {
    background: rgba(239, 68, 68, 0.05);
}

.theme-light .quick-stat {
    background: rgba(0, 0, 0, 0.03);
}

.theme-light .btn-refresh, .theme-light .btn-theme-toggle {
    background: rgba(0, 0, 0, 0.02);
}

.theme-light .server-stats-hardware {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.02);
}

.theme-light .form-control {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.theme-light .form-control:focus {
    border-color: var(--accent-amethyst) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.theme-light .form-control::placeholder {
    color: #94a3b8 !important;
}

.theme-light #srv-ram-num,
.theme-light #srv-cpu-num,
.theme-light #edit-srv-ram-num,
.theme-light #edit-srv-cpu-num {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.theme-light .resource-limits-box {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

.theme-light input[type="range"] {
    background: rgba(0, 0, 0, 0.08) !important;
}

.theme-light .modal-content {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.theme-light .modal-header, .theme-light .modal-footer {
    border-color: rgba(0, 0, 0, 0.06);
}

.theme-light .terminal-logs-screen {
    background: #0f172a !important;
    color: #f1f2f6 !important;
}

.theme-light .file-editor-area-text {
    background: #0f172a !important;
    color: #f1f2f6 !important;
}

.theme-light .btn-small {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.theme-light .btn-small:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: var(--text-primary) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Overrides per i bottoni colorati in modalità chiara */
.theme-light .btn-primary {
    background: var(--accent-amethyst) !important;
    color: white !important;
    border: 1px solid rgba(var(--accent-amethyst-rgb), 0.3) !important;
}
.theme-light .btn-primary:hover {
    background: #4f46e5 !important;
    color: white !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 15px rgba(var(--accent-amethyst-rgb), 0.45) !important;
}

.theme-light .btn-danger {
    background: #ef4444 !important;
    color: white !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.theme-light .btn-danger:hover {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;
}

.theme-light .btn-warning {
    background: #f59e0b !important;
    color: white !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.theme-light .btn-warning:hover {
    background: #d97706 !important;
    color: white !important;
    border-color: #d97706 !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4) !important;
}

.theme-light .btn-secondary {
    background: rgba(168, 85, 247, 0.1) !important;
    color: #a855f7 !important;
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
}
.theme-light .btn-secondary:hover {
    background: #a855f7 !important;
    color: white !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3) !important;
}

.theme-light .btn-danger-outline {
    background: rgba(239, 68, 68, 0.09) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.theme-light .btn-danger-outline:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

.theme-light .btn-console {
    background: rgba(16, 185, 129, 0.09) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.theme-light .btn-console:hover {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3) !important;
}

.theme-light .btn-file {
    background: rgba(14, 165, 233, 0.09) !important;
    color: #0ea5e9 !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
.theme-light .btn-file:hover {
    background: #0ea5e9 !important;
    color: white !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3) !important;
}

.theme-light .btn-backup {
    background: rgba(245, 158, 11, 0.09) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.theme-light .btn-backup:hover {
    background: #f59e0b !important;
    color: white !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3) !important;
}

.theme-light .btn-modpack {
    background: rgba(139, 92, 246, 0.09) !important;
    color: #8b5cf6 !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
}
.theme-light .btn-modpack:hover {
    background: #8b5cf6 !important;
    color: white !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3) !important;
}

.theme-light .btn-settings {
    background: rgba(236, 72, 153, 0.09) !important;
    color: #ec4899 !important;
    border: 1px solid rgba(236, 72, 153, 0.35) !important;
}
.theme-light .btn-settings:hover {
    background: #ec4899 !important;
    color: white !important;
    border-color: #ec4899 !important;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.3) !important;
}

.theme-light .btn-database {
    background: rgba(139, 92, 246, 0.09) !important;
    color: #8b5cf6 !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
}
.theme-light .btn-database:hover {
    background: #8b5cf6 !important;
    color: white !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3) !important;
}

.theme-light .btn-text {
    color: var(--text-secondary) !important;
}
.theme-light .btn-text:hover {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

.theme-light .btn-close {
    color: var(--text-secondary) !important;
}
.theme-light .btn-close:hover {
    color: var(--text-primary) !important;
}

.theme-light .file-breadcrumbs-container span.crumb:hover {
    color: var(--accent-amethyst) !important;
    text-shadow: 0 0 4px rgba(var(--accent-amethyst-rgb), 0.3);
}

.theme-light .slider {
    background-color: rgba(0, 0, 0, 0.05);
}

.theme-light .slider:before {
    background-color: var(--text-secondary);
}

.theme-light input:checked + .slider {
    background-color: rgba(var(--accent-purple-rgb), 0.15);
}

/* ==========================================================================
   Utility Classes (Flexbox)
   ========================================================================== */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }

/* TOAST NOTIFICATION */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid var(--accent-emerald);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon { color: var(--accent-emerald); }
.toast.error .toast-icon { color: var(--accent-danger); }

/* CodeMirror Search Highlights */
.cm-search-highlight {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
.cm-search-highlight-active {
    background-color: #00e676 !important; /* Verde smeraldo acceso */
    color: #000000 !important;
    font-weight: bold;
    border-radius: 2px;
}

/* Colori personalizzati per i bottoni utility */
.btn-console { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); color: #10b981; }
.btn-console:hover { background: #10b981; color: white; box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }

.btn-file { background: rgba(14, 165, 233, 0.08); border: 1px solid rgba(14, 165, 233, 0.25); color: #0ea5e9; }
.btn-file:hover { background: #0ea5e9; color: white; box-shadow: 0 0 15px rgba(14, 165, 233, 0.4); }

.btn-backup { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.25); color: #f59e0b; }
.btn-backup:hover { background: #f59e0b; color: white; box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }

.btn-modpack { background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.25); color: #8b5cf6; }
.btn-modpack:hover { background: #8b5cf6; color: white; box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); }

.btn-settings { background: rgba(236, 72, 153, 0.08); border: 1px solid rgba(236, 72, 153, 0.25); color: #ec4899; }
.btn-settings:hover { background: #ec4899; color: white; box-shadow: 0 0 15px rgba(236, 72, 153, 0.4); }

.btn-database { background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.25); color: #8b5cf6; }
.btn-database:hover { background: #8b5cf6; color: white; box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); }

/* 22. TICKET LIST TABLE */
#ticket-list-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#ticket-list-content .table-responsive {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#ticket-list-content .table-responsive table {
    width: 100%;
    border-collapse: collapse;
}

#ticket-list-content .table-responsive thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(18, 12, 24, 0.98);
    backdrop-filter: blur(6px);
}

#ticket-list-content .table-responsive thead th {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

#ticket-list-content .table-responsive tbody td {
    padding: 0.65rem 1rem;
    text-align: center;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#ticket-list-content .table-responsive tbody tr:last-child td {
    border-bottom: none;
}

#ticket-manager-modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#ticket-manager-modal .modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* ==========================================================================
   23. GESTIONE BACKUP (BACKUPS MANAGER STYLES)
   ========================================================================== */
.backups-list-box {
    min-height: 150px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem;
}

.backup-item-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.backup-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(var(--accent-amethyst-rgb), 0.2);
}

.backup-item-info {
    flex: 1;
    min-width: 0;
}

.backup-item-date {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.backup-item-filename {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: 0.25rem;
}

.backup-item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.backup-item-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.backup-item-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
}

/* Pulsanti azioni backup */
.backup-btn-download, .backup-btn-restore, .backup-btn-delete {
    background: none;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.backup-btn-download {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}
.backup-btn-download:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.backup-btn-restore {
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}
.backup-btn-restore:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.backup-btn-delete {
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.backup-btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* OVERRIDES TEMA CHIARO PER BACKUP */
.theme-light .backups-list-box {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.theme-light .backup-item-card {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-primary) !important;
}

.theme-light .backup-item-card:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(var(--accent-amethyst-rgb), 0.2) !important;
}

.theme-light .backup-btn-download {
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: var(--text-secondary) !important;
}

.theme-light .backup-btn-download:hover {
    border-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

.theme-light .backup-btn-restore:hover {
    background: rgba(16, 185, 129, 0.08) !important;
}

.theme-light .backup-btn-delete:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}

.theme-light #backups-modal .card {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}
