:root {
    --bg: #060b16;
    --sidebar: #0d1422;
    --panel: #101b2f;
    --panel-2: #15233d;
    --text: #e5ecff;
    --muted: #91a3c7;
    --line: rgba(145, 163, 199, 0.24);
    --accent: #3b82f6;
    --accent-2: #22d3ee;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --sidebar-width: 250px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #142443 0, var(--bg) 60%);
    color: var(--text);
}

.menu-toggle {
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 1101;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
    display: none;
    cursor: pointer;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.55);
    z-index: 1090;
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar), #0a101d);
    border-right: 1px solid var(--line);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    overflow-y: auto;
    z-index: 1100;
}

.nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #c4d6ff;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.nav-close {
    display: none;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
}

.main-nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    padding: 0.68rem 0.75rem;
    border: 1px solid transparent;
}

.main-nav a:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(59, 130, 246, 0.14);
}

.main-nav a.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 22px rgba(34, 211, 238, 0.25);
}

main {
    margin-left: var(--sidebar-width);
    padding: 1.5rem clamp(1rem, 3vw, 2rem);
}

.module-content {
    max-width: 1240px;
}

.module-header h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
}

.module-header p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}

.card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.card p {
    margin: 0.45rem 0 0;
    font-size: 1.4rem;
}

.module-panel {
    margin-top: 1.2rem;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.module-panel h2 {
    margin-top: 0;
}

.module-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.module-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.84rem;
    color: var(--muted);
}

.module-form input,
.module-form select,
.module-form textarea {
    margin-top: 0.36rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(8, 14, 27, 0.86);
    color: var(--text);
    padding: 0.68rem;
}

.module-form textarea {
    min-height: 88px;
}

.module-form button {
    grid-column: 1 / -1;
    border: none;
    border-radius: 999px;
    padding: 0.78rem 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 700;
    cursor: pointer;
}

button.secondary {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(21, 35, 61, 0.55);
    color: var(--text);
    padding: 0.45rem 0.65rem;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(11, 18, 33, 0.72);
}

table th,
table td {
    text-align: left;
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--line);
}

table thead {
    background: rgba(21, 35, 61, 0.7);
}

table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.category-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem;
    background: rgba(9, 15, 28, 0.72);
}

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

.category-card ul {
    margin: 0.75rem 0 0;
    padding-left: 1rem;
}

.module-placeholder {
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 0.65rem;
    background: rgba(7, 12, 24, 0.42);
}

.pill {
    font-size: 0.74rem;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    background: rgba(34, 211, 238, 0.15);
    color: #67e8f9;
}

.muted {
    color: var(--muted);
}

@media (max-width: 980px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav-close {
        display: inline-flex;
    }

    .main-nav {
        transform: translateX(-108%);
        transition: transform 0.22s ease;
    }

    body.nav-open .main-nav {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
        padding-top: 3.8rem;
    }
}

@media (max-width: 700px) {
    .module-form {
        grid-template-columns: 1fr;
    }

    table th,
    table td {
        padding: 0.58rem 0.6rem;
    }
}
