/* ===================================================================
   SNRDC Buyer's Portal — one stylesheet for the whole program.
   Same navy/gold look staff already use.
   =================================================================== */

:root {
  --snrdc-navy: #1f3864;
  --snrdc-navy-dark: #142643;
  --snrdc-navy-tint: #eef2f8;
  --snrdc-gold: #bf9000;
  --snrdc-gold-tint: #fbf3d9;

  --surface: #ffffff;
  --surface-muted: #f6f7f9;
  --border: #e1e4ea;
  --text: #1c1f26;
  --text-muted: #5b6472;

  --status-pending: #b8860b;
  --status-progress: #1f3864;
  --status-completed: #1e7d4f;
  --status-rejected: #b3261e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(20,38,67,.06), 0 1px 8px rgba(20,38,67,.04);
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-muted);
}

a { color: var(--snrdc-navy); }

/* --- page frame ---------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.shell__sidebar {
  width: 230px; flex-shrink: 0; background: var(--snrdc-navy); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.shell__brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px;
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
}
.shell__brand img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }

.shell__nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 2px; overflow-y: auto; flex: 1; }
.shell__nav a {
  color: #dbe3f0; text-decoration: none; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px;
}
.shell__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.shell__nav a.is-active { background: var(--snrdc-gold); color: #26200a; font-weight: 600; }

.shell__user { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.12); }
.shell__username { font-size: 13px; margin-bottom: 2px; }
.shell__usersub { font-size: 11px; color: #a9b7cd; font-family: Consolas, monospace; margin-bottom: 10px; }
.shell__company { font-size: 10px; color: #8ea1bf; line-height: 1.4; margin-top: 12px; }
.shell__user .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.shell__user .btn--ghost:hover { background: rgba(255,255,255,.1); }

.shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell__topbar {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border-bottom: 1px solid var(--border); padding: 14px 24px; position: sticky; top: 0; z-index: 20;
}
.shell__topbar h1 { font-family: var(--font-display); font-size: 21px; margin: 0; flex: 1; }
.shell__menu { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.shell__content { padding: 22px 24px 48px; }

.bell { position: relative; text-decoration: none; font-size: 18px; line-height: 1; }
.bell__dot {
  position: absolute; top: -6px; right: -8px; background: var(--status-rejected); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px;
}

/* --- cards and text ------------------------------------------------ */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 22px; box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.card--narrow { max-width: 760px; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.card h2 { font-family: var(--font-display); font-size: 16px; margin: 0 0 14px; }
.card__header h2 { margin: 0; }
.hint, .muted { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--snrdc-navy);
  font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin: 22px 0 12px;
}

/* --- buttons -------------------------------------------------------- */

.btn {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; text-decoration: none; text-align: center;
}
.btn--primary { background: var(--snrdc-navy); color: #fff; }
.btn--primary:hover { background: var(--snrdc-navy-dark); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-muted); }
.btn--danger { background: #fdecea; color: var(--status-rejected); border-color: #f3c8c4; }
.btn--danger:hover { background: #fbdedb; }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--block { display: block; width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; }

/* --- forms ---------------------------------------------------------- */

label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
label > span.lbl { display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--text); background: var(--surface);
}
textarea { resize: vertical; min-height: 90px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--snrdc-gold); outline-offset: 1px; }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-muted); color: var(--text-muted); }
.req { color: var(--status-rejected); font-weight: 700; }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row label { margin-bottom: 0; }
.row__grow { flex: 1; min-width: 200px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 14px; }
.check input { width: auto; margin-top: 3px; flex-shrink: 0; }

/* --- banners -------------------------------------------------------- */

