/* VICTOR Supply Chain — client portal and staff admin */
:root {
  --navy: #0A1F35;
  --navy-2: #12304f;
  --navy-3: #1b3d63;
  --red: #B8363A;
  --red-dark: #9a2b2f;
  --gold: #C9A048;
  --gold-soft: #e6d3a6;
  --cream: #F4F1EA;
  --paper: #FBFAF7;
  --white: #fff;
  --ink: #101b29;
  --text: #2a3646;
  --muted: #5f6b7a;
  --line: #dcd6ca;
  --line-soft: #ebe6dc;
  --green: #2f7d4f;
  --amber: #b7791f;
  --blue: #2d5f99;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(10, 31, 53, .06), 0 8px 24px rgba(10, 31, 53, .06);
  --head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--body); color: var(--text); background: var(--cream); }
a { color: var(--navy-3); }
a:hover { color: var(--red); }
img, svg { display: inline-block; vertical-align: middle; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 28px; height: 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font: 700 14px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: 2px; font: 700 15px/1 var(--head); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-3); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #b88f3a; color: var(--navy); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; min-height: 50px; font-size: 17px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-strong { color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy-3); text-decoration: underline; cursor: pointer; }

/* ---------- Forms ---------- */
.stack > * + * { margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-weight: 600; font-size: 14px; color: var(--ink); }
.req { color: var(--red); }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=url],
input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; background: #fff; border: 1px solid #c9c2b4; border-radius: 2px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230A1F35' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(201, 160, 72, .35); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input[type=file] { font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex: none; }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 12px; border: 0; border-radius: 2px;
  background: var(--cream); font-weight: 600; font-size: 13px; color: var(--ink); cursor: pointer; }
