:root {
    --bg: #f8f4ee;
    --bg-alt: #f4f8fb;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-border: rgba(103, 141, 170, 0.16);
    --text: #203040;
    --muted: #5f7382;
    --accent: #6ea9c3;
    --accent-strong: #427792;
    --peach: #f0c9bc;
    --sage: #d4e8d7;
    --butter: #f6e7b8;
    --lavender: #dddaf4;
    --shadow: 0 24px 60px rgba(44, 73, 98, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 35%),
        linear-gradient(145deg, #fcf8f2 0%, #eff6fb 55%, #f8f5ff 100%);
}

body {
    position: relative;
    overflow-x: hidden;
}

.background-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(10px);
    opacity: 0.7;
    pointer-events: none;
}

.orb-a,
.orb-c {
    width: 360px;
    height: 360px;
    top: -80px;
    right: -80px;
    background: rgba(208, 233, 216, 0.7);
}

.orb-b,
.orb-d {
    width: 280px;
    height: 280px;
    bottom: -60px;
    left: -40px;
    background: rgba(240, 201, 188, 0.55);
}

.login-shell,
.dashboard-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-panel,
.hero-card,
.panel,
.summary-card,
.document-card,
.profile-card,
.compat-card {
    position: relative;
    background: var(--panel);
    backdrop-filter: blur(18px);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.interactive-surface {
    overflow: hidden;
}

.interactive-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        190px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.22),
        rgba(255, 255, 255, 0.08) 28%,
        transparent 58%
    );
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.interactive-surface:hover::after {
    opacity: 1;
}

.login-panel {
    width: min(900px, 100%);
    padding: 36px;
    border-radius: var(--radius-xl);
}

.login-topbar {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
}

.login-content {
    display: grid;
    align-content: start;
    justify-items: center;
}

.login-intro {
    display: grid;
    justify-items: start;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    background: #ffffff !important;
}

