:root {
  /* Admin-first shared theme tokens */
  --portal-theme-accent: #1d8078;
  --portal-theme-active-text: #0f4f6d;
  --portal-theme-bg: #f6f8fb;
  --portal-theme-brand: #0f4f6d;
  --portal-theme-danger: #961d13;
  --portal-theme-line: #dbe5ec;
  --portal-theme-line-strong: #cfdde8;
  --portal-theme-muted: #5f7488;
  --portal-theme-paper: #ffffff;
  --portal-theme-shadow: rgba(9,22,54,.12);
  --portal-theme-shadow-soft: rgba(9,22,54,.08);
  --portal-theme-shell-1: #16344d;
  --portal-theme-shell-2: #1c4a68;
  --portal-theme-shell-3: #246889;
  --portal-theme-shell-soft-text: #f4fbff;
  --portal-theme-soft: #eef3f6;
  --portal-theme-text: #1a3348;
  --portal-theme-transparent: transparent;
  --portal-color-001: #d6e2ec;
  --portal-color-002: rgba(255,255,255,.16);
  --portal-color-004: rgba(214,241,255,.45);
  --portal-color-005: #16324a;
  --portal-color-007: #d7dee5;
  --portal-color-008: rgba(14,90,122,.55);
  --portal-color-011: #334155;
  --portal-color-012: #cbd5e1;
  --portal-color-015: rgba(255,214,220,.55);
  --portal-color-019: #f6fbff;
  --portal-color-020: #f8fbff;
  --portal-color-028: #0f172a;
  --portal-color-029: #166534;
  --portal-color-030: #92400e;
  --portal-color-031: #c8d8e6;
  --portal-color-033: #f1f5f9;
  --portal-color-035: #fde68a;
  --portal-color-036: #fffbeb;
  --portal-color-041: #0f4f75;
  --portal-color-042: #1f2d3f;
  --portal-color-043: #bbf7d0;
  --portal-color-044: #ecfdf5;
  --portal-color-045: #fecaca;
  --portal-color-046: #fef2f2;
  --portal-color-051: #12344f;
  --portal-color-053: #bfdbfe;
  --portal-color-054: #eff6ff;
  --portal-color-055: #f5faff;
  --portal-color-056: #f6faff;
  --portal-color-057: #f9fcff;
  --portal-color-062: #0f567b;
  --portal-color-063: #1d4ed8;
  --portal-color-068: #f7f9fc;
  --portal-color-069: #f7fbff;
  --portal-color-082: rgba(9,22,54,.14);
  --portal-color-084: #0b4f6f;
  --portal-color-092: #123048;
  --portal-color-093: #17374e;
  --portal-color-096: #233345;
  --portal-color-097: #2e4458;
  --portal-color-100: #4b5563;
  --portal-color-101: #5b738a;
  --portal-color-102: #5d7388;
  --portal-color-103: #5f7388;
  --portal-color-104: #607b92;
  --portal-color-108: #d3e1ee;
  --portal-color-109: #d6dee8;
  --portal-color-113: #ef4444;
  --portal-color-116: #f7fcff;
  --portal-color-133: rgba(255,255,255,.92);
  --portal-color-139: #086f8d;
  --portal-color-141: #0a6b86;
  --portal-color-142: #0a87a8;
  --portal-color-144: #0c4d6e;
  --portal-color-145: #0d7da2;
  --portal-color-156: #1a2739;
  --portal-color-157: #1b2939;
  --portal-color-158: #1c2736;
  --portal-color-159: #1d2a3b;
  --portal-color-160: #1d2a3d;
  --portal-color-162: #1e2c3d;
  --portal-color-163: #1e2d3f;
  --portal-color-164: #1f2c3d;
  --portal-color-165: #1f2e3f;
  --portal-color-166: #1f3342;
  --portal-color-169: #243244;
  --portal-color-170: #253546;
  --portal-color-171: #273446;
  --portal-color-172: #2a3a4c;
  --portal-color-175: #2f3a42;
  --portal-color-182: #5c6f82;
  --portal-color-185: #93a8bc;
  --portal-color-187: #a8b8c9;
  --portal-color-192: #b91c1c;
  --portal-color-193: #b9c9d9;
  --portal-color-199: #c8d3e0;
  --portal-color-200: #c8e8f5;
  --portal-color-205: #d1fae5;
  --portal-color-206: #d2dbe6;
  --portal-color-208: #d3e0ea;
  --portal-color-209: #d4dce7;
  --portal-color-210: #d4dde7;
  --portal-color-211: #d4dde8;
  --portal-color-213: #d5dde7;
  --portal-color-216: #d93a72;
  --portal-color-218: #dbe4ee;
  --portal-color-220: #dc2626;
  --portal-color-223: #e2e9f1;
  --portal-color-225: #e5e7eb;
  --portal-color-226: #e6eaf0;
  --portal-color-227: #e6ebf1;
  --portal-color-230: #e7f6fd;
  --portal-color-231: #e8edf3;
  --portal-color-232: #e8eef3;
  --portal-color-234: #e9eff6;
  --portal-color-235: #e9f9ff;
  --portal-color-237: #eceff4;
  --portal-color-239: #eef2f7;
  --portal-color-245: #f1f7fb;
  --portal-color-246: #f1f8fe;
  --portal-color-247: #f1f8ff;
  --portal-color-248: #f2f4f6;
  --portal-color-249: #f2f9ff;
  --portal-color-253: #fee2e2;
  --portal-color-256: rgba(0,0,0,.12);
  --portal-color-276: rgba(20,29,52,.26);
  --portal-color-277: rgba(20,29,52,.38);
  --portal-color-278: rgba(20,35,54,0.14);
  --portal-color-292: rgba(255,255,255,.4);

  /* Cross-portal unified aliases */
  --portal-ui-bg: var(--portal-theme-bg);
  --portal-ui-text: var(--portal-theme-text);
  --portal-ui-muted: var(--portal-theme-muted);

  /* Shared component aliases */
  --portal-btn-primary-bg: #0f4f6d;
  --portal-btn-primary-hover: #0ea5e9;
  --portal-btn-primary-active: #0c6b98;

  /* Layout fallback tokens */

  /* Extended shared tokens for non-color stylesheet migration */
  --portal-ext-green-success: #15803d;
  --portal-ext-login-bg: #f7f3ee;
  --portal-ext-login-ink: #1d2329;
  --portal-ext-login-soft: #6d6e6b;
  --portal-ext-login-accent-2: #f2b36f;
  --portal-ext-link-hover: #0a5f5d;
  --portal-ext-input-warm: #fffdf9;
  --portal-ext-form-ink: #1b2d3b;
  --portal-ext-info-border-soft: #dbeafe;
  --portal-ext-field-border-soft: #cfe0f2;
  --portal-ext-patient-btn-border: #0c5f82;
  --portal-ext-patient-btn-grad-start: #17749c;
  --portal-ext-patient-btn-grad-end: #0f6489;
  --portal-ext-patient-btn-hover-border: #0b5575;
  --portal-ext-patient-btn-hover-grad-start: #1a83b0;
  --portal-ext-patient-btn-hover-grad-end: #136f97;
  --portal-ext-danger-600: #b42318;
  --portal-ext-danger-700: #8f1d1d;
  --portal-ext-danger-750: #7a271a;
  --portal-ext-danger-800: #7a1414;
  --portal-ext-danger-850: #7f1010;
  --portal-ext-danger-900: #661010;
  --portal-ext-danger-border-soft: #efc2c6;
  --portal-ext-danger-accent: #d92d20;
  --portal-ext-danger-bg-soft: #fff5f6;
  --portal-ext-danger-border-mid: #e39aa2;
  --portal-ext-sky-bg-soft: #f0f9ff;
  --portal-ext-sky-ink: #0b4d78;
  --portal-ext-slate-ink: #36516a;
  --portal-ext-bluewhite: #fbfdff;
  --portal-ext-panel-soft: #f1f7ff;
  --portal-ext-brand-border-dark: #08466f;
  --portal-ext-brand-border-darker: #063a60;
  --portal-ext-warn-border-dark: #713005;
  --portal-ext-warn-border-darker: #632b06;
  --portal-ext-panel-grad-end: #f2f7fb;
  --portal-ext-panel-grad-mid: #eef6fb;
  --portal-ext-overlay-weak: rgba(0, 0, 0, 0.08);
  --portal-ext-shadow-text-12: rgba(0, 0, 0, 0.12);
  --portal-ext-shadow-text-14: rgba(0, 0, 0, 0.14);
  --portal-ext-shadow-text-18: rgba(0, 0, 0, 0.18);
  --portal-ext-shadow-text-20: rgba(0, 0, 0, 0.2);
  --portal-ext-sky-ink-18: rgba(11,77,120,0.18);
  --portal-ext-sky-ink-20: rgba(11,77,120,0.2);
  --portal-ext-sky-ink-25: rgba(11,77,120,0.25);
  --portal-ext-cyan-glow: rgba(137, 210, 244, 0.08);
  --portal-ext-brand-shadow-25: rgba(14, 165, 233, 0.25);
  --portal-ext-brand-shadow-32: rgba(14, 165, 233, 0.32);
  --portal-ext-brand-ring-22: rgba(14,165,233,.22);
  --portal-ext-brand-ring-35: rgba(14,165,233,.35);
  --portal-ext-brand-ring-38: rgba(14,165,233,.38);
  --portal-ext-teal-zero: rgba(15, 124, 122, 0);
  --portal-ext-teal-08: rgba(15, 124, 122, 0.08);
  --portal-ext-teal-12: rgba(15, 124, 122, 0.12);
  --portal-ext-teal-15: rgba(15, 124, 122, 0.15);
  --portal-ext-teal-18: rgba(15, 124, 122, 0.18);
  --portal-ext-slate-08: rgba(15, 23, 42, 0.08);
  --portal-ext-slate-12: rgba(15, 23, 42, 0.12);
  --portal-ext-slate-24: rgba(15,23,42,.24);
  --portal-ext-slate-48: rgba(15,23,42,.48);
  --portal-ext-danger-24: rgba(185,28,28,.24);
  --portal-ext-ink-12: rgba(19, 29, 43, 0.12);
  --portal-ext-danger-ring-15: rgba(217,45,32,.15);
  --portal-ext-success-ring-32: rgba(22,163,74,.32);
  --portal-ext-patient-brand-ring-20: rgba(23,116,156,.2);
  --portal-ext-warm-zero: rgba(242, 179, 111, 0);
  --portal-ext-warm-20: rgba(242, 179, 111, 0.2);
  --portal-ext-warm-25: rgba(242, 179, 111, 0.25);
  --portal-ext-accent-bg-10: rgba(29, 128, 120, 0.1);
  --portal-ext-accent-border-35: rgba(29, 128, 120, 0.35);
  --portal-ext-ink-border-10: rgba(29, 35, 41, 0.1);
  --portal-ext-ink-border-20: rgba(29, 35, 41, 0.2);
  --portal-ext-accent-border-42: rgba(29,128,120,.42);
  --space-4: 16px;
}

