@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg: #030712; /* Slate 950 */
    --surface: #0f172a; /* Slate 900 */
    --panel: rgba(30, 41, 59, 0.5); /* Slate 800 with opacity */
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(236, 72, 153, 0.3);
    --primary: #f472b6; /* Pink 400 */
    --primary-glow: rgba(244, 114, 182, 0.2);
    --success: #10b981; /* Emerald 500 */
    --danger: #f43f5e; /* Rose 500 */
    --warning: #f59e0b; /* Amber 500 */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- BACKGROUND DECOR --- */
body::before {
    content: ''; position: fixed; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(244, 114, 182, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 0% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 40%);
    pointer-events: none; z-index: -1;
}

/* --- SIDEBAR --- */
aside {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 2000;
    transition: var(--transition);
    height: 100vh;
    overflow-y: auto;
}

.system-brand {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-dot {
    width: 10px; height: 10px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 15px var(--primary);
}

.nav-group { margin-bottom: 2.5rem; }
.nav-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
    padding-left: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: var(--border-active);
}

.system-status {
    margin-top: auto;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.top-bar {
    padding: 1.5rem 3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.25rem;
    margin-right: 1.5rem;
}

.page-info h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#current-time {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.content-body {
    padding: 3rem;
    max-width: 1600px;
    width: 100%;
    margin: 0;
    display: none;
    animation: fadeIn 0.4s ease-out;
}

@media (max-width: 1400px) {
    .content-body { padding: 2rem; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-body.active { display: block; }

/* --- CARDS --- */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.monitor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.monitor-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.monitor-card::after {
    content: ''; position: absolute; top: 0; right: 0;
    width: 60px; height: 60px;
    background: radial-gradient(circle at 100% 0%, var(--primary-glow), transparent 70%);
}

.m-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
}

.m-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- PANELS --- */
.section-row {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.panel-box {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    height: fit-content;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- CONTROLS --- */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.control-row:last-of-type { border-bottom: none; }

.m-switch {
    position: relative;
    display: inline-block;
    width: 44px; height: 22px;
}

.m-switch input { opacity: 0; width: 0; height: 0; }

.m-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .4s; border-radius: 34px;
}

.m-slider:before {
    position: absolute; content: "";
    height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: #94a3b8; transition: .4s; border-radius: 50%;
}

input:checked + .m-slider { background-color: var(--primary); }
input:checked + .m-slider:before { transform: translateX(22px); background-color: white; }

.p-box {
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.01);
}

.p-box:hover { background: rgba(255, 255, 255, 0.03); }
.p-box.active {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.p-box h4 { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.p-box p { font-size: 0.7rem; color: var(--text-muted); }

/* --- TABLES --- */
.table-container {
    overflow-x: auto;
    margin-top: 0.5rem;
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }
th {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.85rem;
}

.mono-id {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.75rem;
    background: var(--primary-glow);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* --- BUTTONS --- */
.btn-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--text-main);
    color: var(--bg);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px -5px var(--primary);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; color: transparent; }
.btn-primary:disabled::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 1.5rem; height: 1.2rem; border: 2px solid #fff;
    border-radius: 50%; border-top-color: transparent;
    transform: translate(-50%, -50%); animation: spin 0.8s linear infinite;
}

/* --- LIVE FEED --- */
.feed-item {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.feed-meta { display: flex; flex-direction: column; gap: 0.25rem; }
.feed-id { font-family: var(--font-mono); color: var(--primary); font-weight: 700; font-size: 0.8rem; }
.feed-env { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.feed-time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--success); }

.live-dot {
    width: 8px; height: 8px; background: var(--primary);
    border-radius: 50%; animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(244, 114, 182, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 114, 182, 0); }
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center;
    z-index: 3000; padding: 2rem;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    width: 100%; max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem; border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

/* --- TERMINAL DIALOG --- */
#terminal-dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(20px);
    display: none; align-items: center; justify-content: center;
    z-index: 5000;
}

#terminal-dialog-overlay.active { display: flex; }

.terminal-dialog-card {
    background: #000;
    border: 1px solid var(--border-active);
    width: 100%; max-width: 450px;
    padding: 2.5rem; position: relative;
    border-radius: 4px;
}

.terminal-dialog-header {
    font-family: var(--font-mono);
    font-size: 0.7rem; color: var(--primary);
    margin-bottom: 1.5rem; text-transform: uppercase;
}

.terminal-dialog-body {
    font-size: 1rem; color: var(--text-main);
    margin-bottom: 2.5rem; line-height: 1.6;
}

.terminal-dialog-footer { display: flex; gap: 1rem; }

.terminal-btn {
    flex: 1; padding: 0.75rem;
    font-family: var(--font-mono); font-size: 0.75rem;
    cursor: pointer; background: transparent;
    border: 1px solid var(--border); color: var(--text-muted);
}

.terminal-btn.confirm {
    background: var(--primary); color: #000; font-weight: 700; border: none;
}

/* --- UTILS --- */
#toast {
    position: fixed; bottom: 2rem; right: 2rem;
    background: #fff; color: #000;
    padding: 1rem 2rem; border-radius: 12px;
    font-weight: 600; font-size: 0.85rem;
    transform: translateY(200%); transition: var(--transition);
    z-index: 4000; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

#toast.show { transform: translateY(0); }

.code-block {
    background: #000; padding: 1.25rem;
    border-radius: 8px; border: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 0.8rem;
    color: var(--primary); overflow-x: auto;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .monitor-grid { grid-template-columns: repeat(2, 1fr); }
    .section-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    aside { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); width: 280px; }
    aside.active { transform: translateX(0); }
    .menu-toggle { display: block; }
    .top-bar { padding: 1rem 2rem; }
    .content-body { padding: 2rem 1.5rem; }
}

@media (max-width: 480px) {
    .monitor-grid { grid-template-columns: 1fr; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }
