:root {
    color-scheme: light;
    --text: #182530;
    --muted: #687888;
    --line: #d9e1e8;
    --line-strong: #bfccd7;
    --surface: #ffffff;
    --surface-soft: #f4f6f8;
    --surface-tint: #edf5f4;
    --blue: #2f6285;
    --teal: #2e766d;
    --green: #2e7654;
    --amber: #956d1f;
    --red: #a54848;
}

html,
body {
    min-height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--surface-soft);
}

a {
    color: var(--blue);
}

button,
input,
select,
textarea {
    font: inherit;
}

h1,
h2,
h3 {
    color: var(--text);
    letter-spacing: 0;
}

h1:focus {
    outline: none;
}

h2 {
    margin: 0 0 0.8rem;
    font-size: 1.05rem;
}

h3 {
    margin: 1rem 0 0.65rem;
    font-size: 0.95rem;
}

.content {
    padding: 1.4rem 1rem 2rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.2;
}

.page-header p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    max-width: 62rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.icon-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
    padding: 0.42rem 0.75rem;
    text-decoration: none;
}

.text-button:hover,
.icon-button:hover {
    border-color: var(--line-strong);
    background: #f7fafb;
}

.icon-button {
    width: 2.3rem;
    padding: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.grid-wide {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 1rem;
}

.panel,
.card-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(24, 37, 48, 0.04);
}

.panel {
    padding: 1rem;
}

.card-item {
    padding: 0.85rem;
}

.metric {
    min-height: 8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top: 4px solid var(--blue);
}

.metric.green {
    border-top-color: var(--green);
}

.metric.amber {
    border-top-color: #d7a331;
}

.metric.red {
    border-top-color: var(--red);
}

.metric-label,
.eyebrow {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.metric-value {
    font-size: 2rem;
    font-weight: 900;
}

.stack {
    display: grid;
    gap: 0.75rem;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.78rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0;
    background: #fbfcfd;
}

tbody tr:last-child td {
    border-bottom: none;
}

.selected-row td {
    background: #edf5f4;
}

.selected-card {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(46, 118, 109, 0.12);
}

.tech-panel {
    border-top: 4px solid var(--teal);
}

.tech-tone-1 {
    border-top-color: var(--teal);
}

.tech-tone-2 {
    border-top-color: var(--blue);
}

.tech-tone-3 {
    border-top-color: var(--green);
}

.tech-tone-4 {
    border-top-color: var(--amber);
}

.tech-tone-5 {
    border-top-color: #6c5c9c;
}

.tech-tone-6 {
    border-top-color: var(--red);
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #bfd5e4;
    background: #f0f7fb;
    color: #285d81;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.status.green {
    border-color: #a7d6c8;
    background: #edf8f4;
    color: #1b604f;
}

.status.amber {
    border-color: #ead095;
    background: #fff8e7;
    color: #76500f;
}

.status.red {
    border-color: #e7b6b6;
    background: #fff1f1;
    color: #8e3434;
}

.muted {
    color: var(--muted);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.detail-list div {
    min-height: 4.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #fbfcfd;
}

.media-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.media-thumb {
    width: 4.5rem;
    height: 3.4rem;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef5f8;
}

.timeline {
    display: grid;
    gap: 0.65rem;
}

.timeline-item {
    border-left: 3px solid var(--teal);
    padding-left: 0.75rem;
}

.notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 700;
}

.notice-error {
    border-color: #e2b4b4;
    background: #fff2f2;
    color: #8d3333;
}

.notice-ok {
    border-color: #a7d6c8;
    background: #edf8f4;
    color: #1b604f;
}

.admin-form {
    display: grid;
    gap: 0.85rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
}

.admin-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--text);
    font-weight: 800;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    min-height: 2.55rem;
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    color: var(--text);
    background: #ffffff;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: var(--teal);
    outline: 3px solid rgba(46, 118, 109, 0.16);
}

.check-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
}

.check-row input {
    width: 1rem;
    min-height: 1rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.55rem;
}

.feature-grid label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    min-height: 2.35rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    color: #314250;
    font-weight: 800;
}

.feature-grid input {
    width: 1rem;
    min-height: 1rem;
}

.section-heading {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.quote-builder-form {
    gap: 1rem;
}

.quote-builder-block {
    display: grid;
    gap: 0.55rem;
}

.quote-line-scroll,
.detail-table-wrap {
    overflow-x: auto;
}

.quote-line-grid {
    display: grid;
    grid-template-columns: 7rem minmax(16rem, 2fr) 5rem 6rem 7rem 6rem 5rem 7rem minmax(14rem, 1.2fr);
    gap: 0.45rem;
    min-width: 1120px;
    align-items: start;
}

.quote-source-grid {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 1.4fr) 7rem minmax(12rem, 1.4fr);
    gap: 0.45rem;
    align-items: start;
}

.quote-line-heading {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.quote-detail-panel {
    min-width: 0;
}

.quote-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.85rem;
}

.quote-detail-header p {
    margin: 0.2rem 0 0;
}

.quote-grand-total {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 900;
    white-space: nowrap;
}

.compact-table th,
.compact-table td {
    padding: 0.55rem;
}

.source-list {
    display: grid;
    gap: 0.2rem;
}

.source-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--line);
}

.source-item:first-child {
    border-top: none;
}

.source-item a,
.source-item p,
.source-item .muted {
    grid-column: 1 / -1;
}

.source-item p {
    margin: 0;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    border: 1px solid #245d55;
    border-radius: 8px;
    background: var(--teal);
    color: #ffffff;
    font-weight: 900;
    padding: 0.55rem 0.85rem;
}

.login-shell {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(46, 118, 109, 0.12), rgba(47, 98, 133, 0.08)),
        #f6f8fa;
}

.login-page {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 3rem;
    color: var(--text);
    font-weight: 900;
}

.login-brand img {
    width: 2.15rem;
    height: 2.15rem;
}

.login-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 2rem;
    align-items: center;
}

.login-copy h1 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4.8rem);
    line-height: 1;
}

.login-copy p:not(.eyebrow) {
    max-width: 42rem;
    margin: 1.2rem 0 0;
    color: #435464;
    font-size: 1.05rem;
    line-height: 1.6;
}

.login-panel {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 45px rgba(24, 37, 48, 0.12);
}

.login-panel h2 {
    margin-bottom: 0.2rem;
    font-size: 1.4rem;
}

.login-form {
    display: grid;
    gap: 0.85rem;
}

.login-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--text);
    font-weight: 800;
}

.login-form input {
    min-height: 2.75rem;
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    color: var(--text);
    background: #ffffff;
}

.login-form input:focus {
    border-color: var(--teal);
    outline: 3px solid rgba(46, 118, 109, 0.16);
}

.login-form button {
    min-height: 2.75rem;
    border: 1px solid #245d55;
    border-radius: 8px;
    background: var(--teal);
    color: #ffffff;
    font-weight: 900;
}

.pilot-access {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}

.pilot-companies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-top: 2rem;
}

.pilot-company {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
}

.pilot-company span,
.pilot-company strong {
    min-width: 0;
}

@media (max-width: 900px) {
    .grid-wide,
    .login-grid {
        grid-template-columns: 1fr;
    }

    .login-brand {
        margin-bottom: 1.6rem;
    }
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
    }

    .media-row {
        grid-template-columns: 4.5rem minmax(0, 1fr);
    }

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

    .quote-source-grid {
        grid-template-columns: 1fr;
    }

    .quote-detail-header {
        flex-direction: column;
    }
}
