@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Inter:wght@300;400;500;600;700&family=Ubuntu+Mono&display=swap');

:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg: #0f172a;
    --glass: rgba(30, 41, 59, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --accent: #c084fc;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --status-online: #3fb950;
    --status-error: #da3633;
    --accent-blue: #58a6ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Sidebar */
aside {
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--glass-border);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 10000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

aside nav {
    padding: 0 1rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(to right, #818cf8, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 2.5rem 1.5rem 0.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
}

.nav-item {
    padding: 0.9rem 1.2rem;
    border-radius: 1.2rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-dim);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    box-shadow: 0 8px 20px -4px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-item i {
    width: 1rem;
    height: 1rem;
}

/* Mobile Hamburger */
.mobile-toggle {
    display: none;
    cursor: pointer;
    z-index: 10001;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 0.5rem;
    position: fixed;
    top: 1rem;
    left: 1rem;
}

/* Main Content */
main {
    margin-left: 280px;
    flex: 1;
    padding: 3rem;
    max-width: 1400px;
    transition: margin-left 0.3s ease;
    overflow-y: auto;
    height: 100vh;
}

/* When logs section is active, prevent main scroll */
body.logs-active main {
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-right-group {
    transition: margin-right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fix alignment with terminal edge (above the FM boundary) */
body.terminal-active .header-right-group {
    margin-right: calc(260px + 0.75rem);
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 3rem;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    padding: 1.5rem;
}

.stat-val {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 0.5rem;
    color: var(--accent);
}

.section {
    display: none;
    animation: fadeIn 0.4s easeOut;
}

.section.active {
    display: block;
}

/* Logs section - no external scroll, fit screen */
#section-logs.active {
    display: flex !important;
    flex-direction: column;
    height: calc(100vh - 180px);
    overflow: hidden;
}

#section-logs>div {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

#section-logs>div>div {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: 100%;
}

/* Logs panel headers - ensure both are aligned */
.logs-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    min-height: 40px;
    height: 40px;
}

.logs-panel-title {
    opacity: 0.7;
    margin: 0;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    height: 100%;
}

.logs-panel-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    flex: 1;
    margin-left: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Tables & Scrolling */
.table-container {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    max-height: calc(100vh - 400px);
    min-height: 450px;
    /* Ensure space for dropdowns even with 1 row */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2rem;
}

.table-container::-webkit-scrollbar {
    display: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #111827;
}

th {
    text-align: center;
    padding: 1rem 0.5rem;
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-dim);
    font-weight: 400;
    font-size: 0.85rem;
}

td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

