:root {
  color-scheme: light;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #0b1c30;
  background: #f8f9ff;
  font-synthesis: none;
  --primary: #004e9f;
  --blue: #0066cc;
  --text: #0b1c30;
  --muted: #576477;
  --line: #e1e8f3;
  --surface: #eff4ff;
  --green: #00677d;
  --error: #b42323;
}
* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
body { margin: 0; font-size: 13px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
input, select { min-width: 0; }
input::placeholder { color: #8290a4; opacity: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a, input, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid #3a91ed; outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline-offset: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; }
h1 { font-size: 25px; letter-spacing: -.5px; }
h2 { font-size: 19px; letter-spacing: -.2px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.small-icon { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 100; padding: 10px 16px; background: white; border: 2px solid var(--blue); border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.1px; line-height: 1.6; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 4px; min-height: 36px; padding: 7px 12px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; line-height: 20px; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s; white-space: nowrap; }
.button .icon { width: 17px; height: 17px; }
.button:hover { text-decoration: none; }
.button-primary { color: white; background: var(--blue); border-color: var(--blue); }
.button-primary:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); }
.button-outline { color: #40516a; border-color: #d6e0ef; background: white; }
.button-outline:hover:not(:disabled) { background: var(--surface); border-color: #b7cce7; }
.button-quiet { color: var(--primary); background: #edf3ff; }
.button-quiet:hover:not(:disabled) { background: #e1ecff; }
.icon-button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-button:hover { background: #e5eeff; color: var(--primary); }
.brand-mark { width: 36px; height: 36px; background: var(--blue); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; box-shadow: 0 3px 8px #0066cc18; }
.brand-mark-large { width: 52px; height: 52px; border-radius: 13px; margin-bottom: 18px; }
.brand-mark-large .icon { width: 28px; height: 28px; }
.centered-view { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: radial-gradient(ellipse at 35% 30%, #d7e3ff42, transparent 50%), radial-gradient(ellipse at 80% 75%, #b3ebff33, transparent 40%), #f8f9ff; }
.auth-layout { width: 100%; max-width: 440px; }
.auth-heading { text-align: center; margin-bottom: 24px; }
.auth-heading h1 { font-size: 22px; letter-spacing: -.3px; }
.auth-heading p { font-size: 12px; color: var(--muted); margin-top: 9px; }
.auth-card { position: relative; overflow: hidden; background: white; padding: 30px 27px 28px; border-radius: 9px; box-shadow: 0 16px 50px #17365e0b, 0 2px 8px #17365e05; border: 1px solid #e8edf6; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, #004e9f, #0066cc 55%, #50d9fe); }
.auth-card > .muted { margin-top: 6px; }
#login-form { display: grid; gap: 18px; margin-top: 25px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { display: flex; align-items: center; gap: 6px; color: #263b56; font-size: 12px; font-weight: 600; }
.field label .icon { color: var(--primary); width: 16px; height: 16px; }
.field small { color: var(--muted); font-size: 11px; }
.phone-field, .password-field { display: flex; align-items: stretch; background: #eff4ff; border: 1px solid #dfe7f6; border-radius: 6px; overflow: hidden; }
.phone-field:focus-within, .password-field:focus-within { border-color: #74a6da; box-shadow: 0 0 0 3px #0066cc10; background: white; }
.country-prefix { display: flex; align-items: center; gap: 7px; padding: 11px 12px; font-size: 13px; font-weight: 600; background: #e5eeff; white-space: nowrap; }
.country-prefix > span { font-size: 17px; }
.phone-field input, .password-field input { width: 100%; background: transparent; border: 0; padding: 12px; outline: none; color: var(--text); font-size: 15px; }
.password-field { align-items: center; padding-right: 3px; }
.phone-field input::placeholder, .password-field input::placeholder { font-size: 13px; }
.login-submit { width: 100%; margin-top: 3px; min-height: 46px; font-size: 12px; box-shadow: 0 4px 12px #0066cc20; }
.form-message { padding: 10px 13px; border: 1px solid #f1cece; border-radius: 6px; background: #fff2f2; color: #9d2525; font-size: 13px; }
.boot-state { text-align: center; color: var(--muted); }
.boot-state h1 { color: var(--text); font-size: 20px; margin: 15px 0 6px; }
.spinner { display: inline-block; border: 2px solid #d1e1f8; border-top-color: var(--blue); border-radius: 50%; width: 27px; height: 27px; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-header { position: sticky; z-index: 20; top: 0; background: #ffffffed; box-shadow: 0 1px 8px #0000000a; backdrop-filter: blur(16px); }
.header-inner { max-width: 1280px; padding: 0 12px; height: 64px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: .45px; }
.brand:hover { text-decoration: none; }
.brand-break { display: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-button { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid #c1c6d533; border-radius: 12px; background: #eff4ff; color: var(--text); max-width: 310px; text-align: left; }
.user-button:hover { background: #e5eeff; }
.avatar-wrap { position: relative; display: flex; flex-shrink: 0; }
.avatar { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--primary); color: white; font-size: 15px; font-weight: 700; border-radius: 12px; }
.online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--green); }
.user-copy { display: flex; flex-direction: column; overflow: hidden; padding-right: 4px; }
.user-copy strong { font-size: 15px; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.user-copy small { font-size: 12px; line-height: 16px; color: #414753; }
.logout-button { min-height: 36px; font-weight: 600; color: #414753; background: transparent; border-color: #c1c6d54d; }
.logout-button:hover:not(:disabled) { color: var(--error); background: #ffdad64d; }
.password-change { width: 32px; height: 36px; }
.password-change .icon { width: 17px; height: 17px; }
.portal-main { max-width: 1280px; margin: auto; padding: 24px 12px; }
#portal-message { margin-bottom: 16px; }
.profile-banner { position: relative; background: radial-gradient(ellipse at 88% 0%, #d3e4fe66, transparent 48%), radial-gradient(ellipse at 65% 100%, #b3ebff4d, transparent 35%), white; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px; border: 1px solid #c1c6d533; border-radius: 8px; box-shadow: 0 1px 3px #0000000d; margin-bottom: 24px; }
.customer-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-mark-wrap { position: relative; flex-shrink: 0; }
.profile-mark { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: #dce9ff; color: var(--primary); border-radius: 8px; box-shadow: 0 1px 3px #0000000d; }
.profile-mark .icon { width: 32px; height: 32px; }
.customer-tier { position: absolute; bottom: -4px; right: -4px; padding: 3px 5px; border-radius: 12px; background: #883700; color: white; font-size: 11px; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.customer-copy { min-width: 0; }
.profile-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile-title h1 { overflow-wrap: anywhere; font-size: 22px; line-height: 28px; letter-spacing: -.22px; }
.customer-level { padding: 3px 8px; background: #e5eeff; color: var(--primary); font-size: 12px; line-height: 16px; font-weight: 600; border-radius: 12px; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin-top: 4px; font-size: 13px; color: #414753; }
.profile-meta > span, .profile-address { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta .icon { width: 16px; height: 16px; color: var(--green); }
.profile-meta .customer-owner { color: var(--text); font-size: 14px; font-weight: 600; }
.customer-owner .icon { width: 18px; height: 18px; color: var(--primary); }
#customer-tax-wrap .icon, #customer-code-wrap .icon { color: #727784; }
.profile-address { color: #414753; font-size: 12px; line-height: 16px; margin-top: 3px; }
.profile-address .icon { width: 16px; height: 16px; color: #727784; }
.profile-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding-left: 24px; border-left: 1px solid #c1c6d54d; }
.profile-actions > .button { padding-right: 16px; padding-left: 16px; background: var(--primary); border-color: var(--primary); }
.support-actions { display: flex; gap: 4px; }
.support-actions .button { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.support-actions .button:first-child { flex: 1; background: #e5eeff; color: var(--text); }
.button-support { color: var(--green); background: #eff4ff; border-color: #c1c6d533; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary-card { position: relative; min-width: 0; padding: 16px 16px 16px 20px; border-radius: 8px; background: white; box-shadow: 0 1px 3px #0000000d; overflow: hidden; }
.purchase-card::before, .paid-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--primary); }
.paid-card::before { background: var(--green); }
.summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #414753; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.metric-icon { color: var(--primary); width: 32px; height: 32px; border-radius: 12px; background: #d3e4fe; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-icon .icon { width: 18px; height: 18px; }
.metric-value { font-size: 20px; font-weight: 700; line-height: 24px; display: block; margin: 12px 0 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.currency-unit { font-size: 12px; font-weight: 400; color: #414753; }
.debt-card .currency-unit { color: #dfe8ff; }
.summary-card p { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--primary); }
.summary-card p .icon { width: 16px; height: 16px; }
.paid-card .metric-icon { background: #b3ebff66; color: var(--green); }
.paid-card p { color: var(--green); }
.debt-card { color: white; background: var(--blue); padding-left: 16px; box-shadow: 0 4px 6px #0000001a; }
.debt-card .summary-heading, .debt-card p { color: #dfe8ff; }
.debt-card .metric-icon { color: white; background: #ffffff33; }
.history-section { border-radius: 8px; background: white; box-shadow: 0 1px 3px #0000000d; }
.history-tabs { display: flex; align-items: flex-end; background: #eff4ff; padding: 12px 16px 0; gap: 8px; border-radius: 8px 8px 0 0; }
.history-tab { display: flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 4px 4px 0 0; color: #414753; background: transparent; padding: 8px 16px; font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.history-tab > .icon { width: 18px; height: 18px; }
.history-tab:hover { background: #e5eeff; }
.history-tab[aria-selected="true"] { color: var(--primary); background: white; box-shadow: 0 1px 3px #0000000d; }
.tab-count { margin-left: 4px; font-size: 11px; font-weight: 600; background: #d3e4fe; color: var(--primary); border-radius: 12px; padding: 2px 8px; min-width: 23px; line-height: 14px; }
.history-body { padding: 16px; }
.filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 8px; background: #eff4ff; }
.search-filters { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.search-field { display: flex; align-items: center; gap: 8px; border: 1px solid #c1c6d533; background: white; border-radius: 4px; padding: 0 12px; min-width: 260px; width: 260px; box-shadow: 0 1px 3px #0000000d; }
.search-field > .icon { color: #727784; width: 18px; height: 18px; }
.search-field input { width: 100%; min-width: 0; height: 34px; padding: 8px 0; border: 0; background: transparent; color: var(--text); outline: none; font-size: 12px; }
.search-field:focus-within { border-color: #74a6da; box-shadow: 0 0 0 2px #0066cc15; }
.filter-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.filter-chip { height: 36px; padding: 0 12px; border: 0; border-radius: 4px; background: #e5eeff; color: var(--text); font-size: 11px; font-weight: 600; white-space: nowrap; }
.filter-chip:hover { background: #dce9ff; }
.filter-chip[aria-pressed="true"] { background: var(--primary); color: white; }
.date-controls { position: relative; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.date-range-button { display: flex; align-items: center; gap: 4px; padding: 0 10px; height: 36px; border: 1px solid #c1c6d533; border-radius: 4px; background: white; color: var(--text); box-shadow: 0 1px 3px #0000000d; white-space: nowrap; font-size: 12px; }
.date-range-button > .icon:first-child { width: 18px; height: 18px; color: var(--primary); }
.range-prefix { font-size: 11px; color: #414753; }
#date-preset { height: 36px; max-width: 135px; border: 1px solid #c1c6d533; border-radius: 4px; background: white; color: var(--text); padding: 0 8px; font-size: 12px; box-shadow: 0 1px 3px #0000000d; }
.refresh-button { width: 32px; height: 36px; color: var(--primary); }
.refresh-button .icon { width: 17px; height: 17px; }
.date-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 10; width: 330px; max-width: calc(100vw - 48px); padding: 12px; border: 1px solid #dce5f2; border-radius: 8px; background: white; box-shadow: 0 10px 35px #17365e26; }
.popover-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.popover-heading .icon-button { width: 25px; height: 25px; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compact-field { gap: 5px; }
.compact-field label { font-size: 11px; color: #414753; }
.compact-field input { width: 100%; height: 36px; border: 1px solid #dce5f2; border-radius: 4px; background: white; color: var(--text); padding: 6px 8px; font-size: 12px; }
.date-popover .form-message { margin-top: 12px; }
.date-apply { width: 100%; margin-top: 12px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; margin: 6px 0; }
.result-count { font-size: 11px; color: #727784; }
.csv-button { min-height: 28px; padding: 3px 0 3px 8px; background: transparent; color: var(--primary); font-size: 11px; }
.csv-button .icon { width: 15px; height: 15px; }
.order-list { display: grid; gap: 12px; }
.order-card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px #0000000d; }
.order-overview { padding: 16px; display: flex; align-items: center; gap: 12px; background: #eff4ff; }
.order-overview:hover { background: #e5eeff99; }
.order-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #004e9f1a; color: var(--primary); flex-shrink: 0; }
.order-icon.has-debt { background: #50d9fe4d; color: #005c70; }
.order-description { min-width: 0; flex: 1; }
.order-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.order-code { color: var(--primary); font-size: 15px; line-height: 20px; font-weight: 700; overflow-wrap: anywhere; }
.order-date { color: #414753; background: #dce9ff; padding: 2px 5px; border-radius: 12px; font-size: 11px; line-height: 14px; }
.status-badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 11px; line-height: 14px; font-weight: 600; border-radius: 12px; background: #d3e4fe; color: var(--primary); }
.status-badge.debt-badge { background: #dce9ff; color: var(--text); }
.status-badge.neutral-badge { background: #e5eeff; color: #414753; }
.order-financials { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.order-total, .order-paid { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.order-total > span, .order-paid > span { color: #414753; font-size: 11px; line-height: 14px; }
.order-total strong { font-size: 20px; line-height: 24px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-paid { min-width: 140px; }
.order-paid strong { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--green); white-space: nowrap; }
.order-paid .debt-text { color: var(--error); font-size: 12px; font-weight: 600; }
.detail-toggle { flex-shrink: 0; width: 32px; min-height: 32px; height: 32px; border-radius: 12px; background: #e5eeff; padding: 0; color: var(--text); }
.detail-toggle .icon { transition: transform .15s; width: 20px; height: 20px; }
.detail-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.order-details { border-top: 1px solid #c1c6d533; background: white; padding: 16px; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-heading strong { display: flex; align-items: center; gap: 4px; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.detail-heading .icon { color: var(--primary); width: 18px; height: 18px; }
.detail-heading > span { color: #414753; font-size: 12px; white-space: nowrap; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; color: #414753; background: #eff4ff; border-radius: 8px; font-size: 12px; }
.detail-payment { display: inline-flex; align-items: center; gap: 4px; }
.detail-payment .icon { color: var(--green); width: 16px; height: 16px; }
.detail-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions .button { min-height: 32px; padding: 5px 12px; }
.table-scroll { overflow-x: auto; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; background: #eff4ff; color: #414753; font-size: 11px; font-weight: 600; text-transform: uppercase; white-space: nowrap; padding: 8px 12px; }
td { padding: 12px; border-top: 1px solid #c1c6d51a; vertical-align: middle; }
tbody tr:hover { background: #eff4ff66; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.detail-table .numeric, .detail-table .center { font-size: 13px; font-weight: 600; }
.detail-table td:last-child { font-size: 15px; }
.item-name { min-width: 230px; }
.item-name strong { display: block; font-size: 15px; line-height: 20px; font-weight: 600; }
.item-name small { display: block; margin-top: 3px; color: #414753; font-size: 12px; line-height: 16px; }
.item-name .gift-label { color: var(--green); font-size: 11px; }
.payment-table th { padding-top: 12px; padding-bottom: 12px; }
.payment-code { color: var(--primary); font-size: 13px; font-weight: 700; }
.payment-method { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; }
.payment-method .icon { width: 16px; height: 16px; color: var(--green); }
.payment-source { display: block; color: #414753; font-size: 12px; margin-top: 3px; }
.payment-amount { color: var(--green); font-size: 15px; font-weight: 700; }
.payment-orders { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.payment-orders span { background: #e5eeff; color: var(--primary); font-size: 13px; font-weight: 600; padding: 2px 4px; border-radius: 2px; }
.data-state, .empty-state { text-align: center; padding: 38px 15px; color: var(--muted); background: #f8f9ff; border: 1px dashed #dce5f3; border-radius: 8px; }
.data-state .spinner { margin-bottom: 10px; }
.data-state strong, .empty-state strong { display: block; color: #3f536f; margin-bottom: 6px; font-size: 14px; }
.data-state p, .empty-state p { font-size: 12px; }
.data-state .button { margin-top: 14px; }
.empty-state > .icon { width: 31px; height: 31px; color: #95abc5; margin-bottom: 11px; }
.detail-loading, .detail-error { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.detail-loading .spinner { width: 17px; height: 17px; margin-right: 8px; }
.detail-error .button { margin-left: 10px; }
.partial-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 16px; padding: 10px 12px; background: #fff8eb; color: #795a26; border-radius: 4px; font-size: 12px; }
.partial-note .icon { width: 17px; height: 17px; }
.portal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; font-size: 10px; color: #727784; }
.portal-footer > span:first-child { display: flex; align-items: center; gap: 4px; }
.portal-footer .icon { width: 12px; height: 12px; }
.profile-dialog { width: min(460px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 10px; padding: 22px; color: var(--text); box-shadow: 0 20px 70px #17365e25; }
.profile-dialog::backdrop { background: #0b1c3066; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 18px; }
.profile-definition { margin: 12px 0 0; }
.profile-definition > div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1f7; }
.profile-definition > div:last-child { border: 0; }
.profile-definition dt { font-size: 12px; color: var(--muted); }
.profile-definition dd { font-size: 13px; font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.dialog-description { font-size: 12px; margin-top: 8px; }
.dialog-form { display: grid; gap: 15px; margin-top: 22px; }
.dialog-form input { width: 100%; border: 1px solid #dce5f2; border-radius: 5px; background: #f8faff; padding: 10px 12px; color: var(--text); }
.print-view { display: none; }
.noscript { position: fixed; inset: 20px 20px auto; padding: 20px; background: white; border: 1px solid #e2bebe; color: var(--error); z-index: 100; }
@media (max-width: 1100px) {
  .brand { font-size: 15px; }
  .header-actions { gap: 8px; }
  .filter-toolbar { align-items: stretch; flex-direction: column; }
  .search-filters { justify-content: space-between; }
  .search-field { flex: 1; }
  .date-controls { justify-content: flex-end; }
  .order-overview { flex-wrap: wrap; }
  .order-description { flex-basis: calc(100% - 60px); }
  .order-financials { flex: 1; justify-content: space-between; padding-left: 52px; }
  .order-total, .order-paid { text-align: left; }
  .order-paid { min-width: 0; }
}
@media (max-width: 767px) {
  .brand { font-size: 12px; gap: 8px; }
  .brand-break { display: block; }
  .user-copy { display: none; }
  .user-button { padding: 4px; }
  .header-actions { gap: 6px; }
  .portal-main { padding-top: 16px; }
  .profile-banner { align-items: stretch; flex-direction: column; gap: 16px; }
  .profile-actions { padding-left: 0; border: 0; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .profile-actions > .button { padding-right: 10px; padding-left: 10px; }
  .summary-grid { gap: 10px; }
  .summary-card { padding: 14px 12px 14px 16px; }
  .summary-heading { font-size: 10px; letter-spacing: .3px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-icon .icon { width: 16px; height: 16px; }
  .metric-value { font-size: 18px; }
  .summary-card p { font-size: 11px; align-items: flex-start; }
  .history-tabs { padding: 10px 8px 0; gap: 4px; }
  .history-tab { flex: 1; padding: 8px; font-size: 12px; white-space: normal; }
  .history-tab > .icon { width: 17px; height: 17px; }
  .history-body { padding: 12px; }
  .filter-toolbar { padding: 10px; }
  .search-filters { gap: 8px; }
  .search-field { flex: 1 1 100%; min-width: 0; width: 100%; }
  .date-controls { justify-content: space-between; }
  .date-range-button { min-width: 0; flex: 1; white-space: normal; text-align: left; padding: 0 7px; }
  .date-range-button strong { font-size: 11px; }
  .range-prefix { display: none; }
  #date-preset { max-width: 125px; }
  .table-scroll > .payment-table { min-width: 850px; }
  .order-title { gap: 5px; }
  .order-code { font-size: 14px; }
  .order-total strong { font-size: 18px; }
  .order-paid strong { font-size: 13px; }
  .detail-heading { align-items: flex-start; }
  .detail-heading strong { font-size: 11px; }
}
@media (max-width: 480px) {
  .centered-view { padding: 28px 16px; }
  .auth-heading h1 { font-size: 19px; }
  .auth-heading p { font-size: 11px; }
  .auth-card { padding: 26px 20px 22px; }
  .login-submit { font-size: 11px; }
  .brand { font-size: 11px; }
  .brand .brand-mark { width: 32px; height: 32px; }
  .logout-button { width: 32px; min-height: 34px; padding: 0; }
  .logout-button span { display: none; }
  .password-change { width: 26px; }
  .profile-banner { padding: 16px 12px; margin-bottom: 16px; }
  .customer-block { align-items: flex-start; gap: 12px; }
  .profile-mark { width: 56px; height: 56px; }
  .profile-mark .icon { width: 29px; height: 29px; }
  .profile-title h1 { font-size: 20px; line-height: 26px; }
  .profile-meta { font-size: 12px; gap: 5px 8px; }
  .profile-address { align-items: flex-start; line-height: 18px; }
  .profile-address .icon { margin-top: 1px; }
  .profile-actions { flex-direction: column; align-items: stretch; }
  .summary-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
  .summary-card { padding: 16px 16px 16px 20px; }
  .summary-heading { font-size: 12px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric-value { font-size: 20px; }
  .summary-card p { font-size: 12px; }
  .history-tab { font-size: 11px; padding: 8px 5px; }
  .tab-count { padding: 2px 5px; margin-left: 1px; }
  .history-body { padding: 12px 8px; }
  .filter-chip { padding: 0 10px; }
  .date-controls { flex-wrap: wrap; }
  .date-range-button { flex-basis: calc(100% - 40px); }
  #date-preset { order: 3; width: 100%; max-width: none; }
  .date-popover { top: calc(100% + 6px); max-width: calc(100vw - 68px); }
  .order-overview { gap: 10px; padding: 12px; }
  .order-icon { width: 36px; height: 36px; }
  .order-description { flex-basis: calc(100% - 48px); }
  .order-financials { padding-left: 0; gap: 10px; }
  .order-total strong { font-size: 17px; }
  .order-paid strong { font-size: 12px; }
  .order-paid .debt-text { font-size: 11px; }
  .order-details { padding: 12px; }
  .portal-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  @page { size: A4 landscape; margin: 13mm; }
  body { color: #111; background: white; font-size: 10px; }
  body > :not(.print-view) { display: none !important; }
  .print-view { display: block; }
  .print-view h1 { font-size: 21px; margin-bottom: 5px; }
  .print-view h2 { font-size: 15px; margin: 20px 0 8px; }
  .print-view p { font-size: 10px; margin: 3px 0; }
  .print-view .print-summary { display: flex; gap: 25px; border-top: 1px solid #aaa; border-bottom: 1px solid #aaa; margin: 14px 0; padding: 9px 0; }
  .print-view .print-summary p { display: flex; flex-direction: column; gap: 3px; }
  .print-view .print-summary strong { font-size: 14px; }
  .print-view table { font-size: 9px; }
  .print-view th { padding: 7px; font-size: 9px; background: #f3f3f3; color: #333; border-bottom: 1px solid #aaa; }
  .print-view td { padding: 8px 7px; border-bottom: 1px solid #ddd; }
  .print-view thead { display: table-header-group; }
  .print-view tr { break-inside: avoid; }
  .print-view .print-footer { margin-top: 15px; color: #555; }
}
