/* Document Management — Atlas Portal design system (light, professional, neat).
   Brand colours sampled from the RECAFCO logo. */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/Inter-Regular.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/Inter-Medium.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/Inter-SemiBold.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/Inter-Bold.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 800; font-style: normal; font-display: swap; src: url(fonts/Inter-ExtraBold.woff) format("woff"); }

:root {
  --brand: #EA2B2E;
  --brand-dark: #C91F22;
  --charcoal: #2B2D33;
  --charcoal-2: #3A3B3B;
  --tint: #FDEEEE;                     /* brand 8% on white */
  --ring: rgba(234, 43, 46, .18);       /* brand 18% */

  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-3: #EFF1F4;
  --line: #E6E8EC;
  --line-2: #D7DBE1;
  --text: #1C1E23;
  --muted: #5E6573;
  --dim: #8D94A0;
  --ok: #12804E;
  --warn: #B26B00;
  --danger: #C62828;
  --mark: #FFE7A3;

  --radius: 14px;
  --radius-btn: 10px;
  --shadow: 0 1px 2px rgba(28, 30, 35, .04), 0 2px 8px rgba(28, 30, 35, .04);
  --shadow-md: 0 1px 2px rgba(28, 30, 35, .05), 0 8px 24px rgba(28, 30, 35, .08);
  --shadow-lg: 0 4px 12px rgba(28, 30, 35, .08), 0 24px 60px rgba(28, 30, 35, .18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; }
.muted { color: var(--dim); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.spacer { flex: 1; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 26px; height: 26px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-btn); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--dim); text-decoration: none; }
.btn:focus-visible, .input:focus, select:focus-visible, textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--ring); border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(234, 43, 46, .25); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.dark { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn.dark:hover { background: #1f2126; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #FDF0F0; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 31px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-btn); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:hover { border-color: var(--dim); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--dim); }
.req::after { content: " *"; color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1320px; margin: 0 auto; height: 66px; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-sep { width: 1px; height: 30px; background: var(--line-2); }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name b { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.brand-name span { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--tint); }
.hsearch { display: flex; align-items: center; gap: 8px; height: 38px; width: 280px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-btn); background: var(--surface-2); color: var(--dim); }
.hsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: #fff; }
.hsearch input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--text); }
.hsearch kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; color: var(--dim); background: #fff; }
.userbtn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 30px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.userbtn:hover { border-color: var(--line-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--charcoal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu button, .menu a { display: flex; width: 100%; gap: 9px; align-items: center; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.page { max-width: 1320px; margin: 0 auto; padding: 26px 24px 60px; }
.footer { max-width: 1320px; margin: 0 auto; padding: 18px 24px 30px; display: flex; gap: 12px; align-items: center; color: var(--dim); font-size: 12px; border-top: 1px solid var(--line); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px 40px 30px; box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--surface-3) 1px, transparent 1px), linear-gradient(90deg, var(--surface-3) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 100%); mask-image: linear-gradient(90deg, transparent 35%, #000 100%); opacity: .9; }
.hero::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 6px; background: linear-gradient(var(--brand), var(--brand-dark)); }
.hero > * { position: relative; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.025em; margin: 8px 0 8px; }
.hero .intro { margin: 0 0 22px; color: var(--muted); font-size: 15px; max-width: 640px; }
.searchbar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 13px; padding: 6px 6px 6px 16px; max-width: 820px; box-shadow: var(--shadow-md); transition: border-color .15s, box-shadow .15s; }
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring), var(--shadow-md); }
.searchbar svg.i { color: var(--dim); width: 20px; height: 20px; }
.searchbar input { flex: 1; border: 0; outline: 0; height: 44px; font-size: 16px; background: transparent; min-width: 0; }
.searchbar .btn { height: 44px; padding: 0 20px; }
.stats { display: flex; gap: 34px; margin-top: 26px; flex-wrap: wrap; }
.stat { border-left: 3px solid var(--brand); padding: 1px 0 1px 13px; display: flex; flex-direction: column; }
.stat:nth-child(2n) { border-left-color: var(--charcoal); }
.stat b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

