/* Saral Hub brand tokens (brand/brand-identity.md). Views use these tokens only; never hard-code colours. */
:root {
  /* Palette */
  --sh-green: #087C65;        /* Saral Green - primary, dominant */
  --sh-forest: #145548;       /* Deep Forest - depth and contrast */
  --sh-amber: #F2A93B;        /* Action Amber - highlights, use sparingly */
  --sh-ivory: #F6F8F5;        /* Soft Ivory - page background */
  --sh-graphite: #26332F;     /* Graphite - text and headings */
  --sh-white: #FFFFFF;        /* Cards and surfaces */
  --sh-green-tint: #E6F2EF;   /* subtle tonal variation of Saral Green */
  --sh-border: #DDE4E0;
  --sh-muted: #5B6863;        /* secondary text, AA on white and ivory */

  /* Functional status colours (always paired with text) */
  --sh-status-approved: #16845B;
  --sh-status-pending: #C58A19;
  --sh-status-rejected: #D64545;
  --sh-status-processing: #3977C5;
  --sh-status-draft: #68756E;
  --sh-status-returned: #8062B5;

  /* Typography */
  --sh-font-heading: "Manrope", system-ui, sans-serif;
  --sh-font-body: "Inter", system-ui, sans-serif;
  --sh-font-ui: "IBM Plex Sans", system-ui, sans-serif;

  /* Shape */
  --sh-radius-control: 8px;
  --sh-radius-card: 12px;
  --sh-sidebar-width: 248px;

  /* Bootstrap mapping */
  --bs-primary: var(--sh-green);
  --bs-primary-rgb: 8, 124, 101;
  --bs-body-bg: var(--sh-ivory);
  --bs-body-color: var(--sh-graphite);
  --bs-body-font-family: var(--sh-font-body);
  --bs-border-color: var(--sh-border);
  --bs-border-radius: var(--sh-radius-control);
  --bs-link-color: var(--sh-green);
  --bs-link-color-rgb: 8, 124, 101;
  --bs-link-hover-color: var(--sh-forest);
  --bs-link-hover-color-rgb: 20, 85, 72;
  --bs-secondary-color: var(--sh-muted);
  --bs-focus-ring-color: rgba(8, 124, 101, .35);
}

body { background: var(--sh-ivory); color: var(--sh-graphite); font-family: var(--sh-font-body); }
h1, h2, h3, h4, h5, h6, .sh-heading { font-family: var(--sh-font-heading); font-weight: 700; color: var(--sh-graphite); }
.sh-num, .table td.num, .table th.num { font-family: var(--sh-font-ui); font-variant-numeric: tabular-nums; text-align: right; }

