* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    --bg-soft: #141b34;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --success-line: #a7f3d0;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    --error-line: #fecaca;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 20% 10%, #1e293b 0%, var(--bg) 45%, #050814 100%);
    min-height: 100vh;
}

.page-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(16, 185, 129, 0.08));
    pointer-events: none;
}

.page-shell {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.brand {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.subtitle {
    margin: 4px 0 0;
    color: #cbd5e1;
    font-size: 0.92rem;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-nav a {
    text-decoration: none;
    color: #e2e8f0;
    padding: 8px 10px;
    border-radius: 9px;
}

.topbar-nav a:hover {
    background: rgba(148, 163, 184, 0.2);
}

.user-chip {
    color: #f8fafc;
    font-size: 0.86rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.25);
}

h1, h2, h3 {
    margin: 0 0 10px;
    line-height: 1.25;
}

h1 {
    font-size: 1.65rem;
}

p {
    color: var(--muted);
    margin: 0 0 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.panel h3 {
    margin-bottom: 8px;
}

.list-clean {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list-clean li {
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

form {
    display: grid;
    gap: 12px;
    max-width: 680px;
}

label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
    color: #0f172a;
}

select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
    color: #0f172a;
}

input:focus,
textarea:focus {
    outline: 2px solid rgba(79, 70, 229, 0.35);
    border-color: var(--primary);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.btn {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: 0.18s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: #e2e8f0;
    border-color: rgba(226, 232, 240, 0.4);
}

.btn-outline:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(226, 232, 240, 0.6);
}

.btn-subtle {
    background: #eef2ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.inline-form {
    display: inline;
    margin: 0;
}

.notice {
    border-radius: 10px;
    padding: 11px 13px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

.notice.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-line);
}

.notice.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-line);
}

.spacer {
    height: 8px;
}

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

fieldset {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface-soft);
}

legend {
    font-weight: 700;
    color: #1e293b;
    padding: 0 8px;
}

.option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.option input {
    width: auto;
}

.kpi {
    text-align: center;
}

.kpi-value {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
    color: #0f172a;
}

.module-accordion {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.module-accordion summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    color: #0f172a;
    padding: 12px;
}

.module-accordion summary::-webkit-details-marker {
    display: none;
}

.module-status {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
}

.module-status.done {
    color: var(--success-text);
}

.module-body {
    padding: 0 12px 12px;
    border-top: 1px solid var(--line);
}

.module-body p,
.module-body ul,
.module-body ol,
.module-body h1,
.module-body h2,
.module-body h3 {
    margin-bottom: 10px;
}

.module-body ul,
.module-body ol {
    padding-left: 20px;
}

.module-actions {
    margin-top: 12px;
}

@media (max-width: 640px) {
    .content-card {
        padding: 18px;
    }

    .topbar {
        padding: 14px;
    }
}
