@font-face{font-family:Inter;src:local("Inter");font-display:swap}
:root {
    color-scheme: light;
    --ink: #172437; --muted: #526479; --line: #dce5ee; --paper: #f3f6fa;
    --blue: #12385a; --deep: #092640; --accent: #b82630; --accent-dark: #98202a;
    --white: #fff; --radius: 15px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 Inter, system-ui, sans-serif; }
h1, h2, p { margin: 0 0 .7em; }
h1 { font-size: clamp(2rem, 5vw, 3.05rem); line-height: 1.06; letter-spacing: -.045em; margin-bottom: .28em; overflow-wrap: anywhere; }
h2 { font-size: 1.28rem; letter-spacing: -.02em; }
a { color: var(--blue); text-underline-offset: .23em; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #2a6c9c; outline-offset: 3px; }
button { cursor: pointer; }
.wrap { width: min(1270px, 100% - 64px); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-content { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2.5rem); min-height: 72px; padding-block: .65rem; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.brand img { width: 100px; height: 40px; object-fit: contain; }
.brand span { padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.header-content nav, .account-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.header-content nav a, .account-nav > a, .account-nav .quiet { padding: .58rem .68rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 630; }
.header-content nav a:hover, .header-content nav .current, .account-nav > a:hover, .account-nav .quiet:hover { background: #edf3f8; color: var(--blue); }
.account-nav, .public-page .header-content nav { margin-inline-start: auto; }
.main-content { padding-block: 2.8rem 4rem; }
.page-heading, .section-heading { display: flex; align-items: center; gap: 1.1rem; justify-content: space-between; }
.page-heading { margin-bottom: 1.65rem; flex-wrap: wrap; }
.page-heading p, .section-heading h2 { margin-bottom: 0; }
.section-heading { margin-bottom: .65rem; }
.muted, .results, small { color: var(--muted); }
.surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: clamp(1rem, 3vw, 1.7rem); min-width: 0; }
button.quiet { border: 0; background: transparent; color: var(--blue); padding: .45rem; text-align: start; }
.button { border: 1px solid #cbd8e5; border-radius: 9px; background: var(--white); color: var(--blue); padding: .58rem .95rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 690; gap: .35rem; }
.button:hover { border-color: var(--blue); background: #f2f7fb; color: var(--blue); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--white); }
.button.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.button.danger { color: var(--accent-dark); }
.button.disabled { opacity: .55; pointer-events: none; }
.actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; margin-bottom: 1.1rem; font-weight: 650; }
.stack { display: grid; gap: 1rem; }
.narrow { width: min(100%, 520px); margin: 2rem auto 0; }
.narrow form { margin-top: 1.35rem; }
.access-shell { display: grid; grid-template-columns: 1.18fr 1fr; overflow: hidden; width: min(100%, 930px); margin: clamp(1rem, 6vw, 5rem) auto 0; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 16px 45px #18385212; }
.access-intro, .access-form { padding: clamp(1.5rem, 5.5vw, 4rem); }
.access-intro { display: grid; align-content: center; justify-items: start; min-height: 425px; color: #fff; background: radial-gradient(ellipse at 102% 110%, #28618b 0, transparent 65%), var(--deep); }
.access-intro h1 { max-width: 9ch; font-size: clamp(2.45rem, 6vw, 4.3rem); }
.access-intro p { max-width: 29ch; font-size: 1.08rem; color: #e2edf6; margin: .8rem 0 1.5rem; }
.access-intro a { color: #fff; font-weight: 650; }
.access-form { align-self: center; }
.access-form h2 { font-size: 1.75rem; margin-bottom: .9rem; }
.form-link { display: inline-block; margin-top: 1rem; }
label { display: flex; flex-direction: column; gap: .3rem; min-width: 0; color: var(--ink); font-size: .9rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 44px; min-width: 0; border: 1px solid #bfcddc; border-radius: 8px; background: #fbfcfe; color: var(--ink); padding: .52rem .68rem; }
input::placeholder { color: #5d7084; }
textarea { resize: vertical; }
fieldset { margin: 0; min-inline-size: 0; }
legend { font-size: 1.16rem; font-weight: 720; padding-inline: .5rem; }
.form-grid, .detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.required { color: var(--accent); }
.filters { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.filters .search-filter { flex: 1 1 240px; }
.results { margin: 1rem 0 .6rem; font-size: .91rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; }
th { background: #edf3f8; color: var(--blue); font-size: .82rem; text-align: left; }
td, th { border-bottom: 1px solid var(--line); padding: .75rem .6rem; vertical-align: top; overflow-wrap: anywhere; }
td { font-size: .91rem; }
tbody tr:hover { background: #f8fbfd; }
.row-actions { white-space: nowrap; }
.row-actions a { margin-inline-end: .55rem; line-height: 1.7; font-weight: 650; }
.code { font-family: ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: end; gap: .35rem; flex-wrap: wrap; margin-top: 1rem; }
.page-number { min-width: 33px; padding: .4rem; text-align: center; text-decoration: none; border-radius: 8px; }
.page-number.selected { color: var(--white); background: var(--blue); font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px,100%), 1fr)); gap: .85rem; margin-bottom: 1.2rem; }
.metric { position: relative; display: grid; color: var(--muted); font-weight: 650; text-decoration: none; }
.metric:hover { border-color: #9bb5cd; }
.metric strong { font-size: 2.15rem; color: var(--deep); line-height: 1.15; margin-top: .35rem; }
.metric-arrow { position: absolute; right: 1.25rem; top: 1.15rem; color: var(--blue); }
.recent-row { display: grid; grid-template-columns: minmax(135px, .6fr) 1.5fr auto; gap: .75rem; padding-block: .8rem; border-top: 1px solid var(--line); text-decoration: none; }
.recent-row time { color: var(--muted); font-size: .9rem; }
.detail-data { margin: 0; display: grid; gap: .5rem; }
.detail-data div { padding-bottom: .38rem; border-bottom: 1px solid #edf1f5; }
.detail-data dt { color: var(--muted); font-weight: 630; font-size: .81rem; }
.detail-data dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.danger-zone { margin-top: 1.6rem; }
.empty { color: var(--muted); padding: 1.3rem 0 .7rem; }
.notice { border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1.15rem; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice.error { background: #fff0f0; border-color: #eab7ba; color: #7b1921; }
.notice.success { background: #edfaef; border-color: #b5d8bb; color: #245a31; }
.notice.warning { background: #fff8e8; border-color: #e6cb85; color: #634813; justify-content: space-between; }
.tracking-results { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1.15rem; }
.timeline { list-style: none; margin: .75rem 0 0; padding-inline-start: .8rem; border-inline-start: 3px solid #c6d9e8; }
.timeline li { display: flex; flex-wrap: wrap; justify-content: space-between; padding: .35rem; gap: .4rem; }
.status { background: #eef0f3; padding: .17rem .5rem; border-radius: 8px; }
.status.active { color: #245a31; background: #e3f4e7; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 2; inset: .5rem auto auto .5rem; background: white; padding: .5rem; }
@media (max-width: 900px) {
    .header-content { flex-wrap: wrap; gap: .4rem; }
    .header-content nav { order: 3; width: 100%; }
    .public-page .header-content nav { order: initial; width: auto; }
    .wrap { width: calc(100% - 38px); }
    .table-wrap { overflow: visible; }
    .stack-table, .stack-table tbody { display: block; }
    .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .stack-table tr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; margin-bottom: .65rem; }
    .stack-table td { border: 0; padding: .38rem .5rem; overflow-wrap: anywhere; }
    .stack-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font: 650 .75rem/1.3 Inter, system-ui, sans-serif; margin-bottom: .12rem; }
    .stack-table .row-actions { grid-column: 1 / -1; }
    .form-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .wrap { width: calc(100% - 24px); }
    .brand img { width: 82px; }
    .brand span { display: none; }
    .main-content { padding-block: 1.6rem 2.5rem; }
    .access-shell, .form-grid, .detail-grid { grid-template-columns: 1fr; }
    .access-intro { min-height: auto; }
    .access-intro h1 { max-width: none; }
    .access-shell { border-radius: 16px; margin-top: .4rem; }
    .narrow { margin-top: 0; }
    .recent-row { grid-template-columns: 1fr auto; }
    .recent-row span { grid-row: 2; grid-column: 1 / -1; }
    .filters label:has([type=date]) { flex: 1 1 120px; }
    .pagination { justify-content: space-between; }
    .pagination .page-number:not(.selected) { display: none; }
}
.print-awb { display: none; }
@page { size: A4; margin: 12mm; }
@page awb { size: A4 landscape; margin: 7mm; }
@media print {
    body { background: white; font-size: 9.5pt; }
    .skip-link, .header-content nav, .account-nav, .page-heading .actions, .back, .danger-zone, .notice { display: none; }
    .wrap { width: 100%; }
    .main-content { padding: .6rem 0; }
    h1 { font-size: 19pt; }
    h2 { font-size: 12pt; }
    .detail-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: .55rem; }
    .surface { padding: .55rem; border: 1px solid #aaa; border-radius: 4px; break-inside: avoid; }
    body:has(.print-awb) .site-header, .main-content:has(.print-awb) > :not(.print-awb) { display: none; }
    .main-content:has(.print-awb) { padding: 0; }
    .print-awb {
        page: awb;
        display: grid;
        grid-template-columns: 383px 426px;
        gap: 2px;
        width: fit-content;
        margin-inline: auto;
        padding: 2px;
        background: #e9e9e9;
        color: #003366;
        font: 12px Verdana, Arial, Helvetica, sans-serif;
        /* Preserve the legacy dimensions while fitting the sheet on landscape A4. */
        zoom: .79;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .print-awb-details, .print-awb-summary { background: white; padding: 6px; min-width: 0; }
    .print-awb table { border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
    .print-awb th, .print-awb td, .print-awb-payment :is(dt, dd) {
        border: 0;
        padding: 6px;
        color: inherit;
        vertical-align: middle;
        font: inherit;
        overflow-wrap: anywhere;
    }
    .print-awb tr { break-inside: avoid; }
    .print-awb th, .print-awb-payment dt { background: #f4f4f4; }
    .print-awb td, .print-awb-payment dd { background: #fbfbfb; }
    .print-awb-details tr { height: 33px; }
    .print-awb-details .print-awb-sender-heading { height: 30px; }
    .print-awb-details .print-awb-short-row { height: 27px; }
    .print-awb-details .print-awb-company-row { height: 28px; }
    .print-awb-details .print-awb-tall-row { height: 42px; }
    .print-awb-label-column { width: 92px; }
    .print-awb-total-label { width: 52px; }
    .print-awb-total-value { width: 72px; }
    .print-awb .print-awb-section { background: #e9e9e9; font-weight: bold; }
    .print-awb-summary { padding: 8px; }
    .print-awb-logo { display: grid; place-items: center; min-height: 115px; }
    .print-awb-payment { display: grid; gap: 2px; margin: 2px 0 28px; }
    .print-awb-payment dt { min-height: 28px; font-weight: bold; }
    .print-awb-payment dd { min-height: 33px; margin: 0; }
    .print-awb-route { width: 405px; margin-inline-start: 1px; }
    .print-awb-destination-column { width: 121px; }
    .print-awb-route th { height: 30px; }
    .print-awb-route td { height: 27px; }
    .print-awb-route th, .print-awb-route td { text-align: center; }
    .print-awb-route th, .print-awb-route td:first-child { font-weight: bold; }
    .print-awb-route td:first-child { color: #eb6c73; }
    .print-awb-contact { min-height: 66px; margin-top: 3px; align-content: center; text-align: right; }
    .print-awb-contact a { color: inherit; text-decoration: none; }
    .print-awb-signatures { display: grid; align-content: space-around; min-height: 202px; margin-top: 147px; text-align: center; break-inside: avoid; }
    .print-awb-signatures span { color: black; font: 16px 'Times New Roman', serif; }
    .print-awb-signature-row { display: grid; grid-template-columns: 208fr 130fr 56fr; gap: 2px; }
}

/* Shared record forms */
[hidden] { display: none !important; }
.form-heading-title { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.form-heading-title h1 { margin-bottom: .15em; }
.heading-icon, .legend-icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border-radius: 11px;
    background: #eaf2f9;
    color: #164b71;
}
.heading-icon { width: 53px; height: 53px; }
.heading-icon .form-icon { width: 27px; height: 27px; }
.legend-icon { width: 36px; height: 36px; }
.form-icon { flex: 0 0 auto; vertical-align: middle; }
.form-jump { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.1rem; }
.form-jump a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid #d7e2ec;
    border-radius: 9px;
    background: #fff;
    padding: .48rem .78rem;
    min-height: 42px;
    text-decoration: none;
    font-weight: 650;
}
.form-jump a:hover { background: #eaf2f9; }
.form-jump .form-icon, .cep-lookup .form-icon { width: 17px; height: 17px; }
.record-form { gap: 1.35rem; }
.form-panel { box-shadow: 0 4px 14px #17365209; scroll-margin-top: 1rem; }
.form-legend { display: flex; align-items: center; gap: .58rem; padding: 0 .55rem; color: var(--deep); font-size: 1.26rem; }
.form-subsection { border-top: 1px solid var(--line); margin-top: 1.15rem; padding-top: 1.05rem; }
.field-caption {
    display: flex;
    align-items: center;
    gap: .38rem;
    color: var(--blue);
    font-size: .89rem;
    font-weight: 730;
    margin: 0 0 .65rem;
}
.field-caption .form-icon { width: 17px; height: 17px; }
.form-field { display: grid; align-content: start; gap: .3rem; min-width: 0; }
.form-field label { align-items: start; }
.person-switch {
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .32rem;
    padding: .25rem;
    border: 1px solid #d8e3ed;
    border-radius: 10px;
    background: #f0f5fa;
    margin: 0 0 .85rem;
}
.person-switch label { position: relative; cursor: pointer; }
.person-switch input { position: absolute; opacity: 0; width: 1px; min-height: 1px; padding: 0; }
.person-switch span { display: block; padding: .5rem .62rem; border: 1px solid transparent; border-radius: 7px; text-align: center; }
.person-switch input:checked + span { border-color: #bfcfdd; background: #fff; color: var(--blue); box-shadow: 0 1px 3px #17365214; }
.person-switch input:focus-visible + span { outline: 2px solid #2a6c9c; outline-offset: 2px; }
.input-line { min-width: 0; }
.cep-line { display: flex; align-items: stretch; gap: .4rem; }
.cep-line input { flex: 1 1 95px; }
.cep-lookup { flex: 0 0 auto; padding-inline: .64rem; font-size: .83rem; white-space: nowrap; }
.cep-lookup:disabled { opacity: .58; cursor: wait; }
.field-help { color: var(--muted); font-size: .82rem; }
.field-help:empty { display: none; }
.field-help[data-state=error], .field-error { color: #961d29; }
.field-help[data-state=success] { color: #245a31; }
.field-error { margin: 0; font-size: .82rem; font-weight: 650; }
.has-error :is(input, select, textarea) { border-color: #b82630; }
.input-money { position: relative; }
.input-money input { padding-inline-start: 2.7rem; font-variant-numeric: tabular-nums; }
.money-prefix { position: absolute; inset: 0 auto 0 .74rem; display: flex; align-items: center; color: var(--muted); font-weight: 650; pointer-events: none; }
.account-login-field { margin-bottom: 1.1rem; }
.form-actions { padding-top: .25rem; }
@media (min-width: 601px) and (max-width: 900px) {
    .cep-field { grid-column: span 2; }
    .cep-line { max-width: 330px; }
}
@media (max-width: 600px) {
    .heading-icon { width: 44px; height: 44px; }
    .heading-icon .form-icon { width: 23px; height: 23px; }
    .form-jump a { font-size: .83rem; padding-inline: .55rem; }
    .form-jump .form-icon { width: 15px; }
    .form-actions > .primary { flex: 1 1 auto; }
}
