:root {
    --ink: #132036;
    --navy: #0a1629;
    --navy2: #122846;
    --blue: #1769e0;
    --canvas: #f1f4f8;
    --paper: #fff;
    --line: #cbd4e0;
    --muted: #607089;
    --green: #087443;
    --amber: #9a6500;
    --red: #b42318;
    --sidebar: 272px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 14px/1.45 Arial, sans-serif
}

.error-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.error-shell {
    width: min(560px, 100%);
    min-height: auto;
    margin: 0;
}

.error-card {
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 42px;
}

.error-logo {
    display: block;
    width: 176px;
    height: auto;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
}

.error-code {
    margin: 32px 0 8px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.error-card h1 {
    margin: 0;
}

.error-card > p:not(.error-code) {
    max-width: 460px;
    color: var(--muted);
    font-size: 15px;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.button-link,
.secondary-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border: 1px solid var(--ink);
    border-radius: 0;
    padding: 9px 14px;
    background: var(--ink);
    color: #fff;
    font: 700 12px Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button {
    background: #fff;
    color: var(--ink);
}

.connection-banner {
    position: fixed;
    z-index: 20;
    right: 18px;
    bottom: 18px;
    max-width: min(440px, calc(100% - 36px));
    border: 1px solid var(--red);
    background: #fff;
    color: var(--red);
    padding: 12px 14px;
    font-weight: 700;
}

aside {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: var(--sidebar);
    padding: 24px 16px;
    background: var(--navy);
    border-right: 1px solid #24415f;
    color: #dfe9f8
}

.brand {
    padding: 0 10px 21px;
    border-bottom: 1px solid #2a4562;
}

.brand img {
    display: block;
    width: 176px;
    max-height: 58px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
}

.brand small,
.user small {
    display: block;
    margin-top: 7px;
    color: #8fa9c9;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.75px
}

.user {
    margin: 20px 10px 12px;
    padding: 13px 0;
    border-bottom: 1px solid #2a4562;
    font-size: 13px;
    font-weight: 700
}

.user small {
    font-size: 9px
}

nav {
    display: grid;
    gap: 2px;
    margin-top: 8px
}

nav a {
    position: relative;
    display: block;
    padding: 11px 12px 11px 21px;
    border-left: 3px solid transparent;
    color: #b9c9de;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none
}

nav a:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 7px;
    width: 4px;
    height: 4px;
    background: #58799d;
    transform: translateY(-50%)
}

nav a:hover,
nav a.active {
    border-left-color: #4b9dff;
    background: var(--navy2);
    color: #fff
}

nav a.active:before {
    background: #8cc2ff
}

.logout {
    min-height: 30px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #aebbc9;
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font: 700 12px Arial;
    cursor: pointer
}

.logout:hover {
    border-color: var(--blue);
    background: #f4f8ff;
    color: var(--blue)
}

main {
    min-height: 100vh;
    margin-left: var(--sidebar)
}

header {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .35px
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.header-actions form {
    margin: 0
}

.page {
    width: min(1480px, 100%);
    margin: auto;
    padding: 34px
}

h1,
h2 {
    color: var(--ink)
}

h1 {
    margin: 0;
    font-size: 29px;
    line-height: 1.1
}

h2 {
    margin: 28px 0 12px;
    font-size: 15px;
    letter-spacing: .1px;
    text-transform: uppercase
}

.title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--ink)
}

.title-row p,
.muted {
    margin: 7px 0 0;
    color: var(--muted)
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin: 22px 0
}

.metrics>div,
.card,
.setup-card {
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--paper)
}

.metrics>div {
    border-top: 3px solid var(--blue)
}

.metrics small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase
}

.metrics b {
    display: block;
    margin-top: 7px;
    font-size: 24px;
    line-height: 1.1
}

.danger {
    color: var(--red) !important
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 1.1fr);
    gap: 18px
}

.two-col > * {
    min-width: 0
}

.narrow {
    max-width: 620px
}

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

.step-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.step-heading > span {
    display: inline-flex;
    min-width: 74px;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--blue);
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
}

.step-heading h2 {
    margin: 0 0 5px;
}

.step-heading p {
    margin: 0;
}

.planning-section {
    min-width: 0;
    margin: 0 0 18px;
    border: 1px solid var(--line);
    padding: 18px;
}

