/* Lavanya Medicare Solutions — Enterprise Design System
   Brand: vibrant azure #1580c9 · deep blue #123f74 · gold #f5b31f
          magenta #c2178a · green #63b52b · IBM Plex Sans
   (CSS variable names kept for backwards-compat; values are the Lavanya palette) */
:root {
  --deep: #123f74;
  --deep-2: #0d2f5c;
  --jade: #1580c9;
  --jade-dark: #1069ab;
  --teal: #17a6d6;
  --teal-dark: #1188b3;
  --marigold: #f5b31f;
  --marigold-dark: #d9990c;
  --gold-soft: #f7dca8;
  --magenta: #c2178a;
  --magenta-dark: #9c1170;
  --leaf: #63b52b;
  --leaf-dark: #4e9821;
  --pink-soft: #f8dcec;
  --porcelain: #f7f9fc;
  --mist: #e4eaf2;
  --mist-2: #eef3fa;
  --ink: #14181f;
  --text: #2a3546;
  --muted: #6b7a90;
  --line: #dce4ee;
  --card: #ffffff;
  --bg: #f5f7fb;
  --shadow: 0 6px 24px -6px rgba(18, 63, 116, .12);
  --shadow-lg: 0 20px 50px -16px rgba(18, 63, 116, .22);
  --radius: 16px;
  --radius-sm: 10px;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
.display {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  letter-spacing: -.01em;
  color: var(--ink);
  font-weight: 600;
}

h1 {
  font-size: 1.65rem
}

h2 {
  font-size: 1.3rem
}

h3 {
  font-size: 1.1rem
}

.text-mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.text-deep {
  color: var(--deep) !important;
}

.text-jade {
  color: var(--jade) !important;
}

.text-marigold {
  color: var(--marigold) !important;
}

.bg-deep {
  background: var(--deep) !important;
  color: #fff;
}

.bg-jade {
  background: var(--jade) !important;
  color: #fff;
}

.bg-mist {
  background: var(--mist-2) !important;
}

.bg-porcelain {
  background: var(--porcelain) !important;
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .3s cubic-bezier(.4, 0, .2, 1);
}

.app.sidebar-collapsed {
  grid-template-columns: 60px 1fr;
}

/* ── Sidebar container ────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, #123f74 0%, #0e3562 60%, #0d2f5c 100%);
  color: #d2deec;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: width .3s cubic-bezier(.4, 0, .2, 1);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

/* ── Brand (sticky at top) ────────────────────────────────────────── */
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #123f74 0%, #103a5e 100%);
  z-index: 2;
  box-shadow: inset 0 -3px 0 0 transparent;
}

/* Multicolor brand accent stripe (gold → magenta → azure), echoes the wave art */
.sidebar .brand::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--marigold) 0%, var(--magenta) 45%, var(--jade) 100%);
}

.sidebar .brand .brand-logo {
  width: 212px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  transition: width .3s cubic-bezier(.4, 0, .2, 1);
}

.sidebar .brand .brand-text {
  transition: opacity .2s ease, width .3s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

.sidebar .brand .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--jade), var(--deep));
  border: 2px solid var(--marigold);
}

/* ── Scrollable nav area ──────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .08) transparent;
  position: relative;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .08);
  border-radius: 4px;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
}

/* ── Scroll fade indicator ────────────────────────────────────────── */
.sidebar-nav::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(transparent, #0e3562);
  pointer-events: none;
  display: block;
  flex-shrink: 0;
  margin: 0 -8px;
}

/* ── Group headers ────────────────────────────────────────────────── */
.sidebar .group {
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #8aa2c8;
  margin: 14px 8px 4px;
  padding: 0 2px;
  font-weight: 600;
  position: relative;
}

.sidebar .group::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06) 0%, transparent 100%);
  margin-top: 4px;
}

/* ── Nav links ────────────────────────────────────────────────────── */
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c0d2e8;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease, padding-left .15s ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  margin: 1px 0;
}

.sidebar a svg {
  flex-shrink: 0;
  opacity: .75;
  transition: opacity .15s ease;
}

.sidebar a:hover svg,
.sidebar a.active svg {
  opacity: 1;
}

.sidebar a span {
  transition: opacity .2s ease;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.sidebar a.active {
  background: rgba(21, 128, 201, .2);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--marigold);
  font-weight: 600;
}

.sidebar a.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
}

.sidebar a .ico {
  width: 18px;
  text-align: center;
  opacity: .8;
}

.sidebar-spacer {
  flex: 0;
}

.sidebar-bottom-link {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 10px 14px;
  margin: 0 8px;
  flex-shrink: 0;
}

/* ── Sidebar backdrop (mobile overlay) ──────────────────────────── */
.sidebar-backdrop {
  display: none;
}

/* ── Sidebar collapsed state — Hover-expand flyout ──────────────── */
.sidebar-collapsed .sidebar {
  width: 60px;
  overflow: visible;
  z-index: 10;
}

.sidebar-collapsed .sidebar-nav {
  padding: 6px 4px 0;
  overflow: visible;
}

.sidebar-collapsed .sidebar .brand {
  justify-content: center;
  padding: 14px 0 12px;
}

.sidebar-collapsed .sidebar .brand .brand-logo {
  width: 32px;
  height: 32px;
}

/* Logo swap: full logo by default, short logo when collapsed */
.brand-logo-short {
  display: none;
}

.sidebar-collapsed .brand-logo-full {
  display: none;
}

.sidebar-collapsed .brand-logo-short {
  display: block;
  width: 32px;
  height: 32px;
}

.sidebar-collapsed .sidebar:hover .brand-logo-full {
  display: block;
  width: 32px;
}

.sidebar-collapsed .sidebar:hover .brand-logo-short {
  display: none;
}

.sidebar-collapsed .sidebar .brand .brand-text {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

.sidebar-collapsed .sidebar .group {
  height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-collapsed .sidebar .group::after {
  display: none;
}

.sidebar-collapsed .sidebar a {
  justify-content: center;
  padding: 10px;
  gap: 0;
}

.sidebar-collapsed .sidebar a span {
  width: 0;
  opacity: 0;
  overflow: hidden;
  display: inline-block;
}

.sidebar-collapsed .sidebar .sidebar-bottom-link {
  border-top-color: transparent;
  margin: 0 4px;
  padding: 10px 0;
  text-align: center;
}

/* ── Collapsed tooltips via data-tip ────────────────────────────── */
.sidebar-collapsed .sidebar a[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #123f74;
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 1100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  font-family: 'IBM Plex Sans', sans-serif;
  border: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-collapsed .sidebar a[data-tip]:hover::after {
  opacity: 1;
  transition-delay: .4s;
}

.sidebar-collapsed .sidebar .sidebar-bottom-link[data-tip]::after {
  left: calc(100% + 12px);
  top: 50%;
}

/* ── Flyout on hover ─────────────────────────────────────────────── */
.sidebar-collapsed .sidebar:hover {
  width: 260px;
  box-shadow: 4px 0 30px rgba(18, 63, 116, .35);
  z-index: 1000;
}

.sidebar-collapsed .sidebar:hover .sidebar-nav {
  padding: 6px 8px 0;
  overflow-y: auto;
}

.sidebar-collapsed .sidebar:hover .brand {
  justify-content: flex-start;
  padding: 14px 14px 12px;
}

.sidebar-collapsed .sidebar:hover .brand .brand-logo {
  width: 32px;
}

.sidebar-collapsed .sidebar:hover .brand .brand-text {
  width: auto;
  opacity: 1;
  overflow: visible;
}

.sidebar-collapsed .sidebar:hover .group {
  height: auto;
  opacity: 1;
  margin: 14px 8px 4px;
  padding: 0 2px;
  overflow: visible;
  pointer-events: auto;
  transition: opacity .2s ease .06s;
}

.sidebar-collapsed .sidebar:hover .group::after {
  display: block;
}

.sidebar-collapsed .sidebar:hover a {
  justify-content: flex-start;
  padding: 8px 10px;
  gap: 10px;
}

.sidebar-collapsed .sidebar:hover a span {
  width: auto;
  opacity: 1;
  overflow: visible;
  display: inline;
}

.sidebar-collapsed .sidebar:hover .sidebar-bottom-link {
  border-top-color: rgba(255, 255, 255, .08);
  margin: 0 8px;
  padding: 10px 14px;
  text-align: left;
}

/* Hide flyout tooltips when sidebar is expanded (hover flyout active) */
.sidebar-collapsed .sidebar:hover a[data-tip]::after {
  opacity: 0;
}

/* ── Staggered text fade-in on hover ─────────────────────────────── */
.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(1) span {
  transition-delay: .02s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(2) span {
  transition-delay: .04s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(3) span {
  transition-delay: .06s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(4) span {
  transition-delay: .08s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(5) span {
  transition-delay: .10s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(6) span {
  transition-delay: .12s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(7) span {
  transition-delay: .14s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(8) span {
  transition-delay: .16s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(9) span {
  transition-delay: .18s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(10) span {
  transition-delay: .20s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(11) span {
  transition-delay: .22s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(12) span {
  transition-delay: .24s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(13) span {
  transition-delay: .26s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(14) span {
  transition-delay: .28s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(15) span {
  transition-delay: .30s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(16) span {
  transition-delay: .32s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(17) span {
  transition-delay: .34s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(18) span {
  transition-delay: .36s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(19) span {
  transition-delay: .38s;
}

.sidebar-collapsed .sidebar:hover a[data-tip]:nth-of-type(20) span {
  transition-delay: .40s;
}

/* ── Hamburger button ────────────────────────────────────────────── */
.gc-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--mist);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s ease;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.gc-hamburger svg {
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.gc-hamburger.active svg {
  transform: rotate(180deg);
}

.gc-hamburger:hover {
  background: var(--porcelain);
  border-color: var(--line);
}

.gc-hamburger:active {
  transform: scale(.95);
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--mist);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(18, 63, 116, .04);
}

.topbar .search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar .search input {
  width: 100%;
  border: 1px solid var(--mist);
  border-radius: 999px;
  padding: 7px 14px 7px 34px;
  background: var(--porcelain);
  font-size: .84rem;
}

.topbar .search::before {
  content: "\1F50D";
  position: absolute;
  left: 10px;
  top: 6px;
  font-size: .88rem;
  opacity: .55;
}

.topbar .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar .actions .iconbtn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--mist);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.topbar .actions .iconbtn .badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--marigold);
  color: #3a2a05;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 4px;
  border: 2px solid #fff;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jade), var(--deep));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  box-shadow: 0 2px 6px rgba(18, 63, 116, .2);
}

.content {
  padding: 16px 20px 40px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.page-head .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 2px;
}

.page-head h1,
.page-head h2,
.page-head h3 {
  margin: 0;
}

.page-head .sub {
  color: var(--muted);
  margin-top: 2px;
  font-size: .82rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--mist);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h5 {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  color: var(--ink);
}

.card-body {
  padding: 14px 16px;
}

.stat {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--mist);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 600;
}

.stat .val {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.75rem;
  color: var(--deep);
  font-weight: 600;
  line-height: 1.1;
  margin-top: 4px;
}

.stat .delta {
  font-size: .74rem;
  color: var(--teal-dark);
  margin-top: 3px;
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(21, 128, 201, .06), transparent 70%);
}

.stat.gold::after {
  background: radial-gradient(circle, rgba(245, 179, 31, .08), transparent 70%);
}

.stat.gold .val {
  color: #9a6206;
}

.btn {
  border-radius: 10px;
  font-weight: 500;
  padding: .45rem .95rem;
  font-size: .84rem;
  transition: all .18s ease;
}

.btn-primary {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff;
  box-shadow: 0 2px 8px rgba(21, 128, 201, .25);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--jade-dark);
  border-color: var(--jade-dark);
  box-shadow: 0 4px 14px rgba(21, 128, 201, .35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(21, 128, 201, .2);
}

.btn-deep {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}

.btn-deep:hover {
  background: #0d2f5c;
  color: #fff;
}

.btn-gold {
  background: var(--marigold);
  border-color: var(--marigold);
  color: #3a2a05;
  box-shadow: 0 2px 8px rgba(245, 179, 31, .25);
}

.btn-gold:hover {
  background: #dd8d12;
  color: #3a2a05;
  box-shadow: 0 4px 14px rgba(245, 179, 31, .35);
  transform: translateY(-1px);
}

.btn-outline-jade {
  color: var(--jade);
  border: 1px solid var(--jade);
  background: transparent;
}

.btn-outline-jade:hover {
  background: var(--jade);
  color: #fff;
  box-shadow: 0 2px 8px rgba(21, 128, 201, .25);
}

.btn-ghost {
  background: transparent;
  color: var(--deep);
  border: 1px solid var(--mist);
}

.btn-ghost:hover {
  background: var(--porcelain);
  border-color: var(--line);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background: var(--porcelain);
  color: var(--muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  border-bottom: 2px solid var(--mist);
  padding: 8px 12px;
}

.table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-color: var(--mist);
  font-size: .84rem;
}

.table tbody tr {
  transition: background .15s ease;
}

.table tbody tr:hover {
  background: rgba(21, 128, 201, .03);
}

.table .case-id {
  font-family: "IBM Plex Mono", monospace;
  color: var(--deep);
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pill.uncontacted {
  background: #eef1f3;
  color: #6b7a90;
}

.pill.attempted {
  background: #fff3cd;
  color: #7a5a00;
}

.pill.connected {
  background: #d9ece8;
  color: #0c5d52;
}

.pill.warm {
  background: #fde0c2;
  color: #9a6206;
}

.pill.hot {
  background: #ffd2c4;
  color: #a3331a;
}

.pill.converted {
  background: #d2efd9;
  color: #1f6b3a;
}

.pill.cold {
  background: #dde6ea;
  color: #4a5e66;
}

.pill.non-converted {
  background: #e9d8d8;
  color: #7a3a3a;
}

.pill.digital {
  background: #e3eefc;
  color: #1a4e8a;
}

.pill.other {
  background: #f0e6f7;
  color: #5a3a78;
}

.pill.urgent {
  background: #ffe3e0;
  color: #a83a25;
}

.pill.tat-ok {
  background: #d2efd9;
  color: #1f6b3a;
}

.pill.tat-warn {
  background: #fde0c2;
  color: #9a6206;
}

.pill.tat-late {
  background: #ffd2c4;
  color: #a3331a;
}

.pill.dot::before {
  content: "\25CF";
  font-size: .55rem;
}

.pill .x-mark {
  margin-left: 4px;
  color: inherit;
  opacity: .7;
  font-weight: 700;
}

.pill.translation {
  background: #f4ecda;
  color: #7a5a00;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .74rem;
  background: var(--mist-2);
  color: var(--deep);
  border: 1px solid var(--mist);
  transition: background .15s ease;
}

.chip.wa {
  background: #dcf6e0;
  color: #1b6b3a;
  border-color: #b9e6c4;
}

.chip.email {
  background: #e3eefc;
  color: #1a4e8a;
  border-color: #c0d8f3;
}

.chip.web {
  background: #f0e6f7;
  color: #5a3a78;
  border-color: #dcc7eb;
}

.chip.crm {
  background: #fff3cd;
  color: #7a5a00;
  border-color: #f0d9a8;
}

.chip.manual {
  background: var(--mist-2);
  color: var(--deep);
}

.chip.chatbot {
  background: #e0f0f0;
  color: #0c5d8a;
  border-color: #bfdde0;
}

/* ── Tab bar (filter pills) ─────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--mist);
  border-radius: 8px;
  padding: 2px;
}

.tabs .tab {
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.tabs .tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .5);
}

.tabs .tab.active {
  background: #fff;
  color: var(--jade);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

/* ── Timeline ────────────────────────────────────────────────────── */
.timeline-wrap {
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: 12px;
  overflow: hidden;
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--mist);
  background: var(--porcelain);
}

.timeline-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
}

.timeline-head-title svg { color: var(--jade); }

.timeline-head-count {
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--mist);
  border-radius: 10px;
  padding: 2px 8px;
}

.timeline-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--mist);
  background: var(--card);
}

.timeline-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid var(--mist);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  user-select: none;
}

.timeline-filter-chip:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: #f0f7fc;
}

.timeline-filter-chip.active {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff;
  box-shadow: 0 1px 3px rgba(21, 128, 201, .25);
}

.chip-count {
  background: rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 0 6px;
  font-size: .65rem;
  min-width: 18px;
  text-align: center;
  line-height: 18px;
}

.timeline-filter-chip.active .chip-count {
  background: rgba(255,255,255,.25);
}

.timeline-body {
  padding: 8px 0;
  max-height: 520px;
  overflow-y: auto;
}

.timeline-body::-webkit-scrollbar { width: 5px; }
.timeline-body::-webkit-scrollbar-track { background: transparent; }
.timeline-body::-webkit-scrollbar-thumb { background: var(--mist); border-radius: 4px; }
.timeline-body::-webkit-scrollbar-thumb:hover { background: #c5cdd8; }

.timeline-group {
  padding: 0 18px;
  margin-bottom: 4px;
}

.timeline-group + .timeline-group {
  border-top: 1px solid var(--mist);
  padding-top: 12px;
  margin-top: 8px;
}

.timeline-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 8px 0 6px;
}

.timeline-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--mist);
}

.t-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all .15s ease;
  position: relative;
}

/* Vertical connecting line through the icon column */
.t-item::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--mist) 60%, transparent);
  z-index: 0;
}

/* Small node dot at the junction */
.t-item::after {
  content: "";
  position: absolute;
  left: 25px;
  top: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--mist);
  z-index: 0;
}

.t-item:first-child::after {
  display: none;
}

.t-item:last-child::before {
  display: none;
}

.t-item:hover {
  background: var(--porcelain);
  border-color: var(--mist);
}

.t-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: transform .15s ease;
  position: relative;
  z-index: 1;
}

.t-item:hover .t-icon { transform: scale(1.08); }

.t-icon svg { width: 16px; height: 16px; }

.t-icon--case_created { background: #eff6ff; color: var(--jade); border-color: #dbeafe; }
.t-icon--stage_change { background: #f0f4ff; color: var(--deep); border-color: #dbeafe; }
.t-icon--assigned { background: #f5f3ff; color: #7c3aed; border-color: #ede9fe; }
.t-icon--reassigned { background: #fdf4ff; color: #a855f7; border-color: #f3e8ff; }
.t-icon--attachment { background: #fffbeb; color: #d97706; border-color: #fef3c7; }
.t-icon--communication { background: #ecfdf5; color: #059669; border-color: #d1fae5; }
.t-icon--info_request { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.t-icon--secure_link_generated { background: #ecfeff; color: #0891b2; border-color: #cffafe; }
.t-icon--offline_comm { background: #eef2ff; color: #6366f1; border-color: #e0e7ff; }

.t-content { flex: 1; min-width: 0; }

.t-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.t-label {
  font-weight: 600;
  font-size: .82rem;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.t-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.t-who-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jade), var(--deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  font-weight: 700;
  color: #fff;
}

.t-detail {
  font-size: .8rem;
  color: var(--text);
  line-height: 1.5;
  margin-top: 3px;
  padding-left: 0;
}

.t-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.t-time {
  font-size: .7rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  display: flex;
  align-items: center;
  gap: 4px;
}

.t-time-relative {
  color: var(--jade);
  font-weight: 600;
  font-size: .7rem;
}

.t-time-abs {
  color: var(--muted);
  font-size: .68rem;
}

.t-time-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mist);
  flex-shrink: 0;
}

.t-empty {
  text-align: center;
  padding: 48px 24px;
}

.t-empty svg {
  margin-bottom: 12px;
  color: var(--mist);
}

.t-empty-title {
  font-weight: 600;
  font-size: .88rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.t-empty-desc {
  font-size: .78rem;
  color: var(--muted);
}

.tl-expand-btn {
  background: none;
  border: none;
  color: var(--jade, #1580c9);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
  white-space: nowrap;
}

.tl-expand-btn:hover {
  text-decoration: underline;
}

.t-label {
  word-break: break-word;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .88rem;
  border: 1px solid var(--mist);
  box-shadow: var(--shadow);
}

.msg .meta {
  font-size: .68rem;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.msg.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #e8f2fc, #dbe9f8);
  border-color: #c0d8f0;
}

.msg.in {
  align-self: flex-start;
  background: #fff;
  border-color: var(--mist);
}

.msg.system {
  align-self: center;
  background: var(--porcelain);
  font-size: .76rem;
  color: var(--muted);
  border-style: dashed;
}

.msg.hospital {
  align-self: flex-start;
  background: #fff9ee;
  border-color: #f0d9a8;
}

.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
}

.form-control,
.form-select {
  border: 1px solid var(--mist);
  border-radius: 9px;
  padding: .5rem .75rem;
  font-size: .84rem;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .15);
  outline: none;
}

.form-text {
  color: var(--muted);
  font-size: .74rem;
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  background: #f8fafd;
  color: var(--muted);
  transition: .2s ease;
  cursor: pointer;
}

.dropzone:hover {
  border-color: var(--jade);
  background: #eef4fb;
  color: var(--deep);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .08);
}

.dropzone .big {
  font-size: 1.75rem;
  color: var(--jade);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--mist);
  border-radius: 8px;
  background: #fff;
}

.file-row .icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--mist-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--deep);
  font-weight: 700;
  font-size: .7rem;
}

.file-row .meta {
  flex: 1;
}

.file-row .meta .name {
  font-weight: 600;
  font-size: .84rem;
  color: var(--ink);
}

.file-row .meta .sub {
  font-size: .74rem;
  color: var(--muted);
}

.hero-band {
  background: linear-gradient(135deg, #123f74 0%, #1580c9 60%, #17a6d6 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px -8px rgba(18, 63, 116, .3);
}

.hero-band h2 {
  color: #fff;
  font-family: "IBM Plex Sans", sans-serif;
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.hero-band p {
  color: #c2d6ee;
  margin: 0;
  max-width: 680px;
}

.hero-band::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .12);
}

.hero-band::before {
  content: "";
  position: absolute;
  right: 30px;
  top: 30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 162, 31, .35);
}

.steprail {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.steprail .step {
  flex: 1;
  min-width: 150px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--mist);
  position: relative;
}

.steprail .step .n {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.25rem;
  color: var(--jade);
  font-weight: 600;
  line-height: 1;
}

.steprail .step .t {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}

.steprail .step .d {
  font-size: .8rem;
  color: var(--text);
  margin-top: 5px;
}

.steprail .step.active {
  background: linear-gradient(135deg, var(--jade), var(--jade-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(21, 128, 201, .3);
}

.steprail .step.active .n,
.steprail .step.active .t,
.steprail .step.active .d {
  color: #fff;
}

.steprail .step.done {
  background: #e2ecf8;
  border-color: #c2d6ee;
}

.steprail .step.done .n {
  color: var(--jade);
}

.alert-soft {
  border-radius: 10px;
  border: 1px solid var(--mist);
  padding: 10px 14px;
  background: var(--mist-2);
  color: var(--deep);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-soft.warn {
  background: #fff5e2;
  border-color: #f0d9a8;
  color: #7a5a00;
}

.alert-soft.danger {
  background: #ffe9e1;
  border-color: #f5c6b6;
  color: #a3331a;
}

.alert-soft .ico {
  font-size: 1rem;
}

.filterbar {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
  box-shadow: 0 1px 4px rgba(18, 63, 116, .04);
}

.filterbar .form-select,
.filterbar .form-control {
  padding: .35rem .6rem;
  font-size: .82rem;
  width: auto;
  min-width: 130px;
}

.filterbar .tabs {
  display: flex;
  gap: 6px;
}

.filterbar .tab {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .8rem;
  border: 1px solid var(--mist);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
}

.filterbar .tab.active {
  background: var(--deep);
  color: #fff;
  border-color: var(--deep);
  box-shadow: 0 2px 8px rgba(18, 63, 116, .25);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 50px;
}

.bars .b {
  flex: 1;
  background: linear-gradient(180deg, var(--jade), var(--teal));
  border-radius: 6px 6px 2px 2px;
  min-height: 6px;
  transition: height .3s ease;
}

.tat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tat .ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: conic-gradient(var(--jade) var(--p, 55%), var(--mist) 0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: var(--deep);
  font-family: "IBM Plex Mono", monospace;
  position: relative;
  box-shadow: 0 1px 4px rgba(21, 128, 201, .15);
}

.tat .ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.tat .ring span {
  position: relative;
  z-index: 1;
}

.tat.late .ring {
  background: conic-gradient(#d9482a var(--p, 90%), var(--mist) 0);
}

.tat.warn .ring {
  background: conic-gradient(var(--marigold) var(--p, 75%), var(--mist) 0);
}

.bucket-prog {
  display: flex;
  gap: 3px;
}

.bucket-prog .seg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--mist);
}

.bucket-prog .seg.on {
  background: var(--jade);
}

.bucket-prog .seg.hot {
  background: var(--marigold);
}

.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #123f74, #0d2f5c 50%, #1580c9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-wrap::before,
.login-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .08);
  pointer-events: none;
}

.login-wrap::before {
  width: 680px;
  height: 680px;
  left: -200px;
  top: -200px;
}

.login-wrap::after {
  width: 480px;
  height: 480px;
  right: -160px;
  bottom: -160px;
  border-color: rgba(245, 179, 31, .18);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 68%, #fdf4ec 100%);
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: 0 40px 90px -34px rgba(18, 63, 116, .38),
    0 8px 24px -16px rgba(18, 63, 116, .18);
  position: relative;
  z-index: 1;
}

.cmp-table th,
.cmp-table td {
  vertical-align: top;
  font-size: .84rem;
}

.cmp-table thead th {
  background: linear-gradient(135deg, var(--deep), var(--jade));
  color: #fff;
  border-color: var(--deep);
}

.cmp-table .hcell {
  font-weight: 600;
  color: var(--ink);
}

.divider-soft {
  height: 1px;
  background: var(--mist);
  margin: 10px 0;
}

.kbd {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  background: var(--porcelain);
  border: 1px solid var(--mist);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: .74rem;
}

.section-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 6px;
}

.medium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .74rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--porcelain);
  border: 1px solid var(--mist);
  color: var(--deep);
}