.pw-toggle:hover { background: var(--gold-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.fieldset legend { font: 700 15px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin-bottom: 14px; padding: 0; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 2px; border-left: 3px solid; margin: 0 0 16px; font-size: 14px; }
.alert .ic { margin-top: 1px; }
.alert-error { background: #fbeeee; border-color: var(--red); color: #7d2225; }
.alert-success { background: #edf6f0; border-color: var(--green); color: #20573a; }
.alert-info { background: #eef3f9; border-color: var(--blue); color: #1f4572; }
.alert-warning { background: #fdf5e6; border-color: var(--amber); color: #7a5214; }

/* ---------- Header pieces ---------- */
.brand { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; }
.brand img { height: 44px; width: auto; }
.brand-sep { width: 1px; height: 30px; background: rgba(255, 255, 255, .25); }
.brand-label { font: 700 19px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.btn-top { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .22); font-weight: 600; font-size: 15px; }
.btn-top:hover { color: #fff; border-color: var(--gold); }
.lang-menu { position: relative; }
.lang-menu summary { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; list-style: none; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-weight: 600; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary, .lang-menu summary:hover { border-color: var(--gold); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line-soft); }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--cream); }
.flag { display: inline-block; width: 20px; height: 14px; border-radius: 1px; flex: none; background-size: cover; }
.flag-vi { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='30' height='20' fill='%23da251d'/%3E%3Cpath fill='%23ff0' d='M15 4l1.76 5.4h5.68l-4.6 3.34 1.76 5.4L15 14.8l-4.6 3.34 1.76-5.4-4.6-3.34h5.68z'/%3E%3C/svg%3E"); }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='a'%3E%3Cpath d='M0 0v30h60V0z'/%3E%3C/clipPath%3E%3CclipPath id='b'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23a)'%3E%3Cpath d='M0 0v30h60V0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url(%23b)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E"); }

/* ---------- Sign-in pages ---------- */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { background: var(--navy); border-bottom: 4px solid var(--red); }
.auth-top-in, .auth-foot-in { max-width: 1440px; margin: 0 auto; padding: 14px clamp(16px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-tools { display: flex; gap: 10px; align-items: center; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(24px, 6vh, 72px) 16px; }
.auth-card { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 1080px; background: #fff; box-shadow: var(--shadow); }
.auth-card-narrow { grid-template-columns: 1fr; max-width: 640px; }
.auth-panel { position: relative; padding: clamp(32px, 5vw, 60px) clamp(26px, 4vw, 48px); color: #d9e1ea; border-left: 4px solid var(--red);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px),
    linear-gradient(160deg, #15355a 0%, var(--navy) 70%); }
.auth-headline { font: 700 clamp(38px, 4.2vw, 52px)/1.02 var(--head); text-transform: uppercase; letter-spacing: .01em; color: #fff; margin: 0 0 22px; }
.auth-lead { font-size: 17px; line-height: 1.65; color: #c8d3df; margin-bottom: 30px; }
.benefits { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 20px; }
.benefits li { display: flex; gap: 16px; align-items: flex-start; font-size: 16.5px; line-height: 1.5; color: #fff; }
.benefit-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid rgba(201, 160, 72, .45); color: var(--gold); }
.auth-secure { display: flex; gap: 12px; align-items: flex-start; padding-top: 22px; margin: 0; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 14px; color: #b3c0ce; }
.auth-secure .ic { margin-top: 3px; }
.auth-form { padding: clamp(32px, 5vw, 60px) clamp(24px, 4vw, 48px); }
.auth-form h2 { font: 700 34px/1.1 var(--body); letter-spacing: -.01em; margin-bottom: 10px; }
.auth-form > .muted { font-size: 16.5px; line-height: 1.6; margin-bottom: 28px; }
.auth-alt { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.auth-alt p { font-size: 16px; color: var(--muted); margin-bottom: 14px; }
.auth-back { margin-top: 22px; }
.auth-back a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 600; }
.err-code { font: 700 72px/1 var(--head); color: var(--gold); margin: 0 0 10px; }
.prose p { line-height: 1.7; }
.auth-foot { background: var(--navy); color: #c7d1dc; font-size: 14.5px; }
.auth-foot p { margin: 0; }
.auth-foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.auth-foot a { color: #fff; text-decoration: none; }
.auth-foot a:hover { color: var(--gold); }
.auth-foot-in { padding-top: 22px; padding-bottom: 22px; }

/* ---------- Client area ---------- */
.c-top { background: var(--navy); border-bottom: 4px solid var(--red); position: sticky; top: 0; z-index: 20; }
.c-top-in { max-width: 1280px; margin: 0 auto; padding: 12px clamp(16px, 3vw, 32px); display: flex; align-items: center; gap: 24px; }
.c-nav { display: flex; gap: 4px; flex: 1; }
.c-nav a { padding: 10px 14px; color: #cdd6e0; text-decoration: none; font: 600 16px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.c-nav a:hover { color: #fff; }
.c-nav a[aria-current] { color: #fff; border-color: var(--gold); }
.c-tools { display: flex; gap: 10px; align-items: center; }
.c-main { max-width: 1280px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 32px) 56px; }
.c-foot { background: var(--navy); color: #c7d1dc; font-size: 14px; }
.c-foot .auth-foot-in { max-width: 1280px; }
.c-foot a { color: #fff; text-decoration: none; }
.c-foot a:hover { text-decoration: underline; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; color: #fff; padding: 4px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .who { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; text-align: right; }
.user-menu .who b { font-size: 14px; }
.user-menu .who span { color: #aebccb; }
.user-menu ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.user-menu li a, .user-menu li button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; color: var(--ink); text-decoration: none; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.user-menu li a:hover, .user-menu li button:hover { background: var(--cream); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy); font: 700 15px/1 var(--head); letter-spacing: .03em; flex: none; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-navy { background: var(--navy-3); color: #fff; }

/* ---------- Staff admin ---------- */
.a-body { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--navy) 248px, var(--red) 248px 252px, #f5f3ee 252px); }
.a-side { background: var(--navy); color: #c9d3de; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 4px solid var(--red); }
.a-brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.a-brand img { height: 40px; }
.a-brand span { display: block; margin-top: 10px; font: 700 14px/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.a-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.a-nav .sec { font: 700 12px/1 var(--head); letter-spacing: .12em; text-transform: uppercase; color: #7f93a8; padding: 16px 12px 6px; }
.a-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: #d3dce6; text-decoration: none; font-weight: 500; font-size: 14.5px; border-left: 3px solid transparent; }
.a-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.a-nav a[aria-current] { background: rgba(201, 160, 72, .12); color: #fff; border-color: var(--gold); }
.a-nav a .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.a-side-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #7f93a8; }
.a-main { min-width: 0; display: flex; flex-direction: column; }
.a-top { display: flex; align-items: center; gap: 16px; padding: 12px clamp(16px, 2.5vw, 32px); background: #fff; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 15; }
.a-top .lang-menu summary { color: var(--ink); border-color: var(--line); height: 38px; }
.a-top .user-menu summary { color: var(--ink); }
.a-top .user-menu .who span { color: var(--muted); }
.a-search { flex: 1; max-width: 460px; position: relative; }
.a-search input { padding-left: 38px; min-height: 38px; background: #f7f5f0; border-color: var(--line-soft); }
.a-search .ic { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.a-menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--navy); }
.a-content { padding: 28px clamp(16px, 2.5vw, 32px) 48px; flex: 1; }
.lock-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px clamp(16px, 2.5vw, 32px); background: #fdf5e6; color: #7a5214; border-bottom: 1px solid #f0dcb4; font-size: 14px; }
.lock-banner b { color: #5c3d0c; }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font: 700 34px/1.05 var(--head); text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); }
.card { background: #fff; border: 1px solid var(--line-soft); box-shadow: 0 1px 2px rgba(10, 31, 53, .04); margin-bottom: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head h2, .card-head h3 { font: 700 18px/1.1 var(--head); text-transform: uppercase; letter-spacing: .05em; margin: 0; color: var(--navy); }
.card-body { padding: 20px; }
.card-body > :last-child { margin-bottom: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.cols-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: var(--gold); margin-bottom: 10px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line-soft); padding: 18px 20px; border-top: 3px solid var(--navy); text-decoration: none; color: inherit; display: block; }
.stat:hover { border-top-color: var(--gold); }
.stat .n { font: 700 40px/1 var(--head); color: var(--ink); }
.stat .l { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.stat.red { border-top-color: var(--red); }
.stat.red .n { color: var(--red); }
.stat.gold { border-top-color: var(--gold); }
.stat.green { border-top-color: var(--green); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 700 13px/1 var(--head); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf8f4; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf8; }
.table a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a.row-link:hover { color: var(--red); }
.table .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; border-radius: 20px; background: #eef0f3; color: #3c4858; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-new { background: #fdeceb; color: #a12c30; }
.b-review { background: #fdf5e6; color: #8a5a12; }
.b-work { background: #e9f0f8; color: #234f80; }
.b-quote { background: #f3edfa; color: #5b3a8a; }
.b-done { background: #e8f4ec; color: #22603d; }
.b-closed { background: #eef0f3; color: #5f6b7a; }
.b-hold { background: #f4f1ea; color: #6d6455; }
.p-urgent { background: var(--red); color: #fff; }
.p-high { background: #fdeceb; color: #a12c30; }
.p-normal { background: #eef0f3; color: #3c4858; }
.p-low { background: #f4f1ea; color: #6d6455; }
.tag-overdue { color: var(--red); font-weight: 600; font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); background: #fcfbf8; }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.filters input, .filters select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.filters label { font-size: 12.5px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font: 600 15px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--navy); border-color: var(--red); }
.tabs a .n { color: var(--muted); font-family: var(--body); font-size: 12px; margin-left: 4px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 20px; align-items: center; font-size: 13.5px; color: var(--muted); }
.pager a, .pager span.cur { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); text-decoration: none; color: var(--ink); padding: 0 8px; }
.pager span.cur { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Key/value */
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.timeline > li:last-child { border-bottom: 0; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.tl-meta b { color: var(--ink); font-size: 14px; }
.tl-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; color: var(--text); }
.tl-internal { background: #fdf8ec; margin: 0 -20px; padding-left: 20px !important; padding-right: 20px !important; }
.tl-internal .tl-meta::after { content: attr(data-internal); font-size: 11px; font-weight: 700; color: #8a5a12; background: #f6e7c4; padding: 1px 7px; border-radius: 10px; }
.tl-system { font-size: 13.5px; }
.tl-system .tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #f1eee7; color: var(--muted); margin-left: 4px; }
.tl-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); font-size: 13px; text-decoration: none; color: var(--ink); background: #fff; }
.file-chip:hover { border-color: var(--navy); color: var(--navy); }
.composer { border-top: 1px solid var(--line-soft); padding: 18px 20px; background: #fcfbf8; }
.composer-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.composer-tabs label { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; }
.composer-tabs input { accent-color: var(--red); }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Progress steps (client view of a request) */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding-top: 30px; text-align: center; font-size: 12.5px; color: var(--muted); }
.steps li::before { content: ''; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--line); }
.steps li::after { content: ''; position: absolute; top: 3px; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.steps li.done::before, .steps li.cur::before { background: var(--gold); }
.steps li.done::after { background: var(--gold); border-color: var(--gold); }
.steps li.cur::after { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 4px rgba(184, 54, 58, .18); }
.steps li.cur { color: var(--ink); font-weight: 700; }

/* People list */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.people li { display: flex; gap: 12px; align-items: center; }
.people .meta { min-width: 0; flex: 1; }
.people .meta b { display: block; color: var(--ink); font-size: 14px; }
.people .meta span { color: var(--muted); font-size: 12.5px; }
.bar { height: 8px; background: #efebe3; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--navy-3); }
.bar > span.hot { background: var(--red); }

/* Diff list on update review */
.diff { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; max-height: 320px; overflow: auto; border: 1px solid var(--line-soft); }
.diff li { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); }
.diff .add { color: var(--green); }
.diff .mod { color: var(--amber); }
.diff .del { color: var(--red); }
.confirm-box { border: 1px solid #f0dcb4; background: #fffaf0; padding: 18px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-panel { order: 2; }
  .a-body { grid-template-columns: 1fr; background: #f5f3ee; }
  .a-side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .a-body.nav-open .a-side { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 31, 53, .45); }
  .a-menu-btn { display: block; }
  .c-top-in { flex-wrap: wrap; }
  .c-nav { order: 3; width: 100%; overflow-x: auto; }
  .cols-even { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .brand-label, .brand-sep { display: none; }
  .btn-top span { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .user-menu .who { display: none; }
  .a-search { display: none; }
  .auth-foot-in { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 28px; }
  .steps { grid-auto-flow: row; }
  .steps li { text-align: left; padding: 0 0 12px 28px; }
  .steps li::before { left: 7px; top: 0; bottom: 0; right: auto; width: 3px; height: auto; }
  .steps li::after { left: 0; top: 2px; }
}
@media print {
  .a-side, .a-top, .c-top, .c-foot, .composer, .no-print { display: none !important; }
  .a-body { display: block; }
}

/* Clients & staff */
.table th.num, .table td.num { text-align: right; }
.gold-text { color: #8a6a1f; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list > li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.contact-list > li:first-child { padding-top: 0; }
.contact-list > li:last-child { border-bottom: 0; }
.contact-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.contact-row .meta { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.contact-row .meta b { color: var(--ink); font-size: 14.5px; }
.contact-row .meta span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.contact-edit { margin: 8px 0 0 52px; }
.contact-edit summary { cursor: pointer; color: var(--blue); width: max-content; }
.contact-edit form { margin-top: 12px; padding: 16px; background: #faf8f4; border: 1px solid var(--line-soft); }
.contact-add { margin-top: 16px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 2px 9px; font-size: 12.5px; background: #f1ede4; color: var(--ink); border-radius: 10px; }
@media (max-width: 700px) { .contact-edit { margin-left: 0; } }
.red-text { color: var(--red); }
.table tr.muted td { color: var(--muted); }
