:root {
  --ink: #101827;
  --muted: #667085;
  --line: #dde3ea;
  --panel: #ffffff;
  --canvas: #f4f6f9;
  --gold: #c89a22;
  --gold-deep: #a77b12;
  --nav: #111827;
  --nav-soft: #1e293b;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --radius: 16px;
  --shadow: 0 16px 40px rgba(16, 24, 39, 0.08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 18% 10%, rgba(200, 154, 34, 0.12), transparent 34%),
    linear-gradient(145deg, #edf1f5 0%, #f8fafc 52%, #eef2f6 100%);
}
.auth-card {
  width: min(640px, 100%);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(16,24,39,.12);
  padding: 42px;
}
.portal-brand { display: inline-block; margin-bottom: 24px; }
.portal-brand img { display: block; width: min(280px, 78vw); height: auto; }
.portal-kicker, .section-kicker, .topbar-eyebrow {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-panel h1 { margin: 0 0 10px; font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.08; }
.auth-panel > p { color: var(--muted); line-height: 1.65; margin: 0 0 24px; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid #e5e7eb; border-top-color: var(--gold);
  animation: spin .8s linear infinite; margin-bottom: 22px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-pill, .role-badge {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 7px 11px;
  background: #eef2f6; color: #344054;
  font-size: .78rem; font-weight: 800;
}
.status-pill { margin-bottom: 16px; }
.status-pill.warning { background: #fff4e5; color: var(--warning); }
.config-list { display: grid; gap: 10px; margin: 20px 0; }
.config-list div {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc;
}
.config-list code { color: var(--gold-deep); font-weight: 800; }
.fine-print, small { color: var(--muted); font-size: .82rem; }

.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #344054; font-size: .88rem; font-weight: 700; }
label small { font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd6df;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,154,34,.14); }
input:disabled { background: #f3f4f6; color: #667085; }

.button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 16px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.button.primary { background: var(--nav); color: #fff; }
.button.primary:hover { background: #222d3f; }
.button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: #f8fafc; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.back-link { display: inline-block; margin-top: 22px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.back-link:hover { color: var(--ink); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  min-height: 100vh;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--nav); color: #fff;
  padding: 26px 18px 18px;
  z-index: 20;
}
.sidebar-brand { display: block; background: #fff; border-radius: 10px; padding: 12px 14px; }
.sidebar-brand img { display: block; width: 100%; height: auto; }
.sidebar-label { margin: 18px 8px 12px; color: #98a2b3; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.portal-nav { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 9px;
  background: transparent; color: #cbd5e1;
  padding: 11px 12px; text-align: left; font-weight: 700;
}
.nav-item span { width: 22px; text-align: center; color: #94a3b8; }
.nav-item:hover { background: var(--nav-soft); color: #fff; }
.nav-item.active { background: #253246; color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-footer { margin-top: auto; border-top: 1px solid #2d3748; padding-top: 16px; }
.user-mini { display: grid; gap: 4px; padding: 0 8px 12px; }
.user-mini strong { font-size: .9rem; }
.user-mini span { color: #94a3b8; font-size: .78rem; overflow-wrap: anywhere; }
.logout-button { border: 0; background: transparent; color: #cbd5e1; padding: 9px 8px; font-weight: 700; }
.logout-button:hover { color: #fff; }

.app-main { min-width: 0; }
.topbar {
  min-height: 88px;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 30px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 1.35rem; }
.topbar-eyebrow { margin-bottom: 3px; font-size: .66rem; }
.topbar-account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-account > div { display: grid; gap: 2px; }
.topbar-account strong { font-size: .88rem; }
.topbar-account span:not(.role-badge) { color: var(--muted); font-size: .76rem; }
.role-badge { background: #fff8e7; color: var(--gold-deep); }
.menu-button { display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 40px; height: 40px; }

.content-wrap { padding: 30px; max-width: 1500px; margin: 0 auto; }
.view { display: none; }
.view.active-view { display: block; }
.section-header { margin-bottom: 20px; }
.section-header.split { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.section-header h2, .welcome-panel h2 { margin: 0 0 6px; font-size: clamp(1.55rem, 3vw, 2.05rem); }
.section-header p:not(.section-kicker), .welcome-panel p:not(.section-kicker) { margin: 0; color: var(--muted); }

.welcome-panel {
  display: flex; justify-content: space-between; align-items: center; gap: 22px;
  background: linear-gradient(120deg, #111827 0%, #1e293b 72%, #29384d 100%);
  color: #fff; border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.welcome-panel p:not(.section-kicker) { color: #cbd5e1; }
.welcome-panel .section-kicker { color: #e5bd54; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 8px 24px rgba(16,24,39,.04); }
.metric-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; margin-bottom: 10px; }
.metric-card strong { font-size: 2rem; line-height: 1; }
.metric-card small { display: block; margin-top: 8px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panel-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16,24,39,.04); padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-heading h3 { margin: 0; font-size: 1.15rem; }
.text-button { border: 0; background: transparent; color: var(--gold-deep); font-weight: 800; padding: 5px; }
.compact-list { display: grid; gap: 0; }
.compact-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; padding: 13px 0; border-top: 1px solid #edf0f3; }
.compact-row:first-child { border-top: 0; padding-top: 0; }
.compact-row strong { display: block; font-size: .9rem; margin-bottom: 4px; }
.compact-row small { display: block; }
.empty-state { padding: 24px 12px; color: var(--muted); text-align: center; }

.profile-form { max-width: 980px; }
.security-form { margin-top: 18px; }
.form-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.upload-form { display: grid; grid-template-columns: 200px minmax(0,1fr) auto; align-items: end; gap: 16px; margin-bottom: 18px; }
.file-field small { margin-top: 2px; }

.table-card { padding: 0; overflow: hidden; }
.table-card .panel-heading { padding: 20px 22px 0; }
.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 14px 16px; border-top: 1px solid #edf0f3; text-align: left; vertical-align: top; }
.data-table th { background: #fafbfc; color: #667085; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { font-size: .86rem; }
.data-table td strong { display: block; margin-bottom: 3px; }
.data-table td small { display: block; line-height: 1.45; }
.status-tag {
  display: inline-flex; align-items: center; white-space: nowrap;
  border-radius: 999px; padding: 5px 9px; background: #eef2f6;
  color: #344054; font-size: .72rem; font-weight: 800; text-transform: capitalize;
}
.status-tag.accepted, .status-tag.completed { background: #ecfdf3; color: var(--success); }
.status-tag.declined, .status-tag.cancelled { background: #fef3f2; color: var(--danger); }
.status-tag.in_progress, .status-tag.reviewing { background: #eff8ff; color: #175cd3; }
.status-tag.new, .status-tag.scheduled { background: #fff8e7; color: var(--gold-deep); }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-button, .mini-select {
  border: 1px solid #d0d5dd; border-radius: 7px; background: #fff; color: #344054;
  padding: 7px 9px; font-size: .76rem; font-weight: 700; text-decoration: none;
}
.mini-button.danger { color: var(--danger); }

.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.admin-vendors-card { margin-top: 18px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px; border-radius: 10px;
  background: #101828; color: #fff; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-size: .88rem;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #7a271a; }
.toast.success { background: #05603a; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .upload-form { grid-template-columns: 1fr 1fr; }
  .upload-form button { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 840px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw);
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(16,24,39,.22);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { padding: 14px 18px; }
  .topbar-account > div { display: none; }
  .content-wrap { padding: 20px 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .welcome-panel { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .auth-card { padding: 28px 20px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .metric-grid { grid-template-columns: 1fr; }
  .section-header.split { display: block; }
  .section-header.split .status-pill { margin-top: 12px; }
  .upload-form { grid-template-columns: 1fr; }
  .upload-form button { grid-column: auto; width: 100%; }
  .topbar { align-items: center; }
  .role-badge { display: none; }
}

/* ================================================================
   Premier Edge Services — portal / public-site visual alignment
   Keeps portal behavior intact while matching the main website.
   ================================================================ */
:root {
  --ink: #080808;
  --charcoal: #151515;
  --gold: #d4a013;
  --gold-deep: #9d7200;
  --gold-pale: #efe0ae;
  --paper: #ffffff;
  --ivory: #f6f4ef;
  --line: #d9d6cf;
  --muted: #66645f;
  --panel: #ffffff;
  --canvas: #f6f4ef;
  --nav: #080808;
  --nav-soft: #151515;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --radius: 0;
  --shadow: none;
}

html, body { background: var(--ivory); }
body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Login / invitation screens use the same editorial language. */
.auth-shell {
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(212,160,19,.13) 50%, transparent calc(50% + .5px)),
    var(--ivory);
  padding: 56px 24px;
}
.auth-card {
  width: min(690px, 100%);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 0;
  box-shadow: none;
  padding: 48px;
  background: rgba(255,255,255,.98);
}
.portal-brand { margin-bottom: 34px; }
.portal-brand img { width: min(240px, 72vw); }
.portal-kicker,
.section-kicker,
.topbar-eyebrow {
  color: var(--gold-deep);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.auth-panel h1,
.section-header h2,
.welcome-panel h2,
.topbar h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.04em;
}
.auth-panel h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: .95;
  margin-bottom: 18px;
}
.auth-panel > p { color: var(--muted); }
.status-pill,
.role-badge {
  border-radius: 0;
  background: var(--ivory);
  color: var(--ink);
  border-left: 3px solid var(--gold);
  padding: 7px 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .65rem;
}
.status-pill.warning { background: #fff8e8; color: #7a5700; }

input, select, textarea {
  border: 1px solid #c9c5bd;
  border-radius: 0;
  min-height: 48px;
  padding: 11px 13px;
}
textarea { min-height: 112px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 2px rgba(212,160,19,.15);
}
label { color: #262522; }

.button {
  min-height: 49px;
  border-radius: 0;
  padding: 13px 20px;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.button.secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.button.secondary:hover { background: var(--ink); color: var(--paper); }
.back-link { text-decoration: underline; text-underline-offset: 5px; }

/* Desktop portal shell becomes a Premier Edge site header rather than an app sidebar. */
.app-shell {
  min-height: 100vh;
  display: block;
  background: var(--ivory);
}
.sidebar {
  min-height: 92px;
  height: auto;
  width: 100%;
  position: sticky;
  inset: auto;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 0 max(36px, calc((100vw - 1240px) / 2));
  color: var(--ink);
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid rgba(8,8,8,.11);
  box-shadow: none;
  backdrop-filter: blur(16px);
}
.sidebar-brand {
  width: 194px;
  flex: 0 0 194px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.sidebar-label {
  margin: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--gold-deep);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .17em;
  white-space: nowrap;
}
.portal-nav {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  gap: 24px;
}
.nav-item {
  position: relative;
  width: auto;
  min-height: 91px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #242321;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.nav-item span { display: none; }
.nav-item::after {
  position: absolute;
  right: 100%;
  bottom: 25px;
  left: 0;
  height: 1px;
  background: var(--gold);
  content: "";
  transition: right .22s ease;
}
.nav-item:hover,
.nav-item.active { background: transparent; color: var(--ink); box-shadow: none; }
.nav-item:hover::after,
.nav-item.active::after { right: 0; }
.sidebar-footer {
  margin: 0 0 0 4px;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
}
.user-mini { display: none; }
.logout-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.logout-button:hover { background: transparent; color: var(--ink); }

.app-main { min-width: 0; background: var(--ivory); }
.topbar {
  min-height: 154px;
  position: relative;
  top: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 34px max(36px, calc((100vw - 1240px) / 2));
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(212,160,19,.12), transparent 32%),
    var(--ink);
  border: 0;
}
.topbar::after {
  position: absolute;
  left: max(36px, calc((100vw - 1240px) / 2));
  bottom: 0;
  width: 84px;
  height: 3px;
  background: var(--gold);
  content: "";
}
.topbar h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  line-height: .92;
}
.topbar-eyebrow { margin-bottom: 8px; color: var(--gold); }
.topbar-account { gap: 16px; }
.topbar-account strong { font-size: .9rem; }
.topbar-account span:not(.role-badge) { color: #bdb9b0; }
.role-badge {
  border-left-color: var(--gold);
  background: #242424;
  color: var(--gold-pale);
}
.menu-button {
  border: 1px solid #696969;
  border-radius: 0;
  background: transparent;
  color: #fff;
}

.content-wrap {
  width: min(calc(100% - 72px), 1240px);
  max-width: none;
  margin: 0 auto;
  padding: 62px 0 86px;
}
.view.active-view { animation: portalFade .18s ease; }
@keyframes portalFade { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-header { margin-bottom: 30px; }
.section-header h2,
.welcome-panel h2 {
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: .96;
  margin-bottom: 12px;
}
.section-header p:not(.section-kicker),
.welcome-panel p:not(.section-kicker) {
  max-width: 720px;
  color: var(--muted);
  font-size: .98rem;
}
.section-kicker { margin-bottom: 13px; }

.welcome-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 36px;
  margin-bottom: 28px;
  padding: 38px 40px 40px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 0;
  box-shadow: none;
}
.welcome-panel .section-kicker { color: var(--gold-deep); }
.welcome-panel p:not(.section-kicker) { color: var(--muted); }

.metric-grid {
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0;
  margin: 0 0 28px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.metric-card {
  min-height: 160px;
  padding: 28px 26px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.metric-card:last-child { border-right: 0; }
.metric-card span {
  color: var(--muted);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 400;
  line-height: .9;
}
.metric-card small { margin-top: 14px; }

.dashboard-grid { gap: 28px; }
.panel-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 28px;
}
.panel-heading { margin-bottom: 24px; }
.panel-heading h3 {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -.025em;
}
.text-button {
  color: var(--ink);
  font-size: .64rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 6px;
}
.compact-row { padding: 17px 0; border-top-color: var(--line); }
.empty-state { padding: 34px 12px; }

.form-actions { margin-top: 28px; }
.profile-form { max-width: 100%; }
.security-form { margin-top: 28px; }
.upload-form { margin-bottom: 28px; }

.table-card { border-radius: 0; }
.table-card .panel-heading { padding: 26px 28px 0; }
.data-table th,
.data-table td { border-top-color: var(--line); padding: 16px 18px; }
.data-table th {
  background: #f0eee8;
  color: #4f4c46;
  font-size: .62rem;
  letter-spacing: .12em;
}
.data-table td { font-size: .86rem; }
.status-tag {
  border-radius: 0;
  padding: 5px 8px;
  border-left: 2px solid var(--gold);
}
.mini-button,
.mini-select {
  min-height: 35px;
  border-radius: 0;
  border-color: #bbb7af;
  background: #fff;
}
.mini-button:hover { border-color: var(--gold-deep); }

.admin-grid { gap: 22px; }
.admin-vendors-card { margin-top: 28px; }

.toast {
  border-radius: 0;
  border-left: 4px solid var(--gold);
}

@media (max-width: 1240px) {
  .sidebar { padding-inline: 26px; gap: 18px; }
  .sidebar-label { display: none; }
  .portal-nav { gap: 18px; }
  .nav-item { font-size: .61rem; letter-spacing: .1em; }
  .topbar { padding-inline: 36px; }
  .topbar::after { left: 36px; }
}

@media (max-width: 1060px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    min-height: 100vh;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 28px 22px;
    color: #fff;
    background: var(--ink);
    box-shadow: 24px 0 50px rgba(8,8,8,.2);
    overflow-y: auto;
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .sidebar-brand {
    width: 205px;
    flex: 0 0 auto;
    padding: 12px 14px;
    background: #fff;
  }
  .sidebar-label {
    display: block;
    margin: 22px 6px 12px;
    padding: 0;
    border: 0;
    color: var(--gold);
  }
  .portal-nav {
    margin: 0;
    display: grid;
    gap: 0;
  }
  .nav-item {
    min-height: 48px;
    width: 100%;
    padding: 13px 6px;
    color: #d3d0c9;
    justify-content: flex-start;
  }
  .nav-item::after { bottom: 6px; }
  .nav-item:hover,
  .nav-item.active { color: #fff; }
  .sidebar-footer {
    margin: auto 0 0;
    padding-top: 20px;
    border-top: 1px solid #333;
  }
  .user-mini { display: grid; }
  .logout-button {
    margin-left: auto;
    border-color: #fff;
  }
  .logout-button:hover { color: #fff; border-color: var(--gold); }
  .topbar {
    min-height: 112px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 22px 22px;
  }
  .topbar::after { left: 22px; width: 56px; }
  .topbar h1 { font-size: 2rem; }
  .menu-button { display: inline-grid; place-items: center; flex: 0 0 42px; }
  .content-wrap { width: min(calc(100% - 40px), 1240px); padding-top: 42px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .welcome-panel { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 700px) {
  .auth-card { padding: 34px 24px; }
  .content-wrap { width: min(calc(100% - 28px), 1240px); padding: 32px 0 60px; }
  .topbar { min-height: 94px; padding: 16px 14px; }
  .topbar-account { gap: 8px; }
  .topbar-account > div { display: none; }
  .role-badge { display: none; }
  .section-header h2,
  .welcome-panel h2 { font-size: clamp(2.35rem, 13vw, 3.7rem); }
  .welcome-panel { padding: 28px 24px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card,
  .metric-card:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-card:last-child { border-bottom: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-card { padding: 22px; }
  .table-card { padding: 0; }
  .admin-grid { grid-template-columns: 1fr; }
}


/* Email OTP verification for every sign-in */
.otp-input {
  text-align: center;
  font-size: 2rem !important;
  font-weight: 900;
  letter-spacing: .38em;
  font-variant-numeric: tabular-nums;
  padding-left: calc(16px + .38em) !important;
}
.otp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.otp-actions .text-button {
  cursor: pointer;
}