.medium.wa {
  background: #dcf6e0;
  color: #1b6b3a;
  border-color: #b9e6c4;
}

.medium.email {
  background: #e3eefc;
  color: #1a4e8a;
  border-color: #c0d8f3;
}

.medium.chatbot {
  background: #e0f0f0;
  color: #0c5d8a;
  border-color: #bfdde0;
}

.quality-banner {
  background: #fff5e2;
  border: 1px solid #f0d9a8;
  color: #7a5a00;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .82rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-check-input:checked {
  background-color: var(--jade);
  border-color: var(--jade);
  box-shadow: 0 1px 3px rgba(21, 128, 201, .3);
}

/* SPA specific */
#app-view {
  min-height: 400px;
}

/* ── Split-view side panel ──────────────────────────────────────── */
.gc-split {
  display: flex;
  gap: 0;
  width: 100%;
  position: relative;
}

/* 50/50 split mode for MPI dedup and similar screens */
.gc-split.gc-split-50.has-panel .gc-split-main {
  flex: 0 0 50% !important;
  max-width: 50% !important;
}

.gc-split.gc-split-50.has-panel .gc-split-side {
  flex: 0 0 50% !important;
  max-width: 50% !important;
}

/* Draggable resize handle */
.gc-split-handle {
  width: 5px;
  cursor: col-resize;
  background: var(--mist, #e5e7eb);
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 20;
  transition: background .15s;
}

.gc-split-handle:hover,
.gc-split-handle.active {
  background: var(--jade);
}

.gc-split-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 24px;
  border-left: 1px solid rgba(0, 0, 0, .15);
  border-right: 1px solid rgba(0, 0, 0, .15);
}

.gc-split-handle:hover::after {
  border-color: rgba(255, 255, 255, .6);
}

/* Main content area */
.gc-split-main {
  flex: 0 0 100%;
  max-width: 100%;
  transition: all .35s cubic-bezier(.4, 0, .2, 1);
  min-width: 0;
}

.gc-split.has-panel .gc-split-main {
  flex: 0 0 74%;
  max-width: 74%;
}

/* Side panel */
.gc-split-side {
  flex: 0 0 0%;
  max-width: 0%;
  opacity: 0;
  overflow: hidden;
  transform: translateX(16px);
  transition: all .35s cubic-bezier(.4, 0, .2, 1);
  background: var(--card, #fff);
  border-left: 1px solid var(--line, #e5e7eb);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  position: relative;
}

.gc-split.has-panel .gc-split-side {
  flex: 0 0 26%;
  max-width: 26%;
  opacity: 1;
  transform: translateX(0);
  padding: 10px;
  border-radius: var(--radius);
  margin-left: 5px;
}

/* ── Independent pane scrolling (opt-in: .gc-split--panes) ──────────
   By default a split screen is as tall as its content and the browser
   window is the one scroller, so moving the list also moves the side
   panel. Screens that add .gc-split--panes give each column its own
   scroll container sized to the viewport instead: the list scrolls
   between a pinned toolbar and pinned pagination, the panel scrolls in
   its body, and the page body stops scrolling altogether.

   --gc-split-h is measured by GCApp.fitSplitPanes() from the split's
   real distance to the top of the document (the page header above it
   can wrap, so it cannot be hard-coded). The calc() is only the
   fallback for the frame before that runs: sticky topbar 56 +
   .content top padding 16 + a typical page header 56 + bottom pad 40.

   Desktop only — at <=992px the side panel is already a fixed overlay
   with its own scroll, and locking the list to the viewport there just
   fights the phone's natural page scroll. */
@media (min-width: 993px) {
  .gc-split--panes {
    height: var(--gc-split-h, calc(100vh - 168px));
    min-height: 320px;
    align-items: stretch;
  }

  .gc-split--panes>.gc-split-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* The table card fills the column; only the row region flexes. */
  .gc-split--panes>.gc-split-main>.gc-table-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* Toolbar, filter row, bulk bar, empty state, pagination: keep their
     natural height so they stay visible while the rows scroll. */
  .gc-split--panes>.gc-split-main>.gc-table-card>* {
    flex: 0 0 auto;
  }

  /* The one scroller in the left column. .gc-table thead is already
     position:sticky, so the header row pins to the top of it. */
  .gc-split--panes>.gc-split-main>.gc-table-card>.gc-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  /* Side panel: bounded by the split instead of by its own content, so
     .gc-panel-body (flex:1; overflow-y:auto) becomes the scroller. */
  .gc-split--panes>.gc-split-side {
    height: 100%;
    min-height: 0;
  }

  .gc-split--panes>.gc-split-side>.gc-panel-body,
  .gc-split--panes>.gc-split-side>.gc-panel-empty {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Panel header — modern two-row layout */
.gc-split-side .gc-panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  background: linear-gradient(180deg, #f9fbfd 0%, var(--card, #fff) 100%);
  flex-shrink: 0;
  position: relative;
}

/* Row variant: title on the left, action buttons (Close / Edit) on the right */
.gc-split-side .gc-panel-header.gc-panel-header--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.gc-split-side .gc-panel-header--row .gc-panel-header-right {
  margin-left: auto;
}

.gc-split-side .gc-panel-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--jade, #1580c9);
  border-radius: 1px;
  opacity: 0;
  transition: opacity .2s;
}

.gc-split.has-panel .gc-split-side .gc-panel-header::after {
  opacity: 1;
}

/* Row 1: identity (avatar + info) + close */
.gc-split-side .gc-panel-header-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.gc-split-side .gc-panel-header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.gc-split-side .gc-panel-header-left h5 {
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink, #123f74);
  font-family: 'IBM Plex Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: color .15s;
}

.gc-split-side .gc-panel-header-left h5:hover {
  color: var(--jade);
}

.gc-split-side .gc-panel-header-info {
  flex: 1;
  min-width: 0;
}

.gc-split-side .gc-panel-header-id {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gc-split-side .gc-panel-header-meta {
  font-size: .76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Row 2: action buttons — grouped by function */
.gc-split-side .gc-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.gc-split-side .gc-panel-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Modern action buttons ──────────────────────────────────────── */
.gc-panel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  white-space: nowrap;
  position: relative;
  line-height: 1;
}

.gc-panel-action-btn svg {
  flex-shrink: 0;
  opacity: 1;
  transition: opacity .15s;
}

.gc-panel-action-btn:hover {
  background: var(--porcelain);
  color: var(--ink);
  border-color: var(--line);
}

.gc-panel-action-btn:hover svg {
  opacity: 1;
}

.gc-panel-action-btn:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 1px;
}

/* Primary action — high-contrast filled */
.gc-panel-action-btn.primary {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
  font-weight: 600;
}

.gc-panel-action-btn.primary svg {
  opacity: 1;
}

.gc-panel-action-btn.primary:hover {
  background: var(--jade-dark);
  border-color: var(--jade-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(21, 128, 201, .35);
}

/* Secondary — outlined */
.gc-panel-action-btn.secondary {
  border: 1px solid var(--mist);
  background: #fff;
  color: var(--ink);
}

.gc-panel-action-btn.secondary:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: var(--mist-2);
}

/* Danger */
.gc-panel-action-btn.danger {
  color: #a3331a;
}

.gc-panel-action-btn.danger:hover {
  background: #ffe9e1;
  border-color: #f5c6b6;
}

/* Icon-only compact */
.gc-panel-action-btn.icon-only {
  padding: 7px;
  border-radius: 8px;
  background: var(--porcelain);
  border-color: var(--line);
  color: var(--deep);
}

.gc-panel-action-btn.icon-only svg {
  width: 15px;
  height: 15px;
}

.gc-panel-action-btn.icon-only:hover {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff;
}

.gc-panel-action-btn.icon-only:hover svg {
  opacity: 1;
}

/* Button divider */
.gc-panel-actions-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
  flex-shrink: 0;
}

/* Close button */
.gc-split-side .gc-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted, #6b7a90);
  padding: 5px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gc-split-side .gc-panel-close:hover {
  background: var(--mist, #e4eaf2);
  color: var(--ink, #123f74);
}

.gc-split-side .gc-panel-close:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 1px;
}

/* Panel body */
.gc-split-side .gc-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--mist, #e5e7eb);
}

.gc-split-side .gc-panel-body::-webkit-scrollbar {
  width: 5px;
}

.gc-split-side .gc-panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.gc-split-side .gc-panel-body::-webkit-scrollbar-thumb {
  background: var(--mist, #e4eaf2);
  border-radius: 3px;
}

.gc-split-side .gc-panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--muted, #6b7a90);
}

/* Panel footer */
.gc-split-side .gc-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #e5e7eb);
  background: var(--porcelain, #f7f9fc);
  flex-shrink: 0;
}

/* Panel loading */
.gc-split-side .gc-panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  gap: 14px;
}

.gc-split-side .gc-panel-loading .spinner-border {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--jade);
  border-width: 2.5px;
}

