* {
    box-sizing: border-box;
}

:root {
    --bg: #070b14;
    --bg-secondary: #0d1422;
    --panel: #111a2b;
    --panel-hover: #162238;
    --border: #26344d;

    --text: #f8fafc;
    --muted: #8fa0b8;

    --primary: #6366f1;
    --primary-hover: #818cf8;

    --success: #10b981;
    --danger: #ef4444;

    --shadow:
        0 20px 50px rgba(0, 0, 0, 0.35);
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at top right,
            rgba(99, 102, 241, 0.12),
            transparent 35%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(16, 185, 129, 0.07),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);
}


/* =========================
   APP SHELL
========================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: 260px;
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 28px 18px;

    background: rgba(9, 14, 25, 0.92);
    border-right: 1px solid var(--border);

    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

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

    padding: 8px 10px 28px;
}

.brand-mark {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #8b5cf6
        );

    color: white;

    font-size: 20px;
    font-weight: 800;

    box-shadow:
        0 8px 25px rgba(99, 102, 241, 0.3);
}

.brand h1 {
    margin: 0;

    font-size: 15px;
    line-height: 1.3;
}

.brand span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================
   NAVIGATION
========================= */

.navigation {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 13px 14px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: transparent;

    color: var(--muted);

    font-size: 14px;
    font-weight: 600;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.nav-item span {
    width: 20px;

    text-align: center;

    font-size: 15px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.14);

    border-color:
        rgba(99, 102, 241, 0.25);

    color: #a5b4fc;
}


/* =========================
   SIDEBAR FOOTER
========================= */

.sidebar-footer {
    margin-top: auto;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 15px 12px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 10px rgba(16, 185, 129, 0.7);
}


/* =========================
   MAIN CONTENT
========================= */

.main-content {
    width: calc(100% - 260px);

    margin-left: 260px;

    padding: 35px 45px 60px;

    min-height: 100vh;
}


/* =========================
   TOPBAR
========================= */

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

    margin-bottom: 35px;
}

.breadcrumb {
    margin-bottom: 7px;

    color: var(--muted);

    font-size: 12px;
}

.topbar h2 {
    margin: 0;

    font-size: 27px;
    font-weight: 700;
}

.runtime-status {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: rgba(255, 255, 255, 0.025);

    color: var(--muted);

    font-size: 12px;
}


/* =========================
   SECTIONS
========================= */

.section {
    display: none;
}

.section.active {
    display: block;
}


/* =========================
   HERO
========================= */

.hero-card {
    position: relative;

    overflow: hidden;

    margin-bottom: 25px;

    padding: 32px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(99, 102, 241, 0.14),
            rgba(17, 26, 43, 0.95)
        );

    box-shadow: var(--shadow);
}

.hero-card::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -60px;
    top: -70px;

    border-radius: 50%;

    background:
        rgba(99, 102, 241, 0.12);

    filter: blur(10px);
}

.hero-content {
    position: relative;
    z-index: 1;

    max-width: 720px;
}

.eyebrow,
.card-label {
    display: block;

    color: #818cf8;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1.4px;
}

.hero-card h3 {
    margin: 10px 0 10px;

    font-size: 25px;
}

.hero-card p {
    margin: 0;

    max-width: 680px;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.7;
}


/* =========================
   GRID
========================= */

.content-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;
}


/* =========================
   CARD
========================= */

.card {
    min-width: 0;

    padding: 25px;

    background:
        linear-gradient(
            145deg,
            rgba(17, 26, 43, 0.98),
            rgba(13, 20, 34, 0.98)
        );

    border: 1px solid var(--border);

    border-radius: 14px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.2);
}

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

    margin-bottom: 22px;
}

.card h3 {
    margin: 7px 0 0;

    font-size: 18px;
}

.card p {
    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}


/* =========================
   FORMS
========================= */

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;

    margin-bottom: 8px;

    color: #b7c3d6;

    font-size: 12px;
    font-weight: 600;
}

input {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #2b3a54;
    border-radius: 9px;

    background: #080e1a;

    color: var(--text);

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input::placeholder {
    color: #52627a;
}

input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(99, 102, 241, 0.12);
}


/* =========================
   BUTTONS
========================= */

.primary-button,
.secondary-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 13px 16px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.primary-button {
    border: 1px solid transparent;

    background: var(--primary);

    color: white;
}

.primary-button:hover {
    background: var(--primary-hover);

    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid #34445f;

    background: rgba(255, 255, 255, 0.03);

    color: #dbe4f2;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.07);

    border-color: #4b5e7d;
}


/* =========================
   RESULT
========================= */

.result-indicator {
    color: var(--success);

    font-size: 12px;

    text-shadow:
        0 0 10px
        rgba(16, 185, 129, 0.7);
}

pre {
    margin: 0;

    min-height: 190px;

    padding: 18px;

    overflow: auto;

    border: 1px solid #1e2b41;
    border-radius: 9px;

    background: #060b14;

    color: #a7f3d0;

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 12px;

    line-height: 1.7;

    white-space: pre-wrap;
    word-break: break-word;
}


/* =========================
   ADMIN
========================= */

.admin-hero {
    background:
        linear-gradient(
            135deg,
            rgba(16, 185, 129, 0.10),
            rgba(17, 26, 43, 0.98)
        );
}

.admin-login-card {
    max-width: 620px;
}

.admin-content {
    margin-top: 0;
}

.admin-result-card {
    margin-top: 22px;
}

.error-message {
    margin-top: 12px;

    color: #f87171;

    font-size: 12px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {

    .sidebar {
        width: 210px;
    }

    .main-content {
        width: calc(100% - 210px);

        margin-left: 210px;

        padding: 30px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 680px) {

    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;

        width: 100%;
        min-height: auto;

        padding: 15px;

        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        padding-bottom: 15px;
    }

    .navigation {
        flex-direction: row;
    }

    .nav-item {
        justify-content: center;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        width: 100%;

        margin-left: 0;

        padding: 25px 18px 40px;
    }

    .topbar {
        align-items: flex-start;

        gap: 15px;

        flex-direction: column;
    }

    .hero-card {
        padding: 24px;
    }
}



/* =========================
   TEXT FOUNDATION V1
========================= */

.natural-answer {
    min-height: 110px;
    padding: 18px;
    border: 1px solid #1e2b41;
    border-radius: 9px;
    background: #060b14;
    color: #dbeafe;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

input[type="file"] {
    padding: 10px;
}