:root {
    --ink: #211f1d;
    --ink-strong: #1a1816;
    --muted: #756e66;
    --cream: #f4f0e8;
    --paper: #fffaf1;
    --paper-solid: #fffdf9;
    --bronze: #8d6642;
    --bronze-dark: #6e4c2f;
    --olive: #3a4a3a;
    --green: #2f7253;
    --amber: #b97828;
    --line: #ded4c5;
    --shadow: 0 22px 60px rgba(35, 29, 23, 0.13);
    --heading: "Outfit", "Hanken Grotesk", Arial, sans-serif;
    --body: "Hanken Grotesk", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); font-family: var(--body); background: var(--cream); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.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; }
.eyebrow { margin: 0 0 10px; color: var(--bronze); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.primary-button, .secondary-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--ink-strong); border-radius: 6px; padding: 0 21px; font-family: var(--heading); font-weight: 700; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.primary-button { color: var(--paper); background: var(--ink-strong); }
.secondary-button { color: var(--ink); background: transparent; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(33, 31, 29, .12); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.text-button { border: 0; padding: 0; color: var(--bronze-dark); font-weight: 700; background: none; cursor: pointer; }
.icon-button { display: inline-grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }

/* Login */
.login-shell { min-height: 100vh; }
.login-main { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 43%) 1fr; background: linear-gradient(145deg, #fffaf1 0%, #f4f0e8 62%, #e7dfd2 100%); }
.login-panel { display: grid; align-items: center; padding: clamp(32px, 6vw, 92px); position: relative; z-index: 2; }
.login-panel-inner { width: min(100%, 480px); margin-inline: auto; animation: rise-in .7s cubic-bezier(.2,.8,.2,1) both; }
.brand-link { display: inline-block; margin-bottom: clamp(56px, 9vh, 96px); }
.brand-link img { display: block; width: 122px; height: auto; }
.login-heading h1 { margin: 0; font-family: var(--heading); font-size: clamp(2.8rem, 5vw, 4.8rem); font-weight: 800; letter-spacing: 0; line-height: .95; }
.login-heading > p:last-child { max-width: 420px; margin: 20px 0 34px; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.login-fields { display: grid; gap: 20px; }
.field-group label { display: block; margin-bottom: 8px; color: #453f39; font-size: .9rem; font-weight: 700; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.field-label-row .text-button { font-size: .82rem; }
.input-wrap { min-height: 58px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; border: 1px solid #cfc3b4; border-radius: 6px; padding: 0 9px 0 15px; background: rgba(255, 253, 249, .82); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.input-wrap:focus-within { border-color: var(--bronze); background: var(--paper-solid); box-shadow: 0 0 0 4px rgba(141, 102, 66, .13); }
.input-wrap > i { color: var(--bronze); font-size: 1.1rem; }
.input-wrap input { width: 100%; height: 54px; border: 0; outline: 0; color: var(--ink); font-size: 1rem; font-weight: 600; background: transparent; }
.input-wrap input::placeholder { color: #a39a91; font-weight: 500; }
.password-toggle { width: 40px; height: 40px; color: var(--muted); }
.login-button { width: 100%; margin-top: 28px; border-radius: 999px; box-shadow: 0 12px 30px rgba(26, 24, 22, .18); }
.login-support { margin: 30px 0 0; color: var(--muted); text-align: center; }
.login-support a { color: var(--ink); font-weight: 700; text-decoration-color: var(--bronze); text-underline-offset: 4px; }
.local-demo-note, .alert-message { display: flex; align-items: center; gap: 10px; border-radius: 6px; padding: 12px 14px; font-size: .87rem; font-weight: 650; }
.local-demo-note { margin-top: 18px; color: #315d48; background: #e3eee8; }
.alert-message { margin: 0 0 20px; color: #8a331e; background: #f8e4dc; }
.login-visual { min-height: 100vh; position: relative; overflow: hidden; background: #302c27 url("assets/customer-portal-hero.jpg") center / cover no-repeat; }
.login-visual-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(26,24,22,.75), rgba(26,24,22,.24) 58%, rgba(58,74,58,.16)), linear-gradient(0deg, rgba(26,24,22,.68), transparent 55%); }
.login-visual-copy { position: absolute; right: clamp(28px, 5vw, 82px); bottom: clamp(36px, 7vh, 88px); left: clamp(28px, 5vw, 82px); max-width: 720px; color: var(--paper); animation: rise-in .8s .15s cubic-bezier(.2,.8,.2,1) both; }
.login-visual-copy h2 { max-width: 700px; margin: 22px 0 26px; font-family: var(--heading); font-size: clamp(2.4rem, 5vw, 5.8rem); font-weight: 800; line-height: .98; }
.secure-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 8px 13px; color: var(--paper); font-size: .82rem; font-weight: 700; background: rgba(26,24,22,.24); backdrop-filter: blur(10px); }
.visual-points { display: flex; flex-wrap: wrap; gap: 12px 24px; color: rgba(255,250,241,.88); font-weight: 650; }
.visual-points span { display: inline-flex; align-items: center; gap: 7px; }
.visual-points i { color: #d3bb95; }

/* Portal */
.portal-page { background: linear-gradient(180deg, #faf6ef 0, #f4f0e8 44%, #efe8de 100%); }
.portal-shell { min-height: 100vh; padding-bottom: 40px; }
.portal-header { position: sticky; top: 0; z-index: 30; min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; border-bottom: 1px solid rgba(222,212,197,.85); padding: 0 clamp(20px, 3.5vw, 58px); background: rgba(255,250,241,.9); backdrop-filter: blur(16px); box-shadow: 0 10px 32px rgba(35,29,23,.05); }
.portal-brand { display: flex; align-items: center; gap: 14px; justify-self: start; text-decoration: none; }
.portal-brand img { width: 105px; height: auto; display: block; }
.portal-brand span { border-left: 1px solid var(--line); padding-left: 14px; color: var(--muted); font-family: var(--heading); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.desktop-nav { display: flex; gap: 4px; }
.nav-button { position: relative; border: 0; padding: 28px 14px 25px; color: #635c55; font-weight: 700; background: none; cursor: pointer; }
.nav-button::after { content: ""; position: absolute; right: 14px; bottom: 18px; left: 14px; height: 2px; border-radius: 999px; background: var(--bronze); transform: scaleX(0); transition: transform .2s ease; }
.nav-button.is-active { color: var(--ink); }
.nav-button.is-active::after { transform: scaleX(1); }
.account-menu { position: relative; justify-self: end; }
.account-button { min-height: 48px; display: flex; align-items: center; gap: 10px; border: 0; padding: 4px 6px; background: none; cursor: pointer; }
.account-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--paper); font-size: .76rem; font-weight: 800; background: var(--olive); }
.account-name { font-weight: 750; }
.account-popover { position: absolute; top: calc(100% + 8px); right: 0; width: 220px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--paper-solid); box-shadow: var(--shadow); animation: pop-in .18s ease-out both; }
.account-popover span { color: var(--muted); font-size: .85rem; }
.logout-link { display: flex; gap: 8px; align-items: center; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px; color: var(--ink); font-weight: 700; text-decoration: none; }
.portal-main { width: min(1500px, calc(100% - 40px)); margin: 0 auto; }
.welcome-band { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: clamp(38px, 6vw, 78px) 0 34px; animation: rise-in .55s ease-out both; }
.welcome-band h1 { margin: 0; font-family: var(--heading); font-size: clamp(2.1rem, 4vw, 4rem); font-weight: 800; line-height: 1; }
.welcome-band > div > p:last-child { margin: 14px 0 0; color: var(--muted); font-size: 1.05rem; }
.welcome-date { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; font-weight: 650; white-space: nowrap; }
.welcome-actions { display: flex; align-items: center; gap: 18px; }
.insights-link { min-height: 42px; text-decoration: none; }
.quote-link { text-decoration: none; }
.account-team-strip { display: grid; grid-template-columns: minmax(190px,.85fr) repeat(3,minmax(0,1fr)); align-items: stretch; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: rgba(255,253,249,.76); box-shadow: 0 8px 24px rgba(35,29,23,.035); animation: rise-in .5s ease-out both; }
.account-team-title, .account-team-member { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.account-team-title { background: rgba(235,225,211,.5); }
.account-team-member { border-left: 1px solid var(--line); }
.account-team-title > span:last-child, .account-team-member > span:last-child { min-width: 0; display: grid; gap: 2px; }
.account-team-title small, .account-team-member small { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.account-team-title strong, .account-team-member strong { overflow: hidden; font-family: var(--heading); font-size: .92rem; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.account-team-title-icon, .account-team-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; }
.account-team-title-icon { color: #704b2d; background: #eadbcb; }
.account-team-icon { color: #2b6549; background: #dfece4; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.summary-card { min-width: 0; min-height: 132px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 8px; padding: 22px; text-align: left; background: rgba(255,253,249,.82); box-shadow: 0 10px 28px rgba(35,29,23,.04); animation: rise-in .55s ease-out both; }
button.summary-card { cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
button.summary-card:hover { transform: translateY(-2px); border-color: #b9a994; box-shadow: 0 14px 32px rgba(35,29,23,.08); }
.summary-card:nth-child(2) { animation-delay: .06s; }
.summary-card:nth-child(3) { animation-delay: .12s; }
.summary-card:nth-child(4) { animation-delay: .18s; }
.summary-card > span:nth-child(2) { min-width: 0; display: grid; }
.summary-card small { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.summary-card strong { margin: 2px 0; overflow: hidden; font-family: var(--heading); font-size: 1.65rem; text-overflow: ellipsis; white-space: nowrap; }
.summary-card em { overflow: hidden; color: var(--muted); font-size: .82rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.summary-card > i { color: #a89c8f; }
.summary-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; font-size: 1.12rem; }
.summary-icon.amber { color: #7b501f; background: #f2dfc3; }
.summary-icon.green { color: #2b6549; background: #dfece4; }
.summary-icon.charcoal { color: var(--paper); background: var(--ink-strong); }
.summary-icon.bronze { color: #704b2d; background: #eadbcb; }
.summary-icon.blue { color: #2e586b; background: #dceaf0; }
.summary-icon.red { color: #a72121; background: #f7dede; }
.summary-card.in-progress-card { border-color: #e7b3b3; background: rgba(255,242,240,.92); }
.summary-card.in-progress-card strong { color: #ae2020; }
.summary-card.follow-on-card { border-color: #efaaa5; background: rgba(255,240,239,.96); }
.summary-card.follow-on-card strong { color: #b72c25; }
.summary-card.follow-on-card .summary-icon { color: #b72c25; background: #ffd9d6; }
.smart-data-status { margin: 6px 0 0; color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: .05em; }
.jobs-section { margin-top: 48px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-family: var(--heading); font-size: clamp(1.8rem, 3vw, 2.5rem); }
.job-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.job-search-row { min-width: 0; display: flex; flex: 1 1 auto; align-items: center; gap: 14px; }
.search-control { width: min(440px, 100%); min-height: 50px; display: grid; grid-template-columns: 30px 1fr; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 0 16px; background: var(--paper-solid); }
.search-control:focus-within { border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(141,102,66,.1); }
.search-control i { color: var(--bronze); }
.search-control input { width: 100%; height: 48px; border: 0; outline: 0; background: transparent; }
.filter-tabs { display: flex; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: rgba(255,253,249,.7); }
.filter-button { min-height: 40px; border: 0; border-radius: 4px; padding: 0 12px; color: var(--muted); font-size: .86rem; font-weight: 700; background: transparent; cursor: pointer; }
.filter-button span { display: inline-grid; min-width: 22px; height: 22px; place-items: center; margin-left: 4px; border-radius: 50%; font-size: .7rem; background: #eee7dc; }
.filter-button.is-active { color: var(--paper); background: var(--ink-strong); }
.filter-button.is-active span { color: var(--ink); background: var(--paper); }
.dispatch-follow-filters { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.dispatch-follow-filters[hidden] { display: none; }
.dispatch-follow-filters label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: .78rem; font-weight: 750; cursor: pointer; }
.dispatch-follow-filters input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink-strong); }
.job-list { display: grid; gap: 8px; }
.job-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: rgba(255,253,249,.88); box-shadow: 0 8px 22px rgba(35,29,23,.035); transition: border-color .2s ease, box-shadow .2s ease; animation: rise-in .45s ease-out both; }
.job-card:hover, .job-card.is-open { border-color: #b7a892; box-shadow: 0 12px 30px rgba(35,29,23,.075); }
.job-card.has-follow-on { border-color: #efb1ad; background: #fff1f0; }
.job-card.has-follow-on:hover, .job-card.has-follow-on.is-open { border-color: #d85e58; box-shadow: 0 12px 30px rgba(183,44,37,.11); }
.job-card.has-follow-on .job-details { background: #fff7f6; }
.job-card:focus-visible { outline: 3px solid rgba(141,102,66,.25); outline-offset: 2px; }
.job-main { min-height: 86px; display: grid; grid-template-columns: 1.25fr 2fr 1fr .9fr 1.25fr 38px; align-items: center; gap: 18px; padding: 14px 18px; cursor: pointer; text-transform: uppercase; }
.job-card[data-kind="order"] .job-main,
.job-card[data-kind="dispatched"] .job-main { grid-template-columns: 1.15fr 1.7fr .85fr .85fr .75fr .55fr 1.05fr 38px; }
.job-card[data-awaiting="true"] .job-main { grid-template-columns: 1.2fr 1.8fr .9fr .9fr .85fr 1.15fr 38px; }
.job-reference { display: flex; align-items: center; gap: 12px; }
.job-reference > div, .job-customer, .job-date, .job-est-delivery, .job-value, .job-units { min-width: 0; display: grid; gap: 2px; }
.job-reference small, .job-date small, .job-est-delivery small, .job-value small, .job-units small { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.job-reference strong, .job-customer strong, .job-date strong, .job-est-delivery strong, .job-value strong, .job-units strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-customer span { overflow: hidden; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.type-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 6px; }
.type-icon.quote { color: #704b2d; background: #f1e1ce; }
.type-icon.order { color: #2e6149; background: #deece3; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; width: fit-content; border-radius: 999px; padding: 8px 10px; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.attention { color: #815313; background: #f7e7c8; }
.status-pill.neutral { color: #675c52; background: #eee7de; }
.status-pill.dispatch { color: #294e61; background: #dceaf0; }
.status-pill.progress { color: #2c644a; background: #dcece2; }
.status-pill.complete { color: #53604e; background: #e5eadf; }
.status-pill.follow-on { color: #b72c25; background: #ffdeda; }
.row-action { width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.job-card.is-open .row-action { transform: rotate(90deg); background: #eee6dc; }
.job-details { border-top: 1px solid var(--line); padding: 14px 18px 16px 58px; background: rgba(244,240,232,.54); text-transform: uppercase; animation: details-in .28s ease-out both; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)) auto; gap: 20px; align-items: center; }
.dispatch-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px 24px; align-items: end; }
.dispatch-detail-grid .detail-actions { grid-column: 4; }
.order-detail-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.order-detail-item { min-height: 56px; display: grid; align-content: center; gap: 3px; border: 1px solid #ded7cd; border-radius: 6px; padding: 9px 12px; background: rgba(255,255,255,.54); }
.order-detail-item small { color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.order-detail-item strong { font-size: .88rem; line-height: 1.25; }
.order-detail-wide { grid-column: 1 / -1; }
.order-detail-meta { min-height: 52px; }
.order-notes { white-space: pre-line; }
.connected-orders { margin-top: 8px; border: 1px solid #ded7cd; border-radius: 6px; padding: 10px 12px; background: rgba(255,255,255,.54); }
.connected-orders-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.connected-orders-heading h3 { margin: 0; font-family: var(--heading); font-size: .84rem; text-transform: uppercase; }
.connected-orders-heading .secondary-button { min-height: 32px; padding: 0 10px; font-size: .7rem; }
.connected-order-head, .connected-order-row { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(120px,.8fr) minmax(130px,.8fr); gap: 14px; align-items: center; }
.connected-order-head { padding: 0 10px 7px; color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.connected-order-row { min-height: 34px; border-top: 1px solid var(--line); padding: 6px 8px; font-size: .74rem; font-weight: 750; }
.connected-order-row.this-order { border: 2px solid #776b60; border-radius: 5px; background: #f6f1e9; }
.connected-order-row.following-later { border-radius: 5px; color: #b72c25; background: #ffdeda; }
.connected-order-empty { margin: 2px 10px 0; color: var(--muted); font-size: .78rem; }
.detail-block { display: grid; gap: 3px; }
.detail-block small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.detail-block span { color: var(--muted); font-size: .78rem; }
.detail-actions { display: flex; justify-content: end; gap: 8px; }
.detail-actions .primary-button, .detail-actions .secondary-button { min-height: 42px; padding: 0 14px; font-size: .84rem; }
.notes-panel { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(300px,1fr); gap: 22px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.notes-panel h3 { margin: 0 0 4px; font-family: var(--heading); font-size: .9rem; }
.notes-list { margin: 0; color: var(--muted); font-size: .84rem; }
.note-entry { min-height: 44px; display: grid; grid-template-columns: 1fr 42px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding-left: 13px; background: var(--paper-solid); }
.note-entry:focus-within { border-color: var(--bronze); }
.note-entry input { min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; }
.add-note { color: var(--paper); background: var(--ink); transform: scale(.82); }
.dispatch-progress { margin-bottom: 22px; }
.progress-line { display: grid; grid-template-columns: repeat(4,1fr); align-items: center; margin: 0 7%; }
.progress-line span { position: relative; height: 3px; background: #d7cec2; }
.progress-line span::before { content: ""; position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border: 3px solid var(--paper); border-radius: 50%; background: #c4baad; box-shadow: 0 0 0 1px #c4baad; transform: translate(-50%,-50%); }
.progress-line span:last-child::after { content: ""; position: absolute; top: 50%; right: 0; width: 12px; height: 12px; border: 3px solid var(--paper); border-radius: 50%; background: #c4baad; box-shadow: 0 0 0 1px #c4baad; transform: translate(50%,-50%); }
.progress-line .is-complete { background: var(--green); }
.progress-line .is-complete::before, .progress-line .is-complete:last-child::after { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.progress-line .is-active::before { background: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 0 0 5px rgba(185,120,40,.13); }
.progress-labels { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 12px; text-align: center; font-size: .75rem; font-weight: 700; }
.progress-labels span { display: grid; gap: 1px; }
.progress-labels small { color: var(--muted); font-weight: 500; }
.empty-state { border: 1px dashed #c8b9a6; border-radius: 8px; padding: 62px 20px; text-align: center; background: rgba(255,253,249,.45); }
.empty-state i { color: var(--bronze); font-size: 1.8rem; }
.empty-state h3 { margin: 13px 0 4px; font-family: var(--heading); }
.empty-state p { margin: 0; color: var(--muted); }
.mobile-nav { display: none; }

/* Modal and feedback */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(26,24,22,.62); backdrop-filter: blur(6px); animation: fade-in .18s ease both; }
.confirm-modal { position: relative; width: min(480px,100%); border-radius: 8px; padding: 34px; text-align: center; background: var(--paper-solid); box-shadow: 0 30px 80px rgba(0,0,0,.28); animation: modal-in .25s cubic-bezier(.2,.8,.2,1) both; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 22px; border-radius: 50%; color: #2f6c4f; font-size: 1.6rem; background: #dfece4; }
.confirm-modal h2 { margin: 0 0 12px; font-family: var(--heading); font-size: 2rem; }
.confirm-modal > p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.55; }
.confirm-check { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin: 24px 0; border: 1px solid var(--line); border-radius: 6px; padding: 14px; text-align: left; font-size: .9rem; cursor: pointer; }
.confirm-check input { width: 18px; height: 18px; accent-color: var(--green); }
.confirm-modal .modal-confirm { width: 100%; }
.confirm-modal .modal-cancel { margin-top: 18px; }
.toast-message { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; align-items: center; gap: 10px; border-radius: 6px; padding: 14px 18px; color: var(--paper); font-weight: 700; background: var(--ink); box-shadow: var(--shadow); animation: toast-in .25s ease-out both; }
.toast-message i { color: #a8d1b8; }

@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes details-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
    .account-team-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .account-team-title { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
    .account-team-member:nth-child(2) { border-left: 0; }
    .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .job-main { grid-template-columns: 1.2fr 1.8fr .9fr 1fr 38px; }
    .job-date { display: none; }
    .detail-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .order-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .detail-actions { grid-column: 1 / -1; justify-content: start; }
}

@media (max-width: 900px) {
    .login-main { grid-template-columns: 1fr; }
    .login-panel { min-height: 68vh; padding: 34px 24px 44px; }
    .brand-link { margin-bottom: 48px; }
    .login-visual { min-height: 360px; }
    .login-visual-copy h2 { font-size: clamp(2.4rem, 10vw, 4.4rem); }
    .portal-header { grid-template-columns: 1fr auto; min-height: 68px; padding-inline: 18px; }
    .desktop-nav { display: none; }
    .portal-brand img { width: 92px; }
    .portal-brand span { display: none; }
    .portal-main { width: min(100% - 28px, 1500px); }
    .job-controls { align-items: stretch; flex-direction: column; }
    .job-search-row { align-items: stretch; }
    .search-control { width: 100%; }
    .filter-tabs { overflow-x: auto; }
    .filter-button { flex: 0 0 auto; }
    .job-main { min-height: 0; grid-template-columns: 1fr auto; gap: 13px; padding: 17px; }
    .job-card[data-kind="order"] .job-main,
    .job-card[data-kind="dispatched"] .job-main { grid-template-columns: minmax(0,1fr) minmax(105px,auto) minmax(74px,auto); }
    .job-reference { grid-column: 1; }
    .job-customer { grid-column: 1; }
    .job-date { display: grid; grid-column: 1; }
    .job-value { grid-column: 2; grid-row: 1; text-align: right; }
    .job-card[data-kind="order"] .job-value,
    .job-card[data-kind="dispatched"] .job-value { grid-column: 3; grid-row: 1; }
    .job-card[data-kind="order"] .job-units,
    .job-card[data-kind="dispatched"] .job-units { grid-column: 2; grid-row: 2; text-align: right; }
    .job-card[data-kind="order"] .job-est-delivery,
    .job-card[data-kind="dispatched"] .job-est-delivery { grid-column: 2; grid-row: 1; }
    .job-status { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
    .job-card[data-kind="order"] .job-status,
    .job-card[data-kind="dispatched"] .job-status { grid-column: 3; grid-row: 2; }
    .row-action { grid-column: 2; grid-row: 4; justify-self: end; }
    .job-card[data-kind="order"] .row-action,
    .job-card[data-kind="dispatched"] .row-action { grid-column: 3; grid-row: 3; }
    .job-details { padding: 14px 16px; }
    .dispatch-detail-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .dispatch-detail-grid .detail-actions { grid-column: 3; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .order-detail-wide { grid-column: auto; }
    .notes-panel { grid-template-columns: 1fr; }
    .mobile-nav { position: fixed; right: 10px; bottom: 10px; left: 10px; z-index: 40; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid rgba(222,212,197,.9); border-radius: 8px; padding: 7px; background: rgba(255,250,241,.95); box-shadow: 0 16px 40px rgba(35,29,23,.18); backdrop-filter: blur(14px); }
    .mobile-nav button { min-height: 50px; display: grid; place-items: center; gap: 2px; border: 0; border-radius: 5px; color: var(--muted); font-size: .66rem; font-weight: 700; background: transparent; }
    .mobile-nav i { font-size: 1.05rem; }
    .mobile-nav button.is-active { color: var(--paper); background: var(--ink); }
    .portal-shell { padding-bottom: 90px; }
}

@media (max-width: 620px) {
    .login-panel { min-height: 100vh; align-items: start; }
    .login-panel-inner { padding-top: 8px; }
    .brand-link { margin-bottom: 46px; }
    .login-heading h1 { font-size: 3rem; }
    .login-heading > p:last-child { font-size: .98rem; }
    .login-visual { min-height: 330px; }
    .visual-points { display: grid; gap: 7px; }
    .account-name, .account-button > i { display: none; }
    .welcome-band { align-items: start; flex-direction: column; padding-top: 34px; }
    .welcome-band h1 { max-width: 330px; font-size: 2.4rem; }
    .welcome-actions { width: 100%; align-items: stretch; flex-direction: column; gap: 10px; }
    .welcome-actions .insights-link { width: 100%; }
    .welcome-actions .welcome-date { justify-content: center; }
    .account-team-strip { grid-template-columns: 1fr; }
    .account-team-title { grid-column: auto; }
    .account-team-member { border-top: 1px solid var(--line); border-left: 0; }
    .account-team-title, .account-team-member { padding: 13px 16px; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-card { min-height: 104px; padding: 17px; }
    .jobs-section { margin-top: 38px; }
    .section-heading { align-items: start; }
    .section-heading .secondary-button { width: 46px; min-height: 46px; padding: 0; }
    .section-heading .secondary-button { font-size: 0; }
    .section-heading .secondary-button i { font-size: 1rem; }
    .filter-tabs { margin-inline: -14px; border-right: 0; border-left: 0; border-radius: 0; padding-inline: 14px; }
    .job-main { grid-template-columns: minmax(0,1fr) auto; }
    .job-card[data-kind="order"] .job-main,
    .job-card[data-kind="dispatched"] .job-main { grid-template-columns: minmax(0,1fr) auto; }
    .job-customer span { white-space: normal; }
    .job-status { grid-column: 1 / -1; grid-row: auto; }
    .job-value { grid-row: 1; }
    .job-date { display: none; }
    .job-card[data-kind="order"] .job-date,
    .job-card[data-kind="dispatched"] .job-date { display: grid; grid-column: 1; grid-row: 3; }
    .job-card[data-kind="order"] .job-est-delivery,
    .job-card[data-kind="dispatched"] .job-est-delivery { grid-column: 2; grid-row: 3; }
    .job-card[data-kind="order"] .job-value,
    .job-card[data-kind="dispatched"] .job-value { grid-column: 2; grid-row: 1; }
    .job-card[data-kind="order"] .job-units,
    .job-card[data-kind="dispatched"] .job-units { grid-column: 2; grid-row: 2; text-align: right; }
    .job-card[data-kind="order"] .job-status,
    .job-card[data-kind="dispatched"] .job-status { grid-column: 1 / -1; grid-row: 4; }
    .job-card[data-kind="order"] .row-action,
    .job-card[data-kind="dispatched"] .row-action { grid-column: 2; grid-row: 4; }
    .row-action { grid-column: 2; grid-row: 3; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .job-search-row { flex-direction: column; }
    .dispatch-follow-filters { justify-content: flex-start; }
    .dispatch-detail-grid { grid-template-columns: 1fr 1fr; }
    .dispatch-detail-grid .detail-actions { grid-column: 1 / -1; justify-content: start; }
    .job-details { padding: 16px; }
    .connected-orders { padding: 12px; }
    .connected-orders-heading { align-items: stretch; flex-direction: column; }
    .connected-orders-heading .secondary-button { justify-content: center; }
    .connected-order-head, .connected-order-row { grid-template-columns: 1fr .8fr; gap: 8px; }
    .connected-order-head span:last-child { display: none; }
    .connected-order-row span:last-child { grid-column: 1 / -1; font-size: .7rem; }
    .detail-actions { grid-column: 1 / -1; display: grid; }
    .progress-labels { font-size: .62rem; }
    .progress-labels small { font-size: .6rem; }
    .confirm-modal { padding: 30px 22px 24px; }
    .toast-message { right: 12px; bottom: 82px; left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