.banner { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin: 0 0 16px; line-height: 1.55; }
.banner--error { background: #fdecea; color: var(--status-rejected); }
.banner--success { background: #e6f4ec; color: var(--status-completed); }
.banner--info { background: var(--snrdc-navy-tint); color: var(--snrdc-navy); }
.banner--warn { background: var(--snrdc-gold-tint); color: #6b5200; border: 1px solid #e8d9a0; }

.status-banner { border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 20px; max-width: 820px;
  background: var(--snrdc-gold-tint); border: 1px solid var(--snrdc-gold); }
.status-banner__title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #8a6d00; margin-bottom: 6px; }
.status-banner p { margin: 0; font-size: 13px; line-height: 1.55; }
.status-banner--active { background: #e6f4ec; border-color: var(--status-completed); }
.status-banner--active .status-banner__title { color: var(--status-completed); }
.status-banner--off { background: #fdecea; border-color: var(--status-rejected); }
.status-banner--off .status-banner__title { color: var(--status-rejected); }

/* --- tables --------------------------------------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 8px 10px; color: var(--text-muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:hover td { background: var(--surface-muted); }
.nowrap { white-space: nowrap; }
.empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-muted); color: var(--text-muted); white-space: nowrap; }
.badge--pending, .badge--new { background: var(--snrdc-gold-tint); color: #8a6d00; }
.badge--in_progress, .badge--contacted { background: var(--snrdc-navy-tint); color: var(--snrdc-navy); }
.badge--completed, .badge--active { background: #e6f4ec; color: var(--status-completed); }
.badge--rejected { background: #fdecea; color: var(--status-rejected); }
.badge--cancelled, .badge--closed { background: var(--surface-muted); color: var(--text-muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager__count, .pager__page { font-size: 12px; color: var(--text-muted); }
.pager__links { display: flex; align-items: center; gap: 10px; }

/* --- field display grid (profile, BIS) ------------------------------ */

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.fields--3 { grid-template-columns: repeat(3, 1fr); }
.field__label { font-size: 11px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); margin-bottom: 3px; }
.field__value { font-size: 14px; word-break: break-word; }
.field__value--mono { font-family: Consolas, monospace; }

/* --- tabs ----------------------------------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 16px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--snrdc-navy); border-bottom-color: var(--snrdc-gold); }

/* --- sign-in / register screens ------------------------------------- */

body.auth { background: var(--snrdc-navy); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.auth-card { width: 400px; max-width: 100%; background: var(--surface); border-radius: var(--radius-md); padding: 30px; box-shadow: var(--shadow-card); }
.auth-card--wide { width: 460px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { width: 54px; height: 54px; object-fit: contain; }
.auth-brand__mark { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--snrdc-navy); }
.auth-brand__full { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.auth-brand__sub { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.auth-card h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 16px; }
.auth-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--snrdc-gold);
  background: var(--snrdc-gold-tint); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; color: #6b5200; }
.auth-alt { margin-top: 16px; font-size: 13px; text-align: center; color: var(--text-muted); }
.auth-card .btn { width: 100%; padding: 12px; font-size: 15px; }
.auth-card .btn--ghost { margin-top: 10px; border-width: 1.5px; border-color: var(--snrdc-navy); color: var(--snrdc-navy); }
.namebox { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 12px 0; margin-bottom: 14px; }
.namebox legend { font-size: 13px; color: var(--text-muted); padding: 0 4px; }

/* --- printable sheets ----------------------------------------------- */

body.print { background: #fff; }
.sheet { max-width: 8.0in; margin: 0 auto; padding: 24px; background: #fff; }
.print-bar { background: var(--snrdc-navy-tint); border-bottom: 1px solid var(--border); padding: 10px 16px;
  display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 13px; }
@media print {
  .print-bar, .no-print { display: none !important; }
  .sheet { max-width: none; padding: 0; }
  body.print { font-size: 11px; }
}

/* --- small screens --------------------------------------------------- */

@media (max-width: 860px) {
  .shell__sidebar {
    position: fixed; left: -240px; transition: left .2s; z-index: 40;
  }
  .shell__sidebar.is-open { left: 0; }
  .shell__menu { display: block; }
  .shell__content { padding: 16px; }
  .grid2, .grid3, .fields, .fields--3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}