.planning-section legend {
    padding: 0 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.planning-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 14px 0;
}

.checkbox-grid label,
.confirmation-check {
    display: flex;
    min-height: 28px;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.checkbox-grid input[type=checkbox],
.confirmation-check input[type=checkbox] {
    width: auto;
    min-height: auto;
    margin: 0;
}

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

.contract-terms {
    max-height: 360px;
    overflow-y: auto;
    margin: 0 0 18px;
    border: 1px solid var(--line);
    padding: 18px;
    background: #f8fafc;
}

.contract-terms section {
    margin-bottom: 16px;
}

.contract-terms h3 {
    margin: 0 0 5px;
    font-size: 12px;
    text-transform: uppercase;
}

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

.planning-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
    margin: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.planning-summary p {
    margin: 5px 0;
    color: var(--muted);
}

label {
    display: block;
    margin: 13px 0;
    color: #35445b;
    font-size: 12px;
    font-weight: 800
}

input,
select,
textarea {
    display: block;
    width: 100%;
    min-height: 39px;
    margin-top: 6px;
    padding: 9px 10px;
    border: 1px solid #aebbc9;
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #7fb7ff;
    outline-offset: -1px;
    border-color: var(--blue)
}

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

input[type=checkbox] {
    display: inline-block;
    width: auto;
    min-height: 0;
    margin: 0 7px 0 0;
    vertical-align: middle;
    accent-color: var(--blue)
}

button,
.button {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 9px 14px;
    border: 1px solid var(--blue);
    border-radius: 0;
    background: var(--blue);
    color: #fff;
    font: 800 12px Arial;
    text-decoration: none;
    cursor: pointer
}

button:hover,
.button:hover {
    border-color: #0d4fac;
    background: #0d4fac
}

.danger-button {
    border-color: var(--red);
    background: var(--red)
}

.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 0;
    background: #fff
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700
}

.pagination div {
    display: flex;
    gap: 8px
}

.pagination a {
    padding: 7px 10px;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none
}

.pagination a:hover {
    border-color: var(--blue);
    color: var(--blue)
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap
}

th {
    background: #eaf0f6;
    color: #53657b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .85px;
    text-align: left;
    text-transform: uppercase
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #dce3eb
}

tbody tr:last-child td {
    border-bottom: 0
}

tbody tr:hover {
    background: #f7faff
}

td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px
}

a {
    color: #125ac5;
    font-weight: 700
}

.status,
.pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid #aebbc9;
    border-radius: 0;
    background: #edf2f7;
    color: #29425e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase
}

.pill {
    background: #fff
}

.payment_pending {
    border-color: #d9ad49;
    background: #fff6db;
    color: var(--amber)
}

.confirmed,
.completed,
.closed {
    border-color: #79be98;
    background: #e7f5ec;
    color: var(--green)
}

.cancelled {
    border-color: #e5a19d;
    background: #fff0ef;
    color: var(--red)
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line)
}

.actions form {
    display: flex;
    gap: 8px;
    align-items: center
}

.cart-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #dce3eb
}

.cart-line:last-child {
    border-bottom: 0
}

.text-button {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--red)
}

.text-button:hover {
    background: transparent;
    color: #8f1a12
}

.balance {
    margin: 8px 0 0;
    color: var(--muted)
}

.actions form input {
    min-width: 230px;
    margin: 0
}

.actions button {
    margin: 0
}

.message {
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 0;
    font-weight: 700
}

.message.success {
    border-color: #8ac3a4;
    background: #e9f8ef;
    color: #176238
}

.message.error {
    border-color: #e3a19b;
    background: #fff2f0;
    color: #98231c
}

.select-search {
    margin-bottom: 8px;
}

.notice {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e0bc68;
    border-left: 4px solid #c78a11;
    background: #fff8e3;
    color: #6e5318
}

.check {
    color: var(--green);
    font-size: 20px;
    font-weight: 900
}

.setup-card {
    margin: 14px 0;
    border-left: 4px solid var(--blue)
}

.setup-card h2 {
    margin: 0 0 3px;
    text-transform: none
}

.setup-card ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2px;
    margin: 17px 0;
    padding: 0;
    list-style: none
}

.setup-card li {
    padding: 8px 0;
    border-top: 1px solid #e9eef5
}

