/* Server Management Specific Styles based on Unraid design */
:root {
    --unraid-bg: #1c1c1e;
    --unraid-panel: #242426;
    --unraid-border: #38383a;
    --unraid-text: #e0e0e0;
    --unraid-accent: #FE2C55; /* Kaywat accent mapped as Unraid error/accent */
    --unraid-accent-hover: #ff4750;
    --unraid-orange: #fb8c00;
    --unraid-green: #4caf50;
    --unraid-blue: #2196f3;
}

body.server-mgmt-view {
    background-color: var(--unraid-bg);
    color: var(--unraid-text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

.server-container {
    padding: 0;
}

/* Header */
.unraid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #111113;
    border-bottom: 1px solid var(--unraid-border);
}

.unraid-logo {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.version-badge {
    font-size: 0.65rem;
    color: #888;
    margin-left: 0.75rem;
    padding: 0.2rem 0.4rem;
    background: #333;
    border-radius: 4px;
    letter-spacing: 1px;
}

.server-selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.server-dropdown {
    background-color: transparent;
    border: none;
    color: var(--unraid-text);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    padding-bottom: 2px;
}

.server-dropdown:focus {
    outline: none;
}

.server-dropdown option {
    background: #2a2a2c;
    color: #fff;
}

.server-uptime {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.icon-btn:hover {
    color: var(--unraid-accent);
}

/* Navigation */
.unraid-nav {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 2rem 0 2rem;
    background-color: #1a1a1c;
    border-bottom: 1px solid var(--unraid-border);
}

.nav-tab {
    background: transparent;
    border: none;
    color: #888;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tab.active, .nav-tab:hover {
    color: var(--unraid-text);
    border-bottom-color: var(--unraid-text);
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.panel {
    background-color: var(--unraid-panel);
    border-radius: 6px;
    border: 1px solid var(--unraid-border);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.mt-4 { margin-top: 1.5rem; }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--unraid-border);
}

.panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--unraid-text);
    letter-spacing: 0.5px;
}

.panel-header h3 i {
    width: 16px;
    height: 16px;
}

.panel-body {
    padding: 1rem;
}

.panel-body.no-padding {
    padding: 0;
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

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

.stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-online {
    color: var(--unraid-green);
}

.status-offline {
    color: var(--unraid-accent);
}

.sm-icon {
    width: 16px;
    height: 16px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.progress {
    height: 100%;
    background-color: var(--unraid-green);
    transition: width 0.3s ease;
}

.progress-warning {
    background-color: #fb8c00;
}
.progress-danger {
    background-color: #f44336;
}

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

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

.data-table th, .data-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
}

.data-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #aaa;
    font-weight: 600;
    background-color: rgba(0,0,0,0.1);
}

.data-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--unraid-green);
    margin-top: 0.2rem;
}

.status-indicator.stopped {
    color: #888;
}

.status-indicator i {
    width: 12px;
    height: 12px;
}

/* Actions */
.panel-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: transparent;
    color: var(--unraid-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    border-color: var(--unraid-orange);
    color: var(--unraid-orange);
}

.btn-primary:hover {
    background-color: rgba(251, 140, 0, 0.1);
}

.btn-danger {
    border-color: var(--unraid-accent);
    color: var(--unraid-accent);
}

.btn-danger:hover {
    background-color: rgba(248, 38, 49, 0.1);
}

.btn-outline {
    border-color: #555;
}

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

.panel-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(0,0,0,0.1);
    align-items: center;
    flex-wrap: wrap;
}

.footer-btn {
    color: #bbb;
    border-color: #444;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer-btn:hover {
    color: #fff;
    border-color: var(--unraid-orange);
}

.footer-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.footer-btn.disabled:hover {
    border-color: #444;
    color: #bbb;
}

.unraid-orange-text {
    color: var(--unraid-orange) !important;
}

/* Toggle switch for Unraid Basic/Advanced View */
.toggle-view {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #888;
}