.gc-split-side .gc-panel-loading .loading-text {
  font-size: .74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

/* Empty state for side panel */
.gc-split-side .gc-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 28px;
  text-align: center;
  gap: 10px;
  flex: 1;
}

.gc-split-side .gc-panel-empty .empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--mist-2, #eef3fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.gc-split-side .gc-panel-empty .empty-title {
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink, #123f74);
}

.gc-split-side .gc-panel-empty .empty-desc {
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 240px;
}

/* Table improvements */
.gc-split .table {
  border-collapse: separate;
  border-spacing: 0;
}

.gc-split .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--porcelain, #f7f9fc);
  border-bottom: 2px solid var(--mist, #e4eaf2);
}

.gc-split .table tbody tr {
  transition: all .15s ease;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.gc-split .table tbody tr:last-child {
  border-bottom: none;
}

.gc-split .table tbody tr:hover {
  background: linear-gradient(90deg, rgba(21, 128, 201, .04) 0%, rgba(21, 128, 201, .02) 100%);
}

.gc-table tbody tr.gc-row-active {
  background: linear-gradient(90deg, rgba(21, 128, 201, .12) 0%, rgba(21, 128, 201, .06) 100%) !important;
  box-shadow: inset 3px 0 0 var(--jade, #1580c9);
}

.gc-table tbody tr.gc-row-active td {
  font-weight: 500;
}

.gc-table tbody tr.gc-row-active .gc-company-name-text {
  color: var(--deep, #123f74);
  font-weight: 700;
}

.gc-table tbody tr.gc-row-active .gc-status-badge {
  box-shadow: 0 0 0 1px rgba(21, 128, 201, .25);
}

.gc-split .table tbody tr.gc-row-active {
  background: linear-gradient(90deg, rgba(21, 128, 201, .12) 0%, rgba(21, 128, 201, .06) 100%) !important;
  box-shadow: inset 3px 0 0 var(--jade, #1580c9);
}

.gc-split .table tbody tr.gc-row-active td:first-child {
  font-weight: 600;
}

/* Action buttons in table */
.gc-split .table .gc-actions {
  display: flex;
  gap: 2px;
  opacity: .5;
  transition: opacity .15s;
}

.gc-split .table tbody tr:hover .gc-actions {
  opacity: 1;
}

.gc-split .table .gc-actions .btn {
  padding: 3px 6px;
  border-radius: 5px;
  transition: all .15s ease;
}

.gc-split .table .gc-actions .btn:hover {
  background: var(--mist-2, #eef3fa);
  transform: scale(1.1);
}

/* Company name cell */
.gc-split .table .gc-company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-split .table .gc-company-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line, #e5e7eb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  flex-shrink: 0;
}

.gc-split .table .gc-company-logo-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--mist-2, #eef3fa), var(--mist, #e4eaf2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--deep, #123f74);
  flex-shrink: 0;
}

.gc-split .table .gc-company-name {
  font-weight: 600;
  font-size: .84rem;
  color: var(--ink, #123f74);
  line-height: 1.3;
}

.gc-split .table .gc-company-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--muted);
  margin-top: 1px;
}

/* Code cell */
.gc-split .table .gc-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  color: var(--deep, #123f74);
  font-weight: 500;
  background: var(--porcelain, #f7f9fc);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Location cell */
.gc-split .table .gc-location {
  font-size: .82rem;
  color: var(--text, #2a3a57);
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-split .table .gc-location .loc-icon {
  font-size: .7rem;
  opacity: .5;
}

/* Pill badges */
.gc-split .table .pill {
  font-size: .64rem;
  padding: 3px 8px;
  letter-spacing: .02em;
}

/* Filter bar modern */
.gc-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.gc-filter-bar .gc-search-wrap {
  position: relative;
  flex: 0 0 auto;
}

.gc-filter-bar .gc-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .82rem;
  pointer-events: none;
  transition: color .15s;
}

.gc-filter-bar .gc-search-wrap input {
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--mist, #e4eaf2);
  border-radius: 10px;
  font-size: .82rem;
  width: 240px;
  background: var(--card, #fff);
  transition: all .2s ease;
}

.gc-filter-bar .gc-search-wrap input:focus {
  outline: none;
  border-color: var(--jade, #1580c9);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .12);
  width: 280px;
}

.gc-filter-bar .gc-search-wrap input:focus~.search-icon {
  color: var(--jade);
}

.gc-filter-bar .gc-search-wrap input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* Add button */
.gc-filter-bar .btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--jade, #1580c9), var(--jade-dark, #1069ab));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(21, 128, 201, .25);
  transition: all .2s ease;
}

.gc-filter-bar .btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 128, 201, .35);
}

.gc-filter-bar .btn-add:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(21, 128, 201, .2);
}

.gc-filter-bar .btn-add .btn-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Record count */
.gc-record-count {
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.gc-record-count .count-num {
  font-weight: 700;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
}

/* Page header modern */
.gc-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.gc-page-header .gc-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Title + record-count pill sit on one baseline-aligned row. */
.gc-page-header .gc-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Record-count pill beside the page title — jade-tinted, with a live dot. */
.gc-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--jade, #0f8a6b);
  background: color-mix(in srgb, var(--jade, #0f8a6b) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--jade, #0f8a6b) 24%, transparent);
  line-height: 1.4;
  white-space: nowrap;
}

.gc-count-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade, #0f8a6b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--jade, #0f8a6b) 18%, transparent);
}

/* Nothing to show until the count loads — keep the row clean. */
.gc-count-pill:empty {
  display: none;
}

.gc-page-header .gc-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .64rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--teal-dark);
  font-weight: 600;
}

.gc-page-header h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

/* Title with an inline record-count chip (e.g. "Companies  3") */
.gc-page-header h3.gc-title-with-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gc-count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--jade, #1580c9);
  background: linear-gradient(135deg, rgba(21, 128, 201, .15), rgba(21, 128, 201, .07));
  border: 1px solid rgba(21, 128, 201, .22);
  box-shadow: 0 1px 2px rgba(21, 128, 201, .08);
  transition: transform .18s ease, background .18s ease;
}

/* Hide the chip until it has a value so no empty bubble shows on load */
.gc-count-chip:empty {
  display: none;
}

.gc-page-header .gc-subtitle {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 1px;
}

.gc-page-header .gc-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gc-record-count {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--mist);
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
}

/* Pagination modern */
.gc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line, #e5e7eb);
  background: var(--porcelain, #f7f9fc);
  border-radius: 0 0 var(--radius-sm, 12px) var(--radius-sm, 12px);
}

.gc-pagination .gc-page-info {
  font-size: .74rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-pagination .gc-page-info strong {
  color: var(--ink);
  font-weight: 600;
}

.gc-pagination .gc-page-btns {
  display: flex;
  gap: 3px;
}

.gc-pagination .gc-page-btn {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--mist, #e4eaf2);
  background: var(--card, #fff);
  color: var(--text);
  font-size: .74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}

.gc-pagination .gc-page-btn:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(21, 128, 201, .04);
}

.gc-pagination .gc-page-btn.active {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(21, 128, 201, .3);
}

.gc-pagination .gc-page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Side panel detail styles */
.gc-panel-company-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.gc-panel-company-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line, #e5e7eb);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  flex-shrink: 0;
}

.gc-panel-company-logo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mist-2), var(--mist));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--deep);
  flex-shrink: 0;
}

.gc-panel-company-info {
  flex: 1;
  min-width: 0;
}

.gc-panel-company-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.2;
  margin-bottom: 2px;
}

.gc-panel-company-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gc-panel-company-code .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  display: inline-block;
}

.gc-panel-company-code .status-dot.inactive {
  background: var(--muted);
}

/* Detail grid in panel */
.gc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.gc-detail-item {
  min-width: 0;
}

.gc-detail-item .detail-label {
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 2px;
  line-height: 1;
}

.gc-detail-item .detail-value {
  font-size: .8rem;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.4;
}

.gc-detail-item .detail-value.empty {
  color: var(--muted);
  font-style: italic;
}

/* Detail section in panel */
.gc-detail-section {
  margin-bottom: 16px;
}

.gc-detail-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.gc-detail-section .section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
}

.gc-detail-section .section-count {
  font-size: .64rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--mist-2);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Detail table in panel */
.gc-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.gc-detail-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--mist);
  background: var(--porcelain);
}

.gc-detail-table td {
  padding: 6px 8px;
  font-size: .74rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: top;
}

.gc-detail-table tr:last-child td {
  border-bottom: none;
}

.gc-detail-table tr:hover td {
  background: rgba(21, 128, 201, .02);
}

/* Panel action buttons */
.gc-panel-actions {
  display: flex;
  gap: 6px;
}

.gc-panel-actions .btn {
  padding: 6px 12px;
  font-size: .76rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.gc-panel-actions .btn-edit {
  background: var(--jade);
  color: #fff;
  border: none;
}

.gc-panel-actions .btn-edit:hover {
  background: var(--jade-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(21, 128, 201, .3);
}

.gc-panel-actions .btn-close {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--mist);
}

.gc-panel-actions .btn-close:hover {
  background: var(--porcelain);
  color: var(--ink);
}

/* Empty state for table */
.gc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.gc-empty-state .empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--mist-2), var(--mist));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.gc-empty-state .empty-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.gc-empty-state .empty-desc {
  font-size: .8rem;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.5;
}

/* Loading skeleton */
.gc-skeleton {
  background: linear-gradient(90deg, var(--mist) 25%, var(--mist-2) 50%, var(--mist) 75%);
  background-size: 200% 100%;
  animation: gc-shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes gc-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Responsive */
@media (max-width:992px) {
  .app {
    grid-template-columns: 1fr;
  }

  .app .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .2);
    overflow: hidden;
  }

  .app .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .app .sidebar .sidebar-nav {
    overflow-y: auto;
    padding: 6px 8px 0;
  }

  /* Hide scroll fade on mobile */
  .app .sidebar .sidebar-nav::after {
    display: none;
  }

  /* Reset collapsed flyout behavior on mobile */
  .sidebar-collapsed .sidebar {
    width: 260px;
    overflow: hidden;
  }

  .sidebar-collapsed .sidebar .sidebar-nav {
    padding: 6px 8px 0;
    overflow-y: auto;
  }

  .sidebar-collapsed .sidebar .brand {
    justify-content: flex-start;
    padding: 14px 14px 12px;
  }

  .sidebar-collapsed .sidebar .brand .brand-text {
    width: auto;
    opacity: 1;
    overflow: visible;
  }

  .sidebar-collapsed .sidebar .group {
    height: auto;
    opacity: 1;
    margin: 14px 8px 4px;
    padding: 0 2px;
    overflow: visible;
    pointer-events: auto;
  }

  .sidebar-collapsed .sidebar .group::after {
    display: block;
  }

  .sidebar-collapsed .sidebar a {
    justify-content: flex-start;
    padding: 8px 10px;
    gap: 10px;
  }

  .sidebar-collapsed .sidebar a span {
    width: auto;
    opacity: 1;
    overflow: visible;
    display: inline;
  }

  .sidebar-collapsed .sidebar .sidebar-bottom-link {
    border-top-color: rgba(255, 255, 255, .08);
    margin: 0 8px;
    padding: 10px 14px;
    text-align: left;
  }

  /* Hide collapsed tooltips on mobile — flyout is always expanded */
  .sidebar-collapsed .sidebar a[data-tip]::after {
    display: none !important;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }

  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .gc-split.has-panel .gc-split-main {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .gc-split.has-panel .gc-split-side {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    flex: 0 0 340px;
    max-width: 340px;
    z-index: 100;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .12);
    border-left: none;
  }
}

@media (max-width:640px) {
  .gc-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .gc-filter-bar .gc-search-wrap input {
    width: 100%;
  }

  .gc-filter-bar .gc-search-wrap input:focus {
    width: 100%;
  }

  .gc-filter-bar .btn-add {
    justify-content: center;
  }
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.gc-breadcrumb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--jade);
  font-weight: 600;
  margin-bottom: 2px;
}

/* ── Large icon button (header add button) ───────────────────────── */
.gc-icon-btn-large {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--mist);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--jade);
  transition: all .15s ease;
}

.gc-icon-btn-large:hover {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
  box-shadow: 0 2px 8px rgba(21, 128, 201, .3);
  transform: translateY(-1px);
}

/* ── Table card container ────────────────────────────────────────── */
.gc-table-card {
  background: var(--card, #fff);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gc-table-card__header {
  padding: 14px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink, #24427d);
  border-bottom: 1px solid var(--mist);
  background: linear-gradient(180deg, #f9fbfd 0%, #fff 100%);
}

.gc-table-card__body {
  padding: 16px;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink, #24427d);
}

.gc-table--sm {
  font-size: .78rem;
}

.gc-table--sm thead th {
  padding: 6px 10px;
  font-size: .72rem;
}

.gc-table--sm tbody td {
  padding: 5px 10px;
}

.gc-row-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Generic card ─────────────────────────────────────────────────── */
.gc-card {
  background: var(--card, #fff);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* Had no padding, so every consumer (26 of them, across 9 screens) rendered its heading
     and content flush against the border. */
  padding: 14px 16px;
  margin-bottom: 14px;
}
.gc-card > :first-child { margin-top: 0; }
.gc-card > :last-child { margin-bottom: 0; }
.gc-card > h4 {
  margin: 0 0 10px;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}


/* ── Warning / info box ───────────────────────────────────────────── */
.gc-warn-box {
  background: rgba(255, 183, 77, .08);
  border: 1px solid rgba(255, 183, 77, .25);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .8rem;
  line-height: 1.5;
}

/* ── Table toolbar (search row) ──────────────────────────────────── */
.gc-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mist);
  background: linear-gradient(180deg, #f9fbfd 0%, #fff 100%);
  flex-wrap: wrap;
}

/* ── Search input in toolbar ─────────────────────────────────────── */
.gc-search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.gc-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color .15s;
}

.gc-search-input {
  width: 100%;
  border: 1px solid var(--mist);
  border-radius: 8px;
  padding: 7px 12px 7px 32px;
  font-size: .82rem;
  background: #fff;
  transition: all .2s ease;
  font-family: inherit;
}

.gc-search-input:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .12);
}

.gc-search-input:focus+.gc-search-icon,
.gc-search-input:focus~.gc-search-icon {
  color: var(--jade);
}

.gc-search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* ── Toolbar filters ────────────────────────────────────────────── */
.gc-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.gc-filter-select {
  border: 1px solid var(--mist);
  border-radius: 8px;
  padding: 7px 28px 7px 10px;
  font-size: .82rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all .2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.gc-filter-select:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .12);
}

