/* Client portal shell + replacements for the WordPress admin classes the shared views use. */
:root {
	--brand: #0b5cad;
	--ink: #14202e;
	--ink-2: #4a5666;
	--ink-3: #7a8594;
	--line: #e3e7ec;
	--bg: #f5f7fa;
	--card: #fff;
	--radius: 10px;
	--piq-accent: var(--brand);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.pt {
	font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; display: inline-block; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 650; }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f0f2f5; padding: 1px 4px; border-radius: 4px; }

/* ---------- Shell ---------- */
.pt-app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.pt-side { background: #0f2039; color: #c9d2de; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.pt-brand { display: block; padding: 4px 10px 14px; }
.pt-brand:hover { text-decoration: none; }
.pt-logo { max-width: 170px; max-height: 44px; display: block; }
.pt-side .pt-logo { max-height: 52px; }
.pt-side .pt-logo { filter: none; }
.pt-wordmark { font-size: 19px; font-weight: 750; color: #fff; letter-spacing: -.02em; }
.pt-org { margin: 0 10px 18px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; font-size: 13px; font-weight: 600; }
.pt-nav { display: flex; flex-direction: column; gap: 2px; }
.pt-nav a { color: #c9d2de; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.pt-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.pt-nav a.is-active { background: var(--brand); color: #fff; }
.pt-side-foot { margin-top: auto; padding: 0 12px; font-size: 13px; }
.pt-side-foot a { color: #93a1b3; }
.pt-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.pt-top { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.pt-title { font-weight: 600; color: var(--ink-2); }
.pt-user { display: flex; gap: 18px; font-size: 13px; align-items: center; }
.pt-user a { color: var(--ink-2); }
.pt-content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* ---------- WordPress admin class equivalents ---------- */
.wrap { margin: 0; }
.wp-header-end { border: 0; margin: 8px 0 0; height: 0; }
.wp-heading-inline { margin-right: 10px; }
.page-title-action { display: inline-block; vertical-align: 4px; margin-left: 8px; padding: 5px 12px; border: 1px solid var(--brand); border-radius: 7px; font-size: 13px; font-weight: 600; }
.page-title-action:hover { background: var(--brand); color: #fff; text-decoration: none; }
.description { color: var(--ink-3); font-size: 13px; }
p.description { margin: 6px 0 0; }
.clear { clear: both; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: 8px; padding: 2px 14px; margin: 14px 0; }
.notice p { margin: 10px 0; }
.notice-success { border-left-color: #0a7d4f; background: #f3faf6; }
.notice-error { border-left-color: #b42318; background: #fdf4f3; }
.notice-warning { border-left-color: #b26a00; background: #fffaf0; }

.subsubsub { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 12px 0; color: var(--ink-3); }
.subsubsub li { display: inline; }
.subsubsub a.current { color: var(--ink); font-weight: 650; }

.button, button.button, input.button {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 34px; padding: 0 14px; border: 1px solid #cdd4dc; border-radius: 8px;
	background: #fff; color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.button:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.button-primary, button.button-primary, input.button-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button-primary:hover { filter: brightness(1.08); color: #fff; }
.button:disabled { opacity: .6; cursor: default; }
.button-link-delete { background: none; border: 0; color: #b42318; cursor: pointer; font: inherit; padding: 0 4px; }
p.submit { margin: 18px 0 0; display: flex; gap: 8px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input:not([type]), select, textarea {
	font: inherit; color: var(--ink); background: #fff; border: 1px solid #cdd4dc; border-radius: 8px; padding: 7px 10px; min-height: 36px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; vertical-align: -3px; margin: 0 4px 0 0; }
input[type=file] { font: inherit; }
.regular-text { width: 26em; }
.large-text { width: 100%; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea { background: #f5f7fa; color: var(--ink-2); }

.form-table { width: 100%; border-collapse: collapse; }
.form-table th { width: 220px; text-align: left; vertical-align: top; padding: 14px 16px 14px 0; font-weight: 600; }
.form-table td { padding: 10px 0; vertical-align: top; }

.widefat { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.widefat th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); background: #fafbfc; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.widefat td { padding: 12px; border-bottom: 1px solid var(--line); }
.widefat tbody tr:last-child td { border-bottom: 0; }
.widefat.striped tbody tr:nth-child(even) td { background: #fbfcfd; }
.widefat tbody tr:hover td { background: #f6f9fd; }

/* ---------- Tweaks to the shared ProcureIQ components ---------- */
.piq-card { border-color: var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.piq-tile { border-color: var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.piq-tile strong { font-size: 28px; font-weight: 700; }
.piq-meter i { background: var(--brand); }
.piq-badge { border-radius: 999px; font-weight: 550; }
.piq-split { gap: 20px; }
.piq-doc { top: 72px; }
.piq-doc iframe { height: calc(100vh - 110px); border-radius: var(--radius); }
.piq-actions { flex-wrap: wrap; }
.pt-spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: pt-spin .8s linear infinite; }
@keyframes pt-spin { to { transform: rotate(360deg); } }
.pt-narrow { max-width: 760px; }
.pt-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pt-inline input[type=email], .pt-inline input[type=text] { min-width: 220px; }
.piq-row-actions form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

.piq-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 18px 0; }
.piq-org { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); }
.piq-org:hover { border-color: var(--brand); text-decoration: none; }
.piq-org span { display: block; color: var(--ink-3); font-size: 13px; margin-top: 4px; }

/* ---------- Sign-in pages ---------- */
body.pt-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--brand) 14%, #fff), var(--bg)); }
.pt-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: 0 12px 32px rgba(16,24,40,.08); }
.pt-card h1 { display: block; font-size: 20px; margin-bottom: 6px; }
.pt-card-brand { margin-bottom: 22px; }
.pt-card-brand .pt-wordmark { color: var(--ink); }
.pt-card-brand .pt-logo { max-height: 48px; }
.pt-sub { color: var(--ink-2); margin: 0 0 14px; }
.pt-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.pt-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.pt-form label.pt-check { flex-direction: row; align-items: center; font-weight: 500; }
.pt-form input[type=text], .pt-form input[type=password], .pt-form input[type=email] { width: 100%; min-height: 40px; }
.pt-wide { width: 100%; min-height: 42px; }
.pt-links { text-align: center; margin: 18px 0 0; font-size: 13px; }
.pt-auth-foot { color: var(--ink-3); font-size: 12px; margin-top: 18px; }

@media (max-width: 900px) {
	.pt-app { grid-template-columns: 1fr; }
	.pt-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
	.pt-org, .pt-side-foot { display: none; }
	.pt-nav { flex-direction: row; flex-wrap: wrap; }
	.pt-content { padding: 18px 16px 40px; }
	.pt-top { padding: 0 16px; }
	.form-table th { width: auto; display: block; padding-bottom: 0; }
	.form-table td { display: block; }
	.regular-text { width: 100%; }
}

/* ---------- Sourcing (officer) ---------- */
.piq-sealed { background: #fff8e6; border: 1px solid #f3dca4; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.piq-sealed strong { margin-right: 6px; }
.piq-add-suppliers { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 4px; }
.piq-filter { width: 100%; max-width: 420px; margin-bottom: 8px; }
.piq-pick { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fafbfc; }
.piq-pick label { display: block; padding: 5px 0; border-bottom: 1px solid #eef1f4; }
.piq-pick label:last-child { border-bottom: 0; }
.piq-actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.piq-actions-row .piq-warn { margin: 0 8px 0 0; }
.piq-qa { border-bottom: 1px solid var(--line); padding: 10px 0; }
.piq-qa p { margin: 4px 0; }
.piq-q, .sp-q { background: #f5f7fa; border-radius: 8px; padding: 8px 12px; }
.piq-a, .sp-a { padding: 4px 12px; border-left: 3px solid var(--brand); }
.piq-notice-form { margin-top: 14px; }
.piq-attach { margin-top: 12px; padding: 14px 18px; }
.piq-attach ul { margin: 6px 0 0 18px; }

/* ---------- Supplier submission page ---------- */
body.pt-supplier { background: var(--bg); }
.sp-top { background: #0f2039; color: #fff; }
.sp-top-in { max-width: 1100px; margin: 0 auto; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-org { font-weight: 650; font-size: 16px; }
.sp-by .pt-wordmark { font-size: 14px; opacity: .8; }
.sp-by .pt-logo { max-height: 28px; }
.sp-main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 48px; }
.sp-kicker { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--ink-3); margin: 0 0 4px; }
.sp-main h1 { font-size: 26px; display: block; }
.sp-for { color: var(--ink-2); margin: 4px 0 16px; }
.sp-closing { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 18px; margin-bottom: 16px; }
.sp-closing span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.sp-closing.is-closed { border-left-color: #b42318; }
.sp-count { font-weight: 700; font-size: 18px; color: var(--brand); white-space: nowrap; }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sp-grid .piq-card { margin: 0; }
.sp-spec { white-space: normal; line-height: 1.6; }
.sp-status { font-weight: 600; }
.sp-status--ok { color: #0a7d4f; }
.sp-files { list-style: none; padding: 0; margin: 8px 0; }
.sp-files li { padding: 6px 0; border-bottom: 1px solid #eef1f4; }
.sp-form input[type=file] { border: 1px dashed #b8c2cc; border-radius: 8px; padding: 10px; background: #fafbfc; font-weight: 400; }
.sp-form label.pt-check { align-items: flex-start; line-height: 1.4; }
.sp-decline { margin-top: 14px; }
.sp-decline summary { cursor: pointer; color: var(--ink-2); }
.sp-qa { border-bottom: 1px solid var(--line); padding: 8px 0; }
.sp-foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 0 0 28px; }
@media (max-width: 860px) { .sp-grid { grid-template-columns: 1fr; } .sp-closing { flex-direction: column; align-items: flex-start; } }

/* ---------- Vendor registration & profile ---------- */
.vp-main { max-width: 860px; }
.vp-form { gap: 0; }
.vp-form .piq-card { margin: 0 0 16px; }
.vp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.vp-grid label, .vp-form .piq-card > label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.vp-grid .vp-wide { grid-column: 1 / -1; }
.vp-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.vp-checks label { font-weight: 500; }
.vp-docs { display: grid; gap: 10px; }
.vp-doc { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.vp-doc strong { grid-column: 1 / -1; font-size: 13px; }
.vp-doc input[type=file] { border: 1px dashed #b8c2cc; border-radius: 8px; padding: 6px; background: #fff; }
.vp-exp { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.piq-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 16px; }
.piq-tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; }
.piq-tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.piq-tabs a .piq-pill { margin-left: 4px; }
.piq-share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.piq-share input { flex: 1; min-width: 280px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.piq-kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0; }
.piq-kv dt { color: var(--ink-3); }
.piq-kv dd { margin: 0; }
.piq-expired { color: #b42318; font-weight: 600; }
.piq-expiring { color: #b26a00; font-weight: 600; }
@media (max-width: 700px) { .vp-grid, .piq-kv { grid-template-columns: 1fr; } }
.pt-form .vp-checks label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.piq-formcfg { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 18px; align-items: start; }
.piq-formcfg-side { margin: 0; position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.piq-cfg-group { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 10px; }
.piq-cfg-group.is-gov { background: #f3f7fd; border-radius: 8px; padding: 4px 10px 8px; border-top: 0; }
.piq-cfg-group h3 { margin: 10px 0 6px; font-size: 13px; }
.piq-cfg { width: 100%; border-collapse: collapse; font-size: 13px; }
.piq-cfg th { font-size: 11px; color: var(--ink-3); font-weight: 600; text-align: center; padding: 2px 4px; }
.piq-cfg td { padding: 5px 4px; border-top: 1px solid #eef1f4; }
.piq-cfg td:nth-child(2), .piq-cfg td:nth-child(3) { text-align: center; width: 64px; }
.piq-formcfg-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.piq-preview-bar { display: flex; justify-content: space-between; padding: 8px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.piq-formcfg-preview iframe { display: block; width: 100%; height: calc(100vh - 140px); min-height: 640px; border: 0; }
@media (max-width: 1100px) { .piq-formcfg { grid-template-columns: 1fr; } .piq-formcfg-side { position: static; max-height: none; } }
.piq-bankverify { margin-top: 14px; }
.piq-bankverify label { display: block; margin: 8px 0; font-weight: 600; }

/* Organisation switcher */
.pt-switch { padding: 0; }
.pt-switch summary { cursor: pointer; list-style: none; padding: 8px 28px 8px 10px; position: relative; }
.pt-switch summary::-webkit-details-marker { display: none; }
.pt-switch summary::after { content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; border: solid #93a1b3; border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); }
.pt-switch[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.pt-switch-list { display: flex; flex-direction: column; padding: 4px 6px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.pt-switch-list span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #93a1b3; padding: 6px 6px 4px; font-weight: 500; }
.pt-switch-list a { position: relative; color: #c9d2de; padding: 7px 6px 7px 22px; border-radius: 6px; font-weight: 500; display: flex; flex-direction: column; }
.pt-switch-list a small { color: #93a1b3; font-weight: 400; font-size: 11.5px; }
.pt-switch-list a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.pt-switch-list a.is-current { color: #fff; }
.pt-switch-list a.is-current::before { content: "✓"; position: absolute; left: 6px; top: 7px; }

/* Signed-in user: name with e-mail underneath */
.pt-who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.pt-who span { font-weight: 500; }
.pt-who small { color: var(--ink-3, #6b7785); font-size: 12px; }
.pt-who:hover { text-decoration: none; }
.pt-who:hover span { text-decoration: underline; }
@media (max-width: 640px) { .pt-who small { display: none; } }

/* Incomplete vendor profile */
.piq-card--warn { border-left: 3px solid #b26a00; background: #fffaf0; }
.piq-list { margin: 6px 0 10px 18px; list-style: disc; }
.piq-list li { margin: 2px 0; }

.sp-items { margin: 4px 0 14px; }
.sp-items td.num, .sp-items th.num { text-align: right; white-space: nowrap; }

/* Footer */
.pt-content { flex: 1 0 auto; }
.pt-foot { padding: 16px 28px 22px; color: var(--ink-3, #6b7785); font-size: 12px; border-top: 1px solid var(--line, #e3e7ec); }
@media (max-width: 900px) { .pt-main { min-height: 0; } .pt-foot { padding: 14px 16px 20px; } }
