:root {
    --bg: #F6F1E8;
    --bg-soft: #FBF7EF;
    --panel: rgba(255, 251, 245, 0.96);
    --panel-strong: #FFFAF3;
    --text: #0F172A;
    --muted: #4B5563;
    --sidebar: linear-gradient(180deg, rgba(255, 251, 245, 0.98) 0%, rgba(245, 239, 230, 0.98) 100%);
    --line: rgba(26, 54, 93, 0.14);
    --brand: #1E3A5F;
    --brand-deep: #102844;
    --brand-soft: rgba(30, 58, 95, 0.08);
    --brand-tint: #DCE7F5;
    --brand-mist: #EEF4FB;
    --border: #CCD7E6;
    --danger-bg: #FDECEC;
    --danger-text: #B42318;
    --danger-border: #F3C7C7;
    --success-bg: #E7F6EC;
    --success-text: #166534;
    --success-border: #CAE7D3;
    --warn-bg: #FFF6E5;
    --warn-text: #9A6700;
    --warn-border: #F1D8A8;
    --shadow: 0 22px 48px rgba(32, 41, 57, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(30, 58, 95, 0.08), transparent 24%),
        linear-gradient(180deg, #f8f3eb 0%, #f3ede3 100%);
}

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

.is-hidden {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-card {
    width: min(520px, 100%);
    padding: 32px;
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.auth-card__brand {
    margin-bottom: 20px;
}

.auth-card__brand h1 {
    margin: 8px 0 10px;
    font-size: 2rem;
    line-height: 1.05;
}

.auth-card__brand p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.brand-copy__eyebrow,
.panel__eyebrow,
.hero__eyebrow,
.status-card__label,
.sidebar__footer-label {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
}

.panel__eyebrow,
.hero__eyebrow,
.sidebar__footer-label {
    color: var(--brand-deep);
    font-weight: 700;
}

.input-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--muted);
}

.input-shell input,
.input-shell select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(30, 58, 95, 0.14);
    background: rgba(30, 58, 95, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-shell input:focus,
.input-shell select:focus {
    border-color: rgba(30, 58, 95, 0.30);
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.10);
    background: rgba(255, 251, 245, 0.98);
}

.primary-action,
.secondary-action {
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 160ms ease, transform 160ms ease;
}

.primary-action:hover,
.secondary-action:hover {
    filter: brightness(0.98);
}

.primary-action {
    padding: 14px 22px;
    border: 0;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff8f5;
    box-shadow: 0 16px 30px rgba(30, 58, 95, 0.24);
}

.secondary-action {
    padding: 10px 16px;
    border: 1px solid rgba(30, 58, 95, 0.18);
    background: rgba(30, 58, 95, 0.08);
    color: var(--brand-deep);
}

.error-message {
    margin: 0;
    color: var(--danger-text);
    font-weight: 700;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 14px;
    padding: 12px 14px;
}

.shell {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(30, 58, 95, 0.035) 0, rgba(30, 58, 95, 0.035) 96px, transparent 96px),
        linear-gradient(180deg, #f8f3eb 0%, #f3ede3 100%);
    transition: grid-template-columns 280ms cubic-bezier(0.22, 1, 0.36, 1),
        background 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.shell:has(.sidebar:hover),
.shell:has(.sidebar:focus-within) {
    grid-template-columns: 288px minmax(0, 1fr);
    background:
        linear-gradient(90deg, rgba(30, 58, 95, 0.035) 0, rgba(30, 58, 95, 0.035) 288px, transparent 288px),
        linear-gradient(180deg, #f8f3eb 0%, #f3ede3 100%);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
    padding: 16px 12px 10px;
    background: var(--sidebar);
    border-right: 1px solid rgba(30, 58, 95, 0.10);
    overflow: hidden;
    width: 96px;
    z-index: 20;
    transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar:hover,
.sidebar:focus-within {
    width: 288px;
}

.sidebar__brand,
.sidebar__footer,
.nav-item__text {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar:hover .sidebar__brand,
.sidebar:hover .sidebar__footer,
.sidebar:hover .nav-item__text,
.sidebar:focus-within .sidebar__brand,
.sidebar:focus-within .sidebar__footer,
.sidebar:focus-within .nav-item__text {
    opacity: 1;
    transform: translateX(0);
}

.sidebar__brand {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
    box-shadow: 0 12px 28px rgba(30, 58, 95, 0.24);
}

.brand-mark__seal {
    position: relative;
    width: 22px;
    height: 22px;
    border: 3px solid #f8f3eb;
    border-radius: 8px;
}

.brand-mark__seal::before,
.brand-mark__seal::after {
    content: "";
    position: absolute;
    background: #f8f3eb;
    border-radius: 999px;
}

.brand-mark__seal::before {
    inset: 50% auto auto 50%;
    width: 10px;
    height: 3px;
    transform: translate(-50%, -50%);
}

.brand-mark__seal::after {
    inset: auto auto 4px 4px;
    width: 8px;
    height: 3px;
}

.brand-copy {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-copy strong {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand-copy__eyebrow {
    color: rgba(17, 17, 17, 0.56);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 256px;
    padding: 12px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active {
    background: rgba(30, 58, 95, 0.08);
    transform: translateX(2px);
    outline: none;
}

.nav-item.is-active {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.14), rgba(30, 58, 95, 0.05));
    box-shadow: inset 0 0 0 1px rgba(30, 58, 95, 0.16);
}

.nav-item__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(30, 58, 95, 0.08);
    flex: 0 0 auto;
}

.nav-item__icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.nav-item__label,
.nav-item__hint {
    width: 100%;
    text-align: left;
}

.nav-item__label {
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.nav-item__hint {
    color: rgba(17, 17, 17, 0.54);
    font-size: 0.88rem;
    line-height: 1.2;
    margin-top: 4px;
}

.sidebar__footer {
    margin-top: auto;
    min-width: 240px;
    padding: 14px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 18px;
    background: rgba(30, 58, 95, 0.08);
    color: rgba(17, 17, 17, 0.68);
    line-height: 1.5;
}

.sidebar__footer strong {
    color: var(--text);
}

.sidebar__footer-label {
    margin-bottom: 6px;
}

.sidebar__footer-meta strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.1;
    margin-bottom: 4px;
}

.sidebar__footer-meta small {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.sidebar__footer p {
    margin: 6px 0 0;
    font-size: 0.84rem;
    line-height: 1.45;
}

.workspace {
    padding: 20px 22px 24px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 18px;
    margin-bottom: 20px;
}

.hero__meta,
.hero__status,
.panel {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero__meta {
    min-height: 272px;
    padding: 26px 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(255, 246, 239, 0.98)),
        radial-gradient(circle at top right, rgba(30, 58, 95, 0.12), transparent 32%);
    border: 1px solid var(--line);
}

.hero__meta h1 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero__meta p,
.panel p,
.helper-copy,
.section-copy,
.feature-list {
    color: var(--muted);
    line-height: 1.7;
}

.hero__status {
    display: grid;
    gap: 14px;
    align-self: stretch;
}

.status-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
}

.status-card {
    padding: 20px 18px;
    border-radius: var(--radius-lg);
}

.status-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.05rem;
    line-height: 1.1;
}

.panel {
    padding: 24px;
}

.panel__header {
    margin-bottom: 16px;
}

.panel__header h2 {
    margin: 8px 0 0;
    font-size: 1.8rem;
    line-height: 1.08;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-grid--form {
    grid-template-columns: 1.1fr 0.9fr;
}

.helper-copy,
.section-copy {
    margin: 0 0 18px;
}

.feature-list {
    margin: 0;
    padding-left: 18px;
}

.summary-card h2 {
    margin: 10px 0 8px;
    font-size: 2rem;
}

.warning-list {
    display: grid;
    gap: 10px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(30, 58, 95, 0.14);
    background: rgba(30, 58, 95, 0.04);
    color: var(--brand-deep);
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    background: rgba(30, 58, 95, 0.08);
    outline: none;
}

.filter-chip.is-active {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.14), rgba(30, 58, 95, 0.06));
    border-color: rgba(30, 58, 95, 0.22);
}

.warning-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
}

.warning-row span {
    color: var(--warn-text);
    font-weight: 700;
}

.result-table-shell {
    overflow: auto;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th,
.result-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.result-table td:last-child,
.result-table th:last-child {
    width: 120px;
}

.result-table th {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-deep);
}

.detail-toggle {
    min-width: 100px;
    padding: 8px 12px;
}

.detail-row td {
    padding: 0 0 18px;
    border-bottom: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0 12px;
}

.detail-card {
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid var(--border);
}

.detail-card h3 {
    margin: 8px 0 10px;
    font-size: 1.15rem;
}

.detail-card p {
    margin: 0 0 8px;
}

.detail-items {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.detail-metric {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(30, 58, 95, 0.04);
    border: 1px solid rgba(30, 58, 95, 0.10);
}

.detail-metric span {
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-metric strong {
    font-size: 1rem;
    line-height: 1.1;
}

.detail-metric--strong {
    grid-column: 1 / -1;
    background: rgba(30, 58, 95, 0.08);
}

.detail-item {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(30, 58, 95, 0.04);
    border: 1px solid rgba(30, 58, 95, 0.10);
}

.detail-item span,
.detail-copy {
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-pill--success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.status-pill--warning {
    background: var(--warn-bg);
    color: var(--warn-text);
    border-color: var(--warn-border);
}

.status-pill--danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

@media (max-width: 1180px) {
    .hero,
    .dashboard-grid,
    .dashboard-grid--form,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .sidebar:hover,
    .sidebar:focus-within {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .sidebar__brand,
    .sidebar__footer,
    .nav-item__text {
        opacity: 1;
        transform: none;
    }

    .sidebar__nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav-item {
        min-width: 210px;
    }

    .workspace {
        padding: 18px;
    }

    .hero__meta,
    .panel {
        padding: 22px;
        min-height: auto;
    }
}