.gc-filter-select:hover {
  border-color: var(--jade);
}

.gc-filter-input {
  border: 1px solid var(--mist);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .82rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: all .2s ease;
  min-width: 140px;
}

.gc-filter-input:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .12);
}

.gc-filter-input::placeholder {
  color: var(--muted);
}

/* ── Inline tabs (toolbar) ─────────────────────────────────────── */
.gc-tabs-inline {
  display: flex;
  gap: 2px;
  background: var(--mist);
  border-radius: 8px;
  padding: 2px;
}

.gc-tabs-inline .gc-tab {
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.gc-tabs-inline .gc-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .5);
}

.gc-tabs-inline .gc-tab.active {
  background: #fff;
  color: var(--jade);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* ── Section label (drawer) ─────────────────────────────────────── */
.gc-section-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--mist);
}

/* ── Table wrap ──────────────────────────────────────────────────── */
.gc-table-wrap {
  overflow-x: auto;
}

/* ── Table ────────────────────────────────────────────────────────── */
.gc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.gc-table thead th {
  background: var(--porcelain, #f7f9fc);
  color: var(--muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  border-bottom: 2px solid var(--mist);
  padding: 10px 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.gc-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line, #e5e7eb);
  font-size: .82rem;
  color: var(--text);
}

.gc-table tbody tr {
  transition: all .12s ease;
}

.gc-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(21, 128, 201, .03) 0%, rgba(21, 128, 201, .01) 100%);
}

.gc-table tbody tr.gc-row-active {
  background: linear-gradient(90deg, rgba(21, 128, 201, .08) 0%, rgba(21, 128, 201, .04) 100%);
  box-shadow: inset 3px 0 0 var(--jade);
}

.gc-table tbody tr:last-child td {
  border-bottom: none;
}

.gc-table tbody tr.gc-row-active {
  background: linear-gradient(90deg, rgba(21, 128, 201, .08) 0%, rgba(21, 128, 201, .04) 100%);
  box-shadow: inset 3px 0 0 var(--jade);
}

/* ── Table column-specific headers ───────────────────────────────── */
.gc-th-num {
  width: 42px;
  text-align: center;
}

.gc-th-actions {
  width: 80px;
  text-align: center;
}

.gc-th-code {
  min-width: 120px;
}

.gc-th-name {
  min-width: 160px;
}

/* ── Row number ──────────────────────────────────────────────────── */
.gc-row-num {
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Row action buttons ──────────────────────────────────────────── */
.gc-row-actions {
  display: flex;
  gap: 2px;
  justify-content: center;
  opacity: .45;
  transition: opacity .15s;
}

.gc-table tbody tr:hover .gc-row-actions {
  opacity: 1;
}

/* ── Icon button (small, for table rows) ─────────────────────────── */
.gc-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: all .12s ease;
  padding: 0;
}

.gc-icon-btn:hover {
  background: var(--mist-2, #eef3fa);
  transform: scale(1.1);
}

.gc-icon-btn.gc-icon-danger {
  color: #a3331a;
}

.gc-icon-btn.gc-icon-danger:hover {
  background: #ffe9e1;
  color: #dc3545;
}

.gc-icon-btn.gc-icon-success {
  color: #1a7a4c;
}

.gc-icon-btn.gc-icon-success:hover {
  background: #e0f5ea;
  color: #0f8b4d;
}

/* ── Status badge variants ───────────────────────────────────────── */
.gc-status-badge.gc-status-new {
  background: #e8eaf6;
  color: #3949ab;
}

.gc-status-badge.gc-status-new .gc-status-dot {
  background: #3949ab;
}

.gc-status-badge.gc-status-processing {
  background: #fff3e0;
  color: #e65100;
}

.gc-status-badge.gc-status-processing .gc-status-dot {
  background: #e65100;
}

/* ── Type badge: overdue ─────────────────────────────────────────── */
.gc-type-badge.gc-type-overdue {
  background: #fce4ec;
  color: #c62828;
}

/* ── Company link (code column) ──────────────────────────────────── */
.gc-company-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  font-weight: 500;
  color: var(--deep);
  background: var(--porcelain, #f7f9fc);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* ── Company name cell ───────────────────────────────────────────── */
.gc-company-name-cell {
  display: flex;
  flex-direction: column;
}

.gc-company-name-text {
  font-weight: 600;
  font-size: .84rem;
  color: var(--ink);
  line-height: 1.3;
}

/* ── Type badge (zone) ───────────────────────────────────────────── */
.gc-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--mist-2, #eef3fa);
  color: var(--deep);
  border: 1px solid var(--mist);
}

.gc-type-badge.gc-type-india {
  background: #e3eefc;
  color: #1a4e8a;
  border-color: #c0d8f3;
}

.gc-type-badge.gc-type-uae,
.gc-type-badge.gc-type-dubai {
  background: #fff3cd;
  color: #7a5a00;
  border-color: #f0d9a8;
}

.gc-type-badge.gc-type-usa,
.gc-type-badge.gc-type-united-states {
  background: #d9ece8;
  color: #0c5d52;
  border-color: #b9e6c4;
}

.gc-type-badge.gc-type-default {
  background: var(--mist-2);
  color: var(--deep);
}

.gc-type-badge.gc-type-warning {
  background: #fff3cd;
  color: #7a5a00;
  border-color: #f0d9a8;
}

.gc-type-badge.gc-type-channel {
  background: #e8eaf6;
  color: #3949ab;
  border-color: #c5cae9;
}

.gc-type-badge.gc-type-partner {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #bbdefb;
}

.gc-type-badge.gc-type-lab {
  background: #f3e5f5;
  color: #7b1fa2;
  border-color: #e1bee7;
}

.gc-type-badge.gc-type-centre {
  background: #e0f2f1;
  color: #00695c;
  border-color: #b2dfdb;
}

/* ── Avatar initials ─────────────────────────────────────────────── */
.gc-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--jade, #1580c9), var(--deep, #1069ab));
  flex-shrink: 0;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ── Inline error row ───────────────────────────────────────────── */
.gc-group-inline-error {
  background: #fff5f5 !important;
  outline: 1px solid #fecaca;
}

/* ── Status badge ────────────────────────────────────────────────── */
.gc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.gc-status-badge.gc-status-active {
  background: #d2efd9;
  color: #1f6b3a;
}

.gc-status-badge.gc-status-inactive {
  background: #eef1f3;
  color: #6b7a90;
}

/* ── Status dot ──────────────────────────────────────────────────── */
.gc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.gc-status-active .gc-status-dot {
  background: #1f6b3a;
}

.gc-status-inactive .gc-status-dot {
  background: #9ca3af;
}

/* ── Pagination (custom for master-companies) ────────────────────── */
.gc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line, #e5e7eb);
  background: var(--porcelain, #f7f9fc);
  gap: 12px;
  flex-wrap: wrap;
}

.gc-pagination-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gc-page-size-label {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

.gc-page-size-select {
  border: 1px solid var(--mist);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .78rem;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.gc-pagination-center {
  flex: 1;
  text-align: center;
}

.gc-page-info {
  font-size: .74rem;
  color: var(--muted);
}

.gc-pagination-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-page-nav {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--mist);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
}

.gc-page-nav:hover:not(:disabled) {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(21, 128, 201, .04);
}

.gc-page-nav:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.gc-page-current {
  font-size: .74rem;
  color: var(--muted);
  padding: 0 8px;
  white-space: nowrap;
}

/* ── Side panel — company header ─────────────────────────────────── */
.gc-panel-company-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.gc-panel-company-info {
  flex: 1;
  min-width: 0;
}

.gc-panel-company-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.2;
  margin-bottom: 2px;
}

.gc-panel-company-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--muted);
}

/* ── Missing fields warning ──────────────────────────────────────── */
.gc-missing-fields {
  background: #fff5e2;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.gc-missing-title {
  font-size: .74rem;
  font-weight: 700;
  color: #7a5a00;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.gc-missing-title::before {
  content: "⚠";
  font-size: .82rem;
}

.gc-missing-list {
  margin: 0;
  padding: 0 0 0 16px;
  list-style: none;
}

.gc-missing-list li {
  font-size: .74rem;
  color: #7a5a00;
  padding: 1px 0;
  position: relative;
}

.gc-missing-list li::before {
  content: "•";
  position: absolute;
  left: -12px;
  color: #b8860b;
}

/* ── Panel section (collapsible) ─────────────────────────────────── */
.gc-panel-section {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.gc-panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--porcelain, #f7f9fc);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}

.gc-panel-section-header:hover {
  background: var(--mist-2, #eef3fa);
}

.gc-panel-section-title {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
}

.gc-panel-section-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .82rem;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform .2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gc-panel-section-toggle:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 1px;
  border-radius: 3px;
}

.gc-panel-section.collapsed .gc-panel-section-toggle {
  transform: rotate(-90deg);
}

.gc-panel-section-count {
  font-size: .62rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--mist);
  padding: 1px 6px;
  border-radius: 4px;
}

.gc-panel-section-body {
  padding: 8px 12px;
}

.gc-panel-section.collapsed .gc-panel-section-body {
  display: none;
}

/* ── Info rows (detail key-value) ────────────────────────────────── */
.gc-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

.gc-info-row:last-child {
  border-bottom: none;
}

.gc-info-label {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: .01em;
}

.gc-info-value {
  font-size: .78rem;
  color: var(--ink);
  text-align: right;
  word-break: break-word;
  line-height: 1.4;
  min-width: 0;
}

.gc-info-value.gc-empty {
  color: var(--muted);
  font-style: italic;
}

.gc-info-value.gc-mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
}

/* ── Inline editable inputs inside info-rows (detail/edit tabs) ─────── */
.gc-info-value .ld-field {
  font-size: .8rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #d1d5db);
  background: var(--mist-2, #f8f9fb);
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  color: var(--ink);
  line-height: 1.35;
}
.gc-info-value .ld-field:hover {
  border-color: #b0bec5;
  background: #fff;
}
.gc-info-value .ld-field:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
  background: #fff;
  outline: none;
}
.gc-info-value .ld-field::placeholder {
  color: #9ca3af;
  font-weight: 400;
}
.gc-info-value .ld-field--sm {
  width: 80px;
  flex-shrink: 0;
}
.gc-info-value select.ld-field {
  appearance: auto;
  cursor: pointer;
  padding-right: 24px;
  background-image: none;
}
.gc-info-value select.ld-field option {
  font-size: .8rem;
  padding: 4px 8px;
}

/* ── Contact card ────────────────────────────────────────────────── */
.gc-contact-card {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
}

.gc-contact-card:last-child {
  margin-bottom: 0;
}

.gc-contact-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1px;
}

.gc-contact-detail {
  font-size: .72rem;
  color: var(--muted);
}

.gc-contact-purpose {
  font-size: .68rem;
  color: var(--jade);
  font-weight: 500;
  margin-top: 2px;
}

/* ── Address card ────────────────────────────────────────────────── */
.gc-address-card {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
}

.gc-address-card:last-child {
  margin-bottom: 0;
}

.gc-address-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}

.gc-address-line {
  font-size: .78rem;
  color: var(--text);
}

.gc-address-city {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 1px;
}

.gc-address-pin {
  font-size: .68rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 1px;
}

/* ── No data placeholder ─────────────────────────────────────────── */
.gc-no-data {
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
  padding: 16px;
  font-style: italic;
}

/* ── Mono text helper ────────────────────────────────────────────── */
.gc-mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
}

/* ── Empty value in info rows ────────────────────────────────────── */
.gc-empty {
  color: var(--muted) !important;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════
   TABS — Drawer tab navigation
   ══════════════════════════════════════════════════════════════════ */
.gc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--mist);
  margin-bottom: 16px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  /* kill the phantom scrollbar from the tabs' -2px underline overlap */
  scrollbar-width: none;
  /* Firefox: hide the strip's scrollbar chrome (still scrolls on overflow) */
}

.gc-tabs::-webkit-scrollbar {
  display: none;
}

/* WebKit/Blink: hide the strip's scrollbar chrome */

.gc-tab {
  padding: 10px 18px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: all .15s ease;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.gc-tab:hover {
  color: var(--ink);
  background: rgba(21, 128, 201, .03);
}

.gc-tab.active {
  color: var(--jade);
  font-weight: 600;
  border-bottom-color: var(--jade);
}

.gc-tab-content {
  display: none;
}

.gc-tab-content.active {
  display: block;
}

/* ── Side panel tabs ────────────────────────────────────────────── */
.gc-panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--mist);
  padding: 0 16px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.gc-panel-tabs::-webkit-scrollbar {
  display: none;
}

.gc-panel-tabs .gc-tab {
  padding: 10px 12px;
  font-size: .74rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.gc-panel-tabs .gc-tab:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, .02);
}

.gc-panel-tabs .gc-tab:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: -2px;
  border-radius: 4px;
}

.gc-panel-tabs .gc-tab.active {
  color: var(--jade);
  font-weight: 600;
  border-bottom-color: var(--jade);
}

.gc-tab-num {
  font-size: .62rem;
  font-weight: 600;
  background: var(--mist);
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
  transition: all .15s;
}

.gc-tab.active .gc-tab-num {
  background: rgba(21, 128, 201, .12);
  color: var(--jade);
}

/* ══════════════════════════════════════════════════════════════════
   CASE WORKSPACE — Stepper, Patient Header, Two-column
   ══════════════════════════════════════════════════════════════════ */

/* ── Workflow stepper ───────────────────────────────────────────── */
.gc-stepper {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.gc-stepper::-webkit-scrollbar {
  display: none;
}

.gc-step {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: .68rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 6px;
  transition: all .15s;
  cursor: default;
}

.gc-step .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  background: var(--mist);
  color: var(--muted);
  flex-shrink: 0;
}

/* Five states, five readings — see App\Services\CaseJourneyService. The base .gc-step above
   IS the "pending" look (muted text, grey dot), so `pending` needs no rule of its own. */

.gc-step.done {
  color: var(--leaf);
}

.gc-step.done .dot {
  background: var(--leaf);
  color: #fff;
}

/* In progress. Several steps can honestly be live at once (a passport chase, a VIL request
   and a visa application overlap), so `current` is the shared "being worked" look and only
   .is-primary — the earliest live step — gets the "you are here" ring. */
.gc-step.current {
  color: var(--ink);
  font-weight: 600;
}

.gc-step.current .dot {
  background: var(--jade);
  color: #fff;
}

.gc-step.is-primary .dot {
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .25);
}

/* Blocked — not started because a prerequisite is missing. Amber, not red: it is a queue to
   unstick, not an error, and it must not shout louder than a TAT breach beside it. */
.gc-step.blocked {
  color: #a1670a;
}

.gc-step.blocked .dot {
  background: rgba(245, 179, 31, .22);
  color: #a1670a;
  box-shadow: inset 0 0 0 1px rgba(245, 179, 31, .55);
}

/* Not applicable — an optional step nobody needed, or any step on a closed case. Faded and
   outlined so it reads as "off the board" rather than "not done yet". */
.gc-step.na {
  color: var(--muted);
  opacity: .55;
}

.gc-step.na .dot {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--mist);
}

/* ── Patient header card ────────────────────────────────────────── */
.gc-patient-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  flex-wrap: wrap;
}

.gc-patient-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--deep), var(--jade));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(27, 50, 96, .15);
  letter-spacing: .02em;
}

.gc-patient-info {
  flex: 1;
  min-width: 280px;
}

.gc-patient-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gc-patient-name-row h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.gc-patient-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 18px;
  margin-top: 10px;
  font-size: .78rem;
}

.gc-patient-meta-item {
  line-height: 1.4;
}

.gc-patient-meta-item .label {
  opacity: .55;
  font-size: .72rem;
}

.gc-patient-meta-item .value {
  font-weight: 600;
  color: var(--ink);
}

.gc-patient-tat {
  text-align: right;
  flex-shrink: 0;
}

.gc-patient-tat .tat-label {
  font-size: .64rem;
  opacity: .55;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.gc-patient-tat .tat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--jade);
  font-family: 'IBM Plex Mono', monospace;
}

.gc-patient-tat .tat-sub {
  font-size: .72rem;
  opacity: .6;
}

.gc-patient-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

/* ── Two-column layout ──────────────────────────────────────────── */
.gc-workspace-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ── Quick stats card ───────────────────────────────────────────── */
.gc-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--mist);
  border-radius: 8px;
  overflow: hidden;
}

.gc-kv-item {
  padding: 8px 10px;
  background: #fff;
  font-size: .76rem;
}

