:root {
    --bg: #0a0e17;
    --surface: #131c2d;
    --primary: #5271ff;
    --primary-glow: rgba(82, 113, 255, 0.4);
    --accent: #20e2d7;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background: var(--bg);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* Navigation */
.system-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(19, 28, 45, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo { display: flex; align-items: center; gap: 1rem; }
.logo-box { background: var(--primary); padding: 0.5rem; border-radius: 8px; font-weight: 700; color: #fff; box-shadow: 0 0 15px var(--primary-glow); }
.logo-text { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 15px var(--primary-glow); }
.btn-primary:active { transform: scale(0.96); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); }
.btn-ghost.active, .btn-ghost:hover { color: var(--text-main); border-color: var(--primary); }
.btn-accent { background: var(--accent); color: #000; font-weight: 700; width: 100%; box-shadow: 0 4px 20px rgba(32, 226, 215, 0.4); padding: 1rem; }
.full { width: 100%; }
.mt { margin-top: 1.5rem; }

/* Glass Panel */
.glass {
    background: rgba(19, 28, 45, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 2rem;
}

/* Setup App layout */
.workspace { padding: 3rem; max-width: 1400px; margin: 0 auto; }

/* Home */
.hero-brand { text-align: center; margin-bottom: 4rem; }
.hero-brand h1 { font-size: 3.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero-brand p { font-size: 1.25rem; color: var(--text-muted); line-height: 1.6; }

.div-grid-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.legend { display: flex; gap: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.g { background: var(--success); box-shadow: 0 0 10px var(--success); }
.y { background: var(--warning); box-shadow: 0 0 10px var(--warning); }
.r { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

.divisions-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
}
.div-node {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    transition: all 0.2s;
}
.div-node.ok { border-color: rgba(16, 185, 129, 0.5); }
.div-node.partial { border-color: rgba(245, 158, 11, 0.5); }
.div-node.full { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.1); }

/* Forms */
.form-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
.half { flex: 1; }
.coords input { flex: 1; font-family: var(--font-mono); text-align: center; }

label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;}
input, select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    font-family: var(--font-mono);
}
input:focus, select:focus { border-color: var(--primary); }

/* Routing Options */
.routing-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.radio-card { display: block; position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.card-content { border: 2px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 1.5rem; background: rgba(0,0,0,0.2); transition: all 0.2s; display: flex; flex-direction: column; gap: 0.5rem; }
.card-content strong { color: var(--text-main); font-size: 1.1rem; }
.card-content span { color: var(--text-muted); font-size: 0.9rem; line-height: 1.4; }

.radio-card input:checked + .card-content { border-color: var(--accent); background: rgba(32, 226, 215, 0.05); }

/* Auth */
.auth-box { max-width: 440px; margin: 5rem auto; }
.auth-box h2 { text-align: center; margin-bottom: 2rem; }
.auth-hint { margin-top: 1.5rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* Dashboard */
.dashboard-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; text-align: left; margin-top: 1.5rem; }
.data-table th, .data-table td { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.data-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.8rem; }
.data-table td { font-family: var(--font-mono); font-size: 0.95rem; }
.cords-badge { background: rgba(0,0,0,0.3); padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.8rem; color: var(--accent); }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--surface); border-left: 4px solid var(--accent); color: #fff; padding: 1rem 2rem; border-radius: 4px; box-shadow: 0 5px 20px rgba(0,0,0,0.5); z-index: 1000; font-weight: 600; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-box { width: 100%; max-width: 500px; }
.modal-box h3 { margin-bottom: 1rem; }
.modal-box p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }
