:root {
    --ink: #111316;
    --muted: #68707a;
    --line: #dfe4ea;
    --soft: #f4f7fa;
    --paper: #ffffff;
    --charcoal: #171a1f;
    --red: #c9282d;
    --red-dark: #a51f24;
    --teal: #0f8b8d;
    --amber: #c47b24;
    --success: #17864c;
    --warning: #b97317;
    --danger: #b3212d;
    --radius: 8px;
    --shadow: 0 18px 45px rgba(17, 19, 22, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #f7f9fb;
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    min-height: 76px;
    padding: 12px clamp(18px, 4vw, 54px);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(17, 19, 22, .08);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--charcoal);
    color: #fff;
    font-weight: 800;
}

.brand strong { display: block; font-size: 18px; line-height: 1; }
.brand small { display: block; max-width: 240px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.main-nav a,
.side-nav a {
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #3d444d;
    font-weight: 700;
    font-size: 14px;
}

.main-nav a:hover,
.main-nav a.is-active,
.side-nav a:hover,
.side-nav a.is-active {
    background: #edf1f5;
    color: var(--ink);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.language-form select,
input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(15, 139, 141, .22); border-color: var(--teal); }

.language-form select { width: 118px; min-height: 38px; }

.btn,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    cursor: pointer;
    transition: .18s ease;
}