.gc-kv-item .kv-label {
  color: var(--muted);
  font-size: .68rem;
  margin-bottom: 2px;
}

.gc-kv-item .kv-value {
  font-weight: 600;
  color: var(--ink);
}

/* ── AI insight card ────────────────────────────────────────────── */
.gc-ai-card {
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px;
  background: linear-gradient(135deg, #eef2ff 0%, #fff 100%);
}

.gc-ai-card h4 {
  margin: 0 0 8px;
  font-size: .82rem;
  color: #3730a3;
}

/* ── Next actions card ──────────────────────────────────────────── */
.gc-action-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: .8rem;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

.gc-action-item:last-child {
  border-bottom: none;
}

.gc-action-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--jade);
}

.gc-action-item.done {
  opacity: .5;
  text-decoration: line-through;
}

/* Actionable Next-Action rows: clickable, keyboard-focusable. */
.gc-action-item[data-na-action] {
  border-radius: 6px;
  padding-left: 6px;
  padding-right: 6px;
  transition: background var(--dur, .15s) var(--ease, ease);
}

.gc-action-item[data-na-action]:hover {
  background: var(--mist, rgba(0, 0, 0, .04));
}

.gc-action-item[data-na-action]:focus-visible {
  outline: 2px solid var(--ring, var(--jade));
  outline-offset: 1px;
}

/* ── Communication mini card ────────────────────────────────────── */
.gc-comm-item {
  border-left: 3px solid var(--jade);
  padding-left: 10px;
  margin-bottom: 10px;
  font-size: .78rem;
}

.gc-comm-item.outbound {
  border-left-color: #2563eb;
}

.gc-comm-item .comm-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: .72rem;
}

.gc-comm-item .comm-body {
  opacity: .8;
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Document chip ──────────────────────────────────────────────── */
.gc-doc-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--mist);
  border-radius: 8px;
  font-size: .74rem;
  background: #fff;
  transition: background .15s;
  cursor: pointer;
}

.gc-doc-chip:hover {
  background: var(--porcelain);
}

.gc-doc-chip .doc-icon {
  font-size: .85rem;
}

/* ── Query card ─────────────────────────────────────────────────── */
.gc-query-item {
  border-left: 3px solid var(--marigold);
  padding: 10px 14px;
  background: #fffbeb;
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}

.gc-query-item.resolved {
  border-left-color: #94a3b8;
  background: #f8fafc;
}

/* 
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--mist);
color: var(--muted);
font-size: .64rem;
font-weight: 700;
margin-right: 4px;
font-family: 'IBM Plex Mono',
monospace;
transition: all .15s ease;
} */

/* ── Tab number badge ────────────────────────────────────────────── */
.gc-tab-num {
  /* display: inline-flex; */
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  margin-right: 4px;
  font-family: 'IBM Plex Mono', monospace;
  transition: all .15s ease;
}

.gc-tab.active .gc-tab-num {
  background: var(--jade);
  color: #fff;
}

.gc-tab.gc-tab-visited .gc-tab-num {
  background: #d2efd9;
  color: #1f6b3a;
}

.gc-tab.gc-tab-visited {
  color: var(--deep);
}

/* ── "This tab has just become available" dot ─────────────────────────
   A tab that appears mid-case — Follow-up, which unlocks the moment a treatment plan is
   actually shared with the patient or partner — needs to say so. The tab row is otherwise
   static furniture, so a new entry in it goes unnoticed and the operator carries on looking
   for the next step on the tab they are already standing on.

   Deliberately not .gc-tab-num, which is display:none in this stylesheet: this is a state
   marker, not a count. The dot never carries the meaning by itself — the render site pairs
   it with a title and an aria-label. */
.gc-tab-open {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--jade);
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .16);
}

.gc-tab.active .gc-tab-open {
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .24);
}

/* ── Tab navigation bar (Next/Back/Step) ─────────────────────────── */
.gc-tab-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 0;
  border-top: 1px solid var(--line, #e5e7eb);
  margin-top: 16px;
}

.gc-tab-nav .btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}

.gc-tab-nav .btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.gc-tab-nav-info {
  flex: 1;
  text-align: center;
}

.gc-tab-step {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════
   MULTI-GROUP TABLE — Contacts / Addresses in drawer
   ══════════════════════════════════════════════════════════════════ */
.gc-group {
  margin-bottom: 16px;
}

.gc-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gc-group-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
}

.gc-group-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--jade), var(--jade-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(21, 128, 201, .25);
  transition: all .15s ease;
  font-family: inherit;
}

.gc-group-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(21, 128, 201, .35);
}

.gc-group-add:active {
  transform: translateY(0);
}

/* ── Group table ─────────────────────────────────────────────────── */
.gc-group-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* visible so an in-row dropdown (multi-select) is not clipped by the table box */
  overflow: visible;
}

.gc-group-table thead th:first-child {
  border-top-left-radius: 10px;
}

.gc-group-table thead th:last-child {
  border-top-right-radius: 10px;
}

.gc-group-table thead th {
  background: var(--porcelain);
  color: var(--muted);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--mist);
  white-space: nowrap;
  text-align: left;
}

.gc-group-table tbody td {
  padding: 8px 10px;
  font-size: .78rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.gc-group-table tbody tr:last-child td {
  border-bottom: none;
}

.gc-group-table tbody tr:hover td {
  background: rgba(21, 128, 201, .02);
}

.gc-group-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: .82rem;
  background: var(--porcelain);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.gc-group-empty-hint {
  font-size: .74rem;
  color: var(--muted);
  margin-top: 4px;
}

.gc-group-actions {
  display: flex;
  gap: 2px;
  justify-content: center;
}

/* ── Group inline row edit ───────────────────────────────────────── */
.gc-group-inline {
  background: #eef4fb;
}

.gc-group-inline td {
  padding: 8px 10px;
}

.gc-group-inline input,
.gc-group-inline select {
  border: 1px solid var(--mist);
  border-radius: 6px;
  padding: 6px 9px;
  min-height: 32px;
  font-size: .78rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.gc-group-inline input:focus,
.gc-group-inline select:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 2px rgba(21, 128, 201, .12);
}

/* ══════════════════════════════════════════════════════════════════
   VALIDATION — Red borders, inline errors, warning banner
   ══════════════════════════════════════════════════════════════════ */
.gc-field-error .form-control,
.gc-field-error .form-select,
.gc-field-error input,
.gc-field-error select,
.gc-field-error textarea {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, .12) !important;
}

/* Shared required-field highlight (GCApp.validateRequired). Applies directly to the
   invalid control — inputs/selects/textareas or a rich/multi-select control div. */
.gc-field-invalid,
.gc-field-invalid.form-control,
.gc-field-invalid.form-select,
.gc-field-invalid .gc-rs-control,
.gc-field-invalid .gc-ms-control {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, .14) !important;
  border-radius: 6px;
}

/* A field a document read filled in, not a person (GCApp.applyPatientOcrFields). Deliberately
   an amber hint rather than a success green: the value came off a scan and has NOT been saved
   or checked by anyone yet, so the operator is being asked to look at it before pressing Save —
   the opposite of "this is settled". Cleared the moment they edit or the form re-renders. */
.gc-field-autofilled,
.gc-field-autofilled.form-control,
.gc-field-autofilled.form-select {
  border-color: #d39e00 !important;
  box-shadow: 0 0 0 2px rgba(211, 158, 0, .14) !important;
  border-radius: 6px;
}

.gc-field-error-msg {
  color: #dc3545;
  font-size: .7rem;
  margin-top: 3px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

.gc-field-error-msg::before {
  content: "⚠";
  font-size: .68rem;
}

/* The summary the form shows above its fields (B-6.5). This used to be
   `display:none`, and nothing ever unset it — so every screen that built a
   banner rendered it into an invisible box and the user saw only a toast.
   The element is created only when there ARE errors, so `block` is correct:
   an empty container has no banner inside it and takes no space. */
.gc-validation-banner {
  background: #ffe9e1;
  border: 1px solid #f5c6b6;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: block;
  scroll-margin-top: 12px;
}

/* Each summary line is a button that jumps to its field — the list is a way to
   REACH the problem, not just read it. */
.gc-validation-jump {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.gc-validation-jump:hover,
.gc-validation-jump:focus-visible {
  text-decoration-style: solid;
  outline: none;
}

/* A submit button held back by an invalid form. `disabled` already stops the
   click; this makes the reason legible instead of the button looking broken. */
.btn.is-blocked,
.btn:disabled.is-blocked {
  opacity: .55;
  cursor: not-allowed;
  filter: saturate(.6);
}

.gc-validation-banner-title {
  font-size: .78rem;
  font-weight: 700;
  color: #a3331a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.gc-validation-banner-title::before {
  content: "✕";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 700;
}

.gc-validation-banner-list {
  margin: 0;
  padding: 0 0 0 22px;
  list-style: none;
}

.gc-validation-banner-list li {
  font-size: .74rem;
  color: #a3331a;
  padding: 1px 0;
  position: relative;
}

.gc-validation-banner-list li::before {
  content: "•";
  position: absolute;
  left: -12px;
  color: #dc3545;
}

/* ── Drawer ─────────────────────────────────────────────────────── */
.gc-drawer {
  position: fixed;
  inset: 0;
  z-index: 10800;
  pointer-events: none;
}

.gc-drawer-open {
  pointer-events: auto;
}

.gc-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .25s;
}

.gc-drawer-open .gc-drawer-backdrop {
  opacity: 1;
}

.gc-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--card, #fff);
  box-shadow: -4px 0 24px rgba(0, 0, 0, .12);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gc-drawer-open .gc-drawer-panel {
  transform: translateX(0);
}

.gc-drawer-sm {
  width: 420px;
  max-width: 95vw;
}

.gc-drawer-md {
  width: 550px;
  max-width: 95vw;
}

.gc-drawer-lg {
  width: 750px;
  max-width: 95vw;
}

.gc-drawer-xl {
  width: 920px;
  max-width: 95vw;
}

/* +20% wider than xl (920 → 1104) — used by the Edit Company drawer */
.gc-drawer-xxl {
  width: 1104px;
  max-width: 95vw;
}

/* Full-screen editor — near-full viewport for the grouped multi-section forms. */
.gc-drawer-full {
  width: 100vw;
  max-width: 100vw;
}

.gc-drawer-full .gc-drawer-body {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.gc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.gc-drawer-title {
  margin: 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink, #123f74);
  font-family: 'IBM Plex Sans', sans-serif;
}

.gc-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted, #6b7280);
  transition: background .15s ease, color .15s ease;
}

.gc-drawer-close:hover {
  background: var(--mist-2);
  color: var(--deep);
}

.gc-drawer-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .25);
  color: var(--deep);
}

.gc-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.gc-drawer-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.gc-drawer-footer {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  padding: .6rem 1rem;
  border-top: 1px solid var(--line, #e5e7eb);
}

/* ══════════════════════════════════════════════════════════════════
   COMPLETENESS PROGRESS — Side panel
   ══════════════════════════════════════════════════════════════════ */
.gc-completeness {
  margin-bottom: 16px;
  display: none;
}

.gc-completeness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.gc-completeness-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.gc-completeness-pct {
  font-size: .72rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
}

.gc-completeness-pct.good {
  color: #1f6b3a;
}

.gc-completeness-pct.warn {
  color: #9a6206;
}

.gc-completeness-pct.bad {
  color: #a3331a;
}

.gc-completeness-bar {
  height: 6px;
  background: var(--mist);
  border-radius: 3px;
  overflow: hidden;
}

.gc-completeness-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

.gc-completeness-fill.good {
  background: linear-gradient(90deg, #4e9821, #1580c9);
}

.gc-completeness-fill.warn {
  background: linear-gradient(90deg, #9a6206, #f4a21f);
}

.gc-completeness-fill.bad {
  background: linear-gradient(90deg, #a3331a, #dc3545);
}

/* ── Quick stats row in panel ────────────────────────────────────── */
.gc-quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.gc-quick-stat {
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  background: var(--porcelain, #f7f9fc);
  border: 1px solid var(--line, #e5e7eb);
}

.gc-quick-stat .stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--deep);
  line-height: 1;
}

.gc-quick-stat .stat-lbl {
  font-size: .6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 2px;
}

/* ── Panel tag list ──────────────────────────────────────────────── */
.gc-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gc-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .66rem;
  font-weight: 500;
  background: var(--mist-2, #eef3fa);
  color: var(--deep);
  border: 1px solid var(--mist);
}

.gc-tag.jade {
  background: #d2efd9;
  color: #1f6b3a;
  border-color: #b9e6c4;
}

.gc-tag.gold {
  background: #fff3cd;
  color: #7a5a00;
  border-color: #f0d9a8;
}

.gc-tag.red {
  background: #ffe9e1;
  color: #a3331a;
  border-color: #f5c6b6;
}

/* ── Unsaved changes indicator ───────────────────────────────────── */
.gc-unsaved-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--marigold);
  display: inline-block;
  margin-left: 4px;
  animation: gc-pulse 1.5s ease infinite;
}

@keyframes gc-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .6;
    transform: scale(.8);
  }
}

/* ── Tab badge counter ───────────────────────────────────────────── */
.gc-tab .gc-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--mist);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  padding: 0 5px;
  margin-left: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.gc-tab.active .gc-tab-count {
  background: rgba(21, 128, 201, .15);
  color: var(--jade);
}

/* ════════════════════════════════════════════════════════════════
   DRAWER WIZARD TABS (Add / Edit Company) — refined stepper
   Scoped to #gc-drawer-tabs so side-panel / inline tabs are untouched.
   ════════════════════════════════════════════════════════════════ */
#gc-drawer-tabs {
  gap: 4px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  margin-bottom: 20px;
}

#gc-drawer-tabs .gc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px 12px;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 500;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

#gc-drawer-tabs .gc-tab:hover {
  background: rgba(21, 128, 201, .05);
  color: var(--ink);
}

#gc-drawer-tabs .gc-tab.active {
  color: var(--jade);
  font-weight: 600;
  background: linear-gradient(to bottom, rgba(21, 128, 201, .07), rgba(21, 128, 201, 0));
  border-bottom-color: var(--jade);
}

/* Numbered step circles — re-shown just for the wizard */
#gc-drawer-tabs .gc-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: var(--mist);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  font-family: inherit;
  border: 1.5px solid transparent;
  transition: all .18s ease;
}

#gc-drawer-tabs .gc-tab.active .gc-tab-num {
  background: var(--jade);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .15);
}

/* Completed steps: green circle with a check mark instead of the digit */
#gc-drawer-tabs .gc-tab.gc-tab-visited .gc-tab-num {
  background: #e3f4ea;
  color: #1f6b3a;
  border-color: #9ed9b4;
  font-size: 0;
}

#gc-drawer-tabs .gc-tab.gc-tab-visited .gc-tab-num::after {
  content: '\2713';
  font-size: .74rem;
  line-height: 1;
}

#gc-drawer-tabs .gc-tab.gc-tab-visited {
  color: var(--deep);
}

/* Count pill sits closer to the label and reads as a chip */
#gc-drawer-tabs .gc-tab-count {
  margin-left: 2px;
  border-radius: 999px;
  font-family: inherit;
}

/* ── Row hover tooltip ───────────────────────────────────────────── */
.gc-table tbody tr {
  position: relative;
}

/* ── Smooth focus ring for accessibility ─────────────────────────── */
.gc-icon-btn:focus-visible,
.gc-panel-action-btn:focus-visible,
.gc-group-add:focus-visible,
.gc-page-nav:focus-visible,
.gc-tab:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}

/* ── Keyboard focus row highlight ────────────────────────────────── */
.gc-table tbody tr.gc-row-focused {
  outline: 2px solid var(--jade);
  outline-offset: -2px;
}

/* ── Drawer unsaved warning ──────────────────────────────────────── */
.gc-drawer-unsaved-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff5e2;
  border-bottom: 1px solid #f0d9a8;
  font-size: .76rem;
  color: #7a5a00;
  font-weight: 500;
}

.gc-drawer-unsaved-bar .gc-unsaved-dot {
  flex-shrink: 0;
}

/* Lead Intake — add-lead form grid */
.gc-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gc-form-grid>div {
  flex: 1 1 100%;
}

.gc-form-grid>div[style*="flex:1"] {
  flex: 1 1 calc(50% - 6px);
}

/* ── Filter row collapse/expand ─────────────────────────────────── */
.gc-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--mist);
  background: var(--porcelain);
  flex-wrap: wrap;
  transition: padding .25s cubic-bezier(.4, 0, .2, 1), opacity .2s ease, border-color .2s ease;
  opacity: 1;
}

