:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-strong: #eef2f5;
    --text: #17212b;
    --muted: #687684;
    --line: #d9e1e8;
    --blue: #3483fa;
    --green: #00a650;
    --amber: #b7791f;
    --red: #d92d20;
    --shadow: 0 16px 35px rgba(25, 36, 50, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.welcome-body {
    min-height: 100vh;
    background: var(--bg);
}

.welcome-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 14px clamp(18px, 4vw, 54px);
    border-bottom: 1px solid rgba(217, 225, 232, .8);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.welcome-nav .brand-mark {
    width: 40px;
    height: 40px;
    margin: 0;
}

.welcome-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-links .primary-action {
    width: auto;
    min-height: 38px;
    margin-top: 0;
}

.nav-primary {
    padding-inline: 18px;
}

.welcome-links .secondary-action {
    min-height: 38px;
}

.welcome-hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: clamp(520px, 68vh, 660px);
    padding: clamp(36px, 7vw, 86px) clamp(18px, 5vw, 70px);
    overflow: hidden;
    background: #17212b url("/assets/welcome-hero.png") center / cover no-repeat;
    color: #fff;
}

.welcome-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: rgba(255, 255, 255, .25);
}

.welcome-hero-content {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
}

.welcome-hero .eyebrow {
    color: #9ed0ff;
}

.welcome-hero h1 {
    max-width: 620px;
    margin-bottom: 16px;
    font-size: 64px;
}

.welcome-hero p:not(.eyebrow) {
    max-width: 610px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 19px;
    line-height: 1.55;
}

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.welcome-actions .primary-action,
.welcome-actions .secondary-action {
    width: auto;
    min-width: 178px;
    margin-top: 0;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.trust-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 800;
}

.platform-strip {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    width: min(1180px, calc(100% - 36px));
    margin: -38px auto 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 2;
}

.platform-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #cfe7ff;
    border-radius: 8px;
    background: #f4faff;
}

.mp-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 68px;
    height: 68px;
    border: 3px solid #24306f;
    border-radius: 999px;
    background: #16a7e0;
    color: #fff;
    font-weight: 900;
}

.mp-wordmark {
    color: #24306f;
    font-size: 34px;
    font-weight: 900;
    line-height: .88;
}

.platform-strip h2 {
    margin-bottom: 8px;
    font-size: 30px;
}

.platform-strip p:not(.eyebrow) {
    max-width: 760px;
    margin-bottom: 8px;
    color: var(--muted);
    line-height: 1.55;
}

.platform-strip small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: min(620px, 100%);
    margin-top: 28px;
}

.hero-metrics article {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    background: rgba(10, 18, 28, .36);
}

.hero-metrics strong,
.hero-metrics span {
    display: block;
}

.hero-metrics strong {
    margin-bottom: 5px;
    color: #fff;
    font-size: 17px;
}

.hero-metrics span {
    color: rgba(255, 255, 255, .76);
    font-size: 13px;
    line-height: 1.4;
}

.quick-access {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    width: min(1180px, calc(100% - 36px));
    margin: 16px auto 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 2;
}