.setup-card label {
    margin: 0
}

.setup-action {
    max-width: 620px
}

.modal {
    position: fixed;
    z-index: 20;
    top: 50%;
    left: 50%;
    min-width: min(440px, 92vw);
    padding: 24px;
    border: 2px solid var(--ink);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    transform: translate(-50%, -50%)
}

.proof-preview-modal {
    width: min(900px, 94vw);
    min-width: 0;
    max-height: 92vh;
}

.proof-preview-modal .title-row {
    margin-bottom: 12px;
}

.proof-preview-modal iframe {
    display: block;
    width: 100%;
    height: min(680px, 72vh);
    border: 1px solid var(--line);
}

.offline-banner {
    margin-bottom: 15px;
    padding: 11px 14px;
    border: 1px solid #a84d27;
    border-left: 4px solid #a84d27;
    border-radius: 0;
    background: #fff2ea;
    color: #782d12;
    font-weight: 800
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(90deg, #071425d9, #0e3264b8), url("../images/login_bg.40ff5909fed8.jpg") center/cover no-repeat fixed
}

.login-card {
    width: min(450px, 92vw);
    padding: 38px;
    border: 1px solid #fff;
    border-top: 5px solid #4b9dff;
    border-radius: 0;
    background: #fffffff5;
    box-shadow: none
}

.login-card .brand {
    margin-bottom: 25px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--line);
    text-align: center
}

.login-card .brand img {
    width: 205px;
    max-height: 70px;
    margin-inline: auto
}

.login-card .brand small,
.login-card p {
    color: var(--muted)
}

.login-card h1 {
    font-size: 25px
}

.login-card button {
    width: 100%
}

.login-footer {
    position: fixed;
    right: 22px;
    bottom: 18px;
    display: grid;
    gap: 3px;
    color: #d7e1ef;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: right;
    text-transform: uppercase;
}

.login-footer,
.login-footer span {
    color: #dfe9f8 !important;
}

.error {
    display: block;
    margin-top: 4px;
    color: var(--red);
    font-size: 11px
}

@media (max-width: 1024px) {
    :root {
        --sidebar: 230px
    }

    .page {
        padding: 24px
    }

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

@media (max-width: 820px) {
    aside {
        position: relative;
        width: 100%;
        min-height: auto;
        padding: 17px 14px
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 0 3px 13px
    }

    .brand img {
        width: 135px
    }

    .brand small {
        margin: 0
    }

    .user {
        display: none
    }

    nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        margin-top: 12px
    }

    nav a {
        display: flex;
        min-height: 42px;
        align-items: center;
        padding: 9px 7px 9px 15px;
        font-size: 12px
    }

    main {
        margin-left: 0
    }

    header {
        min-height: 56px;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 18px
    }

    .header-actions {
        gap: 5px;
        margin-left: auto
    }

    .logout {
        min-height: 36px;
        padding: 5px 9px;
        font-size: 11px
    }

    .page {
        padding: 20px 14px
    }

    h1 {
        font-size: 24px
    }

    .title-row {
        display: block
    }

    .title-row form {
        margin-top: 14px
    }

    .two-col,
    .form-grid,
    .planning-columns,
    .services-grid,
    .checkbox-grid,
    .planning-summary {
        grid-template-columns: 1fr
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px
    }

    .metrics > div {
        padding: 14px
    }

    .metrics b {
        font-size: 20px
    }

    .actions,
    .actions form {
        display: block
    }

    .actions form {
        margin: 10px 0
    }

    .actions form input {
        width: 100%;
        min-width: 0;
        margin-bottom: 8px
    }

    .table-wrap {
        margin-right: -14px;
        margin-left: -14px;
        border-right: 0;
        border-left: 0
    }

    .modal {
        min-width: 0;
        width: calc(100vw - 28px)
    }

    .proof-preview-modal iframe {
        height: 62vh
    }
}

@media (max-width: 480px) {
    header > div:first-child {
        width: 100%
    }

    .header-actions {
        margin-left: 0
    }

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

    .login {
        padding: 28px 14px 70px
    }

    .login-card {
        padding: 28px 24px
    }

    .login-footer {
        right: 10px !important;
        bottom: 10px !important;
        font-size: 8px !important;
    }
}