.gc-filter-row.collapsed {
  padding: 0 16px;
  border-bottom-color: transparent;
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
}

.gc-filter-row .form-select-sm {
  min-width: 130px;
  max-width: 160px;
  flex: 0 1 auto;
}

/* ── Filter active state ────────────────────────────────────────── */
.gc-filter-row .form-select.gc-filter-active {
  border-color: var(--jade);
  box-shadow: 0 0 0 2px rgba(21, 128, 201, .12);
}

/* ── Filter badge ───────────────────────────────────────────────── */
.gc-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--jade);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
}

.btn.has-active {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(21, 128, 201, .06);
}

/* ── Table skeleton loading ─────────────────────────────────────── */
.gc-skeleton-row td {
  padding: 12px;
}

.gc-skeleton-row:hover {
  background: transparent !important;
}

/* ── SLA badge ──────────────────────────────────────────────────── */
.gc-sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  background: var(--mist-2);
  color: var(--deep);
}

.gc-sla-badge.overdue {
  background: #fce4ec;
  color: #c62828;
}

/* ── Patient name in table ──────────────────────────────────────── */
.gc-patient-name {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: .82rem;
  transition: color .15s;
}

.gc-patient-name:hover {
  color: var(--jade);
}

/* ── Owner cell in table ────────────────────────────────────────── */
.gc-owner-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gc-owner-name {
  font-size: .78rem;
  color: var(--ink);
}

/* ── Related lead row hover ─────────────────────────────────────── */
.gc-related-row {
  transition: background .15s;
  border-radius: 6px;
  padding: 6px 8px !important;
  margin: 0 -8px;
}

.gc-related-row:hover {
  background: rgba(21, 128, 201, .06);
}

/* ── Communication log expand ───────────────────────────────────── */
.ld-comm-row .ld-comm-excerpt {
  font-size: .82rem;
  color: var(--text);
}

.ld-comm-row .ld-comm-body.expanded,
.ld-comm-row .ld-comm-body:not([style*="display: none"]):not([style*="display:none"]) {
  display: block !important;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--text);
  padding: 6px 0;
  border-top: 1px dashed var(--mist);
  margin-top: 6px;
}

.gc-comm-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
}

.gc-comm-dir.inbound {
  background: #d2efd9;
  color: #1f6b3a;
}

.gc-comm-dir.outbound {
  background: #fff3e0;
  color: #e65100;
}

/* ── Standalone page buttons (case-list pagination) ─────────── */
.gc-page-btn {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--mist, #e4eaf2);
  background: var(--card, #fff);
  color: var(--text);
  font-size: .74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}

.gc-page-btn:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(21, 128, 201, .04);
}

.gc-page-btn.active {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(21, 128, 201, .3);
}

.gc-page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Language Switcher ── */
.gc-lang-switcher {
  position: relative;
  display: inline-block;
}

.gc-lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  z-index: 1080;
  min-width: 120px;
  overflow: hidden;
}

.gc-lang-switcher:hover .gc-lang-dropdown,
.gc-lang-dropdown.show {
  display: block;
}

.gc-lang-option {
  padding: 8px 14px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s;
  font-family: 'IBM Plex Sans', sans-serif;
}

.gc-lang-option:hover {
  background: var(--porcelain, #eef2f8);
  color: var(--jade, #1580c9);
}

/* ── RTL Support ── */
[dir="rtl"] .sidebar {
  right: 0;
  left: auto;
}

[dir="rtl"] .main {
  margin-left: 0;
  margin-right: 0;
}

[dir="rtl"] .gc-split-side {
  border-left: none;
  border-right: 1px solid var(--line, #e5e7eb);
}

[dir="rtl"] .gc-search-wrap {
  direction: rtl;
}

[dir="rtl"] .gc-panel-header-left {
  flex-direction: row-reverse;
}

[dir="rtl"] .gc-drawer-panel {
  left: 0;
  right: auto;
}

[dir="rtl"] .gc-pagination-right {
  flex-direction: row-reverse;
}

[dir="rtl"] .gc-filter-row {
  direction: rtl;
}

/* ══════════════════════════════════════════════════════════════
   RBAC permission editors (role matrix + user overrides)
   ══════════════════════════════════════════════════════════════ */
.gc-perm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sticky summary + search toolbar */
.gc-perm-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  margin: -4px -2px 0;
  background: var(--porcelain);
  border: 1px solid var(--mist);
  border-radius: 10px;
}

.gc-perm-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text);
}

.gc-perm-meta b {
  color: var(--ink);
}

.gc-perm-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--mist-2);
  color: var(--jade-dark);
}

.gc-perm-search {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 8px;
  padding: 0 10px;
  height: 38px;
}

.gc-perm-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: .84rem;
  color: var(--ink);
}

.gc-perm-search svg {
  color: var(--muted);
  flex: 0 0 auto;
}

/* Group card */
.gc-perm-group {
  border: 1px solid var(--mist);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.gc-perm-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(0deg, var(--porcelain), #fff);
  border-bottom: 1px solid var(--mist);
}

.gc-perm-group-title {
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--ink);
}

.gc-perm-group-head .gc-perm-count {
  margin-left: 2px;
}

.gc-perm-group-all {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
}

.gc-perm-group-body {
  padding: 4px 6px;
}

/* Permission row — full-row 44px touch target */
.gc-perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}

.gc-perm-row:hover {
  background: var(--mist-2);
}

.gc-perm-row .gc-perm-label {
  flex: 1;
  min-width: 0;
}

.gc-perm-row .gc-perm-name {
  font-size: .84rem;
  color: var(--ink);
  line-height: 1.3;
}

.gc-perm-row .gc-perm-key {
  font-size: .68rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

.gc-perm-row .gc-perm-rolehint {
  font-size: .68rem;
  font-weight: 600;
}

.gc-perm-row.is-hidden {
  display: none;
}

/* Accessible toggle switch */
.gc-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
}

.gc-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.gc-switch-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c7d3e8;
  transition: background .18s ease;
  position: relative;
  pointer-events: none;
}

.gc-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(27, 50, 96, .35);
  transition: transform .18s ease;
}

.gc-switch input:checked+.gc-switch-track {
  background: var(--jade);
}

.gc-switch input:checked+.gc-switch-track .gc-switch-knob {
  transform: translateX(18px);
}

.gc-switch input:focus-visible+.gc-switch-track {
  outline: 2px solid var(--jade-dark);
  outline-offset: 2px;
}

.gc-switch input:disabled+.gc-switch-track {
  opacity: .45;
}

/* ── Paired view/manage matrix (role editor data arrangement) ── */
.gc-perm-matrix {
  display: flex;
  flex-direction: column;
  padding: 2px 4px 4px;
}

.gc-perm-matrix-head,
.gc-perm-matrix-row {
  display: grid;
  grid-template-columns: 1fr repeat(var(--cols, 2), 64px);
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
}

.gc-perm-matrix-head {
  border-bottom: 1px solid var(--mist);
  margin-bottom: 2px;
}

.gc-perm-matrix-head .gc-perm-col {
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

.gc-perm-matrix-row {
  min-height: 42px;
  border-radius: 8px;
  transition: background .15s ease;
}

.gc-perm-matrix-row:hover {
  background: var(--mist-2);
}

.gc-perm-matrix-row.is-hidden {
  display: none;
}

.gc-perm-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gc-perm-col--empty {
  color: var(--mist);
  font-weight: 700;
}

.gc-perm-ent-label {
  min-width: 0;
}

.gc-perm-ent-label .gc-perm-name {
  font-size: .84rem;
  color: var(--ink);
}

/* ── Family grouping for the tri-state user-override editor ── */
.gc-perm-famrow {
  align-items: flex-start;
  flex-wrap: wrap;
}

.gc-perm-famrow .gc-perm-label {
  flex: 1 1 130px;
  padding-top: 6px;
}

.gc-perm-uactions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.gc-perm-uaction {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gc-perm-uaction-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.gc-perm-roledot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.gc-perm-roledot.is-allow {
  background: var(--jade);
}

.gc-perm-roledot.is-deny {
  background: var(--mist);
  border: 1px solid #c7d3e8;
}

@media (max-width: 560px) {

  .gc-perm-matrix-head,
  .gc-perm-matrix-row {
    grid-template-columns: 1fr repeat(var(--cols, 2), 52px);
    gap: 4px;
  }
}

/* ── Company form: clean section labels + status switch ── */
#company-form {
  line-height: 1.55;
  /* +15% over the previous 1.35 for a more open, readable form */
}

.gc-form-section-label {
  font-size: calc(.82rem + 2px);
  /* +2px over the base .82rem section-title size */
  font-weight: 600;
  color: var(--ink, #24427d);
  margin: 1rem 0 .55rem;
  line-height: 1.3;
}

.gc-status-field {
  margin-bottom: .9rem;
}

.gc-form-label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink, #24427d);
  margin-bottom: 6px;
  line-height: 1.3;
}

.gc-status-switch-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.gc-status-switch-text {
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.3;
}

.gc-status-switch-text.is-active {
  color: var(--jade);
}

.gc-status-switch-text.is-inactive {
  color: var(--muted, #6b7280);
}

/* Tri-state segmented control (user overrides) */
.gc-seg {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--mist);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.gc-seg button {
  border: 0;
  border-left: 1px solid var(--mist);
  background: #fff;
  padding: 0 12px;
  height: 34px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.gc-seg button:first-child {
  border-left: 0;
}

.gc-seg button:hover {
  background: var(--mist-2);
}

.gc-seg button[aria-pressed="true"][data-v="inherit"] {
  background: var(--muted);
  color: #fff;
}

.gc-seg button[aria-pressed="true"][data-v="grant"] {
  background: var(--jade);
  color: #fff;
}

.gc-seg button[aria-pressed="true"][data-v="revoke"] {
  background: #dc3545;
  color: #fff;
}

.gc-seg button:focus-visible {
  outline: 2px solid var(--jade-dark);
  outline-offset: -2px;
}

/* Apply-mode conflict cards */
.gc-apply {
  border: 1px solid var(--marigold);
  background: #fff8ec;
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}

.gc-apply-title {
  font-weight: 700;
  font-size: .86rem;
  color: #8a5a00;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gc-apply-users {
  max-height: 120px;
  overflow: auto;
  margin: 8px 0;
  font-size: .76rem;
  color: var(--text);
}

.gc-apply-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--mist);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.gc-apply-opt:hover {
  border-color: var(--jade);
}

.gc-apply-opt input {
  margin-top: 3px;
  accent-color: var(--jade);
}

.gc-apply-opt.selected {
  border-color: var(--jade);
  box-shadow: 0 0 0 2px var(--mist-2);
}

.gc-apply-opt .t {
  font-size: .82rem;
  color: var(--ink);
  font-weight: 600;
}

.gc-apply-opt .d {
  font-size: .75rem;
  color: var(--muted);
}

.gc-perm-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: .82rem;
}

/* Lead export dropdown */
.gc-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(27, 50, 96, .16);
  z-index: 40;
  overflow: hidden;
}

.gc-export-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 10px 14px;
  font-size: .82rem;
  color: var(--ink);
  cursor: pointer;
}

.gc-export-menu button:hover {
  background: var(--mist-2);
}

/* ══ Manual lead entry — sectioned form ══ */
.gc-leadform {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px;
}

.gc-form-sec {
  border: 1px solid var(--mist);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.gc-form-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink);
  background: linear-gradient(0deg, var(--porcelain), #fff);
  border-bottom: 1px solid var(--mist);
}

.gc-form-sec-n {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--jade);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}

.gc-form-sec-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gc-fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 100%;
  min-width: 0;
}

.gc-fld-label {
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.gc-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gc-form-grid>.gc-fld {
  flex: 1 1 calc(50% - 6px);
}

@media (max-width: 560px) {
  .gc-form-grid>.gc-fld {
    flex: 1 1 100%;
  }
}

/* Radio pills */
.gc-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gc-radio {
  position: relative;
}

.gc-radio input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.gc-radio span {
  display: inline-block;
  padding: 8px 14px;
  min-height: 38px;
  line-height: 22px;
  border: 1px solid var(--mist);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
}

.gc-radio input:checked+span {
  background: var(--mist-2);
  border-color: var(--jade);
  color: var(--jade-dark);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--jade);
}

.gc-radio input:focus-visible+span {
  outline: 2px solid var(--jade-dark);
  outline-offset: 2px;
}

/* Dropzone */
.gc-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 22px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: var(--porcelain);
  color: var(--muted);
  font-size: .84rem;
}

.gc-dropzone svg {
  color: var(--jade);
}

/* ══════════════════════════════════════════════════════════════════
   MULTI-SELECT DROPDOWN — category-backed "selection box" (chips + menu)
   ══════════════════════════════════════════════════════════════════ */
.gc-ms {
  position: relative;
}

.gc-ms-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  min-height: 34px;
  padding: .28rem .55rem;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.gc-ms-control:hover {
  border-color: var(--jade);
}

.gc-ms-control:focus,
.gc-ms-control:focus-visible {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .15);
}

.gc-ms.open .gc-ms-control {
  border-color: var(--jade);
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .15);
}

.gc-ms-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
  overflow: hidden;
}

.gc-ms-ph {
  color: var(--muted);
  font-size: .8rem;
}

.gc-ms-chip {
  display: inline-flex;
  align-items: center;
  background: var(--mist-2);
  color: var(--deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
}

.gc-ms-chip.gc-ms-more {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
}

.gc-ms-caret {
  flex: none;
  color: var(--muted);
  transition: transform .18s ease, color .15s ease;
}

.gc-ms.open .gc-ms-caret {
  transform: rotate(180deg);
  color: var(--jade);
}

/* JS pins this panel with position:fixed (GCApp.positionFloatMenu) so an
   ancestor's overflow:hidden can't clip it; the absolute rules below are the
   no-JS fallback. z-index sits above page chrome and drawer content but under
   toasts. */
.gc-ms-menu {
  display: none;
  position: absolute;
  z-index: 10850;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 190px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(27, 50, 96, .16);
  padding: 5px;
}

.gc-ms.open .gc-ms-menu {
  display: block;
  animation: gc-ms-pop .14s ease;
}

@keyframes gc-ms-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.gc-ms-opt {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .5rem;
  border-radius: 7px;
  font-size: .8rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: relative;
}

.gc-ms-opt:hover {
  background: var(--porcelain);
}

.gc-ms-opt.is-checked {
  color: var(--deep);
  font-weight: 500;
}

.gc-ms-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.gc-ms-opt input:focus-visible+.gc-ms-check {
  box-shadow: 0 0 0 2px rgba(21, 128, 201, .3);
}

.gc-ms-check {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, border-color .12s ease;
}

.gc-ms-opt.is-checked .gc-ms-check {
  background: var(--jade);
  border-color: var(--jade);
}

.gc-ms-opt.is-checked .gc-ms-check::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.gc-ms-empty {
  padding: .5rem .6rem;
  font-size: .78rem;
  color: var(--muted);
}

/* ── Drawer form fields: jade focus even over inline gray borders ──── */
.gc-drawer .form-control:focus,
.gc-drawer .form-select:focus,
.gc-drawer textarea:focus,
.gc-drawer input:focus {
  border-color: var(--jade) !important;
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .15);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {

  .gc-ms-caret,
  .gc-ms-check,
  .gc-ms-control,
  .gc-group-inline input,
  .gc-group-inline select {
    transition: none;
  }

  .gc-ms.open .gc-ms-menu {
    animation: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   RICH SINGLE-SELECT — multi-column searchable picker (hospital link, …)
   ══════════════════════════════════════════════════════════════════ */
.gc-rs {
  position: relative;
}

.gc-rs-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  min-height: 34px;
  padding: .28rem .55rem;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.gc-rs-control:hover {
  border-color: var(--jade);
}

.gc-rs-control:focus,
.gc-rs-control:focus-visible {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .15);
}

.gc-rs.open .gc-rs-control {
  border-color: var(--jade);
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .15);
}

.gc-rs-display {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  font-size: .82rem;
}

.gc-rs-ph {
  color: var(--muted);
}

.gc-rs-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-rs-code {
  flex: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  background: var(--mist-2);
  color: var(--deep);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
}

.gc-rs-caret {
  flex: none;
  color: var(--muted);
  transition: transform .18s ease, color .15s ease;
}

.gc-rs.open .gc-rs-caret {
  transform: rotate(180deg);
  color: var(--jade);
}

/* Placed by GCApp.positionFloatMenu (position:fixed) — see .gc-ms-menu. */
.gc-rs-menu {
  display: none;
  position: absolute;
  z-index: 10850;
  top: calc(100% + 4px);
  left: 0;
  width: max(100%, 400px);
  max-width: min(560px, 94vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(27, 50, 96, .18);
  overflow: hidden;
}

/* Opened upward (no room below): lift the shadow the other way so the panel
   still reads as sitting in front of the field. */
.gc-rs-menu.is-above {
  box-shadow: 0 -12px 30px rgba(27, 50, 96, .18);
}

.gc-rs.open .gc-rs-menu {
  display: block;
  animation: gc-ms-pop .14s ease;
}

.gc-rs.open .gc-rs-menu.is-above {
  animation-name: gc-rs-pop-up;
}

@keyframes gc-rs-pop-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* The search row reads as a real search field (bordered box, icon inside)
   rather than a bare caret on a tinted strip — the global input:focus-visible
   outline then lands on an actual box instead of drawing a floating pill. */
.gc-rs-search {
  position: relative;
  padding: 8px 10px;
  border-bottom: 1px solid var(--mist);
  background: var(--porcelain);
  color: var(--muted);
}

.gc-rs-search>svg {
  position: absolute;
  left: 19px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.gc-rs-search input {
  width: 100%;
  min-width: 0;
  padding: .34rem .5rem .34rem 28px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 7px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
}

.gc-rs-search input:focus,
.gc-rs-search input:focus-visible {
  outline: none;
  border-color: var(--jade);
  box-shadow: var(--ring);
}

.gc-rs-search:focus-within>svg {
  color: var(--jade);
}

.gc-rs-head {
  display: grid;
  gap: .5rem;
  padding: 8px 12px;
  background: var(--porcelain);
  border-bottom: 1px solid var(--mist);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--muted);
}

.gc-rs-body {
  max-height: 240px;
  overflow-y: auto;
}

.gc-rs-row {
  display: grid;
  gap: .5rem;
  padding: .5rem .75rem;
  align-items: center;
  cursor: pointer;
  font-size: .8rem;
  border-bottom: 1px solid var(--porcelain);
}

.gc-rs-row:last-child {
  border-bottom: none;
}

.gc-rs-row:hover {
  background: var(--mist-2);
}

.gc-rs-row.is-selected {
  background: rgba(21, 128, 201, .10);
}

.gc-rs-cell-primary {
  color: var(--deep);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-rs-cell-muted {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The code column (Partner ID, Hospital Code). Monospaced so codes of the same shape line up
   down the column and a mistyped one is visible at a glance — these are scanned, not read. */
.gc-rs-cell-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
  color: var(--deep);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Locked picker — GCApp.setRichSelectDisabled. Mirrors a disabled <select>: it still shows and
   still submits its value, it just cannot be opened. */
.gc-rs.is-disabled .gc-rs-control {
  background: var(--porcelain);
  cursor: not-allowed;
  opacity: .7;
}

.gc-rs.is-disabled .gc-rs-caret {
  visibility: hidden;
}

.gc-rs-empty {
  padding: 14px;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
}

/* Combo select (Select2-style): free-type "Use …" row + tighter single-column menu */
.gc-cs .gc-rs-menu {
  width: max(100%, 260px);
  background: #fff;
}

/* Normal (light) option rows, left-aligned text */
.gc-cs .gc-rs-body {
  background: #fff;
}

.gc-cs .gc-rs-row {
  background: #fff;
  color: var(--deep);
  text-align: left;
  justify-items: start;
}

.gc-cs .gc-rs-row:hover {
  background: var(--mist-2);
}

.gc-cs .gc-rs-row.is-selected {
  background: rgba(21, 128, 201, .10);
}

.gc-cs .gc-rs-cell-primary {
  text-align: left;
}

.gc-cs-add {
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .8rem;
  text-align: left;
  color: var(--jade);
  border-top: 1px solid var(--mist);
  background: var(--porcelain);
}

.gc-cs-add:hover {
  background: var(--mist-2);
}

.gc-cs-add strong {
  color: var(--deep);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {

  .gc-rs-caret,
  .gc-rs-control {
    transition: none;
  }

  .gc-rs.open .gc-rs-menu,
  .gc-rs.open .gc-rs-menu.is-above {
    animation: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   CHECK-CHIP GROUP — selectable pills (Languages / Specialties / …)
   No visible checkbox: selection shown via jade border + highlight.
   ══════════════════════════════════════════════════════════════════ */
.gc-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The group itself is borderless, so the shared .gc-field-invalid ring has nothing to hug.
   A transparent border + padding gives it a box without moving the chips when valid. */
.gc-check-group.gc-field-invalid {
  border: 1px solid transparent;
  padding: 4px;
}

.gc-check-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: .34rem .85rem;
  font-size: .8rem;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.gc-check-chip:hover {
  border-color: var(--jade);
  color: var(--deep);
}

/* visually hide the checkbox but keep it focusable/collectable */
.gc-check-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.gc-check-chip.is-checked {
  border-color: var(--jade);
  background: var(--mist-2);
  color: var(--deep);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--jade);
}

.gc-check-chip:focus-within {
  border-color: var(--jade);
  box-shadow: 0 0 0 .2rem rgba(21, 128, 201, .18);
}

@media (prefers-reduced-motion: reduce) {
  .gc-check-chip {
    transition: none;
  }
}

/* ── Lead list: documents badge + owner hover preview ─────────────── */
.gc-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--deep);
  background: var(--mist-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
}

.gc-doc-badge svg {
  color: var(--jade);
}

.gc-owner-tip {
  position: fixed;
  z-index: 11000;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(27, 50, 96, .18);
  padding: 8px;
  min-width: 190px;
  max-width: 260px;
  pointer-events: none;
}

.gc-owner-tip-h {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.gc-owner-tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 2px;
  font-size: .8rem;
  color: var(--ink);
}

.gc-owner-tip-row .gc-avatar-initials {
  width: 22px;
  height: 22px;
  font-size: .6rem;
  flex: none;
}

.gc-owner-tip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Lead side-panel document previews ────────────────────────────── */
.gc-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gc-doc-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.gc-doc-card:hover {
  border-color: var(--jade);
  box-shadow: 0 4px 14px rgba(27, 50, 96, .12);
}

.gc-doc-card:active {
  transform: scale(.99);
}

.gc-doc-thumb {
  height: 96px;
  background-size: cover;
  background-position: center;
  background-color: var(--mist-2);
}

.gc-doc-thumb-file {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  position: relative;
  color: var(--jade);
  background: linear-gradient(135deg, var(--mist-2), #fff);
}

.gc-doc-thumb-file::after {
  content: attr(data-ext);
  position: absolute;
  bottom: 8px;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
}

.gc-doc-cardmeta {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
}

.gc-doc-name {
  font-size: .74rem;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-doc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(10, 22, 48, .82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}

.gc-doc-lightbox-bar {
  width: min(900px, 92vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  font-size: .82rem;
}

.gc-doc-lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.gc-doc-lb-open {
  color: #cbd9f0;
  text-decoration: none;
  font-size: .76rem;
}

.gc-doc-lb-open:hover {
  text-decoration: underline;
}

.gc-doc-lb-close {
  background: rgba(255, 255, 255, .14);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
}

.gc-doc-lb-close:hover {
  background: rgba(255, 255, 255, .28);
}

.gc-doc-lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Remove-document button on a doc card */
.gc-doc-card {
  position: relative;
}

.gc-doc-del {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(10, 22, 48, .55);
  color: #fff;
  font-size: .72rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease;
}

.gc-doc-card:hover .gc-doc-del {
  opacity: 1;
}

.gc-doc-del:hover {
  background: #b0431d;
}

/* ══════════════════════════════════════════════════════════════════
   Full-page master form (Doctor add/edit) — enterprise ERP layout
   ══════════════════════════════════════════════════════════════════ */
.gc-form-page {
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 84px;
  /* clear the sticky action bar */
}

.gc-form-section {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.gc-form-section-head {
  border-bottom: 1px solid var(--line, #e9edf2);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.gc-form-section-head h5 {
  margin: 0;
  font-size: .98rem;
  font-weight: 700;
  color: var(--ink, #123f74);
  letter-spacing: .01em;
}

.gc-form-section-head span {
  display: block;
  margin-top: 3px;
  font-size: .76rem;
  color: var(--muted, #6b7280);
}

/* Field rows inside a section: consistent gaps + uniform control heights. */
.gc-form-section-body>* {
  margin-bottom: 14px;
}

.gc-form-section-body>*:last-child {
  margin-bottom: 0;
}

.gc-form-section-body .gc-form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.gc-form-section-body .gc-form-row>* {
  flex: 1;
  min-width: 0;
}

.gc-form-section-body .form-control,
.gc-form-section-body .form-select,
.gc-form-section-body .gc-rs-control,
.gc-form-section-body .gc-ms-control {
  min-height: 40px;
}

/* Sticky action bar, bottom-right primary CTA. */
.gc-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  margin: 0 auto;
  max-width: 960px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--card, #fff) 32%);
}

@media (max-width: 640px) {
  .gc-form-section {
    padding: 16px;
  }

  .gc-form-section-body .gc-form-row {
    gap: 12px;
  }

  .gc-form-section-body .gc-form-row>* {
    flex: 1 1 100%;
  }

  .gc-form-actions {
    flex-direction: column-reverse;
  }

  .gc-form-actions .btn {
    width: 100%;
  }
}

/* ── Inline utility classes ─────────────────────────────────────── */
.gc-divider {
  margin: 1.25rem 0;
  border: none;
  border-top: 1px solid var(--line, #e5e7eb);
}

.gc-form-section-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink, #24427d);
  margin-bottom: .75rem;
}

/* Full-width full-page form for tab-based masters (Hospital).
   Stretches across the available width — no centered max-width — so the
   two-column field rows have room to breathe on wide screens.
   No sticky-overlay clearance here — its wizard footer is in normal flow,
   so the base .gc-form-page 84px bottom padding is pure dead space. */
.gc-form-page-wide {
  max-width: none;
  margin: 0;
  padding-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════════════
   MODERN PRIMITIVES — Phase 1 polish (additive; keeps jade/marigold brand)
   Semantic token layer + interaction states + a11y focus + rhythm.
   ══════════════════════════════════════════════════════════════════ */
:root {
  /* 4/8px spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Modular type scale */
  --fs-xs: .72rem;
  --fs-sm: .82rem;
  --fs-md: .9rem;
  --fs-lg: 1.05rem;
  --fs-xl: 1.3rem;
  --fs-2xl: 1.65rem;
  --fs-3xl: 2.1rem;

  /* Elevation scale (3 tiers, brand-tinted) */
  --elev-1: 0 1px 2px rgba(27, 50, 96, .06), 0 1px 3px rgba(27, 50, 96, .08);
  --elev-2: 0 4px 12px -4px rgba(27, 50, 96, .14);
  --elev-3: 0 18px 40px -18px rgba(27, 50, 96, .26);

  /* Semantic status tokens (functional colour, not brand accent) */
  --danger: #dc3545;
  --danger-bg: #fdecee;
  --success: #1580c9;
  --success-bg: #e7f6f1;
  --warning: #f4a21f;
  --warning-bg: #fdf1dc;
  --info: #2563eb;
  --info-bg: #e8f0fe;

  /* Interaction */
  --ring: 0 0 0 3px rgba(21, 128, 201, .35);
  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur: 160ms;
}

/* Crisper text rendering + comfortable default measure. */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}

::selection {
  background: rgba(21, 128, 201, .22);
}

/* Button interaction states (base .btn already sets shape/size above). */
.btn {
  transition: background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[disabled],
.btn.disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:hover,
.btn-gold:hover,
.btn-deep:hover {
  box-shadow: var(--elev-2);
}

/* Accessible, consistent keyboard focus ring across interactive elements.
   Low-ish specificity + focus-visible only, so it never shows on mouse clicks
   and never fights a component's own styling on the mouse path. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.gc-tab:focus-visible,
.gc-icon-btn:focus-visible,
.gc-icon-btn-large:focus-visible,
.gc-rs-control:focus-visible,
.gc-ms-control:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Snappier, on-brand form-field focus glow. Border colour is left alone so a
   red invalid border (.gc-field-invalid / .gc-field-error) stays visible. */
.form-control:focus,
.form-select:focus {
  box-shadow: var(--ring);
}

.gc-field-invalid:focus,
.gc-field-error :focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .30);
}

/* Clickables feel clickable; respect reduced-motion. */
.gc-icon-btn,
.gc-icon-btn-large,
.pill,
.gc-tab,
.gc-repeat-add,
.gc-group-add {
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — Phase 2 (adaptive gutters, table scroll, stacking)
   ══════════════════════════════════════════════════════════════════ */

/* Allow grid/flex children to shrink so wide content scrolls inside its own
   container instead of stretching (and horizontally scrolling) the whole page. */
.main,
.gc-split-main,
#app-view {
  min-width: 0;
}

/* Topbar: prevent overflow on small screens */
.topbar {
  min-width: 0;
  max-width: 100%;
}
.topbar .gc-search {
  min-width: 0;
}
.topbar .actions {
  flex-shrink: 0;
}

/* Data tables inside SPA cards get a horizontal scroll region on narrow screens
   (master tables already scroll via .gc-table-wrap). */
.card-body.p-0 {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tablet / small laptop */
@media (max-width: 992px) {
  .content {
    padding: 14px 16px 32px;
  }

  /* Panel narrows on tablet; actions wrap. */
  .gc-split.has-panel .gc-split-side {
    flex: 0 0 38%;
    max-width: 38%;
  }

  .gc-panel-header-actions {
    flex-wrap: wrap;
  }
}

/* Phone */
@media (max-width: 640px) {
  .topbar {
    padding: 8px 12px;
    gap: 8px;
  }

  .content {
    padding: 12px 12px 28px;
  }

  /* Detail side-panel becomes a full-width overlay. */
  .gc-split.has-panel .gc-split-side {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
  }

  /* Toolbars: search full width, filters wrap. */
  .gc-table-toolbar {
    align-items: stretch;
  }

  .gc-search-wrap {
    max-width: none;
    flex: 1 1 100%;
  }

  .gc-toolbar-filters {
    flex-wrap: wrap;
    width: 100%;
  }

  .gc-toolbar-filters>* {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Page headers stack; actions go full width. */
  .gc-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .gc-page-header .gc-header-actions {
    width: 100%;
  }

  .page-head {
    align-items: flex-start;
  }

  /* Pagination wraps cleanly. */
  .gc-pagination {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Side panel: full-screen overlay on phone. */
  .gc-split.has-panel .gc-split-side {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 900;
    border-radius: 0;
    margin-left: 0;
    padding: 0;
  }

  .gc-panel-header {
    padding: 12px 14px 10px;
  }

  .gc-panel-header-actions {
    gap: 3px;
  }

  .gc-panel-action-btn span {
    display: none;
  }

  .gc-panel-tabs {
    padding: 0 12px;
    overflow-x: auto;
  }

  .gc-panel-tabs .gc-tab {
    padding: 9px 10px;
    font-size: .72rem;
  }
}

/* ══════════════════════════════════════════════════════════════════
   MODERN SCROLLBARS — slim, subtle, on-brand (global default)
   Component-specific scrollbars (sidebar-nav, panel-body) keep their own
   styling via higher specificity.
   ══════════════════════════════════════════════════════════════════ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 50, 96, .22) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(27, 50, 96, .20);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(27, 50, 96, .34);
  background-clip: padding-box;
}

/* ══════════════════════════════════════════════════════════════════
   HOSPITAL full-page tab form — full-width surface, rhythm, wizard nav
   (scoped to .gc-form-page-wide; the drawer-derived markup had no surface)
   ══════════════════════════════════════════════════════════════════ */

/* Tab strip sits on its own row above the content card. */
.gc-form-page-wide .gc-tabs {
  margin-bottom: 18px;
  gap: 4px;
}

.gc-form-page-wide .gc-tab {
  padding: 11px 20px;
  font-size: .82rem;
  border-radius: 8px 8px 0 0;
}

/* The active tab pane becomes a real content card instead of floating on the page. */
.gc-form-page-wide .gc-tab-content.active {
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--elev-1);
}

/* ── Grouped sections: logical field segregation with a header + divider ── */
.gc-form-page-wide .gc-fs {
  margin-bottom: 28px;
}

.gc-form-page-wide .gc-fs:last-child {
  margin-bottom: 0;
}

.gc-form-page-wide .gc-fs-head {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #e9edf2);
}

.gc-form-page-wide .gc-fs-title {
  margin: 0;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink, #123f74);
}

.gc-form-page-wide .gc-fs-sub {
  margin: 3px 0 0;
  font-size: .74rem;
  color: var(--muted);
}

/* ── Balanced three-column field grid ──────────────────────────────
   Equal minmax(0,1fr) tracks keep every column the same width and the
   labels/controls aligned; grid — not per-field flex — owns the layout. */
.gc-form-page-wide .gc-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 22px;
  align-items: start;
}

.gc-form-page-wide .gc-form-grid-3>* {
  min-width: 0;
  margin-bottom: 0;
}

/* Full-width members of a section (multi-select, checkbox chips). */
.gc-form-page-wide .gc-fs-full {
  margin-top: 18px;
}

.gc-form-page-wide .gc-fs-full:first-child {
  margin-top: 0;
}

/* Clearer field-label hierarchy: weight + tracking, sits close to its control. */
.gc-form-page-wide .gc-tab-content.active .form-label {
  font-size: .8rem !important;
  font-weight: 600 !important;
  letter-spacing: .01em;
  margin-bottom: 6px !important;
}

/* Comfortable, uniform control height + full column fill so the three
   columns stay balanced and every control edge aligns. */
.gc-form-page-wide .gc-tab-content.active .form-control,
.gc-form-page-wide .gc-tab-content.active .form-select,
.gc-form-page-wide .gc-tab-content.active .gc-rs-control,
.gc-form-page-wide .gc-tab-content.active .gc-ms-control {
  min-height: 42px;
  width: 100%;
  box-sizing: border-box;
}

/* Field cell owns the full column; label + control stack and fill it. */
.gc-form-page-wide .gc-form-grid-3>*>.form-label {
  display: block;
}

/* Wizard nav: Previous · step · Next — a solid floating action bar that
   sticks just above the viewport bottom while the tab scrolls. */
.gc-form-page-wide .gc-tab-nav {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--elev-2);
}

.gc-form-page-wide .gc-tab-step {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--muted);
}

.gc-form-page-wide #gc-hospital-validation-banner:not(:empty) {
  margin-bottom: 12px;
}

/* Three columns → two on tablets, one on phones. */
@media (max-width: 1024px) {
  .gc-form-page-wide .gc-form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gc-form-page-wide .gc-tab-content.active {
    padding: 18px 16px;
  }

  .gc-form-page-wide .gc-form-grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gc-form-page-wide .gc-tab-nav {
    flex-wrap: wrap;
  }

  .gc-form-page-wide .gc-tab-nav .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .gc-form-page-wide .gc-tab-nav-info {
    order: -1;
    flex: 1 1 100%;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PARTNER master — full-width three-column Add / Edit form
   (Col 1 Partner Details · Col 2 Location & Financials · Col 3 Terms,
    then a full-width Additional Details section below.)
   ══════════════════════════════════════════════════════════════════ */

/* Controls fill their column; uniform, comfortable height. */
.gc-form-page-wide .gc-col-form .form-control,
.gc-form-page-wide .gc-col-form .form-select {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
}

.gc-form-page-wide .gc-col-form textarea.form-control {
  min-height: 84px;
}

/* Three balanced columns; each is a logical group card. */
.gc-form-page-wide .gc-col3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* Group cards (the three columns + the full-width extras section). */
.gc-form-page-wide .gc-col-form .gc-fs {
  margin-bottom: 0;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--elev-1);
}

.gc-form-page-wide .gc-col-form .gc-fs-wide {
  margin-top: 20px;
}

/* Consistent vertical rhythm between stacked fields within a column. */
.gc-form-page-wide .gc-fs-body>* {
  margin-bottom: 14px;
}

.gc-form-page-wide .gc-fs-body>*:last-child {
  margin-bottom: 0;
}

.gc-form-page-wide #gc-partner-validation-banner:not(:empty) {
  margin-bottom: 16px;
}

/* Full-width action bar (override the centered 960px default). */
.gc-form-page-wide .gc-form-actions {
  max-width: none;
}

/* Responsive: three columns → two on tablets → one on phones. */
@media (max-width: 1024px) {
  .gc-form-page-wide .gc-col3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gc-form-page-wide .gc-col3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gc-form-page-wide .gc-col-form .gc-fs {
    padding: 16px;
  }
}

.gc-doc-card:hover .gc-doc-del {
  opacity: 1;
}

.gc-doc-del:hover {
  background: #b0431d;
}

/* ── Case inbox: breached-TAT emphasis (A-2.2) ────────────────────── */
tr.case-breached {
  animation: gc-breach-pulse 2.4s ease-in-out infinite;
}

tr.case-breached td:first-child {
  box-shadow: inset 3px 0 0 #dc3545;
}

@keyframes gc-breach-pulse {

  0%,
  100% {
    background: transparent;
  }

  50% {
    background: rgba(220, 53, 69, .06);
  }
}

.tat-overdue-txt {
  color: #dc3545;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  tr.case-breached {
    animation: none;
    background: rgba(220, 53, 69, .05);
  }
}

/* ── Multi-partner clash banner (CA-4.0) ── */
.gc-clash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 16px;
  background: #fff1ef;
  border: 1px solid #f0b8ab;
  border-left: 4px solid #dc3545;
  border-radius: 8px;
}

.gc-clash-banner .gc-clash-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-clash-banner .gc-clash-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.gc-clash-banner strong {
  color: #b02a1a;
  font-size: .88rem;
}

.gc-clash-banner .tiny {
  color: #7a4033;
  font-size: .74rem;
  margin-top: 2px;
}

/* ── Attachment quality: non-blurable "must re-share" banner (CA-3.0) ── */
.aq-quality-msg {
  background: #fff1ef;
  border: 1px solid #f0b8ab;
  border-left: 4px solid #dc3545;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: #8a2a1a;
  font-size: .82rem;
}

.aq-quality-msg strong {
  display: block;
  margin-bottom: 2px;
}

/* ── Attachment quality: full-resolution preview + no-blur note (CA-3.0 / G-6) ── */
.aq-preview {
  margin-bottom: 1rem;
}

.aq-preview-stage {
  background: #0f1020;
  border-radius: 8px;
  min-height: 200px;
  max-height: 460px;
  overflow: auto;
  /* scroll/zoom the full-res document, never downscale-blur it */
  display: flex;
  align-items: center;
  justify-content: center;
}

.aq-preview-img {
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  /* keep the clinical text crisp */
  image-rendering: crisp-edges;
}

.aq-preview-frame {
  width: 100%;
  height: 440px;
  border: 0;
  background: #fff;
}

.aq-noblur-note {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--mist, #eef2f7);
  border-radius: 6px;
  color: var(--muted, #667);
}

/* ── Clash banner: sibling-case list (CA-4.0 / G-5.3) ── */
.gc-clash-banner .gc-clash-siblings {
  margin-top: 6px;
}

.gc-clash-banner .gc-clash-siblings .gc-table {
  background: #fff;
  border-radius: 6px;
}

.gc-table--compact th,
.gc-table--compact td {
  padding: 4px 8px;
  font-size: .74rem;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD REDESIGN — Phase 1
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page layout ──────────────────────────────────────────────── */
.ds-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Hero / greeting ──────────────────────────────────────────── */
.ds-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--deep) 0%, var(--jade) 100%);
  border-radius: var(--radius);
  color: #fff;
}

.ds-hero-greeting {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
}

.ds-hero-summary {
  margin: 4px 0 0;
  font-size: .88rem;
  color: rgba(255, 255, 255, .85);
}

.ds-hero-summary b {
  color: #fff;
}

.ds-hero-alert {
  color: #ffd2c4;
}

.ds-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ── Stats grid (4 cards) ─────────────────────────────────────── */
.ds-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.ds-stat-card {
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.ds-stat-card--clickable {
  cursor: pointer;
}

.ds-stat-card--clickable:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  border-color: var(--jade);
}

.ds-stat-card--clickable:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}

.ds-stat-card--alert {
  border-left: 3px solid var(--marigold);
}

.ds-stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.ds-stat-value {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--deep);
  line-height: 1.1;
}

.ds-stat-delta {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 3px;
}

.ds-stat-delta--up {
  color: var(--leaf);
}

.ds-stat-delta--down {
  color: #dc3545;
}

/* SLA summary in stat card */
.ds-sla-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}

.ds-sla-num {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}

.ds-sla-num--danger {
  color: #dc3545;
}

.ds-sla-num--warning {
  color: #e65100;
}

.ds-sla-num--success {
  color: var(--leaf);
}

/* ── Main 2-column grid ───────────────────────────────────────── */
.ds-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

.ds-main-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ds-main-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Table ─────────────────────────────────────────────────────── */
.ds-table-wrap {
  overflow-x: auto;
}

.ds-case-row {
  cursor: pointer;
  transition: background .12s ease;
}

.ds-case-row:hover {
  background: rgba(21, 128, 201, .03);
}

.ds-cell-time {
  font-family: "IBM Plex Mono", monospace;
  font-size: .74rem;
  color: var(--muted);
  white-space: nowrap;
}

.ds-patient-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-avatar-sm {
  width: 22px;
  height: 22px;
  font-size: .5rem;
  flex-shrink: 0;
}

.ds-patient-name {
  font-weight: 500;
  font-size: .82rem;
}

.ds-patient-country {
  font-size: .72rem;
  color: var(--muted);
  margin-left: 2px;
}

.ds-stage-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-stage-dots {
  display: flex;
  gap: 3px;
}

.ds-stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mist);
  transition: background .2s ease;
}