.toggle-switch {
    width: 28px;
    height: 14px;
    background-color: #555;
    border-radius: 7px;
    position: relative;
    cursor: pointer;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.on {
    background-color: var(--unraid-orange);
}

.toggle-switch.on::after {
    transform: translateX(14px);
}

/* ===========================================
   Phase 2: Comprehensive Dashboard 3-Column
   =========================================== */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1200px) { .dashboard-grid-layout { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px)  { .dashboard-grid-layout { grid-template-columns: 1fr; } }

.dashboard-col { display: flex; flex-direction: column; }

.unraid-widget {
    background-color: var(--unraid-panel);
    border-radius: 6px;
    border: 1px solid var(--unraid-border);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    background-color: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--unraid-border);
    font-size: 0.75rem;
    font-weight: 700;
    color: #aaa;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.widget-header i { width: 13px; height: 13px; margin-right: 0.3rem; vertical-align: middle; }
.widget-actions { display: flex; gap: 0.5rem; cursor: pointer; opacity: 0.5; }
.widget-body { padding: 0.8rem; }
.widget-body.no-padding { padding: 0; }

.tower-info .time-display { font-size: 2.2rem; font-weight: 300; color: #fff; line-height: 1; }
.tower-info .date-display { font-size: 0.8rem; color: #888; margin-top: 0.4rem; }

.info-row { font-size: 0.8rem; display: flex; justify-content: space-between; margin-bottom: 0.25rem; color: #ccc; }
.info-row .label { color: #666; }

.cpu-title { font-size: 0.8rem; color: #888; }

.cpu-cores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-top: 0.8rem;
}

.core-row { display: flex; align-items: center; font-size: 0.7rem; }
.core-label { flex: 0 0 60px; color: #666; }
.core-bar-wrap { flex: 1; height: 4px; background: #333; border-radius: 2px; margin: 0 0.4rem; overflow: hidden; }
.core-bar { height: 100%; background: var(--unraid-blue); transition: width 0.4s ease; }
.core-bar.hot { background: var(--unraid-orange); }
.core-pct { flex: 0 0 30px; text-align: right; color: #aaa; }

.chip-container { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.app-chip {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(0,0,0,0.25);
    padding: 0.2rem 0.5rem 0.2rem 0.2rem;
    border-radius: 5px;
    border: 1px solid var(--unraid-border);
    cursor: pointer;
    transition: border-color 0.2s;
}
.app-chip:hover { border-color: #666; }

.app-icon {
    width: 26px; height: 26px; border-radius: 4px; background: #444;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 0.75rem; flex-shrink: 0;
}

.app-name { font-size: 0.72rem; font-weight: 600; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-status { font-size: 0.6rem; display: flex; align-items: center; gap: 0.2rem; margin-top: 0.1rem; }
.app-status.running { color: var(--unraid-green); }
.app-status.stopped { color: #888; }
.app-status.paused  { color: var(--unraid-orange); }

.donuts-container { display: flex; justify-content: space-around; align-items: center; padding: 0.5rem 0; }
.donut-wrapper { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.donut-chart { width: 54px; height: 54px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.donut-inner {
    width: 42px; height: 42px;
    background-color: var(--unraid-panel);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 0.65rem; font-weight: 700;
}
.donut-label { font-size: 0.6rem; text-align: center; color: #777; line-height: 1.3; }

.ultra-compact th, .ultra-compact td {
    padding: 0.28rem 0.55rem; font-size: 0.72rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ultra-compact th { background: transparent; color: #555; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ultra-compact tr:last-child td { border-bottom: none; }

.disk-use-bar { display: flex; align-items: center; gap: 0.4rem; }
.disk-mini-bar { width: 40px; height: 4px; background: #333; border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.disk-mini-fill { height: 100%; background: var(--unraid-blue); }
.disk-mini-fill.hot    { background: var(--unraid-orange); }
.disk-mini-fill.danger { background: var(--unraid-accent); }
