/* Modern Dark Dashboard Theme */
:root {
    --bg-main: #0b0f19;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --border-color: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --radius-lg: 14px;
    --radius-md: 8px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.dashboard-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.brand-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.badge-online .badge-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.badge-offline .badge-dot {
    background: var(--accent-red);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-outline {
    background: var(--bg-card);
    border-color: #374151;
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: #4b5563;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Grid Layouts */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

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

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-metric-large {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

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

/* Progress Bars */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #1f2937;
    border-radius: 9999px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.fill-blue { background: var(--accent-blue); }
.fill-green { background: var(--accent-green); }
.fill-yellow { background: var(--accent-yellow); }
.fill-red { background: var(--accent-red); }

/* Cores mini bars */
.cores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.core-item {
    background: #182234;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
}

.core-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.core-val {
    font-size: 0.8rem;
    font-weight: 600;
}

/* IP Banner Card */
.ip-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.ip-item {
    background: #182234;
    border: 1px solid #283548;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ip-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ip-value {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #60a5fa;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

th {
    padding: 10px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

td {
    padding: 10px;
    border-bottom: 1px solid #1a2234;
    color: var(--text-primary);
}

tr:hover td {
    background: #141c2c;
}

/* Status indicator dot */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.status-up {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-down {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal-box {
    background: var(--bg-card);
    border: 1px solid #374151;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-wrapper {
        padding: 1rem;
    }
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Web FTP & File Explorer Styles */
.ftp-breadcrumb-item {
    color: #60a5fa;
    cursor: pointer;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.ftp-breadcrumb-item:hover {
    background: rgba(96, 165, 250, 0.15);
    text-decoration: underline;
}
.ftp-breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
    user-select: none;
}
.ftp-quick-btn {
    background: #111827;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ftp-quick-btn:hover {
    border-color: #3b82f6;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}
.ftp-quick-btn.active {
    background: #2563eb;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}
.ftp-item-row {
    transition: background 0.15s;
}
.ftp-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
}
.ftp-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}
.ftp-name-cell:hover .ftp-name-text {
    color: #60a5fa;
    text-decoration: underline;
}
.ftp-icon {
    font-size: 1.15rem;
    user-select: none;
    flex-shrink: 0;
}
.ftp-action-group {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Futuristic / Dynamic Power Controls */
.btn-power {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-power:hover {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}
.btn-warning {
    background: #f59e0b;
    color: #0b0f19;
    font-weight: 600;
    border: none;
}
.btn-warning:hover {
    background: #d97706;
    color: #fff;
}

/* Fullscreen Shutdown Overlay */
.shutdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}
.shutdown-box {
    text-align: center;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: 20px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}
.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #38bdf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