/* Table Cell Styles */
.cell-hostname {
    font-weight: 600;
    font-size: 0.85rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hostname-text {
    display: inline-block;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.cell-cloudhost {
    font-size: 0.85rem;
    opacity: 0.7;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Custom Dropdown with Glassmorphism */
.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.custom-dropdown-trigger i,
.custom-dropdown-trigger svg {
    width: 0.8rem;
    height: 0.8rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.custom-dropdown-menu.show+.custom-dropdown-trigger i,
.custom-dropdown:has(.custom-dropdown-menu.show) .custom-dropdown-trigger i,
.custom-dropdown:has(.custom-dropdown-menu.show) .custom-dropdown-trigger svg {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 100%;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.8rem;
    padding: 0.4rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.custom-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.custom-dropdown-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.custom-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.custom-dropdown-item.selected {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
}

/* Node Dropdown (Live Logs) */
.node-dropdown {
    min-width: 180px;
}

.node-dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.node-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.node-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.node-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.node-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


.copyable {
    cursor: pointer;
    transition: color 0.2s;
}

.copyable:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Search Filter */
.search-container {
    position: relative;
    display: none;
    /* Hidden by default */
    width: 280px;
}

.search-container input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-container i,
.search-container svg {
    position: absolute;
    left: 1rem;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1rem;
    height: 1rem;
    opacity: 0.6;
    pointer-events: none;
    color: var(--accent);
    margin: 0 !important;
}

/* Status Dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    /* grey */
    margin-right: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: breathe 2s infinite ease-in-out;
}

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

@keyframes breathe {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

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

/* Status Filter Logic */
#table-nodes.filter-online tr[data-status="offline"] {
    display: none;
}

#table-nodes.filter-offline tr[data-status="online"] {
    display: none;
}

#table-nodes.filter-online thead tr,
#table-nodes.filter-offline thead tr {
    display: table-row !important;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    border: 1px solid var(--glass-border);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
}

.live-dot.active {
    background: var(--success);
    box-shadow: 0 0 5px var(--success);
}

/* Controls */
.btn {
    padding: 0.4rem 0.7rem;
    border-radius: 0.8rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 65px;
    white-space: nowrap;
}

.btn i,
.btn svg {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    min-height: 1rem;
    flex-shrink: 0;
}

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

.btn-p:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.btn-s {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-s:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-start {
    background: var(--success);
    color: white;
}

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

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

.btn-danger:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Actions Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-width: 130px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
    overflow: hidden;
    padding: 0.4rem;
}

.dropdown-content.show {
    display: block;
}

.dropdown-scroll-area {
    max-height: 126px;
    /* Approx 3 items */
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dropdown-scroll-area::-webkit-scrollbar {
    display: none;
}

.dropdown-item {
    color: var(--text);
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border-radius: 0.5rem;
}

.dropdown-item i,
.dropdown-item svg {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    min-height: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.dropdown-item:hover i,
.dropdown-item:hover svg {
    opacity: 1;
    color: var(--accent);
}

.action-flex {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
}

/* Logs Terminal */
.terminal-container {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    padding: 1.5rem;
    border-radius: 1rem;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.15),
        inset 0 0 25px rgba(255, 255, 255, 0.08),
        0 0 40px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    line-height: 1.5;
    font-size: 0.85rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* System logs container */
.system-logs-container {
    flex: 1;
    min-height: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.15),
        inset 0 0 25px rgba(255, 255, 255, 0.08),
        0 0 40px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    line-height: 1.5;
    font-size: 0.85rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.system-logs-container::-webkit-scrollbar {
    display: none;
}

/* Live logs wrapper with fixed button */
.live-logs-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.15),
        inset 0 0 25px rgba(255, 255, 255, 0.08),
        0 0 40px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    padding-bottom: 0.5rem;
}

.live-logs-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    font-size: 0.85rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 0;
}

.live-logs-scrollable::-webkit-scrollbar {
    display: none;
}

.live-logs-button-container {
    margin-top: 1rem;
    padding-top: 1rem;
    text-align: right;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-container::-webkit-scrollbar {
    display: none;
}

.log-entry {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.3rem;
    font-family: inherit;
}

.log-time {
    color: var(--accent);
    font-size: 0.75rem;
    margin-right: 0.8rem;
    font-family: inherit;
}

.log-date-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    margin: 1.5rem 0 0.8rem;
    opacity: 0.5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-date-header::before,
.log-date-header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.4rem 0;
}

select {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #818cf8;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.8rem;
    border-radius: 0.8rem;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

select::-webkit-scrollbar {
    display: none;
}

select:hover {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

select:focus {
    background: rgba(15, 23, 42, 0.4);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Logs Panel */
.logs-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

.logs-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.logs-panel-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: visible;
}

/* Custom Date Picker with Glassmorphism */
.custom-datepicker {
    position: relative;
    display: inline-block;
}

.custom-datepicker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.custom-datepicker-trigger:hover {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

.custom-datepicker-trigger i,
.custom-datepicker-trigger svg {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.7;
}

.custom-datepicker-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1rem;
    padding: 1rem;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.custom-datepicker-popup::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(90deg,
            rgba(99, 102, 241, 1),
            rgba(168, 85, 247, 1),
            rgba(236, 72, 153, 1),
            rgba(99, 102, 241, 1));
    background-size: 300% 100%;
    animation: neonFlow 3s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes neonFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.custom-datepicker-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.datepicker-nav {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.datepicker-nav:hover {
    background: rgba(99, 102, 241, 0.3);
}

.datepicker-month-year {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 0.5rem;
}

.datepicker-weekdays span {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.3rem 0;
}

.datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.datepicker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
}

.datepicker-day:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.datepicker-day.other-month {
    color: rgba(255, 255, 255, 0.3);
}

.datepicker-day.today {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.datepicker-day.selected {
    background: var(--accent);
    color: white;
}

.datepicker-clear {
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.datepicker-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.node-select-dropdown {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #818cf8;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0.8rem;
    border-radius: 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    width: auto;
    min-width: 160px;
    max-width: 200px;
    transition: all 0.2s;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.01em;
}

.node-select-dropdown option {
    background: #1e293b;
    color: #e0e7ff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.node-select-dropdown option:hover,
.node-select-dropdown option:checked {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

.node-select-dropdown::-webkit-scrollbar {
    display: none;
}

.node-select-dropdown:hover {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

.node-select-dropdown:focus {
    background: rgba(15, 23, 42, 0.4);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.modal-content {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 95%;
    max-width: 850px;
    padding: 2.5rem;
    border-radius: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 2rem;
    padding: 2px;
    background: linear-gradient(90deg,
            rgba(99, 102, 241, 1),
            rgba(168, 85, 247, 1),
            rgba(236, 72, 153, 1),
            rgba(99, 102, 241, 1));
    background-size: 300% 100%;
    animation: neonFlow 3s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

#modal-message {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
}

#editor-container textarea {
    width: 100%;
    height: 400px;
    background: transparent;
    color: #10b981;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    resize: none;
    outline: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#editor-container textarea::-webkit-scrollbar {
    display: none;
}

#info-container pre {
    background: transparent;
    color: #10b981;
    padding: 1.5rem;
    border-radius: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#info-container pre::-webkit-scrollbar {
    display: none;
}

#modal-key-input input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem;
    border-radius: 0.8rem;
    margin-top: 0.5rem;
    outline: none;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 30000;
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    z-index: 40000;
    display: none;
    animation: pulse 2s infinite;
}

pre {
    background: transparent;
    color: #10b981;
    padding: 1.5rem;
    border-radius: 1rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    border: 1px solid var(--glass-border);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-bottom: 2rem;
    display: none;
}

/* RESPONSIVE QUERIES */
@media (max-width: 1024px) {
    aside {
        width: 240px;
        padding: 1.5rem;
    }

    main {
        margin-left: 240px;
        padding: 0;
    }
}

@media (max-width: 768px) {
    aside {
        transform: translateX(-100%);
        width: 280px;
    }

    aside.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }

    main {
        margin-left: 0;
        padding: 4.5rem 1rem 2rem 1rem;
    }

    .header {
        margin-bottom: 1.5rem;
        gap: 0.5rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .card {
        padding: 1rem;
        border-radius: 1rem;
    }

    .stat-val {
        font-size: 1.6rem;
        margin-top: 0.2rem;
    }

    .table-container {
        max-height: calc(100vh - 450px);
        padding-bottom: 150px;
    }

    th,
    td {
        padding: 1rem 0.8rem;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }

    textarea {
        height: 300px;
        padding: 1rem;
        font-size: 0.8rem;
    }

    .btn {
        min-width: 60px;
        padding: 0.4rem 0.6rem;
    }
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
}

/* Terminal Section */
#section-terminal {
    height: calc(100vh - 200px);
    display: none;
    flex-direction: column;
    margin-bottom: 0;
    position: relative;
    overflow: visible;
}

#section-terminal.active {
    display: flex;
    animation: slideUp-terminal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Background Glow behind terminal */
#section-terminal::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.12) 0%, transparent 70%);
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    filter: blur(60px);
    pointer-events: none;
}

.terminal-outer-wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.45) 0%, rgba(20, 20, 30, 0.5) 100%);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.15),
        0 0 50px rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.terminal-outer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.6) 20%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0.6) 80%,
            transparent 100%);
    pointer-events: none;
    z-index: 2;
    animation: shimmer 3s infinite;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.terminal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.terminal-header-bar .btn i,
