:root {
    --mc-navy: #16324f;
    --mc-blue: #1769aa;
    --mc-green: #277a54;
    --mc-border: #cbd5df;
    --mc-bg: #f4f7f9;
    --mc-text: #1f2933;
}

body {
    background: var(--mc-bg);
    color: var(--mc-text);
    font-size: 17px;
    line-height: 1.5;
}

.site-header {
    background: #fff;
    border-bottom: 4px solid var(--mc-green);
    padding: 1rem 0;
}

.brand {
    color: var(--mc-navy);
    text-decoration: none;
}

.brand span {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
}

.brand small {
    display: block;
    color: #52616f;
    font-size: .92rem;
}

.header-actions {
    align-items: center;
    display: flex;
    gap: .65rem;
}

.header-actions form { margin: 0; }

.page-heading h1 {
    color: var(--mc-navy);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 750;
    margin: 0 0 .25rem;
}

.page-heading p { color: #5d6974; }

.primary-action { min-height: 52px; }

.btn-primary {
    background: var(--mc-blue);
    border-color: var(--mc-blue);
}

.btn { font-weight: 650; }

.form-control,
.form-select,
.input-group-text {
    border-color: #9eacb9;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mc-blue);
    box-shadow: 0 0 0 .22rem rgba(23, 105, 170, .18);
}

.search-bar,
.form-section,
.quote-list,
.empty-state {
    background: #fff;
    border: 1px solid var(--mc-border);
    border-radius: 6px;
}

.search-bar { padding: 1.25rem; }

.section-title {
    color: var(--mc-navy);
    font-size: 1.35rem;
    font-weight: 750;
    margin-bottom: .8rem;
}

.quote-list { overflow: hidden; }
.quote-list thead th {
    background: #e8eef3;
    color: #334454;
    font-size: .9rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.quote-list th,
.quote-list td { padding: 1rem; }
.quote-number,
.amount { font-weight: 750; white-space: nowrap; }
.empty-state { padding: 3rem 1.5rem; text-align: center; }

.form-section {
    margin-bottom: 1.25rem;
    padding: 1.4rem;
}

.form-section > h2,
.section-heading h2 {
    color: var(--mc-navy);
    font-size: 1.3rem;
    font-weight: 750;
    margin: 0 0 1.15rem;
}

.section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.section-heading h2 { margin-bottom: 0; }
.form-label { color: #344454; font-weight: 700; }
.text-editor { min-height: 240px; resize: vertical; }

.client-summary {
    background: #eef5f9;
    border-left: 4px solid var(--mc-blue);
    min-height: 3rem;
    padding: .8rem 1rem;
}

.value-labels,
.value-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) 110px;
    gap: .8rem;
    align-items: end;
}

.value-labels {
    color: #344454;
    font-weight: 700;
    margin-bottom: .4rem;
}

.value-row {
    border-bottom: 1px solid #dce3e8;
    padding: .6rem 0;
}

.totals {
    max-width: 430px;
}

.totals > div {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: .4rem .75rem;
}

.totals .grand-total {
    background: var(--mc-navy);
    color: #fff;
    font-size: 1.2rem;
    margin-top: .35rem;
    padding: .8rem;
}

.form-actions {
    background: #fff;
    border-top: 1px solid var(--mc-border);
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: .8rem;
    margin: 0 -12px;
    padding: 1rem 12px;
    position: sticky;
    z-index: 10;
}

.quote-list td:last-child {
    min-width: 360px;
    white-space: nowrap;
}

.quote-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}

.quote-actions form { margin: 0; }

.site-footer {
    color: #63717e;
    font-size: .9rem;
    padding: 1.5rem 0 2rem;
    text-align: center;
}

.error-panel { max-width: 680px; }

.auth-body {
    align-items: center;
    background: #eef3f6;
    display: flex;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-shell {
    margin: 0 auto;
    max-width: 520px;
    width: 100%;
}

.auth-brand {
    border-bottom: 4px solid var(--mc-green);
    color: var(--mc-navy);
    margin-bottom: 1.2rem;
    padding: 0 .25rem 1rem;
}

.auth-brand span {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
}

.auth-brand small {
    color: #52616f;
    display: block;
    font-size: 1rem;
}

.auth-panel {
    background: #fff;
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    padding: 2rem;
}

.auth-panel h1 {
    color: var(--mc-navy);
    font-size: 2rem;
    font-weight: 750;
    margin-bottom: .35rem;
}

.auth-panel > p {
    color: #5d6974;
    margin-bottom: 1.5rem;
}

.auth-password { min-height: 54px; }
.auth-check { font-size: 1.05rem; }
.auth-check .form-check-input { height: 1.25rem; width: 1.25rem; }
.auth-submit { min-height: 58px; font-size: 1.15rem; }

@media (max-width: 767.98px) {
    body { font-size: 16px; }
    .site-header .btn { font-size: .9rem; }
    .site-header .container-xl { align-items: flex-start !important; }
    .header-actions { align-items: stretch; flex-direction: column; }
    .header-actions .btn { width: 100%; }
    .auth-body { padding: 1rem; }
    .auth-panel { padding: 1.35rem; }
    .section-heading { align-items: stretch; flex-direction: column; }
    .section-heading .btn-group { display: grid; }
    .value-row { grid-template-columns: 1fr; padding: 1rem 0; }
    .value-row .remove-value { justify-self: start; }
    .form-actions {
        flex-direction: column-reverse;
        margin: 0;
        position: static;
    }
    .form-actions .btn { width: 100%; }
}
