:root {
    --drp-blue: #1b4a86;
    --drp-blue-dark: #163c6d;
    --text: #1f2328;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --surface: #ffffff;
    --canvas: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--canvas);
}

/* ---------- Header ---------- */

.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-header__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.app-header__logo {
    height: 34px;
    width: auto;
}

.app-header__divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
}

.app-header__title {
    font-weight: 600;
    font-size: 16px;
}

/* ---------- Layout ---------- */

.app-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-head h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-head__meta {
    color: var(--text-muted);
    font-size: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px 24px 26px;
    margin-bottom: 24px;
}

.card__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.card__rule {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 22px 0;
}

/* ---------- Field grid ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 24px;
    margin-bottom: 24px;
}

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

.span-2 {
    grid-column: span 2;
}

.span-all {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .grid, .grid--2 {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: auto;
    }
}

/* ---------- Read-only values ---------- */

.field__label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.field__value {
    font-size: 15px;
    line-height: 1.45;
}

.field__value--empty {
    color: #9ca3af;
}

/* ---------- Inputs ---------- */

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field > label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

input[type="text"],
textarea {
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbd0d8;
    border-radius: 5px;
    padding: 9px 11px;
    width: 100%;
}

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

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--drp-blue);
    box-shadow: 0 0 0 3px rgba(27, 74, 134, 0.14);
}

/* ---------- Buttons ---------- */

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 11px 26px;
    border-radius: 5px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn--primary {
    background: var(--drp-blue);
    color: #fff;
}

.btn--primary:hover {
    background: var(--drp-blue-dark);
}

.btn--secondary {
    background: #fff;
    color: var(--text);
    border-color: #cbd0d8;
}

.btn--secondary:hover {
    background: #f9fafb;
}

/* ---------- Messages ---------- */

.message {
    text-align: center;
    padding: 46px 24px 52px;
}

.message h1 {
    font-size: 26px;
    margin: 0 0 12px;
}

.message p {
    color: var(--text-muted);
    margin: 0 0 8px;
    line-height: 1.55;
}

.message__keys {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 18px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
    color: #b42318;
}

/* ---------- Select ---------- */

select {
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbd0d8;
    border-radius: 5px;
    padding: 9px 11px;
    width: 100%;
    height: 40px;
}

select:focus {
    outline: none;
    border-color: var(--drp-blue);
    box-shadow: 0 0 0 3px rgba(27, 74, 134, 0.14);
}

input[type="number"] {
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbd0d8;
    border-radius: 5px;
    padding: 9px 11px;
    width: 100%;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--drp-blue);
    box-shadow: 0 0 0 3px rgba(27, 74, 134, 0.14);
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
    .app-header__inner {
        padding: 12px 16px;
        gap: 12px;
    }

    .app-header__logo {
        height: 28px;
    }

    .app-header__title {
        font-size: 14px;
    }

    .app-main {
        padding: 20px 16px 40px;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 16px;
    }

    .page-head h1 {
        font-size: 24px;
    }

    .card {
        padding: 18px 16px 20px;
        margin-bottom: 16px;
    }

    .actions {
        flex-direction: column-reverse;
    }

    .actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Keep the header readable on very narrow phones. */
@media (max-width: 380px) {
    .app-header__title {
        font-size: 13px;
    }

    .app-header__divider {
        display: none;
    }
}

/* ---------- Sanitized HTML from GT-CRM (Quote Comments / Quote Notes) ---------- */

.field__value--html > *:first-child {
    margin-top: 0;
}

.field__value--html > *:last-child {
    margin-bottom: 0;
}

.field__value--html p,
.field__value--html ul,
.field__value--html ol,
.field__value--html blockquote,
.field__value--html table {
    margin: 0 0 8px;
}

.field__value--html ul,
.field__value--html ol {
    padding-left: 20px;
}

.field__value--html li {
    margin-bottom: 2px;
}

.field__value--html a {
    color: var(--drp-blue);
}

.field__value--html blockquote {
    border-left: 3px solid var(--border);
    padding-left: 12px;
    color: var(--text-muted);
}

.field__value--html hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

.field__value--html table {
    border-collapse: collapse;
    width: 100%;
}

.field__value--html th,
.field__value--html td {
    border: 1px solid var(--border);
    padding: 5px 8px;
    text-align: left;
}

/* Long unbroken strings in pasted markup must not widen the card. */
.field__value--html {
    overflow-wrap: break-word;
}