.terminal-header-bar .btn svg {
    width: 0.75rem;
    height: 0.75rem;
}

.terminal-system-message {
    position: absolute;
    left: 45%;
    transform: translateX(-50%);
    padding: 0.5rem 1.2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-system-message.success {
    color: var(--status-online);
    border-color: rgba(63, 185, 80, 0.4);
    animation: fadeInOutSlide 2.5s ease-in-out forwards;
}

.terminal-system-message.error {
    color: var(--status-error);
    border-color: rgba(218, 54, 51, 0.4);
    animation: fadeInSlide 0.3s ease-out forwards;
}

@keyframes fadeInOutSlide {
    0% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
}

@keyframes fadeInSlide {
    0% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }

    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.terminal-body-container {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 260px);
    overflow: hidden;
    position: relative;
    padding: 0;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.terminal-body-container.drag-over {
    background: rgba(63, 185, 80, 0.05);
    border: 2px dashed rgba(63, 185, 80, 0.4);
    z-index: 1000;
}

/* Ánh sáng mềm ở giữa */
.terminal-body-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 100% 80% at 50% 50%,
            rgba(100, 150, 200, 0.25) 0%,
            rgba(80, 130, 180, 0.15) 30%,
            rgba(60, 110, 160, 0.08) 50%,
            rgba(40, 90, 140, 0.04) 70%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
    animation: softGlow 6s ease-in-out infinite;
    filter: blur(25px);
    -webkit-filter: blur(25px);
}