/* ---------- filters ---------- */
.filterbar { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(28, 30, 35, .08), 0 1px 6px rgba(28, 30, 35, .06); }
.seg button.on svg { color: var(--brand); }
.filterbar select { width: auto; height: 38px; }
.chiprow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.chiprow .lbl { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-right: 4px; min-width: 76px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
a.chip:hover { text-decoration: none; border-color: var(--line-2); color: var(--text); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-2); color: var(--text); }
button.chip.on { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.chip .n { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
button.chip.on .n { color: rgba(255, 255, 255, .65); }
.chip .dot, .cat .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip.sm { height: 24px; padding: 0 9px; font-size: 11.5px; }
.linkbtn { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 4px 6px; }
.linkbtn:hover { text-decoration: underline; }
.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.results-head { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 14px; flex-wrap: wrap; }
.results-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.results-head .note { font-size: 13px; color: var(--warn); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); text-decoration: none; }
.cover { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .4s; }
.card:hover .cover img { transform: scale(1.03); }
.cover .ph { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; position: relative; }
.cover .ph::before { content: ""; position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px); background-size: 22px 22px; }
.cover .ph b { position: relative; font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.cover .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(43, 45, 51, .75); display: grid; place-items: center; color: #fff; }
.tbadge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(43, 45, 51, .88); backdrop-filter: blur(4px); }
.tbadge.brand { background: var(--brand); }
.card-body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.company { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loc { font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 5px; }
.snip { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc-short { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foundin { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 5px; min-width: 0; }
.foundin b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 500; flex-wrap: wrap; }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.facts svg { color: var(--brand); }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.pill.tint { background: var(--tint); color: var(--brand); }

.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }
.empty > svg.i { width: 40px; height: 40px; color: var(--dim); margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; color: var(--text); }
.more { display: flex; justify-content: center; margin-top: 24px; }

/* ---------- detail: banner + fact bar ---------- */
.banner { position: relative; overflow: hidden; border-radius: 18px; min-height: 280px; display: flex; align-items: flex-end; background: var(--charcoal); color: #fff; box-shadow: var(--shadow-md); }
.banner-bg { position: absolute; inset: -12px; background-size: cover; background-position: center 20%; filter: blur(3px) saturate(1.05); }
.banner::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(20, 21, 25, .25) 0%, rgba(20, 21, 25, .55) 45%, rgba(20, 21, 25, .92) 100%); }
.banner.noimg::before { background: radial-gradient(700px 300px at 85% 0%, rgba(234, 43, 46, .35), transparent 60%),
  linear-gradient(135deg, #2B2D33 0%, #1C1E23 100%); }
.banner::after { content: ""; position: absolute; inset: 0; z-index: 1; opacity: .08; pointer-events: none;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 36px 36px; }
.banner-in { position: relative; z-index: 2; padding: 30px 34px 56px; width: 100%; display: flex; gap: 20px; align-items: flex-end; }
.banner .crumbs { position: absolute; z-index: 2; top: 20px; left: 30px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.banner .crumbs a { color: rgba(255, 255, 255, .85); display: inline-flex; gap: 5px; align-items: center; background: rgba(0, 0, 0, .25); padding: 5px 10px; border-radius: 8px; backdrop-filter: blur(6px); }
.banner .crumbs a:hover { color: #fff; text-decoration: none; background: rgba(0, 0, 0, .4); }
.banner-actions { position: absolute; z-index: 2; top: 18px; right: 22px; display: flex; gap: 8px; }
.banner-actions .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(6px); }
.banner-actions .btn:hover { background: rgba(255, 255, 255, .24); }
.banner-actions .btn.danger:hover { background: var(--danger); border-color: var(--danger); }
.banner .tbadge { position: static; margin-bottom: 12px; }
.banner h1 { font-size: 34px; font-weight: 800; letter-spacing: -.025em; max-width: 900px; }
.banner .sub { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; color: rgba(255, 255, 255, .8); font-size: 14px; }
.banner .sub span { display: inline-flex; align-items: center; gap: 6px; }
.banner .sub b { color: #fff; }
.logo-tile { width: 76px; height: 76px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 28px; flex: none; border: 2px solid rgba(255, 255, 255, .25); }
.factbar { position: relative; z-index: 3; margin: -26px 28px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.fact { padding: 14px 18px; border-right: 1px solid var(--line); min-width: 0; }
.fact:last-child { border-right: 0; }
.fact .k { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.fact .v { font-size: 14.5px; font-weight: 700; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact .v.num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; margin-top: 24px; align-items: start; }
.side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.main > .panel + .panel { margin-top: 20px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 15px; font-weight: 700; }
.panel-h > svg { color: var(--brand); }
.panel-h .count { font-size: 12px; font-weight: 700; color: var(--dim); background: var(--surface-3); border-radius: 10px; padding: 1px 8px; }
.panel-b { padding: 16px 18px; }
.desc { white-space: pre-wrap; color: var(--text); font-size: 14.5px; line-height: 1.65; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s, transform .15s; }
.media:hover { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); transform: translateY(-1px); }
.media .mthumb { aspect-ratio: 16 / 10; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--dim); position: relative; }
.media .mthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.media .minfo { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.media .minfo b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media .minfo span { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; color: #fff; background: rgba(43, 45, 51, .88); text-transform: uppercase; }
.pf-youtube { background: #E62117 !important; } .pf-instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af) !important; }
.pf-tiktok { background: #111 !important; } .pf-facebook { background: #1877F2 !important; } .pf-linkedin { background: #0A66C2 !important; }
.pf-pdf { background: var(--brand) !important; } .pf-web { background: #5E6573 !important; } .pf-image { background: #12804E !important; } .pf-video { background: #6D28D9 !important; }

.contact-row { display: flex; gap: 11px; align-items: center; padding: 10px 0; }
.contact-row + .contact-row { border-top: 1px solid var(--line); }
.contact-row .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.contact-row .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.contact-row .val { font-weight: 600; word-break: break-word; color: var(--text); }
.contact-row .val:hover { color: var(--brand); }
.contact-row .acts { margin-left: auto; display: flex; gap: 2px; }
.person { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px; padding: 12px 13px; background: var(--surface-2); }
.person + .person { margin-top: 10px; }
.person .nm { font-weight: 700; }
.person .ps { font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }
.person a { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 2px 0; color: var(--text); }
.person a svg { color: var(--brand); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; font-size: 13px; margin: 0; }
.kv dt { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding-top: 2px; }
.kv dd { margin: 0; font-weight: 500; }
.tagwrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- editor ---------- */
.editor { max-width: 980px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.section-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-h .num { width: 28px; height: 28px; border-radius: 8px; background: var(--charcoal); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; font-family: var(--mono); }
.section-h h2 { font-size: 15px; }
.section-h p { margin: 0; font-size: 12.5px; color: var(--dim); }
.section-b { padding: 18px 20px 20px; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-btn); background: var(--surface); cursor: text; }
.tagbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.tagbox input { border: 0; outline: 0; flex: 1; min-width: 140px; height: 28px; background: transparent; }
.tagbox .chip { height: 26px; background: var(--tint); border-color: transparent; color: var(--brand); }
.tagbox .chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; display: grid; }
.drop { border: 2px dashed var(--line-2); border-radius: 13px; padding: 28px; text-align: center; background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--tint); }
.drop svg.i { width: 34px; height: 34px; color: var(--brand); }
.drop b { display: block; margin: 6px 0 2px; color: var(--text); }
.flist2 { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.frow { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.frow .ftype { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; flex: none; }
.frow .fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.frow .fmeta input { height: 32px; }
.frow .fsub { font-size: 11.5px; color: var(--dim); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.frow label.cardchk, label.cardchk { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.progress { height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.linkadd { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; }
.people { display: flex; flex-direction: column; gap: 12px; }
.prow { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.editor-foot { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 16px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.status-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-3); color: var(--dim); }
.status-pill.done { background: #E7F5EE; color: var(--ok); }
.status-pill.pending { background: #FFF4DE; color: var(--warn); }
.status-pill.error { background: #FDECEC; color: var(--danger); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table select { width: auto; height: 32px; }
.role { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; letter-spacing: .02em; }
.role.role-admin { background: var(--tint); color: var(--brand); } .role.role-editor { background: #E9EEF7; color: #2D4A7A; } .role.role-viewer { background: var(--surface-3); color: var(--muted); }

/* ---------- auth ---------- */
.auth { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; overflow: hidden; }
.auth::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%); }
.auth::after { content: ""; position: fixed; top: 0; right: 0; bottom: 0; width: 6px; background: linear-gradient(var(--brand), var(--brand-dark)); }
.auth-card { position: relative; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 34px 30px; }
.auth-card .auth-logo { display: block; height: 92px; width: auto; margin: 0 auto 18px; }
.auth-card .eyebrow { text-align: center; }
.auth-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; text-align: center; margin: 6px 0 4px; }
.auth-card .lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 15px; }
.auth-foot { position: relative; margin-top: 18px; font-size: 12px; color: var(--dim); text-align: center; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- modal / viewer / toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20, 21, 25, .55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-h { padding: 20px 22px 6px; } .modal-h h3 { font-size: 18px; font-weight: 800; }
.modal-b { padding: 10px 22px 4px; display: flex; flex-direction: column; gap: 14px; color: var(--muted); }
.modal-f { padding: 18px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.viewer { width: min(1200px, 100%); height: min(92vh, 1000px); background: #16171B; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.viewer-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; background: var(--charcoal); color: #fff; }
.viewer-h b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-h .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.viewer-h .btn:hover { background: rgba(255,255,255,.2); }
.viewer-b { flex: 1; display: grid; place-items: center; overflow: auto; min-height: 0; }
.viewer-b iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-b img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-b video { max-width: 100%; max-height: 100%; }
.viewer-b .embed-v { width: min(420px, 100%); height: 100%; background: #fff; }
.viewer-b .nopreview { color: #DDE1E8; text-align: center; padding: 30px; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--charcoal); color: #fff; padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; animation: up .2s; border-left: 3px solid var(--brand); }
.toast.err { background: var(--danger); border-left-color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 80px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .hsearch { width: 200px; } }
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; } .side { position: static; }
  .hsearch { display: none; }
  .prow { grid-template-columns: 1fr 1fr; }
  .factbar { margin: -22px 14px 0; }
  .fact { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .topbar-in { padding: 0 14px; gap: 10px; height: 60px; }
  .brand-logo { height: 34px; } .brand-sep, .brand-name { display: none; }
  .nav { margin-left: 0; } .nav a { padding: 8px 10px; } .nav .lbl { display: none; }
  .page { padding: 16px 14px 50px; }
  .hero { padding: 24px 20px 22px; } .hero h1 { font-size: 26px; }
  .searchbar .btn .lbl { display: none; } .searchbar .btn { padding: 0 14px; }
  .stats { gap: 18px 24px; } .stat b { font-size: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; }
  .linkadd { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr; }
  .banner { min-height: 300px; border-radius: 14px; } .banner h1 { font-size: 24px; } .banner-in { padding: 70px 20px 40px; } .logo-tile { display: none; }
  .chiprow .lbl { min-width: 0; width: 100%; }
  .footer { flex-direction: column; text-align: center; }
}
@media print { .topbar, .banner-actions, .editor-foot, .footer { display: none; } body { background: #fff; } }

/* ---------- suppliers ---------- */
.results-head .count, .count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 1px 9px; }
.results-head { align-items: center; }
.cards.inner { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cards.inner .card { box-shadow: none; }
.cover .logo-cover { width: 100%; height: 100%; background: #fff; display: grid; place-items: center; padding: 22px 30px; border-bottom: 1px solid var(--line); }
.cover .logo-cover img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.card:hover .cover .logo-cover img { transform: none; }
.cover .ph { background: linear-gradient(135deg, #2B2D33, #1C1E23); }
.slogo { width: 46px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.slogo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.slogo.ph { background: var(--charcoal); color: #fff; font-weight: 800; font-size: 16px; border: 0; }
.slogo.xl { width: 84px; height: 84px; border-radius: 18px; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.slogo.xl img { padding: 8px; }
.slogo.xl.ph { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); font-size: 30px; }
.supbox { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); transition: border-color .15s; }
.supbox:hover { border-color: var(--brand); text-decoration: none; }
.supbox > span:not(.slogo) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.supbox svg { color: var(--dim); }
.banner .sub a:hover { text-decoration: underline; }
.factbar .v a { color: var(--text); } .factbar .v a:hover { color: var(--brand); }
.logo-pick { width: 132px; height: 132px; border-radius: 16px; border: 2px dashed var(--line-2); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; overflow: hidden; transition: border-color .15s, background .15s; }
.logo-pick:hover, .logo-pick:focus-visible { border-color: var(--brand); background: var(--tint); outline: none; }
.logo-pick #logoprev { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dim); font-size: 12px; font-weight: 600; }
.logo-pick img { width: 100%; height: 100%; object-fit: contain; padding: 12px; background: #fff; }
#suphint { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
#suphint svg { color: var(--brand); }
@media (max-width: 560px) { .slogo.xl { display: none; } .logo-pick { width: 100px; height: 100px; } }
.autotag { margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--tint); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
#suphint svg { color: var(--ok); }
.suppick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }

/* ---------- categories ---------- */
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.catbox { --cc: var(--brand); position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px 18px 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s; }
.catbox::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cc); }
.catbox:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); text-decoration: none; }
.caticon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex: none;
  color: var(--cc); background: color-mix(in srgb, var(--cc) 11%, white); }
.caticon svg.i { width: 24px; height: 24px; }
.caticon.xl { width: 72px; height: 72px; border-radius: 18px; }
.caticon.xl svg.i { width: 34px; height: 34px; }
.catbody { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.catbody b { font-size: 16.5px; font-weight: 800; letter-spacing: -.015em; }
.catpath { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.catmeta { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.catkids { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.catkids span { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 2px 7px; }
.catgo { color: var(--dim); align-self: center; transition: transform .18s, color .18s; }
.catbox:hover .catgo { color: var(--cc); transform: translateX(3px); }
.crumbs2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--dim); margin-bottom: 14px; }
.crumbs2 a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; }
.crumbs2 a:hover { color: var(--brand); }
.crumbs2 span { color: var(--text); font-weight: 700; }
.cathead { --cc: var(--brand); position: relative; overflow: hidden; display: flex; gap: 20px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; padding: 28px 30px; box-shadow: var(--shadow); }
.cathead::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--surface-3) 1px, transparent 1px), linear-gradient(90deg, var(--surface-3) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000); mask-image: linear-gradient(90deg, transparent 40%, #000); }
.cathead::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 6px; background: var(--cc); }
.cathead > * { position: relative; }
.cathead h1 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; margin: 4px 0 4px; }
.cathead .intro { margin: 2px 0 0; color: var(--muted); }
.catfacts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.catfacts span { display: inline-flex; align-items: center; gap: 6px; }
.catfacts svg { color: var(--cc); }
.catactions { display: flex; gap: 8px; margin-left: auto; }
.newbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.results-head { margin-top: 26px; }
.filterbar + #results > .results-head:first-child, .filterbar + #results > .stabs + section > .results-head { margin-top: 6px; }

/* brands */
.bpill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; background: var(--charcoal); color: #fff; vertical-align: 1px; }
.company .bpill { margin-left: 4px; }
.brandrow { display: flex; flex-wrap: wrap; gap: 4px; }
.brandgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.brandcard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--charcoal); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.bc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bc-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; flex: 1; }
.bc-sold { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* search tabs */
.stabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.stabs button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.stabs button:hover { border-color: var(--line-2); color: var(--text); }
.stabs button.on { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.stabs .n { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 8px; background: var(--surface-3); color: var(--muted); }
.stabs button.on .n { background: rgba(255,255,255,.18); color: #fff; }
.results-title h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }

/* pickers */
.pickrow { display: flex; gap: 8px; }
.pickrow select { flex: 1; min-width: 0; }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.iconpick button { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.iconpick button:hover { border-color: var(--line-2); color: var(--text); }
.iconpick button.on { border-color: var(--brand); color: var(--brand); background: var(--tint); box-shadow: 0 0 0 3px var(--ring); }
.colorpick { display: flex; flex-wrap: wrap; gap: 8px; }
.colorpick button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.colorpick button.on { box-shadow: 0 0 0 2px var(--text); }
#suphint .chip, #suphint b { vertical-align: middle; }
#suphint { gap: 6px; }
#brandhint svg, #suphint svg { color: var(--ok); }

/* supplier pop-up */
.modal.sheet { max-width: 980px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--bg); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-b { overflow: auto; padding: 18px 20px 0; }
.editor-foot.in-modal { position: sticky; bottom: 0; padding: 14px 0 18px; background: linear-gradient(transparent, var(--bg) 30%); }
.logoprev { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dim); font-size: 12px; font-weight: 600; }

@media (max-width: 760px) {
  .cathead { flex-wrap: wrap; padding: 22px 20px; } .cathead h1 { font-size: 24px; } .catactions { margin-left: 0; }
  .filterbar .newbtns { width: 100%; } .newbtns .btn { flex: 1; justify-content: center; padding: 0 10px; }
  .pickrow { flex-direction: column; }
}

/* settings */
.logo-pick.wide { width: 240px; height: 140px; background: #fff; }
.logo-pick.wide img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.colorin { width: 44px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.ocrstate { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.ocrstate.ok { background: #EEF8F2; border-color: #CBEBD9; } .ocrstate.ok > svg { color: var(--ok); }
.ocrstate.warn { background: #FFF7E8; border-color: #F5DFB5; } .ocrstate.warn > svg { color: var(--warn); }
.ocrstats { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.ocrstats div { border-left: 3px solid var(--brand); padding-left: 12px; display: flex; flex-direction: column; }
.ocrstats b { font-size: 22px; font-weight: 800; } .ocrstats span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

/* =====================================================================
   Responsive & layout fixes (phones, tablets, small laptops)
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, video, iframe { max-width: 100%; }
.page, .detail > *, .main, .side, .catbody, .card-body, .fmeta, .field { min-width: 0; }
.input, select.input { min-width: 0; }

/* header: user menu + mobile menu */
.usermenu-wrap { position: relative; flex: none; }
.menu { max-width: calc(100vw - 24px); }
.menu .who { display: flex; flex-direction: column; gap: 3px; }
.menu .who b, .menu .who-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.menu .who .role { align-self: flex-start; margin-top: 3px; }
.navbtn { display: none; flex: none; }
.mnav { border-top: 1px solid var(--line); background: #fff; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 16px 30px rgba(28, 30, 35, .12); max-height: calc(100vh - 66px); overflow-y: auto; }
.mnav.hidden { display: none; }
.mnav a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 15px; }
.mnav a > svg:last-child { margin-left: auto; color: var(--dim); }
.mnav a:hover { background: var(--surface-2); text-decoration: none; }
.mnav a.active { background: var(--tint); color: var(--brand); }
.mnav-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; margin-bottom: 8px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface-2); color: var(--dim); }
.mnav-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; color: var(--text); }
.mnav-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: #fff; }

/* banners: breadcrumb row + actions flow above the title (never overlap) */
.banner { flex-direction: column; align-items: stretch; justify-content: space-between; }
.banner-top { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 22px 0; }
.banner .crumbs { position: static; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.banner .crumbs a { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-actions { position: static; flex: none; }
.banner-in { padding-top: 28px; }
.banner h1 { overflow-wrap: anywhere; }

/* modals: always scrollable and centred */
.overlay { display: flex; align-items: center; justify-content: center; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.overlay > .modal { margin: auto; flex: none; }
.overlay > .modal.sheet { max-height: none; }
@media (min-height: 500px) { .overlay > .modal.sheet { max-height: calc(100vh - 40px); } }
.viewer { flex: none; }
.viewer-h { flex-wrap: nowrap; min-width: 0; }
.viewer-h > b { min-width: 0; flex: 1; }
.viewer-acts { display: flex; gap: 6px; flex: none; align-items: center; }
.viewer-h .btn.icon { background: rgba(255,255,255,.14); }
.pdfmobile { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdfmobile img { max-height: 55vh; width: auto; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.4); background: #fff; }
.pdfmobile p { margin: 0; }

/* category header: actions never squeeze the text */
.cathead { flex-wrap: nowrap; }

/* pickers: the select must keep its height when stacked */
.pickrow > select, .pickrow > .btn { flex: none; }
.pickrow > select { flex: 1 1 auto; }

/* fact bar values may wrap rather than hide */
.fact .v { overflow-wrap: anywhere; }

/* ---------- ≤ 1100px: small laptops / tablets landscape ---------- */
@media (max-width: 1100px) {
  .topbar-in { gap: 14px; }
  .nav a { padding: 8px 10px; }
  .hsearch { width: 200px; }
  .brand-name span { display: none; }
}

/* ---------- ≤ 960px: tablets — menu button replaces the nav ---------- */
@media (max-width: 960px) {
  .nav, .hsearch { display: none; }
  .navbtn { display: inline-flex; }
  .topbar-in { gap: 10px; padding: 0 16px; }
  .detail { grid-template-columns: 1fr; }
  .side { position: static; }
  .filterbar { gap: 10px; }
  .filterbar > .spacer { display: none; }
  .filterbar .newbtns { margin-left: auto; }
  .catgrid, .brandgrid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* ---------- ≤ 760px: large phones / small tablets ---------- */
@media (max-width: 760px) {
  .page { padding: 18px 14px 50px; }
  .hero { padding: 24px 20px 22px; border-radius: 16px; }
  .hero h1 { font-size: 26px; }
  .hero .intro { font-size: 14px; }
  .stats { gap: 16px 22px; margin-top: 20px; }
  .stat b { font-size: 20px; }
  .filterbar { flex-direction: column; align-items: stretch; }
  .filterbar .seg { align-self: stretch; }
  .filterbar .seg button { flex: 1; justify-content: center; }
  .filterbar select { width: 100%; }
  .filterbar .newbtns { margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .filterbar .newbtns .btn { justify-content: center; padding: 0 8px; }
  .filterbar .newbtns .btn.primary { grid-column: 1 / -1; }
  .results-title h2 { font-size: 17px; }

  .cathead { padding: 20px 18px; gap: 14px; flex-wrap: wrap; }
  .cathead .caticon.xl { width: 52px; height: 52px; border-radius: 14px; }
  .cathead .caticon.xl svg.i { width: 26px; height: 26px; }
  .cathead > div:not(.catactions) { flex: 1 1 calc(100% - 70px); }
  .cathead h1 { font-size: 23px; }
  .catfacts { gap: 8px 14px; font-size: 12.5px; }
  .catactions { position: absolute; top: 14px; right: 16px; margin: 0; }
  .cathead .eyebrow { padding-right: 96px; }

  .banner { min-height: 0; border-radius: 14px; }
  .banner-top { padding: 14px 14px 0; }
  .banner .crumbs a { max-width: 140px; font-size: 12px; padding: 4px 8px; }
  .banner-actions .btn .lbl { display: none; }
  .banner-actions .btn { width: 34px; padding: 0; justify-content: center; }
  .banner-in { padding: 22px 18px 44px; gap: 14px; }
  .banner h1 { font-size: 23px; }
  .banner .sub { gap: 6px 12px; font-size: 13px; }
  .slogo.xl { display: none; }
  .factbar { margin: -22px 10px 0; grid-template-columns: 1fr 1fr; }
  .fact { padding: 11px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .fact:nth-child(2n) { border-right: 0; }
  .fact .v { white-space: normal; font-size: 13.5px; }
  .fact .v.num { font-size: 18px; }

  .panel-h { flex-wrap: wrap; padding: 13px 14px; }
  .panel-b { padding: 14px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .contact-row .val { font-size: 14px; }

  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head h1 { font-size: 22px; overflow-wrap: anywhere; }
  .page-head .spacer { display: none; }
  .section-h { padding: 14px 16px; }
  .section-b { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .pickrow { flex-direction: column; }
  .pickrow > select { flex: none; width: 100%; }
  .pickrow > .btn { justify-content: center; }
  .linkadd { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr; }
  .frow { flex-wrap: wrap; }
  .frow .fmeta { flex: 1 1 calc(100% - 100px); }
  .section-h .spacer { display: none; }
  .section-h > .btn { flex: 1 1 auto; justify-content: center; }
  .logo-pick.wide { width: 100%; }
  .editor-foot { position: sticky; bottom: 0; margin: 0 -14px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(245, 246, 248, .97); border-top: 1px solid var(--line); flex-wrap: wrap; backdrop-filter: blur(6px); }
  .editor-foot #savestatus, .editor-foot [data-r="status"], .editor-foot #setstatus { flex: 1 1 100%; order: -1; }
  .editor-foot .btn { flex: 1; justify-content: center; }
  .editor-foot.in-modal { margin: 0 -14px; }
  .sheet-b { padding: 14px 14px 0; }

  /* users table becomes cards */
  .usertable thead { display: none; }
  .usertable, .usertable tbody, .usertable tr, .usertable td { display: block; width: 100%; }
  .usertable tr { padding: 14px; border-bottom: 1px solid var(--line); }
  .usertable td { border: 0; padding: 5px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left !important; }
  .usertable td[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
  .usertable td:first-child { padding-bottom: 8px; }
  .usertable td.uacts { justify-content: flex-start; flex-wrap: wrap; padding-top: 10px; }
  .usertable tr:hover td { background: none; }

  .modal-h { padding: 18px 18px 4px; } .modal-b { padding: 10px 18px 4px; } .modal-f { padding: 16px 18px; }
  .overlay { padding: 12px; }
  .viewer { height: calc(100vh - 24px); height: calc(100dvh - 24px); border-radius: 14px; }
  .viewer-h { padding: 8px 8px 8px 12px; gap: 8px; }
  .viewer-h .badge { display: none; }
  .viewer-acts .btn .lbl { display: none; }
  .viewer-acts .btn { width: 34px; padding: 0; justify-content: center; }
  .stabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px 4px; }
  .stabs button { flex: none; }
  #toasts { bottom: auto; top: 72px; width: calc(100% - 28px); }
  .toast { max-width: 100%; }
}

/* ---------- ≤ 420px: small phones ---------- */
@media (max-width: 420px) {
  .topbar-in { padding: 0 12px; }
  .brand-logo { height: 36px; }
  .hero h1 { font-size: 23px; }
  .searchbar { padding: 5px 5px 5px 12px; }
  .searchbar input { font-size: 15px; height: 40px; }
  .searchbar .btn { height: 40px; padding: 0 12px; }
  .stat span { font-size: 10px; letter-spacing: .06em; }
  .seg button { padding: 0 9px; font-size: 12.5px; }
  .catbox { padding: 15px 14px 15px 17px; gap: 12px; }
  .caticon { width: 42px; height: 42px; }
  .cards, .cards.inner, .catgrid, .brandgrid, .media-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr 1fr; }
  .factbar { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 26px 20px 22px; }
  .iconpick { grid-template-columns: repeat(5, 1fr); }
}

/* phones in landscape / very short screens */
@media (max-height: 520px) {
  .topbar { position: relative; z-index: 30; }
  .side { position: static; }
}
@media print { .navbtn, .mnav { display: none !important; } }
.fact .v { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.fact .v.num { display: block; }

/* extracted text panel + OCR test */
.viewer { position: relative; }
.viewer-text { position: absolute; left: 0; right: 0; bottom: 0; max-height: 55%; overflow: auto; background: #fff; color: var(--text);
  border-top: 1px solid var(--line); box-shadow: 0 -12px 30px rgba(0,0,0,.25); padding: 14px 18px 18px; z-index: 2; }
.viewer-text .vt-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.viewer-text .vt-head .btn { margin-left: auto; }
.viewer-text pre, .ocrresult pre { white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 13px; line-height: 1.55; margin: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: 360px; overflow: auto; }
.viewer-h .btn.on { background: #fff; color: var(--text); }
.ocrtest { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ocrresult { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ocrtest { margin: 0 20px 20px; }
@media (max-width: 760px) { .ocrtest { margin: 0 16px 16px; } }

/* =====================================================================
   Document Control additions
   ===================================================================== */
.mono, .docno { font-family: var(--mono); letter-spacing: -.01em; }
.docno { font-weight: 700; color: var(--charcoal); white-space: nowrap; }
a .docno, a.docno { color: var(--brand); }
.nav .badge-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; display: inline-grid; place-items: center; line-height: 1; }
.nav a.active .badge-n { background: var(--brand-dark); }

/* status pills */
.st { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st-draft { background: #EEF0F3; color: #5E6573; }
.st-under-review { background: #FFF4DD; color: #9A5B00; }
.st-approved, .st-issued-for-construction, .st-as-built { background: #E5F4EC; color: #12804E; }
.st-approved-with-comments { background: #E8F1FB; color: #1D5FA8; }
.st-revise-resubmit { background: #FDEFE3; color: #B4510F; }
.st-rejected, .st-void { background: #FDECEC; color: #C62828; }
.st-for-information { background: #EFEAFB; color: #6D28D9; }
.st-pending { background: #FFF4DD; color: #9A5B00; } .st-cancelled { background: #EEF0F3; color: #8D94A0; }
.st-sent { background: #E8F1FB; color: #1D5FA8; } .st-acknowledged { background: #E5F4EC; color: #12804E; }
.rev { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--charcoal); color: #fff; font-size: 11.5px; font-weight: 800; font-family: var(--mono); }
.rev.old { background: var(--surface-3); color: var(--dim); }
.code { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 800; font-size: 12px; color: #fff; }
.code-A { background: #12804E; } .code-B { background: #1D5FA8; } .code-C { background: #B4510F; } .code-D { background: #C62828; }
.why { display: inline-flex; height: 19px; align-items: center; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; background: var(--tint); color: var(--brand-dark); }
.tagpill { display: inline-flex; height: 20px; align-items: center; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.overdue { color: var(--danger); font-weight: 700; }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--charcoal); transition: border-color .15s, transform .15s; }
a.kpi:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--line-2); border-top-color: var(--brand); }
.kpi b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.kpi.hot { border-top-color: var(--brand); } .kpi.hot b { color: var(--brand); }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 22px; align-items: start; }
.dash > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel-h h3 { font-size: 15px; font-weight: 800; }
.panel-h .count { font-size: 12px; font-weight: 700; color: var(--dim); }
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); color: var(--text); min-width: 0; }
.li:last-child { border-bottom: 0; }
a.li:hover { background: var(--surface-2); text-decoration: none; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .r { font-size: 12px; color: var(--dim); white-space: nowrap; text-align: right; }
.empty-sm { padding: 22px 18px; color: var(--dim); font-size: 13px; text-align: center; }
.act-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.act-dot svg.i { width: 15px; height: 15px; }
.projgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.projcard { --pc: var(--charcoal); position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.projcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pc); }
.projcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.projcode { font-family: var(--mono); font-weight: 800; font-size: 12px; color: #fff; background: var(--pc); border-radius: 6px; padding: 2px 7px; align-self: flex-start; }
.projcard h4 { margin: 2px 0 0; font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.projcard .meta { font-size: 12.5px; color: var(--dim); }
.projcard .nums { display: flex; gap: 16px; margin-top: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.projcard .nums b { color: var(--text); }

/* register */
.regbar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(120px, 1fr)); gap: 10px; }
.regbar .input { height: 38px; }
.regbar2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.regbar2 .datebox { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.regbar2 .datebox .input { width: 150px; height: 32px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); user-select: none; }
.toggle.on { border-color: var(--brand); color: var(--brand); background: var(--tint); }
.reg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.reg .table td { vertical-align: top; }
.reg .table tr { cursor: pointer; }
.reg .ttl { font-weight: 600; }
.reg .snip { margin-top: 6px; -webkit-line-clamp: 2; }
.reg .whys { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tablewrap { overflow-x: auto; }
.reg-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--dim); font-size: 12.5px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 11px; background: #FFF8E6; border: 1px solid #F3DFA6; color: #7A5200; font-size: 13px; margin-bottom: 12px; }
.notice.info { background: #EEF4FC; border-color: #CFDDF1; color: #1F4D86; }
.notice.bad { background: #FDF0F0; border-color: #F3C9C9; color: #A11E1E; }
.notice.good { background: #EAF6EF; border-color: #BFE2CE; color: #0E6B41; }
.savedrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.saved { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 11px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.saved:hover { border-color: var(--brand); color: var(--brand); }
.saved button { border: 0; background: none; color: var(--dim); cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.saved button:hover { background: var(--surface-3); color: var(--danger); }

/* document page */
.dochead { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 28px 20px; box-shadow: var(--shadow); overflow: hidden; }
.dochead::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 6px; background: linear-gradient(var(--brand), var(--brand-dark)); }
.dochead .docno { font-size: 15px; color: var(--brand); }
.dochead h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 10px; }
.dochead .chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dochead .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.preview-box { display: flex; gap: 18px; align-items: flex-start; }
.preview-thumb { width: 220px; flex: none; aspect-ratio: 1 / 1.3; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; cursor: pointer; display: grid; place-items: center; color: var(--dim); position: relative; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.preview-thumb:hover { border-color: var(--brand); }
.stamp { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stamp span { transform: rotate(-28deg); border: 4px solid rgba(198, 40, 40, .75); color: rgba(198, 40, 40, .8); font-weight: 900; letter-spacing: .12em; padding: 6px 16px; border-radius: 10px; font-size: 22px; background: rgba(255,255,255,.55); }
.viewer-b { position: relative; }
.viewer-b .stamp span { font-size: 56px; border-width: 7px; }
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.tl:last-child { border-bottom: 0; }
.tl .when { color: var(--dim); font-size: 12px; white-space: nowrap; min-width: 118px; }
.reviewbox { border: 2px solid var(--brand); background: linear-gradient(var(--tint), #fff 60%); border-radius: var(--radius); padding: 18px 20px; margin-top: 18px; }
.reviewbox h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.codepick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.codepick button { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; text-align: left; font-weight: 600; font-size: 13px; }
.codepick button:hover { border-color: var(--dim); }
.codepick button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.rvitem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rvitem:last-child { border-bottom: 0; }
.rvitem .cm { margin-top: 6px; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; white-space: pre-wrap; font-size: 13px; }
.lockbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #FFF4DD; border: 1px solid #F3DFA6; color: #7A5200; border-radius: 11px; font-size: 13px; font-weight: 600; margin-top: 14px; }
.kv dt { color: var(--dim); font-weight: 600; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv { grid-template-columns: 112px 1fr; }

/* inbox */
.inbox-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.icard { display: flex; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.icard:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); text-decoration: none; }
.icard .ith { width: 86px; height: 112px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--dim); }
.icard .ith img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.icard .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.icard .fn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .sg { font-size: 12.5px; color: var(--muted); }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.filing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); gap: 20px; align-items: start; }
.filing .pv { position: sticky; top: 86px; height: calc(100vh - 120px); background: #16171B; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.filing .pv iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.filing .pv img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modeseg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 11px; }
.modeseg button { height: 36px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; }
.modeseg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.reasons { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.numprev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); font-size: 13px; }
.numprev .docno { font-size: 15px; color: var(--brand); }
.pick-results { border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow: auto; margin-top: 6px; background: #fff; }
.pick-results button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; }
.pick-results button:hover { background: var(--surface-2); }
.pick-results button:last-child { border-bottom: 0; }
.pages-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.pages-strip .pg { position: relative; width: 96px; height: 128px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.pages-strip .pg img { width: 100%; height: 100%; object-fit: cover; }
.pages-strip .pg span { position: absolute; left: 5px; bottom: 5px; background: rgba(43,45,51,.85); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 5px; padding: 1px 6px; }
.pages-strip .pg button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; display: grid; place-items: center; color: var(--danger); }

/* transmittal sheet */
.sheetwrap { background: var(--surface-3); border-radius: var(--radius); padding: 26px; }
.trsheet { background: #fff; max-width: 860px; margin: 0 auto; padding: 38px 44px; box-shadow: var(--shadow-md); color: #111; font-size: 13px; }
.trsheet .trtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 3px solid var(--brand); }
.trsheet .trtop img { height: 62px; }
.trsheet .trtitle { text-align: right; }
.trsheet .trtitle h2 { font-size: 22px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.trsheet .trtitle .docno { font-size: 15px; color: var(--brand); }
.trsheet .trgrid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #cfd3da; margin-top: 18px; }
.trsheet .trgrid div { padding: 8px 12px; border-bottom: 1px solid #cfd3da; }
.trsheet .trgrid div:nth-child(odd) { border-right: 1px solid #cfd3da; }
.trsheet .trgrid b { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6b7280; }
.trsheet table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.trsheet th, .trsheet td { border: 1px solid #cfd3da; padding: 7px 9px; text-align: left; font-size: 12px; }
.trsheet th { background: #f2f3f5; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.trsheet .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 34px; }
.trsheet .sign div { border-top: 1px solid #111; padding-top: 6px; font-size: 11.5px; color: #374151; }
.trsheet .foot { margin-top: 26px; font-size: 10.5px; color: #6b7280; text-align: center; }

/* bars (project page) */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar .fill { height: 100%; background: var(--brand); border-radius: 4px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }

/* misc */
.pagetitle { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.pagetitle h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.pagetitle .sub { color: var(--dim); font-size: 13.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { height: 40px; padding: 0 14px; border: 0; background: none; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; } .dot.ok { background: var(--ok); } .dot.bad { background: var(--danger); } .dot.warn { background: var(--warn); }
.modal.wide { max-width: 720px; } .modal.xwide { max-width: 960px; }
.modal-b { max-height: calc(100vh - 200px); overflow: auto; }
.role.role-controller { background: #E9EEF7; color: #2D4A7A; } .role.role-manager { background: #EAF6EF; color: #0E6B41; }
.textview { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 60vh; overflow: auto; color: var(--text); }
.textview .pgbrk { display: block; margin: 10px 0; color: var(--brand); font-weight: 700; border-top: 1px dashed var(--line-2); padding-top: 6px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .regbar { grid-template-columns: 1fr 1fr 1fr; } .regbar > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .dash, .filing { grid-template-columns: 1fr; } .filing .pv { position: static; height: 60vh; } .inbox-top { grid-template-columns: 1fr; } .preview-box { flex-direction: column; } .preview-thumb { width: 100%; max-width: 260px; } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } .regbar { grid-template-columns: 1fr 1fr; } .codepick { grid-template-columns: 1fr 1fr; } .dochead { padding: 20px 18px; } .dochead h1 { font-size: 21px; } .trsheet { padding: 20px; } .reg .hide-sm { display: none; } }
@media print {
  .topbar, .footer, .noprint, #toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .sheetwrap { background: none; padding: 0; } .trsheet { box-shadow: none; max-width: none; padding: 0; }
  .reg { box-shadow: none; border: 0; } .reg .table tr:hover td { background: none; }
  @page { size: A4; margin: 14mm; }
}
.li .t, .li .s { display: block; }
.li .grow { overflow: hidden; }
.li .r { flex: none; }
.li .st, .li .rev { flex: none; }
.topbar-in { max-width: 1440px; gap: 14px; }
.hsearch { width: 230px; }
.nav a { padding: 8px 11px; }
@media (max-width: 1380px) { .brand-name span { display: none; } .hsearch { width: 190px; } }
@media (max-width: 1180px) { .nav .lbl { display: none; } }
@media (max-width: 1520px) { .brand-name span { display: none; } .hsearch { width: 200px; } }
@media (max-width: 1300px) { .nav .lbl { display: none; } }
/* phones: navigation moves to a bar at the bottom of the screen */
@media (max-width: 760px) {
  .nav { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; justify-content: space-around; gap: 0;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10.5px; position: relative; flex: 1; justify-content: center; align-items: center; }
  .nav .lbl { display: block !important; font-size: 10px; }
  .nav .badge-n { position: absolute; top: 0; right: calc(50% - 22px); }
  body { padding-bottom: 70px; }
  .topbar .btn.primary .lbl { display: none; }
}
.hsearch.regsearch { display: flex !important; }
@media (max-width: 760px) { .topbar { backdrop-filter: none; } .reg .table td:first-child { white-space: normal; } .reg .docno { white-space: normal; word-break: break-all; } }
@media (min-width: 761px) and (max-width: 960px) { .nav { display: flex !important; } .nav .lbl { display: none; } }

/* =====================================================================
   Index & Retrieve
   ===================================================================== */
.nav.big a { font-size: 14.5px; padding: 9px 16px; }
.uname { font-weight: 600; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .uname { display: none; } }
.role.role-user { background: #E9EEF7; color: #2D4A7A; }
.pagetitle h1 { display: flex; align-items: center; gap: 10px; } .pagetitle h1 svg.i { width: 26px; height: 26px; color: var(--brand); }
.work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stepcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 20px; transition: opacity .2s; }
.stepcard.off { opacity: .55; }
.stephead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stephead h3 { font-size: 16px; font-weight: 800; }
.stepn { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.stepcard.off .stepn { background: var(--dim); }
.hsearch.mini { width: 220px; height: 34px; background: #fff; }
.typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 360px; overflow: auto; padding: 2px; }
.typetile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s; }
.typetile:hover { border-color: var(--dim); }
.typetile.on { border-color: var(--brand); background: var(--tint); box-shadow: 0 0 0 3px var(--ring); }
.ticon { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--charcoal); display: grid; place-items: center; }
.typetile.on .ticon { background: var(--brand); color: #fff; }
.tname { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.tdeps { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--dim); }
.deptrow { display: flex; flex-wrap: wrap; gap: 8px; }
.deptbtn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; }
.deptbtn:hover { border-color: var(--dim); }
.deptbtn.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.fgrid .field.span-2 { grid-column: 1 / -1; }
.filepick { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.filepick .drop { padding: 20px; }
.camdrop { font: inherit; width: 100%; }
#filelist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.idxfoot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.btn.big { height: 44px; padding: 0 26px; font-size: 15px; }
.donecheck { width: 56px; height: 56px; border-radius: 50%; background: #E5F4EC; color: var(--ok); display: grid; place-items: center; margin: 6px auto 10px; }
.donecheck svg.i { width: 30px; height: 30px; stroke-width: 2.4; }
.bigsearch { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 14px; background: #fff; box-shadow: var(--shadow); }
.bigsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.bigsearch svg.i { color: var(--dim); width: 20px; height: 20px; }
.bigsearch input { flex: 1; border: 0; outline: 0; height: 50px; font-size: 16px; background: transparent; min-width: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 14px; }
.filecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.filecard { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fthumb { width: 84px; height: 110px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: #fff; overflow: hidden; display: grid; place-items: center; color: var(--dim); cursor: pointer; }
.fthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.fthumb:hover { border-color: var(--brand); }
.fmeta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fmeta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fbtns { display: flex; gap: 4px; margin-top: auto; }
.depchecks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 260px; overflow: auto; }
.depcheck { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.depcheck label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.ftable td { padding: 6px 8px; } .ftable th { padding: 8px; } .ftable .input { height: 34px; }
@media (max-width: 1000px) { .work { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .filepick { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr; } .typegrid { grid-template-columns: 1fr 1fr; } .hsearch.mini { width: 100%; } }
label.depcheck { justify-content: flex-start; cursor: pointer; }
/* Retrieve: results scroll inside their own box */
.resultsbox { max-height: 62vh; overflow: auto; }
.resultsbox thead th { position: sticky; top: 0; z-index: 1; }
.role.role-supervisor { background: #FFF4DD; color: #9A5B00; }
