/* ============================================================
   Kims Health Care HMS — base.css
   Design tokens, reset, typography, utilities
   ============================================================ */

:root {
  /* Brand — KIMSHEALTH red (primary #B71C2B extracted from kimshealth.org) */
  --red-25:  #FEF9F9;
  --red-50:  #FEF4F4;
  --red-100: #FAE3E5;
  --red-200: #F4C3C8;
  --red-300: #E9959D;
  --red-400: #D95A66;
  --red-500: #C93140;
  --red-600: #B71C2B;   /* brand primary */
  --red-700: #9C1523;
  --red-800: #7E111D;
  --red-900: #5E0C15;
  --amber:   #FFC107;   /* brand accent (ratings/highlights) */
  --navy:    #21283C;   /* brand dark (boards/footers) */

  /* Neutrals */
  --gray-25:  #FAFBFC;  /* page canvas */
  --gray-50:  #F5F6F8;
  --gray-100: #EDEFF2;
  --gray-200: #E2E5E9;  /* borders */
  --gray-300: #CBD1D8;
  --gray-400: #98A1AC;
  --gray-500: #6B7683;  /* muted text */
  --gray-700: #3D4650;  /* secondary text */
  --gray-900: #171B20;  /* primary ink */
  --white: #FFFFFF;

  /* Semantic */
  --ok:        #157A47;
  --ok-bg:     #E7F6EE;
  --ok-border: #BCE5CD;
  --warn:      #9A6200;
  --warn-bg:   #FFF4DC;
  --warn-border:#F2DCA6;
  --danger:    #C41E25;
  --danger-bg: #FDF1F1;
  --danger-border:#F7C6C8;
  --info:      #1D5FD3;
  --info-bg:   #EAF1FE;
  --info-border:#C4D8FA;
  --violet:    #6941C6;
  --violet-bg: #F2EDFC;
  --violet-border:#DCCFF5;

  /* Surfaces & elevation */
  --surface: var(--white);
  --canvas: var(--gray-25);
  --border: var(--gray-200);
  --shadow-sm: 0 1px 2px rgba(23,27,32,.05);
  --shadow-md: 0 2px 6px rgba(23,27,32,.06), 0 8px 24px rgba(23,27,32,.06);
  --shadow-lg: 0 4px 12px rgba(23,27,32,.08), 0 16px 48px rgba(23,27,32,.14);

  /* Shape & type */
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 19px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  /* Layout */
  --sidebar-w: 250px;
  --topbar-h: 60px;
  --content-max: 1480px;
  --focus-ring: 0 0 0 3px rgba(211,35,42,.18);
}

/* ---------------- Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
/* Icon SVGs ship without width/height attributes (charts set theirs explicitly):
   default them to text size so an unstyled context can never render a giant icon. */
svg:not([width]) { width: 1em; height: 1em; flex-shrink: 0; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--red-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
small { font-size: var(--fs-sm); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
::placeholder { color: var(--gray-400); }
hr { border: 0; border-top: 1px solid var(--border); }

/* Scrollbars (webkit) — quiet */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--gray-400); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Typography helpers ---------------- */
.t-title  { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; }
.t-sub    { color: var(--gray-500); font-size: var(--fs-md); }
.t-label  { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); }
.t-sm     { font-size: var(--fs-sm); }
.t-xs     { font-size: var(--fs-xs); }
.t-muted  { color: var(--gray-500); }
.t-sec    { color: var(--gray-700); }
.t-ink    { color: var(--gray-900); }
.t-danger { color: var(--danger); }
.t-ok     { color: var(--ok); }
.t-warn   { color: var(--warn); }
.t-info   { color: var(--info); }
.t-brand  { color: var(--red-600); }
.t-600    { font-weight: 600; }
.t-700    { font-weight: 700; }
.t-num    { font-variant-numeric: tabular-nums; }
.t-cap    { text-transform: capitalize; }
.t-ell    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-center { text-align: center; }
.t-right  { text-align: right; }
.t-nowrap { white-space: nowrap; }

/* ---------------- Spacing / flex utilities ---------------- */
.flex    { display: flex; }
.flex-col{ display: flex; flex-direction: column; }
.aic     { align-items: center; }
.aifs    { align-items: flex-start; }
.jcb     { justify-content: space-between; }
.jcc     { justify-content: center; }
.jce     { justify-content: flex-end; }
.wrap    { flex-wrap: wrap; }
.g4  { gap: 4px; }  .g6 { gap: 6px; }  .g8 { gap: 8px; }  .g10 { gap: 10px; }
.g12 { gap: 12px; } .g16 { gap: 16px; } .g20 { gap: 20px; } .g24 { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.shrink0 { flex-shrink: 0; }
.mt4 { margin-top: 4px; }  .mt8 { margin-top: 8px; }  .mt12 { margin-top: 12px; }
.mt16{ margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.mb16{ margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.mla { margin-left: auto; }
.w100 { width: 100%; }
.hide { display: none !important; }

/* Responsive visibility */
@media (max-width: 768px) {
  .hide-sm { display: none !important; }
}
@media (min-width: 769px) {
  .only-sm { display: none !important; }
}

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