.login-brand img {
    width: min(100%, 300px);
    height: auto;
    display: block;
    background: #ffffff !important;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(110, 169, 195, 0.14);
    color: var(--accent-strong);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.eyebrow-wide {
    display: flex;
    width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin: 18px 0 10px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
}

h2 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.lead {
    color: var(--muted);
    max-width: 60ch;
    line-height: 1.6;
}

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

.login-form {
    display: grid;
    gap: 18px;
    margin: 28px 0 20px;
    width: min(100%, 420px);
}

.field {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

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

.field input {
    width: 100%;
    min-height: 54px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(77, 113, 136, 0.18);
    background: rgba(255, 255, 255, 0.8);
    padding: 0 18px;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.field input:focus {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(110, 169, 195, 0.18);
}

.remember-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
}

.remember-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-strong);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.inline-form {
    margin: 0;
}

.button:hover,
.tab-chip:hover,
.interactive-row:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: linear-gradient(135deg, #88b7cd, #5d8ea9);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(66, 119, 146, 0.28);
}

.button.secondary {
    background: rgba(66, 119, 146, 0.12);
    color: var(--accent-strong);
}

.button.ghost {
    background: rgba(212, 232, 215, 0.52);
    color: #365f47;
}

.button-small {
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.92rem;
}

.notice {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.notice p:last-child {
    margin-bottom: 0;
}

.danger {
    background: rgba(255, 221, 221, 0.8);
    color: #7a3030;
}

.warning {
    background: rgba(246, 231, 184, 0.72);
    color: #71580e;
}

.compat-grid,
.summary-grid,
.cards-grid,
.profile-grid {
    display: grid;
    gap: 18px;
}

.compat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compat-card,
.document-card,
.profile-card,
.summary-card {
    padding: 22px;
    border-radius: var(--radius-lg);
}

.summary-link {
    text-decoration: none;
    color: inherit;
}

.demo-box {
    margin-top: 24px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(221, 218, 244, 0.78), rgba(212, 232, 215, 0.55));
}

.hero-card {
    border-radius: 32px;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.hero-side {
    display: grid;
    gap: 16px;
    justify-items: end;
}

.hero-copy {
    display: grid;
    gap: 8px;
}

.hero-copy-wide {
    align-content: center;
    justify-items: start;
    width: 100%;
}

.hero-head {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hero-lead {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 0;
}

.hero-separator {
    color: rgba(66, 119, 146, 0.48);
}

.hero-address,
.hero-note {
    margin-bottom: 0;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    min-height: 170px;
    padding: 8px 0;
    background: #ffffff !important;
}

.hero-visual img {
    width: min(100%, 320px);
    height: auto;
    display: block;
    background: #ffffff !important;
}

.hero-visual-compact {
    min-width: 0;
    min-height: 0;
    padding: 0;
    background: #ffffff !important;
}

.hero-visual-compact img {
    width: min(100%, 220px);
}

.summary-grid {
    margin: 22px 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-label,
.label {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.summary-value {
    font-size: 1.8rem;
    line-height: 1.1;
}

.summary-value.compact {
    font-size: 1.1rem;
}

.is-positive {
    color: #25724e;
}

.is-negative {
    color: #a55c42;
}

.is-neutral {
    color: var(--text);
}

.tab-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.tab-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(103, 141, 170, 0.12);
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 700;
    transition: transform var(--transition), background var(--transition), color var(--transition);
}

.tab-chip.is-active {
    background: linear-gradient(135deg, rgba(136, 183, 205, 0.92), rgba(93, 142, 169, 0.95));
    color: #ffffff;
}

.panel {
    border-radius: 30px;
    padding: 26px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(110, 169, 195, 0.12);
    color: var(--accent-strong);
    font-weight: 700;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.78);
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    text-align: left;
}

.data-table thead th {
    color: var(--muted);
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(77, 113, 136, 0.12);
}

.data-table tbody tr {
    transition: transform var(--transition), background var(--transition);
}

.data-table tbody tr:nth-child(odd) {
    background: rgba(244, 248, 251, 0.72);
}

.data-table tbody tr:hover {
    background: rgba(212, 232, 215, 0.38);
}

.table-balance-row {
    background: rgba(240, 201, 188, 0.18) !important;
    font-weight: 700;
}

.cell-right {
    text-align: right !important;
}

.site-footer {
    padding: 0 16px 28px;
    text-align: center;
    color: var(--muted);
}

.site-footer a {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-card {
    display: grid;
    gap: 8px;
}

.empty-card {
    align-content: center;
    min-height: 220px;
}

.pill {
    display: inline-flex;
    align-self: flex-start;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(240, 201, 188, 0.46);
    color: #8d5848;
    font-weight: 700;
    font-size: 0.84rem;
}

.doc-meta {
    color: var(--muted);
    font-size: 0.92rem;
    word-break: break-word;
}

.placeholder-value {
    color: var(--muted);
    font-weight: 600;
}

.card-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-card.wide {
    grid-column: span 2;
}

.stack {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

code {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(66, 119, 146, 0.08);
    font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 900px) {
    .summary-grid,
    .cards-grid,
    .profile-grid,
    .compat-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .login-panel,
    .hero-card,
    .panel {
        padding: 20px;
    }

    .login-topbar {
        grid-template-columns: 1fr;
    }

    .login-intro {
        justify-items: center;
        text-align: center;
    }

    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        min-width: 0;
    }

    .hero-head {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-grid,
    .cards-grid,
    .profile-grid,
    .compat-grid {
        grid-template-columns: 1fr;
    }

    .profile-card.wide {
        grid-column: auto;
    }

    .tab-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

}

@media (max-width: 520px) {
    .dashboard-shell,
    .login-shell {
        width: min(100% - 20px, 100%);
    }

    .tab-bar {
        grid-template-columns: 1fr;
    }

    .button,
    .tab-chip {
        width: 100%;
    }

    .hero-actions {
        width: 100%;
    }

    .login-panel {
        padding: 26px 20px;
    }
}
