/* Vendor portal: calm, readable, built for people who work from orders all day. */
:root {
    --vp-primary: #0f766e;
    --vp-primary-dark: #115e59;
    --vp-bg: #f6f8f9;
    --vp-card: #ffffff;
    --vp-border: #e2e8f0;
    --vp-text: #0f172a;
    --vp-muted: #64748b;
    --vp-danger: #b91c1c;
    --vp-ok: #15803d;
}

html, body { margin: 0; font-family: "Source Sans 3", system-ui, sans-serif; color: var(--vp-text); background: var(--vp-bg); }

/* ---- sign-in pages (plain HTML, no scripts needed) */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 26rem; background: var(--vp-card); border: 1px solid var(--vp-border); border-radius: 16px; padding: 2rem; box-shadow: 0 8px 30px rgba(15, 23, 42, .06); }
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }
.auth-brand__mark, .portal-brand__mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--vp-primary); color: #fff; font-weight: 700; }
.auth-brand__text { font-weight: 700; font-size: 1.1rem; }
.auth-brand__text small, .portal-brand small { font-weight: 500; color: var(--vp-muted); margin-left: .25rem; }
.auth-card h1 { font-size: 1.5rem; margin: 0 0 .4rem; }
.auth-lead { color: var(--vp-muted); margin: 0 0 1.2rem; line-height: 1.5; }
.auth-field { display: block; margin-bottom: 1rem; }
.auth-field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.auth-field input { width: 100%; box-sizing: border-box; padding: .7rem .8rem; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }
.auth-field input:focus { outline: 2px solid var(--vp-primary); outline-offset: 1px; border-color: var(--vp-primary); }
.auth-field small { display: block; margin-top: .25rem; color: var(--vp-muted); }
.auth-error { color: var(--vp-danger); font-size: .85rem; display: block; margin-top: .25rem; }
.auth-button { width: 100%; padding: .8rem 1rem; border: 0; border-radius: 10px; background: var(--vp-primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.auth-button:hover { background: var(--vp-primary-dark); }
.auth-links { margin: 1.1rem 0 0; text-align: center; color: var(--vp-muted); }
.auth-links a { color: var(--vp-primary); }
.auth-alert { padding: .7rem .9rem; border-radius: 10px; margin: 0 0 1rem; line-height: 1.45; }
.auth-alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.auth-alert--ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.auth-foot { max-width: 26rem; text-align: center; color: var(--vp-muted); font-size: .85rem; margin-top: 1.2rem; }

/* ---- app shell */
.portal-appbar { background: var(--vp-primary) !important; }
.portal-brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.portal-brand small { color: rgba(255, 255, 255, .75); }
.portal-brand__mark { background: rgba(255, 255, 255, .18); }
.portal-user-name { color: #fff; font-weight: 600; margin-right: .9rem; }
.portal-signout { margin: 0; }
.portal-signout__btn { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; padding: .35rem .9rem; font: inherit; font-weight: 600; cursor: pointer; }
.portal-signout__btn:hover { background: rgba(255, 255, 255, .24); }
@media (max-width: 599px) { .portal-user-name { display: none; } }
.portal-main { background: var(--vp-bg); min-height: 100vh; }
.portal-loading, .portal-empty { padding: 3rem 1rem; text-align: center; color: var(--vp-muted); }

/* ---- page parts */
.portal-page-title { margin: 0 0 .25rem; font-size: 1.6rem; font-weight: 700; }
.portal-page-sub { margin: 0 0 1.25rem; color: var(--vp-muted); }
.portal-card { background: var(--vp-card); border: 1px solid var(--vp-border); border-radius: 14px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.portal-stat { display: flex; flex-direction: column; gap: .15rem; }
.portal-stat__value { font-size: clamp(1.4rem, 2.6vw, 2rem); white-space: nowrap; font-weight: 700; line-height: 1.1; }
.portal-stat__label { color: var(--vp-muted); font-size: .9rem; }
.portal-stat--alert .portal-stat__value { color: var(--vp-primary); }
.portal-muted { color: var(--vp-muted); }
.portal-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-row-link { cursor: pointer; }
.portal-row-link:hover { background: #f1f5f9; }
.portal-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .9rem 1.2rem; }
.portal-facts dt { color: var(--vp-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .15rem; }
.portal-facts dd { margin: 0; font-weight: 600; }
.portal-timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--vp-border); }
.portal-timeline li { position: relative; padding: 0 0 1rem 1.1rem; }
.portal-timeline li::before { content: ""; position: absolute; left: -.42rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--vp-border); border: 2px solid #fff; }
.portal-timeline li.vendor::before { background: var(--vp-primary); }
.portal-timeline li.branch::before { background: #475569; }
.portal-timeline .when { color: var(--vp-muted); font-size: .85rem; }
.portal-compare del { color: var(--vp-muted); margin-right: .35rem; }
.portal-compare ins { text-decoration: none; font-weight: 700; color: var(--vp-primary-dark); }

@media (max-width: 599px) {
    .auth-card { padding: 1.4rem; }
    .portal-page-title { font-size: 1.35rem; }
}

/* Branch pages: tabs, statement toolbar, ageing */
.portal-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--portal-line, #e2e8f0); margin: .5rem 0 1rem; }
.portal-tab { padding: .55rem .9rem; font-weight: 500; color: #475569; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.portal-tab:hover { color: #0f766e; }
.portal-tab-active { color: #0f766e; border-bottom-color: #0f766e; }
.portal-card-title { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; }
.portal-ageing { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem 1rem; }
.portal-ageing > div { display: flex; flex-direction: column; gap: .15rem; }
.portal-late { color: #b91c1c; }
.portal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.portal-toolbar .mud-input-control { max-width: 11rem; }
.portal-spacer { flex: 1 1 auto; }
.portal-link-button { display: inline-flex; align-items: center; padding: .4rem .9rem; border: 1px solid #0f766e; border-radius: 6px; color: #0f766e; font-weight: 500; text-decoration: none; }
.portal-link-button:hover { background: #f0fdfa; }
.portal-pager { display: flex; align-items: center; justify-content: space-between; padding-top: .75rem; }
.portal-card-link { display: inline-block; margin-top: .4rem; font-size: .875rem; font-weight: 500; color: #0f766e; }