/* Lớp ánh sáng phụ để tăng độ mềm mại */
.terminal-body-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 80% 60% at 50% 50%,
            rgba(120, 170, 220, 0.2) 0%,
            rgba(100, 150, 200, 0.12) 40%,
            rgba(80, 130, 180, 0.06) 65%,
            transparent 90%);
    pointer-events: none;
    z-index: 1;
    animation: softGlowSecondary 8s ease-in-out infinite;
    animation-delay: 2s;
    filter: blur(35px);
    -webkit-filter: blur(35px);
}

@keyframes softGlow {

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

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

@keyframes softGlowSecondary {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1) translate(0, 0);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1) translate(10px, 10px);
    }
}

.terminal-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    transition: background 0.2s;
    position: relative;
    user-select: none;
}

.terminal-title-group:hover {
    background: rgba(255, 255, 255, 0.05);
}

.terminal-title-group .dropdown-content {
    min-width: 200px;
    max-height: 300px;
    top: calc(100% + 5px);
    left: 0;
}

.terminal-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xterm-viewport-wrapper {
    flex: 1;
    height: 100%;
    min-width: 0;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 5;
    background: transparent;
    overflow: hidden;
}

#xterm-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

/* Terminal font - clean and readable - Force override all xterm elements */
/* Load after xterm.css to ensure override */
#xterm-container,
#xterm-container *,
#xterm-container *::before,
#xterm-container *::after,
.xterm,
.xterm *,
.xterm *::before,
.xterm *::after,
.xterm-screen,
.xterm-screen *,
.xterm-screen *::before,
.xterm-screen *::after,
.xterm-rows,
.xterm-rows *,
.xterm-rows *::before,
.xterm-rows *::after,
.xterm-viewport,
.xterm-viewport *,
.xterm-viewport *::before,
.xterm-viewport *::after,
.xterm-text-layer,
.xterm-text-layer *,
.xterm-text-layer *::before,
.xterm-text-layer *::after,
.xterm-char,
.xterm-char *,
.xterm-cursor-layer,
.xterm-cursor-layer *,
.xterm-cursor-layer *::before,
.xterm-cursor-layer *::after,
[class*="xterm"] {
    font-family: "Cascadia Code", "Source Code Pro", "Consolas", "JetBrains Mono", "Fira Code", "Monaco", "Courier New", monospace !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    font-feature-settings: normal !important;
    font-variant-ligatures: none !important;
    font-variant-numeric: normal !important;
    font-variant-east-asian: normal !important;
    text-rendering: geometricPrecision !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    letter-spacing: normal !important;
    line-height: normal !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    unicode-bidi: normal !important;
    direction: ltr !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Additional fix for Vietnamese diacritics - removed shadows */
.xterm-char {
    font-family: "Cascadia Code", "Source Code Pro", "Consolas", "JetBrains Mono", "Fira Code", "Monaco", "Courier New", monospace !important;
    font-kerning: none !important;
    font-variant-ligatures: none !important;
}

/* Adjust cursor - make it smaller or hide */
.xterm-cursor-layer {
    position: relative !important;
}

.xterm-cursor-layer .xterm-cursor {
    /* Option 1: Small underline cursor */
    height: 2px !important;
    width: auto !important;
    margin-top: 12px !important;
    background-color: #58a6ff !important;
    opacity: 0.8 !important;

    /* Option 2: To completely hide cursor, uncomment below and comment above */
    /* display: none !important; */
}

/* Make text slightly tighter for better cursor alignment */
.xterm-char {
    letter-spacing: -0.02em !important;
}

.xterm,
.xterm-screen,
.xterm-viewport,
.xterm-rows,
.xterm-selection-layer {
    background-color: transparent !important;
}

.xterm-viewport {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.xterm-viewport::-webkit-scrollbar {
    display: none !important;
}

@keyframes slideUp-terminal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

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

/* VNX Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.online {
    color: #aff5b4;
    border-color: rgba(63, 185, 80, 0.3);
}

.status-badge.online .dot {
    background: var(--status-online);
    box-shadow: 0 0 10px var(--status-online);
}

.status-badge.connecting .dot {
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
    animation: pulse-terminal 1.5s infinite;
}

/* Status modifiers for the outer box (like in user project) */
.terminal-outer-wrapper.online {
    border-color: rgba(63, 185, 80, 0.2);
}

.terminal-outer-wrapper.error {
    border-color: rgba(218, 54, 51, 0.3);
}

.status-badge.offline {
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.3);
}

.status-badge.offline .dot {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.status-badge.error .dot {
    background: var(--status-error);
    box-shadow: 0 0 10px var(--status-error);
}


@keyframes pulse-terminal {
    0% {
        opacity: 0.4;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* File Manager Layout */
.terminal-layout-container {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.terminal-outer-wrapper {
    flex: 0 0 1280px;
    max-width: 1280px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.file-manager-panel {
    width: 260px;
    flex: 0 0 260px;
    margin: 0;
    border-right: none;
    display: flex;
    flex-direction: column;
    /* Luôn cao đúng khung section-terminal, không phình theo nội dung */
    height: 100%;
    max-height: 100%;
    min-height: 0;
    background: linear-gradient(165deg, rgba(30, 30, 45, 0.6) 0%, rgba(15, 15, 25, 0.8) 100%);
    backdrop-filter: blur(50px) saturate(210%);
    -webkit-backdrop-filter: blur(50px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Bo góc đầy đủ để cạnh phải cũng đẹp */
    border-radius: 14px;
    overflow: visible;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.7),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.terminal-layout-container:not(.show-files) .file-manager-panel {
    display: none;
}

.fm-sidebar-header {
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
}

.fm-title {
    font-size: 0.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, #c084fc, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.15rem;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-out;
}

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

.btn-icon i,
.btn-icon svg {
    width: 1rem;
    height: 1rem;
}

.fm-breadcrumb {
    padding: 0.8rem 1.5rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.file-list.drag-over {
    background: rgba(63, 185, 80, 0.05);
    border: 2px dashed rgba(63, 185, 80, 0.4);
    border-radius: 8px;
}

.file-list::-webkit-scrollbar {
    display: none;
}

.file-list-placeholder {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.85rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 1rem;
    border: 1px solid transparent;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-name-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.file-item .icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.file-item .icon-wrapper i,
.file-item .icon-wrapper svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.folder-icon {
    color: #fcd34d;
    /* Yellow for folders */
    filter: drop-shadow(0 0 5px rgba(252, 211, 77, 0.3));
}

.file-icon {
    color: #94a3b8;
}

/* File type colors */
.icon-js,
.icon-ts {
    color: #facc15;
}

/* JavaScript Yellow */
.icon-html {
    color: #fb923c;
}

/* HTML Orange */
.icon-css {
    color: #38bdf8;
}

/* CSS Blue */
.icon-json {
    color: #a78bfa;
}

/* JSON Purple */
.icon-md,
.icon-txt {
    color: #cbd5e1;
}

/* Text Grey */
.icon-log {
    color: #94a3b8;
    opacity: 0.8;
}

/* Log Grey */
.icon-db,
.icon-sqlite {
    color: #34d399;
}

/* DB Green */
.icon-sh {
    color: #60a5fa;
}

/* Shell Blue */
.icon-py {
    color: #fbbf24;
}

/* Python Yellow/Blue blend (Yellowish here) */
.icon-png,
.icon-jpg,
.icon-jpeg,
.icon-svg {
    color: #ec4899;
}

/* Image Pink */

.file-name {
    flex: 1;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0.6;
}

/* File Manager Modals */
.fm-modal {
    position: fixed;
    inset: 0;
    z-index: 21000;
    display: none;
    align-items: center;
    justify-content: center;
}

.fm-modal.active {
    display: flex;
}

.fm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

#file-action-backdrop {
    background: transparent !important;
    backdrop-filter: none !important;
}

.fm-modal-content {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.2rem;
    padding: 2.5rem;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fm-modal-content::-webkit-scrollbar {
    display: none;
}

.fm-modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.2rem;
    padding: 2px;
    background: linear-gradient(90deg,
            rgba(99, 102, 241, 1),
            rgba(168, 85, 247, 1),
            rgba(236, 72, 153, 1),
            rgba(99, 102, 241, 1));
    background-size: 300% 100%;
    animation: neonFlow 3s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.file-action-content {
    position: fixed;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.85rem;
    min-width: 140px;
    width: fit-content;
    max-width: 200px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 22000;
    overflow: hidden;
    animation: menuFadeIn 0.2s ease-out;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.action-header {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-body {
    padding: 0.4rem;
}

.action-item {
    width: 100%;
    background: none;
    border: none;
    padding: 0.6rem 0.8rem;
    color: var(--text);
    font-size: 0.8rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.action-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-item i,
.action-item svg {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.7;
}

.action-item.danger {
    color: var(--danger);
}

.action-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Folder Picker List */
.folder-picker-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    background: transparent;
    margin: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.folder-picker-list::-webkit-scrollbar {
    display: none;
}

.move-dest-folder-item {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.move-dest-folder-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.fm-path-bar {
    font-size: 0.8rem;
    padding: 0.5rem 0;
    color: var(--accent);
    word-break: break-all;
}

/* Responsive FM */
@media (max-width: 900px) {
    .file-manager-panel {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        transform: translateX(100%);
        z-index: 100;
    }

    .terminal-layout-container.show-files .file-manager-panel {
        transform: translateX(0);
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.3);
    }
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-accent {
    background: rgba(192, 132, 252, 0.1);
    color: var(--accent);
    border: 1px solid rgba(192, 132, 252, 0.2);
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(192, 132, 252, 0.2);
    border-top-color: #c084fc;
    border-radius: 50%;
    animation: fm-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes fm-spin {
    to {
        transform: rotate(360deg);
    }
}

#section-terminal {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    height: calc(100vh - 195px) !important;
}

.terminal-layout-container {
    padding: 0 !important;
    width: 100% !important;
}

.file-manager-panel {
    border-right: none !important;
    border-radius: 14px !important;
}


body.terminal-active main {
    max-width: none !important;
    /* Gần sidebar hơn, chỉ chừa khoảng nhỏ */
    padding: 1.25rem 1.5rem 1.5rem 2rem !important;
    margin-right: 0 !important;
}

body.terminal-active #section-terminal {
    height: calc(100vh - 195px) !important;
}

body.terminal-active .file-manager-panel {
    border-radius: 14px !important;
    border-right: none !important;
}