.ds-stage-dot--active {
  background: var(--jade);
}

.ds-stage-label {
  font-size: .74rem;
  color: var(--text);
}

/* ── SLA at risk ──────────────────────────────────────────────── */
.ds-sla-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

.ds-sla-item:last-child {
  border-bottom: none;
}

.ds-sla-ring {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(var(--jade) var(--p), var(--mist) var(--p));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ds-sla-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.ds-sla-ring span {
  position: relative;
  font-size: .52rem;
  font-weight: 600;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.ds-sla-ring--danger {
  background: conic-gradient(#dc3545 var(--p), var(--mist) var(--p));
}

.ds-sla-ring--danger span {
  color: #dc3545;
}

.ds-sla-info {
  flex: 1;
  min-width: 0;
}

.ds-sla-case {
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  color: var(--deep);
}

.ds-sla-case:hover {
  text-decoration: underline;
}

.ds-sla-meta {
  font-size: .72rem;
  color: var(--muted);
}

/* Case links are real <button>s so the navigation is keyboard-reachable without
   putting role="button" on a <tr> (which would strip its table semantics).
   These rules strip the UA button chrome and restore the link-like type. */
button.gc-company-link {
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  font-weight: 500;
  color: var(--deep);
}

button.ds-sla-case {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--deep);
}

/* ── Bucket distribution ──────────────────────────────────────── */
.ds-bucket-row {
  margin-bottom: 8px;
}

.ds-bucket-header {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.ds-bucket-count {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  color: var(--ink);
}

.ds-bucket-bar {
  height: 6px;
  background: var(--mist);
  border-radius: 3px;
  overflow: hidden;
}

.ds-bucket-fill {
  height: 100%;
  background: var(--jade);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ── Stage chart ──────────────────────────────────────────────── */
.ds-stage-bar {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ds-stage-seg {
  transition: width .4s ease;
}

.ds-stage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ds-stage-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  color: var(--muted);
}

.ds-stage-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Alerts ────────────────────────────────────────────────────── */
.ds-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: .82rem;
  line-height: 1.4;
}

.ds-alert:last-child {
  margin-bottom: 0;
}

.ds-alert-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ds-alert-body {
  flex: 1;
}

.ds-alert--danger {
  background: #fdecee;
  color: #8a2a1a;
  border: 1px solid #f5c6cb;
}

.ds-alert--warning {
  background: #fff8e6;
  color: #7a5a00;
  border: 1px solid #f0d9a8;
}

.ds-alert--info {
  background: var(--mist-2);
  color: var(--deep);
  border: 1px solid var(--mist);
}

.ds-alert--success {
  background: #e7f6f1;
  color: #0b6643;
  border: 1px solid #b9e6c4;
}

.ds-alert-link {
  display: inline-block;
  margin-left: 6px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.ds-alert-link:hover {
  text-decoration: underline;
}

.ds-alert-link--danger {
  color: #a3331a;
}

.ds-alert-link--warning {
  color: #7a5a00;
}

.ds-alert-link--info {
  color: var(--deep);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ds-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ds-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ds-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .ds-stats-grid {
    grid-template-columns: 1fr;
  }

  .ds-hero {
    padding: 16px;
  }

  .ds-hero-greeting {
    font-size: 1.1rem;
  }

  .ds-sla-summary {
    gap: 6px;
  }

  .ds-sla-num {
    font-size: 1.1rem;
  }
}

/* Dashboard table horizontal scroll on small screens */
@media (max-width: 768px) {
  .ds-table-wrap {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .ds-case-row td {
    padding: 6px 8px;
  }

  .ds-patient-country {
    display: none;
  }

  .ds-stage-label {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   GLOBAL SEARCH — Topbar search bar with keyboard shortcut
   ═══════════════════════════════════════════════════════════════════ */
.gc-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}

.gc-search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.gc-search-input {
  width: 100%;
  border: 1px solid var(--mist);
  border-radius: 8px;
  padding: 7px 36px 7px 32px;
  background: var(--porcelain);
  font-size: .82rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.gc-search-input::placeholder {
  color: var(--muted);
}

.gc-search-input:focus {
  background: #fff;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(21, 128, 201, .12);
  outline: none;
}

.gc-search-kbd {
  position: absolute;
  right: 8px;
  padding: 2px 6px;
  font-size: .68rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: 4px;
  pointer-events: none;
  line-height: 1.2;
}

/* ── Global Search Dropdown ──────────────────────────────────── */
.gc-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
}

.gc-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid var(--mist);
}

.gc-search-item:last-child {
  border-bottom: none;
}

.gc-search-item:hover,
.gc-search-item.active {
  background: #f0faf7;
}

.gc-search-item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--porcelain);
  color: var(--jade);
}

.gc-search-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gc-search-item-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-search-item-sub {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-search-item-badge {
  flex-shrink: 0;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--jade);
  background: rgba(21, 128, 201, .08);
  padding: 2px 8px;
  border-radius: 6px;
}

.gc-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
}

/* ── Keyboard hints (table toolbars) ───────────────────────────── */
.gc-keyboard-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .gc-keyboard-hint {
    display: none;
  }
}

/* ── Record count badge ────────────────────────────────────────── */
.gc-record-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--jade);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  margin-right: 4px;
}

@media (max-width: 768px) {
  .gc-search {
    display: none;
  }
}

/* Mobile search overlay (triggered by .gc-mobile-search-btn) */
.gc-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .5);
  padding: 16px;
  align-items: flex-start;
}
.gc-search-overlay.active {
  display: flex;
}
.gc-search-overlay .gc-search {
  display: flex;
  max-width: 100%;
  width: 100%;
  position: relative;
}
@media (max-width: 768px) {
  .gc-search-overlay .gc-search {
    display: flex;
  }
}


/* ── Notifications list ─────────────────────────────────────────── */
.notif-item {
  transition: background .15s;
}

.notif-item:hover {
  background: var(--porcelain);
}

/* ── Reports custom grid override ──────────────────────────────── */
@media (max-width: 900px) {
  .reports-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .gcx-grid--auto {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── Global Responsive Overrides ───────────────────────────────── */
@media (max-width: 768px) {
  .gc-table {
    font-size: .78rem;
  }

  .gc-table th,
  .gc-table td {
    padding: 8px 10px;
  }

  .gc-page-header {
    flex-direction: column;
    gap: 12px;
  }

  .gc-header-actions {
    width: 100%;
  }

  .gc-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gc-table-toolbar {
    flex-direction: column;
    gap: 8px;
  }

  .gc-search-wrap {
    width: 100%;
  }

  .gc-drawer-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 900px) {
  .gcx-grid--halves {
    grid-template-columns: 1fr !important;
  }
}

/* ── Toast Container ───────────────────────────────────────────── */
#gc-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10900;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ── Form Section Labels ───────────────────────────────────────── */
.gc-form-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ── Button Loading State ──────────────────────────────────────── */
.btn.is-loading {
  pointer-events: none;
  opacity: .7;
  position: relative;
}

.btn.is-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: gc-spin .6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

@keyframes gc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Focus Ring ────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}

.gc-tab:focus-visible,
.gc-page-btn:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}

/* ── Screen transition ─────────────────────────────────────────── */
#screen {
  animation: gc-fade-in .2s ease;
}

@keyframes gc-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}