/* Global primary button tone policy */
body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(
  .btn,
  .btn--primary,
  button[type="submit"],
  input[type="submit"],
  a.btn,
  .portal-btn-important,
  .portal-btn-warning
):not(.portal-btn-danger):not(.btn--ghost){
  background:#1a83b0 !important;
  border-color:#1a83b0 !important;
  color:#ffffff !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(
  .btn,
  .btn--primary,
  button[type="submit"],
  input[type="submit"],
  a.btn,
  .portal-btn-important,
  .portal-btn-warning
):not(.portal-btn-danger):not(.btn--ghost):is(:hover,:focus-visible,:active){
  background:#136f97 !important;
  border-color:#136f97 !important;
  color:#ffffff !important;
}

/* Keep ghost buttons readable in all interaction states */
body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(.btn--ghost, a.btn--ghost, button.btn--ghost, .button.btn--ghost){
  background:#f0f9ff !important;
  border-color:#1a83b0 !important;
  color:#1a83b0 !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(.btn--ghost, a.btn--ghost, button.btn--ghost, .button.btn--ghost):is(:hover,:focus-visible,:active){
  background:#1a83b0 !important;
  border-color:#1a83b0 !important;
  color:#ffffff !important;
}

/* Shared popup/notification tone policy */
body.portal-workspace :is(.portal-alert,.login-alert,.portal-amcal-feedback,.portal-amcal-modal__status,.login-page-notice){
  border-color:rgba(29,128,120,.35) !important;
  background:rgba(29,128,120,.10) !important;
  color:#1d8078 !important;
}

