/* Grafana/Zabbix Inspired Ops Dashboard CSS - Ultra-Fast & Spacious Layout */
:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.85);
    --border-card: rgba(255, 255, 255, 0.09);
    --border-highlight: rgba(56, 189, 248, 0.35);
    
    --primary-cyan: #38bdf8;
    --primary-purple: #c084fc;
    --primary-emerald: #10b981;
    --primary-amber: #f59e0b;
    --primary-rose: #f43f5e;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(192, 132, 252, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* Glassmorphism Panel Utility with Spacious Padding */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    box-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
}

/* Login View Styling */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-bg-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    pointer-events: none;
}
.glow-1 { top: 20%; left: 30%; background: var(--primary-cyan); }
.glow-2 { bottom: 20%; right: 30%; background: var(--primary-purple); }

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2.75rem;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-badge {
    width: 60px;
    height: 60px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--primary-cyan);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.25);
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: rgba(11, 15, 25, 0.85);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Main App Layout & Generous Spacing */
.app-layout {
    max-width: 1520px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-logo {
    font-size: 1.85rem;
}

.nav-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
}

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

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

.status-indicator-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
    color: var(--primary-emerald);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-emerald);
    box-shadow: 0 0 8px var(--primary-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.25); }
    100% { opacity: 0.4; transform: scale(0.9); }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Metrics Grid - Spacious Card Layout */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.metric-card {
    padding: 1.85rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-badge {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
}
.metric-badge.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary-emerald);
}

.metric-value-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.metric-val {
    font-family: 'Outfit', sans-serif;
    font-size: 2.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.metric-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.35s ease;
}
.progress-bar-fill.cyan { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.progress-bar-fill.purple { background: linear-gradient(90deg, #c084fc, #7e22ce); }
.progress-bar-fill.emerald { background: linear-gradient(90deg, #10b981, #047857); }

.metric-footer {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
}
.metric-footer strong { color: var(--text-secondary); }

.network-stats-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.25rem 0;
}
.net-item {
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Fira Code', monospace;
}

/* Chart Section */
.chart-section {
    padding: 2rem;
    margin-bottom: 0.5rem;
}

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

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.chart-toggle-btn.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    color: #fff;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.cyan { background: var(--primary-cyan); }
.dot.purple { background: var(--primary-purple); }

.chart-canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Sites Grid - Spacious Spacing */
.sites-section {
    margin-bottom: 0.5rem;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.site-card {
    padding: 1.85rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.site-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.site-type-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-transform: uppercase;
    font-family: 'Fira Code', monospace;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary-emerald);
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary-amber);
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.status-badge.offline {
    background: rgba(244, 63, 94, 0.15);
    color: var(--primary-rose);
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.site-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.site-link {
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: 500;
}
.site-link:hover { text-decoration: underline; }

.code-pill {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
}

/* Management Grid - Generously Spaced */
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 2rem;
}

.manage-card {
    padding: 2rem;
}

.count-pill {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 1.25rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-card);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.action-btn-group {
    display: flex;
    gap: 0.6rem;
}

/* Buttons & Controls */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), #0284c7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
}

.btn-outline-cyan {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--primary-cyan);
}
.btn-outline-amber {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--primary-amber);
}
.btn-outline-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--primary-rose);
}
.btn-outline-slate {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.btn-icon:hover { transform: scale(1.08); }

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.modal-overlay.hidden { display: none; }

.modal-card {
    width: 100%;
    max-width: 850px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

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

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

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

.logs-console {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: #38bdf8;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 480px;
    overflow-y: auto;
}

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

/* Toast Alerts */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 4px solid var(--primary-emerald); }
.toast.error { border-left: 4px solid var(--primary-rose); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   V2 UI Enhancements: Top Navigation, Accent Borders & Storage Mitigation Center
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

.brand-logo-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15);
}

.sep {
    opacity: 0.35;
    margin: 0 0.35rem;
}

.nav-pills-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.65);
    padding: 0.35rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-pill {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.nav-pill:hover {
    color: #fff;
    background: rgba(56, 189, 248, 0.12);
}

.accent-top-cyan { border-top: 3px solid var(--primary-cyan); }
.accent-top-purple { border-top: 3px solid var(--primary-purple); }
.accent-top-emerald { border-top: 3px solid var(--primary-emerald); }
.accent-top-amber { border-top: 3px solid var(--primary-amber); }

.progress-bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar-fill.rose { background: linear-gradient(90deg, #f43f5e, #e11d48); }

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

.site-title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.site-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--primary-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.highlight-card-cyan {
    border-color: rgba(56, 189, 248, 0.38);
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
    box-shadow: 0 10px 30px -5px rgba(56, 189, 248, 0.12);
}

.mitigation-actions-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.mitigation-action-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.15rem 1.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.mitigation-action-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
}

.mit-info {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.mit-info i {
    font-size: 1.35rem;
    margin-top: 0.15rem;
}

.mit-info strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.mit-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

@media (max-width: 960px) {
    .nav-pills-group {
        display: none;
    }
}