/* Buttons and inputs */
.btn { border-radius: var(--sh-radius-control); font-family: var(--sh-font-ui); font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--sh-green); --bs-btn-border-color: var(--sh-green); --bs-btn-hover-bg: var(--sh-forest); --bs-btn-hover-border-color: var(--sh-forest); --bs-btn-active-bg: var(--sh-forest); --bs-btn-active-border-color: var(--sh-forest); --bs-btn-disabled-bg: var(--sh-green); --bs-btn-disabled-border-color: var(--sh-green); }
.btn-outline-primary { --bs-btn-color: var(--sh-green); --bs-btn-border-color: var(--sh-green); --bs-btn-hover-bg: var(--sh-green); --bs-btn-hover-border-color: var(--sh-green); --bs-btn-active-bg: var(--sh-forest); }
.btn-action { --bs-btn-bg: var(--sh-amber); --bs-btn-border-color: var(--sh-amber); --bs-btn-color: var(--sh-graphite); --bs-btn-hover-bg: var(--sh-amber); --bs-btn-hover-color: var(--sh-graphite); --bs-btn-hover-border-color: var(--sh-forest); }
.form-control, .form-select { border-radius: var(--sh-radius-control); }
.form-control:focus, .form-select:focus { border-color: var(--sh-green); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-label { font-weight: 500; }

/* Cards: white on ivory, subtle border, no heavy shadow */
.card { border-radius: var(--sh-radius-card); border: 1px solid var(--sh-border); background: var(--sh-white); box-shadow: none; }

/* App shell */
.sh-shell { display: flex; min-height: 100vh; }
.sh-sidebar { width: var(--sh-sidebar-width); background: var(--sh-white); border-right: 1px solid var(--sh-border); flex-shrink: 0; }
.sh-sidebar .sh-brand { display: block; padding: 1rem 1.25rem; border-bottom: 1px solid var(--sh-border); }
.sh-sidebar .sh-brand img { height: 36px; width: auto; }
.sh-nav { list-style: none; padding: .75rem; margin: 0; }
.sh-nav-section { font-family: var(--sh-font-ui); font-size: .75rem; font-weight: 600; color: var(--sh-muted); padding: .75rem .75rem .25rem; }
.sh-nav a { display: flex; align-items: center; gap: .625rem; padding: .5rem .75rem; border-radius: var(--sh-radius-control); color: var(--sh-graphite); text-decoration: none; font-family: var(--sh-font-ui); font-weight: 500; }
.sh-nav a:hover { background: var(--sh-ivory); }
.sh-nav a.active { background: var(--sh-green-tint); color: var(--sh-green); }
.sh-nav a[aria-disabled="true"] { color: var(--sh-muted); pointer-events: none; }
.sh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sh-topbar { background: var(--sh-white); border-bottom: 1px solid var(--sh-border); padding: .625rem 1rem; display: flex; align-items: center; gap: .75rem; }
.sh-content { padding: 1.5rem; flex: 1; }
.sh-footer { padding: 1rem 1.5rem; color: var(--sh-muted); font-size: .875rem; border-top: 1px solid var(--sh-border); }
.sh-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.sh-page-header h1 { font-size: 1.5rem; margin: 0; }

/* Stat tiles */
.sh-tile { padding: 1rem 1.25rem; }
.sh-tile .sh-tile-label { color: var(--sh-muted); font-size: .875rem; font-family: var(--sh-font-ui); }
.sh-tile .sh-tile-value { font-family: var(--sh-font-ui); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; }

/* Status badges: colour + text, never colour alone */
.sh-status { display: inline-flex; align-items: center; gap: .375rem; font-family: var(--sh-font-ui); font-size: .8125rem; font-weight: 500; padding: .125rem .5rem; border-radius: 999px; border: 1px solid currentColor; background: var(--sh-white); }
.sh-status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.sh-status-approved { color: var(--sh-status-approved); }
.sh-status-pending { color: #8A5F0D; } /* darkened Pending for AA text contrast */
.sh-status-rejected { color: #B83232; }
.sh-status-processing { color: var(--sh-status-processing); }
.sh-status-draft { color: var(--sh-status-draft); }
.sh-status-returned { color: var(--sh-status-returned); }

/* Hold / alert banner */
.sh-banner-hold { border: 1px solid var(--sh-status-rejected); border-left-width: 4px; background: var(--sh-white); border-radius: var(--sh-radius-card); padding: 1rem 1.25rem; }

/* Login */
.sh-auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background-color: var(--sh-ivory);
  background-image: linear-gradient(var(--sh-green-tint) 1px, transparent 1px), linear-gradient(90deg, var(--sh-green-tint) 1px, transparent 1px);
  background-size: 48px 48px; }
.sh-auth .card { width: 100%; max-width: 420px; }
.sh-auth .sh-auth-logo { height: 52px; width: auto; }
.sh-tagline { color: var(--sh-forest); font-family: var(--sh-font-heading); font-weight: 600; }

/* Mobile (down to 360px): sidebar becomes an off-canvas drawer */
@media (max-width: 991.98px) {
  .sh-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s ease; }
  .sh-sidebar.show { transform: none; }
  .sh-content { padding: 1rem; }
}
@media (min-width: 992px) { .sh-menu-toggle { display: none; } }