/* Global destructive action tone */
body.portal-workspace :is(
  .btn.portal-btn-danger,
  a.btn.portal-btn-danger,
  button.portal-btn-danger,
  input[type="submit"].portal-btn-danger,
  .portal-admin-btn-danger,
  button[type="submit"][name*="delete" i],
  button[type="submit"][value*="delete" i],
  input[type="submit"][name*="delete" i],
  input[type="submit"][value*="delete" i]
):not(.portal-icon-btn){
  background:#661010 !important;
  border-color:#661010 !important;
  color:#ffffff !important;
}

body.portal-workspace :is(
  .btn.portal-btn-danger,
  a.btn.portal-btn-danger,
  button.portal-btn-danger,
  input[type="submit"].portal-btn-danger,
  .portal-admin-btn-danger,
  button[type="submit"][name*="delete" i],
  button[type="submit"][value*="delete" i],
  input[type="submit"][name*="delete" i],
  input[type="submit"][value*="delete" i]
):not(.portal-icon-btn):is(:hover,:focus-visible,:active){
  background:#661010 !important;
  border-color:#661010 !important;
  color:#ffffff !important;
}

/* Global portal UI normalization: size, alignment, tables, and typography */
body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace){
  font-size:14px !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(.btn,.btn--primary,.btn--ghost,button,input[type="submit"],a.btn){
  min-height:42px !important;
  padding:10px 18px !important;
  font-size:14px !important;
  font-weight:600 !important;
  line-height:1.2 !important;
  border-radius:8px !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(label,input,select,textarea,th,td,p,small,span){
  font-size:14px !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(.form-control,input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="date"],input[type="time"],select,textarea){
  min-height:42px !important;
  padding:10px 12px !important;
  box-sizing:border-box !important;
  vertical-align:middle !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(.row,[class*="row"],.portal-inline-admin-0005,.portal-inline-admin-0007,.portal-inline-admin-0030){
  align-items:center !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(table,.table,.admin-dashboard-table){
  border-color:rgba(26,131,176,.35) !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace)
  :is(table thead th,.table thead th,.admin-dashboard-table thead th){
  background:#1a83b0 !important;
  border-color:#1a83b0 !important;
  color:#ffffff !important;
}


/* Global portal color policy override: buttons, delete actions, tables */
body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(
  .btn,
  .btn--primary,
  .btn--ghost,
  button,
  button[type="button"],
  button[type="submit"],
  input[type="submit"],
  input[type="button"],
  a.btn,
  .portal-icon-btn,
  .portal-btn-important,
  .portal-btn-warning
):not(.portal-btn-danger):not(.portal-admin-btn-danger){
  background:#0f4f6d !important;
  border-color:#0f4f6d !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(
  .btn,
  .btn--primary,
  .btn--ghost,
  button,
  button[type="button"],
  button[type="submit"],
  input[type="submit"],
  input[type="button"],
  a.btn,
  .portal-icon-btn,
  .portal-btn-important,
  .portal-btn-warning
):not(.portal-btn-danger):not(.portal-admin-btn-danger):is(:hover,:focus-visible,:active){
  background:#0ea5e9 !important;
  border-color:#0ea5e9 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(
  .btn.portal-btn-danger,
  a.btn.portal-btn-danger,
  button.portal-btn-danger,
  input[type="submit"].portal-btn-danger,
  .portal-admin-btn-danger,
  button[type="submit"][name*="delete" i],
  button[type="submit"][value*="delete" i],
  button[type="button"][name*="delete" i],
  button[type="button"][value*="delete" i],
  input[type="button"][name*="delete" i],
  input[type="button"][value*="delete" i],
  input[type="submit"][name*="delete" i],
  input[type="submit"][value*="delete" i]
){
  background:#961d13 !important;
  border-color:#961d13 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(
  .btn.portal-btn-danger,
  a.btn.portal-btn-danger,
  button.portal-btn-danger,
  input[type="submit"].portal-btn-danger,
  .portal-admin-btn-danger,
  button[type="submit"][name*="delete" i],
  button[type="submit"][value*="delete" i],
  button[type="button"][name*="delete" i],
  button[type="button"][value*="delete" i],
  input[type="button"][name*="delete" i],
  input[type="button"][value*="delete" i],
  input[type="submit"][name*="delete" i],
  input[type="submit"][value*="delete" i]
):is(:hover,:focus-visible,:active){
  background:#b91c1c !important;
  border-color:#b91c1c !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(table,.table,.admin-dashboard-table){
  border-color:#0f4f6d !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(table thead th,.table thead th,.admin-dashboard-table thead th){
  background:#0f4f6d !important;
  border-color:#0f4f6d !important;
  color:#ffffff !important;
}

body.portal-workspace .portal-section:is(.admin-dashboard-page--workspace,.doctor-dashboard-page--workspace,.patient-dashboard-page--workspace,.pharmacist-dashboard-page--workspace) :is(table tbody td,table tbody th,.table tbody td,.table tbody th,.admin-dashboard-table tbody td,.admin-dashboard-table tbody th){
  border-color:rgba(15,79,109,.18) !important;
}


/* Final global button text policy */
body.portal-workspace .portal-section :is(
  .btn,
  .btn--primary,
  .btn--ghost,
  button,
  button[type="button"],
  button[type="submit"],
  input[type="submit"],
  input[type="button"],
  a.btn,
  .portal-icon-btn,
  .portal-btn-important,
  .portal-btn-warning,
  .portal-btn-danger,
  .portal-admin-btn-danger
){
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  text-align:center !important;
  justify-content:center !important;
}

body.portal-workspace .portal-section :is(
  .btn,
  .btn--primary,
  .btn--ghost,
  button,
  button[type="button"],
  button[type="submit"],
  input[type="submit"],
  input[type="button"],
  a.btn,
  .portal-icon-btn,
  .portal-btn-important,
  .portal-btn-warning,
  .portal-btn-danger,
  .portal-admin-btn-danger
) :is(span,strong,small,b,i,svg,path){
  color:inherit !important;
  fill:currentColor !important;
  stroke:currentColor !important;
  -webkit-text-fill-color:inherit !important;
}


/* Premium alias layer kept compact for shared components */
:root{
  --portal-surface:#ffffff;
  --portal-surface-soft:#f8fbff;
  --portal-border:#dbe5ec;
  --portal-text:#16324a;
  --portal-text-soft:#5f7488;
  --portal-brand:#0f4f6d;
  --portal-brand-strong:#136f97;
  --portal-radius-lg:20px;
  --portal-radius-md:14px;
}