.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 20px rgba(201, 40, 45, .22); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-muted { background: #edf1f5; color: var(--ink); }
.btn-muted:hover { background: #dfe6ed; }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.full { width: 100%; }

.icon-btn { width: 40px; padding: 0; background: #edf1f5; color: var(--ink); }

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: #edf1f5;
    border-radius: var(--radius);
}
.nav-toggle span { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--ink); }

.flash {
    max-width: 1180px;
    margin: 16px auto 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 700;
}
.flash-success { background: #e4f5ed; color: #0d6638; }
.flash-danger { background: #fde8ea; color: var(--danger); }
.flash-warning { background: #fff3df; color: var(--warning); }

.hero {
    position: relative;
    min-height: 82vh;
    display: grid;
    align-items: center;
    overflow: hidden;
    background: var(--charcoal);
}
.hero-media,
.hero-media img,
.hero-overlay {
    position: absolute;
    inset: 0;
}
.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    background: linear-gradient(90deg, rgba(17,19,22,.92) 0%, rgba(17,19,22,.66) 43%, rgba(17,19,22,.22) 100%);
}
.hero-content {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100% - 36px));
    margin-left: clamp(18px, 7vw, 92px);
    padding: 48px 0;
    color: #fff;
}
.hero h1 {
    margin: 10px 0 16px;
    max-width: 680px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: .95;
    letter-spacing: 0;
}
.hero p { max-width: 660px; color: rgba(255,255,255,.84); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.eyebrow {
    display: inline-block;
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.hero .eyebrow { color: #78d3d0; }

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 620px;
    margin-top: 34px;
}
.metric-row div {
    padding: 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
}
.metric-row strong { display: block; font-size: 24px; }
.metric-row span { display: block; color: rgba(255,255,255,.74); font-size: 13px; }

.section,
.page-hero,
.cta-band,
.site-footer {
    padding-left: clamp(18px, 5vw, 72px);
    padding-right: clamp(18px, 5vw, 72px);
}

.section { padding-top: 74px; padding-bottom: 74px; }
.section-tint { background: #eef3f5; }
.section-head { max-width: 760px; margin-bottom: 34px; }
.section-head h2,
.page-hero h1,
.cta-band h2,
.app-head h1 {
    margin: 8px 0 12px;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.05;
    letter-spacing: 0;
}
.section-head p,
.page-hero p,
.cta-band p { color: var(--muted); max-width: 760px; }

.process-grid,
.solution-grid,
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.process-grid article,
.solution-card,
.panel,
.form-panel,
.stat-grid article,
.contact-info {
    background: var(--paper);
    border: 1px solid rgba(17,19,22,.08);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(17,19,22,.06);
}
.process-grid article { padding: 24px; }
.process-grid span { color: var(--red); font-weight: 900; }
.process-grid h3 { margin: 14px 0 8px; }
.process-grid p,
.solution-card p { color: var(--muted); }

.solution-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.solution-chip {
    min-height: 94px;
    padding: 16px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid rgba(17,19,22,.08);
}
.solution-chip strong,
.solution-chip span { display: block; }
.solution-chip span { margin-top: 8px; color: var(--red); font-weight: 900; }

.split-band,
.ecu-band,
.contact-layout,
.auth-shell,
.wallet-grid,
.request-grid,
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 28px;
    align-items: start;
}
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.check-list li {
    padding: 14px 16px;
    background: #fff;
    border-left: 4px solid var(--teal);
    border-radius: var(--radius);
}

.page-hero {
    padding-top: 74px;
    padding-bottom: 54px;
    background: #fff;
    border-bottom: 1px solid rgba(17,19,22,.08);
}
.page-hero h1 { max-width: 850px; }

.price-table-wrap,
.table-scroll { width: 100%; overflow-x: auto; }
.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.data-table th {
    background: var(--charcoal);
    color: #fff;
    font-size: 13px;
}
.data-table td > span { display: block; color: var(--muted); font-size: 13px; }
.compact-table { min-width: 520px; }

.solution-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.solution-card { padding: 24px; }
.solution-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: #f5e9ea;
    color: var(--red);
    font-weight: 900;
}
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.card-foot strong { color: var(--red); font-size: 20px; }
.card-foot a { color: var(--teal); font-weight: 900; }

.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 40px;
    padding-bottom: 40px;
    background: var(--charcoal);
    color: #fff;
}
.cta-band p { color: rgba(255,255,255,.72); }

.ecu-list { display: grid; gap: 12px; }
.ecu-list div {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid rgba(17,19,22,.08);
}
.ecu-list span { color: var(--red); font-weight: 900; }

.form-panel,
.panel,
.contact-info { padding: 22px; }
.form-panel label { display: grid; gap: 7px; margin-bottom: 14px; }
.form-panel label span { font-size: 13px; color: #3d444d; font-weight: 800; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-link,
.form-note { color: var(--muted); font-size: 13px; text-align: center; }
.form-link a { color: var(--red); font-weight: 900; }
.form-link-small { margin-top: -6px; text-align: right; }

.auth-shell {
    min-height: calc(100vh - 76px);
    align-items: center;
    padding: 64px clamp(18px, 6vw, 86px);
    background: linear-gradient(120deg, #171a1f 0%, #24282e 52%, #f7f9fb 52%);
}
.auth-copy { color: #fff; max-width: 540px; }
.auth-copy h1 { margin: 8px 0 12px; font-size: clamp(34px, 5vw, 64px); line-height: 1; }
.auth-copy p { color: rgba(255,255,255,.78); }
.auth-panel { width: min(100%, 480px); justify-self: end; }

.app-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
    padding: 28px clamp(18px, 4vw, 48px) 64px;
}
.side-nav {
    position: sticky;
    top: 98px;
    display: grid;
    gap: 6px;
    align-self: start;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(17,19,22,.08);
    border-radius: var(--radius);
}
.admin-side-nav a.is-active { background: #f5e9ea; color: var(--red); }
.app-main { display: grid; gap: 20px; min-width: 0; }
.app-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.app-head h1 { margin-bottom: 0; }
.stat-grid article { padding: 18px; }
.stat-grid span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.stat-grid strong { display: block; margin-top: 6px; font-size: 28px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.panel-head h2,
.panel h2,
.form-panel h2 { margin: 0 0 14px; font-size: 22px; }
.panel-head h2 { margin: 0; }
.panel-head a { color: var(--teal); font-weight: 900; }

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.status-completed,
.status-success,
.status-active { background: #e4f5ed; color: var(--success); }
.status-processing,
.status-paid,
.status-pending { background: #fff3df; color: var(--warning); }
.status-rejected,
.status-failed,
.status-suspended { background: #fde8ea; color: var(--danger); }
.status-manual_review,
.status-uploaded,
.status-analyzed { background: #e9f2f8; color: #216d94; }

.solution-select-list { display: grid; gap: 10px; }
.solution-select {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}
.solution-select input { width: 18px; min-height: 18px; }
.solution-select strong,
.solution-select small { display: block; }
.solution-select small { color: var(--muted); }
.solution-select b { color: var(--red); }
.order-total {
    display: flex;
    justify-content: space-between;
    margin: 16px 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.detail-list {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}
.detail-list dt { color: var(--muted); font-weight: 800; }
.detail-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hash-text { font-family: Consolas, monospace; font-size: 12px; }
.line-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.line-items li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #f7f9fb;
    border-radius: var(--radius);
}
.note-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: var(--radius);
    background: #f7f9fb;
}
.note-box p { margin-bottom: 0; color: var(--muted); }

.wallet-grid { grid-template-columns: 360px minmax(0, 1fr); }
.embedded {
    margin-top: 18px;
    padding: 16px;
    box-shadow: none;
    background: #fbfcfd;
}
.embedded h3 { margin-top: 0; }
.danger-zone { border-color: rgba(179, 33, 45, .25); }

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.inline-form input,
.inline-form select { width: 140px; min-height: 34px; padding: 7px 9px; }
.admin-solution-list { display: grid; gap: 12px; }
.solution-admin-row {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) 120px 90px 110px minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.solution-admin-row label { display: grid; gap: 6px; margin: 0; }
.solution-admin-row label span { font-size: 12px; color: var(--muted); font-weight: 800; }
.solution-admin-row small { display: block; color: var(--muted); }
.solution-admin-row .check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}
.check-inline input { width: 16px; min-height: 16px; }

.settings-panel { max-width: 720px; }
.empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 44px;
    text-align: center;
    background: #fff;
    border-radius: var(--radius);
}
.empty-state span { color: var(--red); font-weight: 900; font-size: 38px; }
.empty-state.small { padding: 24px; box-shadow: none; }

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 32px;
    background: #111316;
    color: #fff;
}
.site-footer p { margin: 6px 0 0; color: rgba(255,255,255,.68); }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.footer-links a { color: rgba(255,255,255,.78); font-weight: 800; }

@media (max-width: 1180px) {
    .site-header { grid-template-columns: auto auto; }
    .nav-toggle { display: block; justify-self: end; }
    .main-nav,
    .header-actions {
        grid-column: 1 / -1;
        display: none;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    body.nav-open .main-nav,
    body.nav-open .header-actions { display: flex; }
    .process-grid,
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .solution-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .solution-admin-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .solution-admin-row .wide { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .brand small { max-width: 160px; }
    .hero { min-height: 76vh; }
    .hero-content { margin: 0 auto; }
    .hero-overlay { background: rgba(17,19,22,.76); }
    .metric-row,
    .process-grid,
    .solution-grid,
    .split-band,
    .ecu-band,
    .contact-layout,
    .auth-shell,
    .wallet-grid,
    .request-grid,
    .detail-grid,
    .form-grid.two,
    .app-shell {
        grid-template-columns: 1fr;
    }
    .auth-shell { background: var(--charcoal); }
    .auth-panel { justify-self: stretch; }
    .app-head,
    .cta-band,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
    .side-nav {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .detail-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .site-header { padding: 10px 14px; }
    .brand small { display: none; }
    .main-nav a,
    .side-nav a { width: 100%; }
    .header-actions { align-items: stretch; }
    .language-form,
    .language-form select,
    .header-actions .btn { width: 100%; }
    .hero h1 { font-size: 42px; }
    .section,
    .page-hero,
    .cta-band { padding-top: 44px; padding-bottom: 44px; }
    .stat-grid { grid-template-columns: 1fr; }
    .side-nav { grid-template-columns: 1fr; }
    .solution-select { grid-template-columns: auto minmax(0, 1fr); }
    .solution-select b { grid-column: 2; }
}