.quick-access h2 {
    font-size: 24px;
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.access-grid a {
    display: grid;
    gap: 6px;
    min-width: 0;
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfc;
    color: var(--text);
    text-decoration: none;
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.access-grid a:hover {
    transform: translateY(-1px);
    border-color: #b8d5ff;
    background: #f4f9ff;
}

.access-grid span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.access-grid strong {
    font-size: 18px;
    line-height: 1.2;
}

.access-grid small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.welcome-section {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 54px 0;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 22px;
}

.section-heading h2,
.welcome-cta h2 {
    font-size: 40px;
    line-height: 1.12;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.benefit-card,
.how-grid article {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.benefit-card span {
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
}

.benefit-card strong,
.how-grid strong {
    font-size: 18px;
    line-height: 1.25;
}

.benefit-card p,
.how-grid p,
.welcome-cta p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.how-section {
    padding-top: 8px;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.how-grid article {
    border-left: 4px solid var(--blue);
}

.welcome-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto 54px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.welcome-cta > div:first-child {
    max-width: 720px;
}

.login-shell {
    width: min(100%, 520px);
}

.site-lock-body {
    background: #17212b;
}

.site-lock-panel {
    box-shadow: 0 22px 60px rgba(5, 12, 20, .2);
}

.site-lock-panel .primary-action {
    margin-top: 4px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 18px;
    width: min(100%, 980px);
}

.login-panel,
.payments-panel,
.events-panel,
.stat-card,
.config-strip,
.value-panel,
.owner-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-panel {
    padding: 32px;
}

.intro-panel {
    min-height: 100%;
}

.form-panel {
    display: grid;
    gap: 14px;
}

.value-panel {
    display: grid;
    gap: 0;
    align-content: start;
    overflow: hidden;
}

.value-panel article {
    display: grid;
    gap: 7px;
    padding: 22px;
    border-bottom: 1px solid var(--line);
}

.value-panel strong {
    font-size: 17px;
}

.value-panel span {
    color: var(--muted);
    line-height: 1.5;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #e8f3ff;
    color: var(--blue);
    font-weight: 800;
}

.brand-mark.danger {
    background: #fff0ef;
    color: var(--red);
}

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

h1 {
    margin-bottom: 8px;
    font-size: 40px;
    line-height: 1.05;
}

h2 {
    margin-bottom: 0;
    font-size: 17px;
}

.muted {
    color: var(--muted);
    line-height: 1.55;
}

.alert {
    margin: 20px 0;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.alert-warning {
    background: #fff8e7;
    color: #7a4b00;
    border-color: #f3d59b;
}

.alert-success {
    background: #edfdf4;
    color: #087b3e;
    border-color: #b7ebcc;
}

.auth-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.auth-actions .primary-action,
.auth-actions .secondary-action {
    width: 100%;
    margin-top: 0;
}

.hidden {
    display: none !important;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.primary-action {
    width: 100%;
    margin-top: 18px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}

.demo-action {
    width: 100%;
    margin-top: 10px;
}

.primary-action.disabled {
    pointer-events: none;
    opacity: .55;
}

.secondary-action {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
    font-weight: 650;
}

.danger-action {
    color: var(--red);
    border-color: #f0b8b4;
}

.danger-action:hover {
    background: #fff5f4;
}

.text-link {
    display: inline-flex;
    justify-content: center;
    color: var(--blue);
    font-weight: 750;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.primary-action:hover,
.secondary-action:hover {
    transform: translateY(-1px);
}

.setup-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.app-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px;
}

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

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

.logout-action {
    min-width: 82px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.account-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    white-space: nowrap;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--green);
}

.status-dot.off {
    background: var(--red);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.simple-start {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.simple-heading {
    grid-column: 1 / -1;
}

.simple-heading h2 {
    font-size: 24px;
}

.step-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.step-card .secondary-action,
.step-card form {
    grid-column: 1 / -1;
    width: 100%;
}

.step-card form .secondary-action {
    width: 100%;
}

.step-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #e8f3ff;
    color: var(--blue);
    font-weight: 900;
}

.step-card.done .step-number {
    background: #e7f8ef;
    color: var(--green);
}

.step-card strong,
.step-card span {
    display: block;
}

.step-card span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

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

.owner-card {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 18px;
    box-shadow: none;
}

.owner-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.owner-card strong {
    font-size: 24px;
}

.owner-card p {
    min-height: 42px;
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.admin-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    margin-bottom: 16px;
}

.billing-panel {
    margin-bottom: 16px;
}

.employee-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.compact-action {
    width: auto;
    margin-top: 0;
}

.employee-list {
    display: grid;
}

.employee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.employee-row strong,
.employee-row span {
    display: block;
}

.employee-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.employee-actions form {
    margin: 0;
}

.employee-focus {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.employee-focus div {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.employee-focus span,
.employee-focus strong {
    display: block;
}

.employee-focus span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.employee-focus strong {
    margin-top: 6px;
    font-size: 22px;
}

.technical-details {
    margin-top: 16px;
}

.technical-details summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    font-weight: 700;
}

.technical-details[open] summary {
    margin-bottom: 12px;
}

.employee-row span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.config-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px;
    box-shadow: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    padding: 18px;
    box-shadow: none;
}

.stat-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    min-height: 38px;
    font-size: 30px;
    line-height: 1.2;
}

.stat-card.approved strong {
    color: var(--green);
}

.stat-card.pending strong {
    color: var(--amber);
}

.stat-card.amount strong {
    color: var(--blue);
    font-size: 26px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.payments-panel,
.events-panel {
    min-width: 0;
    overflow: hidden;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.filters {
    display: grid;
    grid-template-columns: 150px minmax(180px, 260px);
    gap: 10px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f9fbfc;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td {
    font-size: 14px;
}

.payment-id {
    font-weight: 800;
}

.subtle {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-approved {
    background: #e7f8ef;
    color: #087b3e;
}

.status-pending,
.status-in_process {
    background: #fff5dc;
    color: #8a5a00;
}

.status-rejected,
.status-cancelled {
    background: #fff0ef;
    color: var(--red);
}

.status-received {
    background: #edf2f7;
    color: #4a5568;
}

.empty-cell {
    padding: 42px 16px;
    color: var(--muted);
    text-align: center;
}

.events-list {
    display: grid;
    gap: 0;
}

.event-row {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.event-row strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.event-row span {
    color: var(--muted);
    font-size: 12px;
}

.toast-host {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
}

.toast {
    padding: 14px 16px;
    border: 1px solid #bde7cf;
    border-radius: 8px;
    background: #f0fff6;
    box-shadow: var(--shadow);
}

.toast strong {
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 980px) {
    .content-grid,
    .config-strip,
    .auth-shell,
    .owner-grid,
    .admin-grid,
    .simple-start {
        grid-template-columns: 1fr;
    }

    .events-panel {
        order: -1;
    }

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

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

    .welcome-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-access {
        grid-template-columns: 1fr;
    }

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

    .platform-strip {
        grid-template-columns: 1fr;
        margin-top: -24px;
    }
}

@media (max-width: 760px) {
    .app-shell {
        padding: 18px;
    }

    h1 {
        font-size: 34px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

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

    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

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

    .employee-form {
        grid-template-columns: 1fr;
    }

    .employee-row {
        align-items: stretch;
        flex-direction: column;
    }

    .employee-focus {
        grid-template-columns: 1fr;
    }

    .welcome-hero {
        min-height: 560px;
        padding: 42px 18px;
        background-position: 58% center;
    }

    .welcome-hero h1 {
        font-size: 42px;
    }

    .welcome-hero p:not(.eyebrow) {
        font-size: 17px;
    }

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

    .welcome-section {
        padding: 42px 0;
    }

    .section-heading h2,
    .welcome-cta h2 {
        font-size: 30px;
    }

    .welcome-actions {
        width: 100%;
    }

    .welcome-actions .primary-action,
    .welcome-actions .secondary-action {
        width: 100%;
    }

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

    .quick-access {
        width: calc(100% - 24px);
        padding: 14px;
    }

    .access-grid a {
        min-height: 0;
    }

    .platform-strip {
        width: calc(100% - 24px);
        padding: 14px;
    }

    .platform-logo {
        padding: 14px;
    }

    .platform-strip h2 {
        font-size: 26px;
    }
}

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

    .login-panel {
        padding: 24px;
    }

    .welcome-nav {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

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

    .welcome-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .welcome-links .primary-action,
    .welcome-links .secondary-action {
        width: 100%;
        min-width: 0;
        padding: 0 10px;
    }

    .welcome-hero {
        min-height: 620px;
    }

    .welcome-hero h1 {
        font-size: 36px;
    }

    .trust-strip span {
        width: 100%;
        justify-content: center;
    }

    .mp-icon {
        width: 56px;
        height: 56px;
    }

    .mp-wordmark {
        font-size: 28px;
    }

    .welcome-cta {
        padding: 22px;
    }
}
