/* FES WorkHub — dependency-free design system */
:root {
  color-scheme: light;
  --red-950: #480713;
  --red-900: #68101f;
  --red-800: #7d1022;
  --red-700: #98162b;
  --red-600: #b4233a;
  --red-500: #d64550;
  --coral-500: #f0645b;
  --coral-300: #ff9e96;
  --coral-100: #ffe5e2;
  --coral-50: #fff3f1;
  --ink-950: #17181c;
  --ink-900: #24262b;
  --ink-800: #34373e;
  --ink-700: #4a4e57;
  --ink-600: #626772;
  --ink-500: #6b707a;
  --ink-400: #707680;
  --ink-300: #b8bdc6;
  --ink-200: #d9dce2;
  --ink-150: #e6e8ec;
  --ink-100: #eff0f3;
  --ink-50: #f7f7f9;
  --white: #fff;
  --success-700: #176b48;
  --success-100: #dff5ea;
  --warning-800: #8a4c06;
  --warning-100: #fff0cf;
  --info-700: #275c9d;
  --info-100: #e1edff;
  --danger-100: #ffe4e6;
  --sidebar-width: 272px;
  --sidebar-compact-width: 96px;
  --topbar-height: 76px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgb(25 17 19 / 5%);
  --shadow-sm: 0 6px 18px rgb(55 22 28 / 8%);
  --shadow-md: 0 18px 48px rgb(54 16 23 / 14%);
  --shadow-lg: 0 30px 70px rgb(43 7 15 / 22%);
  --focus-ring: 0 0 0 3px rgb(214 69 80 / 24%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--ink-50);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
svg:not(.svg-sprite) { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
input::placeholder, textarea::placeholder { color: var(--ink-400); opacity: 1; }
[hidden] { display: none !important; }

:focus-visible {
  border-radius: var(--radius-xs);
  outline: 2px solid var(--red-600);
  outline-offset: 3px;
}

::selection { background: var(--coral-100); color: var(--red-950); }

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 12px;
  padding: 10px 16px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--ink-950);
  color: var(--white);
  font-weight: 750;
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }
.svg-sprite { position: fixed; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.app-root { min-height: 100vh; min-height: 100dvh; }

/* Authentication */
.auth-view {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(420px, 1.05fr) minmax(500px, .95fr);
  background: var(--white);
}

.auth-brand-panel {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow: hidden;
  padding: clamp(48px, 7vw, 104px);
  background:
    radial-gradient(circle at 15% 12%, rgb(255 158 150 / 20%), transparent 32%),
    radial-gradient(circle at 90% 86%, rgb(255 229 226 / 13%), transparent 28%),
    linear-gradient(145deg, var(--red-950), var(--red-800) 55%, #9e1a30);
  color: var(--white);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 50%;
  content: "";
}

.auth-brand-panel::before { width: 440px; height: 440px; top: -230px; right: -140px; }
.auth-brand-panel::after { width: 540px; height: 540px; bottom: -350px; left: -240px; }

.auth-pattern {
  position: absolute;
  right: -42px;
  bottom: -48px;
  width: 320px;
  height: 320px;
  opacity: .18;
  background-image: radial-gradient(rgb(255 255 255 / 70%) 1.3px, transparent 1.3px);
  background-size: 18px 18px;
  transform: rotate(-9deg);
  mask-image: linear-gradient(to bottom right, transparent, #000);
}

.auth-brand-content { position: relative; z-index: 1; width: min(580px, 100%); }
.brand-mark--hero { width: 68px !important; height: 68px !important; margin-bottom: 38px; color: var(--coral-500) !important; box-shadow: 0 18px 38px rgb(0 0 0 / 22%); }
.brand-mark--hero svg { width: 68px !important; height: 68px !important; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--red-600);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--light { color: var(--coral-300); }

.auth-brand-content h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(38px, 4.4vw, 66px);
  font-weight: 820;
  letter-spacing: -.045em;
  line-height: 1.04;
}

.auth-lead {
  max-width: 560px;
  margin: 26px 0 34px;
  color: rgb(255 255 255 / 75%);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.7;
}

.auth-benefits { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; color: rgb(255 255 255 / 88%); }
.auth-benefits li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-check { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border: 1px solid rgb(255 255 255 / 16%); border-radius: 50%; background: rgb(255 255 255 / 10%); color: var(--coral-300); }
.auth-check svg { width: 15px; height: 15px; stroke-width: 2.5; }

.auth-form-panel {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: clamp(32px, 6vw, 90px);
  background:
    linear-gradient(rgb(255 255 255 / 92%), rgb(255 255 255 / 98%)),
    radial-gradient(circle at 70% 10%, var(--coral-100), transparent 35%);
}

.auth-card { width: min(430px, 100%); }
.auth-heading { margin-bottom: 30px; }
.auth-heading h2 { margin: 0 0 9px; color: var(--ink-950); font-size: clamp(27px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.18; }
.auth-heading > p:last-child { margin: 0; color: var(--ink-600); }
.auth-mobile-brand { display: none; }
.login-form { display: grid; gap: 20px; }
.form-field { display: grid; gap: 8px; }
.form-field > label, .label-row label { color: var(--ink-800); font-size: 13px; font-weight: 750; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.input-shell {
  position: relative;
  display: flex;
  min-height: 50px;
  align-items: center;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input-shell:focus-within { border-color: var(--red-500); box-shadow: var(--focus-ring); }
.input-shell > svg { width: 19px; height: 19px; margin-left: 15px; color: var(--ink-500); }
.input-shell input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; padding: 0 15px 0 11px; background: transparent; }
.input-shell:has(.icon-button--inside) input { padding-right: 48px; }
.icon-button--inside { position: absolute; right: 4px; width: 42px !important; min-width: 42px !important; height: 42px !important; color: var(--ink-500); }
.icon-eye { width: 20px; height: 20px; }
.field-error { min-height: 0; color: var(--red-700); font-size: 12px; font-weight: 650; }
.field-error:empty { display: none; }
.form-field.has-error .input-shell { border-color: var(--red-600); background: #fffbfb; }

.check-control { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; color: var(--ink-700); font-size: 13px; cursor: pointer; user-select: none; }
.check-control input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.check-control > span { display: grid; width: 20px; height: 20px; place-items: center; border: 1.5px solid var(--ink-300); border-radius: 6px; background: var(--white); color: transparent; transition: .18s ease; }
.check-control > span svg { width: 14px; height: 14px; stroke-width: 2.8; }
.check-control input:checked + span { border-color: var(--red-700); background: var(--red-700); color: var(--white); }
.check-control input:focus-visible + span { box-shadow: var(--focus-ring); }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 17px;
  font-size: 14px;
  font-weight: 770;
  line-height: 1;
  transition: transform .16s var(--ease), box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.button svg { width: 18px; height: 18px; stroke-width: 2.2; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.button--primary { border-color: var(--red-700); background: linear-gradient(145deg, var(--red-700), var(--red-800)); color: var(--white); box-shadow: 0 7px 16px rgb(152 22 43 / 21%); }
.button--primary:hover { background: linear-gradient(145deg, var(--red-600), var(--red-700)); box-shadow: 0 9px 22px rgb(152 22 43 / 28%); }
.button--secondary { border-color: var(--ink-200); background: var(--white); color: var(--ink-800); box-shadow: var(--shadow-xs); }
.button--secondary:hover { border-color: var(--red-300, #e7a5ae); background: var(--coral-50); color: var(--red-800); }
.button--ghost { border-color: transparent; background: transparent; color: var(--ink-700); }
.button--danger { background: var(--red-700); color: var(--white); }
.button--full { width: 100%; }
.button--compact { min-height: 42px; padding: 8px 14px; white-space: nowrap; }
.button-link { min-height: 32px; border: 0; padding: 3px; background: transparent; color: var(--red-700); font-size: 12px; font-weight: 760; }
.button-link:hover { color: var(--red-500); text-decoration: underline; text-underline-offset: 3px; }
.button-link--light { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 23px 0; color: var(--ink-500); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--ink-150); content: ""; }
.auth-footnote { margin: 22px 20px 0; color: var(--ink-500); font-size: 11px; line-height: 1.6; text-align: center; }
.alert { margin-bottom: 20px; border: 1px solid; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; }
.alert--error { border-color: #fac3ca; background: var(--danger-100); color: var(--red-900); }

/* App shell */
.app-shell { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid rgb(255 255 255 / 7%);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 5% 2%, rgb(240 100 91 / 20%), transparent 23%),
    linear-gradient(180deg, var(--red-950), #560b19 72%, #400710);
  color: rgb(255 255 255 / 78%);
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 15%) transparent;
  transition: width .25s var(--ease), transform .25s var(--ease);
}

.sidebar-brand { display: flex; min-height: var(--topbar-height); align-items: center; justify-content: space-between; border-bottom: 1px solid rgb(255 255 255 / 7%); padding: 0 17px 0 22px; }
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 11px; }
.brand-mark { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; overflow: hidden; border-radius: 12px; color: var(--coral-500); }
.brand-mark svg { width: 40px; height: 40px; stroke: none; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.03; }
.brand-copy strong { color: var(--white); font-size: 21px; font-weight: 850; letter-spacing: .01em; }
.brand-copy small { margin-top: 4px; color: rgb(255 255 255 / 52%); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }

.icon-button {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0;
  background: transparent;
  color: var(--ink-600);
  transition: background .18s ease, color .18s ease, transform .16s var(--ease);
}

.icon-button:hover { background: var(--ink-100); color: var(--red-700); }
.icon-button:active { transform: scale(.96); }
.icon-button svg { width: 20px; height: 20px; }
.icon-button--light { color: var(--white); }
.icon-button--light:hover { background: rgb(255 255 255 / 13%); color: var(--white); }
.sidebar-collapse { color: rgb(255 255 255 / 50%); }
.sidebar-collapse:hover { background: rgb(255 255 255 / 9%); color: var(--white); }

.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 3px; padding: 17px 13px; }
.nav-section-label { margin: 16px 11px 7px; color: rgb(255 255 255 / 66%); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.nav-section-label:first-child { margin-top: 0; }
.nav-admin-section { transition: opacity .18s ease, background .18s ease, color .18s ease; }
.nav-item { position: relative; display: flex; min-height: 44px; align-items: center; gap: 12px; border: 0; border-radius: var(--radius-sm); padding: 9px 12px; background: transparent; color: rgb(255 255 255 / 66%); font-size: 13px; font-weight: 650; text-align: left; white-space: nowrap; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item > svg { width: 19px; height: 19px; flex: 0 0 19px; stroke-width: 1.9; }
.nav-item:hover { background: rgb(255 255 255 / 7%); color: var(--white); transform: translateX(2px); }
.nav-item.is-active, .nav-item[aria-current="page"] { background: linear-gradient(100deg, rgb(240 100 91 / 23%), rgb(255 255 255 / 8%)); color: var(--white); }
.nav-item.is-active::before, .nav-item[aria-current="page"]::before { position: absolute; width: 3px; height: 22px; left: 0; border-radius: 0 4px 4px 0; background: var(--coral-500); content: ""; }
.nav-badge { min-width: 21px; height: 20px; margin-left: auto; border-radius: 999px; padding: 2px 6px; background: var(--coral-500); color: var(--white); font-size: 10px; font-weight: 850; line-height: 16px; text-align: center; }
.nav-badge--warning { background: #f7ad38; color: var(--ink-950); }
.sidebar-footer { display: grid; gap: 7px; border-top: 1px solid rgb(255 255 255 / 7%); padding: 14px 13px 18px; }
.sidebar-help { display: flex; min-height: 58px; align-items: center; gap: 11px; border: 1px solid rgb(255 255 255 / 7%); border-radius: var(--radius-sm); padding: 9px; background: rgb(255 255 255 / 4%); white-space: nowrap; }
.sidebar-help-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; background: rgb(240 100 91 / 15%); color: var(--coral-300); }
.sidebar-help-icon svg { width: 18px; height: 18px; }
.sidebar-help > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.sidebar-help strong { color: rgb(255 255 255 / 75%); font-size: 11px; }
.sidebar-help small { color: rgb(255 255 255 / 66%); font-size: 10px; }
.nav-item--button { width: 100%; }

.workspace { grid-column: 2; min-width: 0; min-height: 100vh; min-height: 100dvh; }
.demo-banner { position: relative; z-index: 25; display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 24px; padding: 6px 22px; background: linear-gradient(90deg, var(--red-800), var(--red-600)); color: var(--white); font-size: 12px; }
.demo-banner > span { display: flex; align-items: center; gap: 6px; }
.demo-banner > span svg { width: 16px; height: 16px; color: var(--coral-300); }
.demo-banner-actions { display: flex; align-items: center; gap: 5px; }
.demo-banner .icon-button { width: 30px; min-width: 30px; height: 30px; }

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--ink-150);
  padding: 0 clamp(20px, 3vw, 40px);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 70%);
  backdrop-filter: blur(18px);
}

.topbar-leading { display: flex; min-width: 0; align-items: center; gap: 12px; }
.mobile-menu-button { display: none; }
.page-identity { min-width: 0; }
.page-identity h1 { margin: 1px 0 0; overflow: hidden; color: var(--ink-950); font-size: 21px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--ink-500); font-size: 10px; font-weight: 650; white-space: nowrap; }
.breadcrumb a:hover { color: var(--red-700); }
.topbar-actions { display: flex; min-width: 0; align-items: center; gap: 9px; }

.business-unit-filter { display: flex; height: 42px; max-width: 160px; align-items: center; gap: 7px; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 0 9px; background: var(--ink-50); color: var(--ink-500); }
.business-unit-filter svg { width: 16px; height: 16px; flex: 0 0 16px; }
.business-unit-filter select { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink-700); font-size: 12px; font-weight: 650; }

.global-search { position: relative; display: flex; width: min(26vw, 310px); height: 42px; align-items: center; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); background: var(--ink-50); transition: border-color .18s ease, box-shadow .18s ease, width .2s var(--ease); }
.global-search:focus-within { width: min(30vw, 360px); border-color: var(--red-400, #d66e7b); background: var(--white); box-shadow: var(--focus-ring); }
.global-search > svg { width: 17px; height: 17px; margin-left: 12px; color: var(--ink-500); }
.global-search input { width: 100%; min-width: 0; height: 40px; border: 0; outline: 0; padding: 0 8px; background: transparent; font-size: 12px; }
.global-search kbd { margin-right: 8px; border: 1px solid var(--ink-200); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: var(--white); color: var(--ink-500); font-family: inherit; font-size: 9px; white-space: nowrap; }
.search-results { position: absolute; z-index: 55; top: calc(100% + 9px); right: 0; left: 0; max-height: min(460px, 65vh); overflow: auto; border: 1px solid var(--ink-150); border-radius: var(--radius-md); padding: 7px; background: var(--white); box-shadow: var(--shadow-md); }
.quick-add-capa { border: 1px solid var(--ink-150); background: var(--white); color: var(--red-700); }
.notification-button { position: relative; border: 1px solid var(--ink-150); background: var(--white); }
.notification-dot { position: absolute; top: 6px; right: 6px; min-width: 9px; height: 9px; border: 2px solid var(--white); border-radius: 999px; background: var(--coral-500); }
.profile-menu { position: relative; }
.profile-trigger { display: flex; min-height: 48px; align-items: center; gap: 9px; border: 0; border-radius: var(--radius-sm); padding: 4px 7px; background: transparent; text-align: left; transition: background .18s ease; }
.profile-trigger:hover, .profile-trigger[aria-expanded="true"] { background: var(--ink-50); }
.avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 12px; font-size: 11px; font-weight: 850; letter-spacing: .02em; }
.avatar--red { background: linear-gradient(145deg, var(--red-600), var(--red-900)); color: var(--white); box-shadow: 0 5px 12px rgb(152 22 43 / 20%); }
.profile-copy { display: flex; min-width: 0; max-width: 128px; flex-direction: column; }
.profile-copy strong { overflow: hidden; color: var(--ink-800); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: var(--ink-500); font-size: 10px; }
.profile-chevron { width: 14px; height: 14px; color: var(--ink-400); }
.dropdown-menu { position: absolute; z-index: 70; top: calc(100% + 8px); right: 0; width: 210px; border: 1px solid var(--ink-150); border-radius: var(--radius-md); padding: 6px; background: var(--white); box-shadow: var(--shadow-md); transform-origin: top right; animation: menu-in .18s var(--ease); }
.dropdown-menu button { display: flex; width: 100%; min-height: 42px; align-items: center; gap: 10px; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--ink-700); font-size: 12px; font-weight: 650; text-align: left; }
.dropdown-menu button:hover { background: var(--coral-50); color: var(--red-800); }
.dropdown-menu button svg { width: 17px; height: 17px; }
.dropdown-menu hr { height: 1px; border: 0; margin: 5px; background: var(--ink-150); }

.page-content { min-height: calc(100vh - var(--topbar-height)); padding: clamp(20px, 3vw, 38px); }
.route-view { width: min(1560px, 100%); margin: 0 auto; }
.mobile-bottom-nav { display: none; }
.sidebar-scrim { display: none; }

/* Reusable page components rendered by app.js */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header-copy { min-width: 0; }
.page-header h2 { margin: 0; color: var(--ink-950); font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.18; }
.page-header p { max-width: 700px; margin: 6px 0 0; color: var(--ink-600); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }

.metric-grid, .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-md);
  padding: 19px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease);
}
.metric-card:hover, .stat-card:hover { border-color: #e8c5ca; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.metric-card::after, .stat-card::after { position: absolute; width: 90px; height: 90px; top: -50px; right: -45px; border-radius: 50%; background: var(--coral-50); content: ""; }
.metric-card__top, .stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-card__label, .stat-label { color: var(--ink-600); font-size: 12px; font-weight: 700; }
.metric-card__icon, .stat-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--coral-50); color: var(--red-700); }
.metric-card__icon svg, .stat-icon svg { width: 19px; height: 19px; }
.metric-card__value, .stat-value { margin-top: 12px; color: var(--ink-950); font-size: clamp(26px, 2.5vw, 34px); font-weight: 820; letter-spacing: -.04em; line-height: 1; }
.metric-card__meta, .stat-meta { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--ink-500); font-size: 11px; }
.trend-up { color: var(--success-700); font-weight: 750; }
.trend-down { color: var(--red-700); font-weight: 750; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .85fr); gap: 18px; }
.panel, .card { min-width: 0; border: 1px solid var(--ink-150); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-xs); }
.panel-header, .card-header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--ink-100); padding: 13px 18px; }
.panel-header h3, .card-header h3 { margin: 0; color: var(--ink-900); font-size: 15px; letter-spacing: -.012em; }
.panel-header p, .card-header p { margin: 3px 0 0; color: var(--ink-500); font-size: 11px; }
.panel-body, .card-body { padding: 18px; }
.panel--flush .panel-body { padding: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-control, .select-control, .search-control { min-height: 44px; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: 8px 12px; outline: 0; background: var(--white); color: var(--ink-800); font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease; }
.field-control:focus, .select-control:focus, .search-control:focus { border-color: var(--red-500); box-shadow: var(--focus-ring); }
.search-control { min-width: min(300px, 100%); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--ink-150); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-xs); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 12px 15px; background: var(--ink-50); color: var(--ink-600); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { border-top: 1px solid var(--ink-100); padding: 13px 15px; color: var(--ink-700); vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fffbfb; }
.data-table .cell-title { color: var(--ink-900); font-weight: 720; }
.data-table .cell-subtitle { margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.data-table .actions-cell { width: 1%; white-space: nowrap; }

.badge, .status-badge, .priority-badge { display: inline-flex; min-height: 24px; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 780; white-space: nowrap; }
.badge::before, .status-badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; opacity: .75; }
.badge--neutral, .status-draft, .status-belum { background: var(--ink-100); color: var(--ink-700); }
.badge--info, .status-progress, .status-berjalan { background: var(--info-100); color: var(--info-700); }
.badge--success, .status-done, .status-selesai { background: var(--success-100); color: var(--success-700); }
.badge--warning, .status-review, .status-tertunda { background: var(--warning-100); color: var(--warning-800); }
.badge--danger, .status-overdue, .status-terlambat { background: var(--danger-100); color: var(--red-800); }
.priority-low { background: var(--ink-100); color: var(--ink-700); }
.priority-medium { background: var(--info-100); color: var(--info-700); }
.priority-high { background: var(--warning-100); color: var(--warning-800); }
.priority-critical { background: var(--danger-100); color: var(--red-800); }

.progress { width: 100%; height: 7px; overflow: hidden; border-radius: 999px; background: var(--ink-100); }
.progress > span { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red-700), var(--coral-500)); transition: width .4s var(--ease); }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--ink-600); font-size: 10px; font-weight: 650; }

.task-list { display: grid; gap: 10px; }
.task-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 13px 14px; background: var(--white); transition: border-color .18s ease, box-shadow .18s ease; }
.task-card:hover { border-color: #e8c5ca; box-shadow: var(--shadow-sm); }
.task-card__marker { width: 4px; height: 42px; border-radius: 999px; background: var(--red-500); }
.task-card__title { margin: 0; color: var(--ink-900); font-size: 13px; font-weight: 750; }
.task-card__meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 5px; color: var(--ink-500); font-size: 10px; }

.kanban-board { display: grid; grid-auto-columns: minmax(280px, 1fr); grid-auto-flow: column; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.kanban-column { min-width: 280px; border-radius: var(--radius-md); padding: 10px; background: var(--ink-100); scroll-snap-align: start; }
.kanban-column__header { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 11px; color: var(--ink-700); font-size: 12px; font-weight: 780; }
.kanban-items { display: grid; gap: 9px; }
.kanban-card { border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 13px; background: var(--white); box-shadow: var(--shadow-xs); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); min-width: 700px; border-top: 1px solid var(--ink-150); border-left: 1px solid var(--ink-150); }
.calendar-cell { min-height: 112px; border-right: 1px solid var(--ink-150); border-bottom: 1px solid var(--ink-150); padding: 8px; background: var(--white); }
.calendar-cell.is-today { background: var(--coral-50); box-shadow: inset 0 0 0 1px var(--coral-300); }
.calendar-day { color: var(--ink-600); font-size: 11px; font-weight: 750; }
.calendar-event { margin-top: 5px; overflow: hidden; border-left: 3px solid var(--red-600); border-radius: 5px; padding: 4px 6px; background: var(--coral-50); color: var(--red-900); font-size: 9px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }

.activity-list, .timeline { margin: 0; padding: 0; list-style: none; }
.activity-item, .timeline-item { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 11px; padding-bottom: 19px; }
.activity-item:not(:last-child)::before, .timeline-item:not(:last-child)::before { position: absolute; width: 1px; top: 36px; bottom: 0; left: 18px; background: var(--ink-150); content: ""; }
.activity-icon, .timeline-icon { z-index: 1; display: grid; width: 36px; height: 36px; place-items: center; border: 3px solid var(--white); border-radius: 50%; background: var(--coral-100); color: var(--red-700); box-shadow: 0 0 0 1px var(--ink-150); }
.activity-icon svg, .timeline-icon svg { width: 15px; height: 15px; }
.activity-content p, .timeline-content p { margin: 1px 0 4px; color: var(--ink-700); font-size: 12px; }
.activity-content time, .timeline-content time { color: var(--ink-500); font-size: 10px; }

.tabs { display: flex; gap: 3px; overflow-x: auto; border-bottom: 1px solid var(--ink-150); margin-bottom: 20px; }
.tab { position: relative; min-height: 44px; border: 0; padding: 10px 13px; background: transparent; color: var(--ink-600); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tab:hover { color: var(--red-700); }
.tab.is-active, .tab[aria-selected="true"] { color: var(--red-800); }
.tab.is-active::after, .tab[aria-selected="true"]::after { position: absolute; height: 2px; right: 8px; bottom: -1px; left: 8px; border-radius: 2px 2px 0 0; background: var(--red-700); content: ""; }

.empty-state { display: grid; min-height: 300px; place-items: center; padding: 40px 24px; text-align: center; }
.empty-state__icon { display: grid; width: 68px; height: 68px; margin: 0 auto 15px; place-items: center; border-radius: 21px; background: var(--coral-50); color: var(--red-600); transform: rotate(-3deg); }
.empty-state__icon svg { width: 30px; height: 30px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink-900); font-size: 17px; }
.empty-state p { max-width: 430px; margin: 0 auto 17px; color: var(--ink-500); font-size: 12px; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--ink-500); font-size: 11px; }
.pagination-controls { display: flex; gap: 4px; }
.pagination button { display: grid; min-width: 40px; height: 40px; place-items: center; border: 1px solid var(--ink-150); border-radius: 8px; background: var(--white); font-size: 11px; }
.pagination button:hover, .pagination button.is-active { border-color: var(--red-700); background: var(--coral-50); color: var(--red-800); }

/* Dialogs, drawers, toasts and loading */
.modal-root, .drawer-root { position: relative; z-index: 100; }
.modal-backdrop, .drawer-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: rgb(23 24 28 / 64%); backdrop-filter: blur(5px); animation: fade-in .16s ease; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid rgb(255 255 255 / 30%); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-lg); animation: modal-in .24s var(--ease); }
.modal--wide { width: min(920px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ink-100); padding: 20px 22px; }
.modal-header h2 { margin: 0; color: var(--ink-950); font-size: 19px; letter-spacing: -.02em; }
.modal-header p { margin: 4px 0 0; color: var(--ink-500); font-size: 11px; }
.modal-body { padding: 22px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--ink-100); padding: 14px 22px; background: var(--ink-50); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-group { display: grid; gap: 7px; }
.form-group label { color: var(--ink-700); font-size: 11px; font-weight: 750; }
.form-group textarea { min-height: 105px; resize: vertical; }
.form-hint { color: var(--ink-500); font-size: 10px; }

.drawer-backdrop { justify-items: end; padding: 0; }
.drawer { width: min(520px, 100%); min-height: 100%; max-height: 100vh; overflow: auto; background: var(--white); box-shadow: var(--shadow-lg); animation: drawer-in .26s var(--ease); }
.drawer-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--ink-100); padding: 18px 20px; background: rgb(255 255 255 / 94%); backdrop-filter: blur(12px); }
.drawer-body { padding: 20px; }

.toast-container { position: fixed; z-index: 150; right: 20px; bottom: 20px; display: grid; width: min(380px, calc(100vw - 40px)); gap: 9px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; gap: 10px; border: 1px solid var(--ink-150); border-left: 4px solid var(--red-600); border-radius: var(--radius-sm); padding: 12px; background: var(--white); box-shadow: var(--shadow-md); pointer-events: auto; animation: toast-in .3s var(--ease); }
.toast--success { border-left-color: var(--success-700); }
.toast--warning { border-left-color: #c47712; }
.toast__icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--coral-50); color: var(--red-700); }
.toast__content strong { display: block; color: var(--ink-900); font-size: 12px; }
.toast__content p { margin: 2px 0 0; color: var(--ink-600); font-size: 11px; }

.loading-overlay { position: fixed; z-index: 200; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--white); color: var(--ink-700); transition: visibility .25s ease, opacity .25s ease; }
.loading-overlay.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.loading-brand { width: 52px; height: 52px; color: var(--red-700); animation: loading-pulse 1.5s ease-in-out infinite; }
.loading-brand svg { width: 52px; height: 52px; stroke: none; }
.loading-spinner { width: 30px; height: 30px; border: 3px solid var(--coral-100); border-top-color: var(--red-600); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-overlay p { margin: 0; color: var(--ink-500); font-size: 12px; font-weight: 650; }
.loading-bar { position: fixed; z-index: 250; top: 0; right: 0; left: 0; height: 3px; overflow: hidden; background: rgb(214 69 80 / 18%); }
.loading-bar span { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, var(--red-800), var(--coral-500)); box-shadow: 0 0 10px var(--coral-500); animation: loading-bar 1.15s ease-in-out infinite; }

.page-skeleton { display: grid; gap: 18px; }
.skeleton { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--ink-100); }
.skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 70%), transparent); content: ""; transform: translateX(-100%); animation: shimmer 1.45s infinite; }
.skeleton--heading { width: min(340px, 70%); height: 35px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skeleton--card { height: 145px; }
.skeleton--panel { height: 340px; }

.noscript-message { position: fixed; z-index: 9999; inset: 20px; display: grid; place-content: center; border-radius: var(--radius-lg); padding: 30px; background: var(--red-950); color: var(--white); text-align: center; }

/* Collapsed desktop sidebar */
body.sidebar-collapsed .app-shell, .app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-compact-width) minmax(0, 1fr); }
body.sidebar-collapsed .sidebar, .sidebar.is-collapsed { width: var(--sidebar-compact-width); }
body.sidebar-collapsed .sidebar-brand, .sidebar.is-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .nav-section-label, body.sidebar-collapsed .nav-item > span, body.sidebar-collapsed .sidebar-help > span:last-child,
.sidebar.is-collapsed .brand-copy, .sidebar.is-collapsed .nav-section-label, .sidebar.is-collapsed .nav-item > span, .sidebar.is-collapsed .sidebar-help > span:last-child { display: none; }
body.sidebar-collapsed .sidebar-brand, .sidebar.is-collapsed .sidebar-brand { gap: 3px; }
body.sidebar-collapsed .nav-item, .sidebar.is-collapsed .nav-item { justify-content: center; gap: 0; padding-inline: 0; }
body.sidebar-collapsed .sidebar-help, .sidebar.is-collapsed .sidebar-help { justify-content: center; padding: 7px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes loading-pulse { 50% { transform: scale(1.06); filter: drop-shadow(0 9px 10px rgb(152 22 43 / 18%)); } }
@keyframes loading-bar { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(22px); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } }

@media (max-width: 1220px) {
  :root { --sidebar-width: 244px; }
  .business-unit-filter { display: none; }
  .profile-copy, .profile-chevron { display: none; }
  .global-search { width: min(28vw, 280px); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); }
}

@media (max-width: 1024px) {
  .auth-view { grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr); }
  .auth-brand-panel { padding: 52px; }
  .auth-benefits { display: none; }
  .app-shell { display: block; }
  .workspace { min-height: 100vh; }
  .sidebar { visibility: hidden; width: min(294px, calc(100vw - 52px)); transform: translateX(-104%); box-shadow: var(--shadow-lg); }
  body.sidebar-collapsed .sidebar, .sidebar.is-collapsed { width: min(294px, calc(100vw - 52px)); }
  body.sidebar-collapsed .brand-copy, .sidebar.is-collapsed .brand-copy,
  body.sidebar-collapsed .sidebar-help > span:last-child, .sidebar.is-collapsed .sidebar-help > span:last-child { display: flex; }
  body.sidebar-collapsed .nav-section-label, .sidebar.is-collapsed .nav-section-label { display: block; }
  body.sidebar-collapsed .nav-item > span, .sidebar.is-collapsed .nav-item > span { display: inline-flex; }
  body.sidebar-collapsed .nav-item, .sidebar.is-collapsed .nav-item { justify-content: flex-start; gap: 12px; padding-inline: 12px; }
  .sidebar.is-open, body.sidebar-open .sidebar { visibility: visible; transform: translateX(0); }
  .sidebar-collapse { display: none; }
  .sidebar-scrim { position: fixed; z-index: 35; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgb(23 24 28 / 55%); backdrop-filter: blur(2px); }
  body:not(.sidebar-open) .sidebar-scrim { display: none; }
  .mobile-menu-button { display: inline-grid; }
  .topbar { padding-inline: 18px; }
  .metric-grid, .stats-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --topbar-height: 66px; }
  .auth-view { display: block; background: var(--white); }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; min-height: 100dvh; align-content: start; padding: max(28px, env(safe-area-inset-top)) 23px max(30px, env(safe-area-inset-bottom)); }
  .auth-mobile-brand { display: flex; width: 100%; align-items: center; gap: 10px; margin: 0 0 clamp(42px, 12vh, 90px); }
  .auth-mobile-brand .brand-mark { color: var(--red-700); }
  .auth-mobile-brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
  .auth-mobile-brand strong { color: var(--red-900); font-size: 18px; }
  .auth-mobile-brand small { margin-top: 3px; color: var(--ink-500); font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
  .auth-heading { margin-bottom: 26px; }
  .auth-heading h2 { font-size: 29px; }

  .demo-banner { justify-content: space-between; padding-inline: 12px; }
  .demo-banner > span { line-height: 1.25; }
  .demo-banner > span strong { display: none; }
  .demo-banner-actions .button-link { display: none; }
  .topbar { gap: 8px; }
  .breadcrumb { display: none; }
  .page-identity h1 { font-size: 18px; }
  .global-search, .quick-add-capa, .profile-menu { display: none; }
  .button--compact span { display: none; }
  .button--compact { width: 44px; min-width: 44px; height: 44px; padding: 0; }
  .page-content { padding: 20px 15px calc(94px + env(safe-area-inset-bottom)); }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 32;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    height: 70px;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    border: 1px solid rgb(255 255 255 / 68%);
    border-radius: 20px;
    padding: 4px 8px;
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 14px 38px rgb(39 18 22 / 20%);
    backdrop-filter: blur(18px);
  }
  .mobile-bottom-nav a { position: relative; display: flex; min-width: 52px; min-height: 55px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border-radius: 13px; color: var(--ink-500); font-size: 8px; font-weight: 720; }
  .mobile-bottom-nav a svg { width: 20px; height: 20px; }
  .mobile-bottom-nav a.is-active, .mobile-bottom-nav a[aria-current="page"] { background: var(--coral-50); color: var(--red-800); }
  .mobile-bottom-nav a i { position: absolute; top: 6px; right: calc(50% - 14px); width: 7px; height: 7px; border: 1px solid white; border-radius: 50%; background: var(--coral-500); }
  .mobile-add-button { display: grid; width: 52px; height: 52px; place-self: center; place-items: center; border: 5px solid var(--white); border-radius: 18px; padding: 0; background: linear-gradient(145deg, var(--red-600), var(--red-900)); color: var(--white); box-shadow: 0 7px 18px rgb(152 22 43 / 32%); transform: translateY(-13px) rotate(4deg); }
  .mobile-add-button:active { transform: translateY(-12px) rotate(0) scale(.95); }
  .mobile-add-button svg { width: 24px; height: 24px; stroke-width: 2.3; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(100vh - 34px); border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation-name: sheet-in; }
  .modal-footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .toast-container { right: 12px; bottom: calc(91px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .skeleton-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .metric-grid, .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card, .stat-card { min-height: 132px; padding: 15px; }
  .metric-card__value, .stat-value { font-size: 27px; }
  .panel-header, .card-header { padding-inline: 14px; }
  .panel-body, .card-body { padding: 14px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-group > * { flex: 1 1 130px; }
  .search-control { width: 100%; min-width: 0; }

  /* Tables become scan-friendly record cards at phone width. */
  .table-wrap { border: 0; overflow: visible; background: transparent; box-shadow: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .data-table tbody { display: grid; gap: 11px; }
  .data-table tbody tr { overflow: hidden; border: 1px solid var(--ink-150); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-xs); }
  .data-table tbody tr:hover { background: var(--white); }
  .data-table td { display: grid; min-height: 42px; grid-template-columns: minmax(92px, 38%) minmax(0, 62%); align-items: center; gap: 9px; border-top: 1px solid var(--ink-100); padding: 9px 12px; text-align: right; }
  .data-table td:first-child { border-top: 0; }
  .data-table td::before { color: var(--ink-500); content: attr(data-label); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
  .data-table td[data-primary="true"] { display: block; padding: 14px 12px; text-align: left; }
  .data-table td[data-primary="true"]::before { display: none; }
  .data-table .actions-cell { display: flex; width: 100%; justify-content: flex-end; }
  .calendar-scroll { margin-inline: -15px; overflow-x: auto; padding-inline: 15px; }
  .pagination { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .topbar { padding-inline: 10px; }
  .topbar-leading { gap: 4px; }
  .page-identity h1 { max-width: 125px; font-size: 16px; }
  .topbar-actions { gap: 5px; }
  .notification-button { border-color: transparent; }
  .page-content { padding-inline: 11px; }
  .metric-grid, .stats-grid { grid-template-columns: 1fr; }
  .metric-card, .stat-card { min-height: auto; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .mobile-bottom-nav { right: 5px; left: 5px; padding-inline: 3px; }
  .mobile-bottom-nav a { min-width: 0; }
  .mobile-bottom-nav a span { font-size: 7px; }
  .task-card { grid-template-columns: auto minmax(0, 1fr); }
  .task-card > :last-child { grid-column: 2; }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --ink-600: #494d55; --ink-200: #aeb2bb; }
  .nav-item { color: rgb(255 255 255 / 88%); }
  .button--primary { background: var(--red-900); }
}

@media print {
  @page { margin: 14mm; size: A4; }
  * { animation: none !important; box-shadow: none !important; text-shadow: none !important; }
  body { min-width: 0; background: var(--white); color: #000; font-size: 10pt; }
  .sidebar, .topbar, .mobile-bottom-nav, .demo-banner, .toast-container, .modal-root, .drawer-root, .loading-overlay, .loading-bar, .page-actions, .toolbar, .button, .pagination { display: none !important; }
  .app-shell, .workspace { display: block !important; min-height: 0; }
  .page-content { min-height: 0; padding: 0; }
  .route-view { width: 100%; }
  .page-header { margin-bottom: 8mm; }
  .page-header h2 { color: #000; font-size: 18pt; }
  .metric-grid, .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .metric-card, .stat-card, .panel, .card, .table-wrap { break-inside: avoid; border-color: #bbb; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 8pt; }
  .data-table th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .data-table td { color: #111; }
  a[href]::after { content: none; }
}

/* --------------------------------------------------------------------------
   Renderer compatibility layer
   These selectors map js/ui/renderers.js markup onto the FES design system.
   -------------------------------------------------------------------------- */

.page-header h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 830;
  letter-spacing: -.04em;
  line-height: 1.14;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 770;
  line-height: 1.1;
  text-align: center;
  transition: transform .16s var(--ease), box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn--primary { border-color: var(--red-700); background: linear-gradient(145deg, var(--red-700), var(--red-900)); color: var(--white); box-shadow: 0 7px 16px rgb(152 22 43 / 20%); }
.btn--primary:hover { border-color: var(--red-600); background: linear-gradient(145deg, var(--red-600), var(--red-800)); box-shadow: 0 9px 22px rgb(152 22 43 / 27%); }
.btn--secondary { border-color: var(--ink-200); background: var(--white); color: var(--ink-800); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { border-color: #daaeb5; background: var(--coral-50); color: var(--red-800); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-600); }
.btn--ghost:hover { background: var(--ink-100); color: var(--ink-900); }
.btn--danger, .btn--danger-ghost { border-color: #f1b8bf; color: var(--red-800); }
.btn--danger { border-color: var(--red-700); background: var(--red-700); color: var(--white); }
.btn--danger-ghost { background: #fff8f8; }
.btn--danger-ghost:hover { border-color: var(--red-600); background: var(--danger-100); }

.icon-btn {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--white);
  color: var(--ink-600);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .16s var(--ease);
}

.icon-btn:hover { border-color: #dfb6bd; background: var(--coral-50); color: var(--red-800); }
.icon-btn:active { transform: scale(.95); }
.icon-btn--danger { border-color: transparent; color: var(--red-700); }
.icon-btn--danger:hover { border-color: #f1b8bf; background: var(--danger-100); }

.link-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 7px 8px;
  background: transparent;
  color: var(--red-700);
  font-size: 11px;
  font-weight: 780;
  text-align: center;
}

.link-btn:hover { background: var(--coral-50); color: var(--red-900); text-decoration: underline; text-underline-offset: 3px; }
.link-btn--danger, .popover button.danger { color: var(--red-700) !important; }

.skeleton-stack { display: grid; gap: 14px; }
.skeleton-stack > span { position: relative; display: block; height: 128px; overflow: hidden; border-radius: var(--radius-md); background: var(--ink-100); }
.skeleton-stack > span:first-child { width: min(380px, 72%); height: 42px; }
.skeleton-stack > span::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 75%), transparent); content: ""; transform: translateX(-100%); animation: shimmer 1.45s infinite; }

.error-state { display: grid; min-height: 330px; place-content: center; justify-items: center; border: 1px solid #f0c2c8; border-radius: var(--radius-lg); padding: 36px 24px; background: linear-gradient(145deg, var(--white), #fff8f8); text-align: center; }
.error-state::before { display: grid; width: 64px; height: 64px; margin-bottom: 16px; place-items: center; border-radius: 20px; background: var(--danger-100); color: var(--red-800); content: "!"; font-size: 29px; font-weight: 850; }
.error-state h2 { margin: 0 0 7px; color: var(--ink-950); font-size: 20px; }
.error-state p { max-width: 480px; margin: 0 0 18px; color: var(--ink-600); }

.bu-chip {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--bu-color, var(--red-600)) 34%, white);
  border-radius: 999px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--bu-color, var(--red-600)) 10%, white);
  color: color-mix(in srgb, var(--bu-color, var(--red-600)) 78%, #17050a);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .05em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.avatar--xs { width: 24px; height: 24px; flex-basis: 24px; border-radius: 8px; font-size: 8px; }
.avatar--sm { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: 9px; }
.avatar--md { width: 38px; height: 38px; flex-basis: 38px; }
.avatar--lg { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; font-size: 13px; }

/* Filters and view controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-md);
  padding: 13px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.filter-bar > label, .modal-form .form-grid > label {
  display: grid;
  min-width: 128px;
  gap: 6px;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 750;
}

.filter-bar label > span, .modal-form label > span { line-height: 1.2; }
.filter-bar input, .filter-bar select, .modal-form input, .modal-form select, .modal-form textarea, .popover select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--ink-200);
  border-radius: 9px;
  padding: 8px 10px;
  outline: 0;
  background: var(--white);
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 560;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.filter-bar input:focus, .filter-bar select:focus, .modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus, .popover select:focus { border-color: var(--red-500); box-shadow: var(--focus-ring); }
.filter-bar--wrap > label { flex: 1 1 130px; }
.filter-bar .filter-search { min-width: min(260px, 100%); flex: 2 1 230px; }
.filter-bar .btn { flex: 0 0 auto; }

.segmented { display: inline-flex; min-height: 44px; align-items: center; gap: 3px; border: 1px solid var(--ink-150); border-radius: 11px; padding: 3px; background: var(--ink-50); }
.segmented button { min-height: 36px; border: 0; border-radius: 8px; padding: 7px 11px; background: transparent; color: var(--ink-600); font-size: 11px; font-weight: 730; }
.segmented button:hover { color: var(--red-800); }
.segmented button.is-active { background: var(--white); color: var(--red-800); box-shadow: 0 2px 7px rgb(36 20 23 / 10%); }
.result-summary { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 14px; margin: -6px 2px 12px; color: var(--ink-500); font-size: 11px; }
.result-summary strong { color: var(--ink-900); font-size: 13px; }

/* Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card {
  --kpi-color: var(--red-700);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 145px;
  overflow: hidden;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-md);
  padding: 17px;
  background: var(--white);
  color: var(--ink-800);
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease);
}

.kpi-card::before { position: absolute; height: 3px; inset: 0 0 auto; background: var(--kpi-color); content: ""; }
.kpi-card::after { position: absolute; width: 84px; height: 84px; top: -49px; right: -42px; border-radius: 50%; background: color-mix(in srgb, var(--kpi-color) 10%, white); content: ""; }
.kpi-card:hover { border-color: color-mix(in srgb, var(--kpi-color) 30%, var(--ink-150)); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.kpi-card__label { color: var(--ink-600); font-size: 10px; font-weight: 750; line-height: 1.35; }
.kpi-card strong { margin-top: auto; color: var(--ink-950); font-size: clamp(26px, 2.2vw, 35px); font-weight: 850; letter-spacing: -.045em; line-height: 1; }
.kpi-card small { margin-top: 7px; color: var(--ink-500); font-size: 9px; line-height: 1.35; }
.kpi-card--red { --kpi-color: var(--red-700); }
.kpi-card--green { --kpi-color: var(--success-700); }
.kpi-card--danger { --kpi-color: #bd1935; }
.kpi-card--amber { --kpi-color: #bf720d; }
.kpi-card--violet { --kpi-color: #7052a8; }
.kpi-card--blue { --kpi-color: var(--info-700); }

.dashboard-grid { margin-top: 18px; }
.dashboard-grid--wide { grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr); }
.dashboard-grid:not(.dashboard-grid--wide) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card__header { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--ink-100); padding: 14px 18px; }
.card__header h2 { margin: 0; color: var(--ink-900); font-size: 14px; font-weight: 800; letter-spacing: -.015em; }
.card__header p { margin: 3px 0 0; color: var(--ink-500); font-size: 10px; }

.portfolio-list, .workstream-list, .workload-list, .attention-summary, .master-list { padding: 5px 11px 11px; }
.portfolio-row { display: grid; width: 100%; min-height: 61px; grid-template-columns: minmax(150px, 1.25fr) minmax(100px, 1fr) auto; align-items: center; gap: 14px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 9px 7px; background: transparent; text-align: left; }
.portfolio-row:last-child { border-bottom: 0; }
.portfolio-row:hover, .workstream-row:hover, .workload-list > button:hover, .attention-summary > button:hover { border-radius: 9px; background: var(--coral-50); }
.portfolio-row > span:first-child { display: flex; min-width: 0; align-items: center; gap: 8px; }
.portfolio-row > span:first-child strong { overflow: hidden; color: var(--ink-800); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-row > span:last-child { display: flex; align-items: flex-end; flex-direction: column; }
.portfolio-row b { color: var(--ink-900); font-size: 12px; }
.portfolio-row small { color: var(--ink-500); font-size: 9px; }

.progress-track, .mini-progress, .workload-meter, .progress-cell > span { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--ink-100); }
.progress-track i, .mini-progress i, .workload-meter i, .progress-cell > span i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red-700), var(--coral-500)); }
.progress-track--lg { height: 10px; }

.workstream-row { display: grid; width: 100%; min-height: 56px; grid-template-columns: 10px minmax(120px, 1fr) minmax(80px, .7fr) 38px; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 8px 7px; background: transparent; text-align: left; }
.workstream-row:last-child { border-bottom: 0; }
.workstream-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--red-600)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot, var(--red-600)) 12%, white); }
.workstream-row > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.workstream-row strong { overflow: hidden; color: var(--ink-800); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workstream-row small { color: var(--ink-500); font-size: 9px; }
.workstream-row > b { color: var(--ink-700); font-size: 10px; text-align: right; }

.attention-summary > button { display: grid; width: 100%; min-height: 48px; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 9px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 6px 7px; background: transparent; color: var(--ink-700); font-size: 11px; font-weight: 670; text-align: left; }
.attention-summary > button:last-child { border-bottom: 0; }
.attention-summary > button > span:last-child { color: var(--ink-400); font-size: 16px; }
.attention-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--ink-100); color: var(--ink-700); font-size: 10px; font-weight: 850; }
.attention-icon--danger { background: var(--danger-100); color: var(--red-800); }
.attention-icon--warning { background: var(--warning-100); color: var(--warning-800); }
.attention-icon--violet { background: #eee8ff; color: #5d428d; }
.attention-icon--blue { background: var(--info-100); color: var(--info-700); }

.workload-list > button { display: grid; width: 100%; min-height: 58px; grid-template-columns: minmax(120px, 1.2fr) minmax(70px, .8fr) 28px; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 8px 7px; background: transparent; text-align: left; }
.workload-list > button:last-child { border-bottom: 0; }
.workload-list > button > span:first-child { display: flex; min-width: 0; align-items: center; gap: 8px; }
.workload-list > button > span:first-child > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.workload-list strong { overflow: hidden; color: var(--ink-800); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workload-list small { color: var(--ink-500); font-size: 8px; }
.workload-list > button > b { color: var(--ink-700); font-size: 10px; text-align: right; }

/* Status, tables, task list, kanban and agenda */
.badge--red { background: var(--danger-100); color: var(--red-800); }
.badge--blue, .badge--assigned, .badge--verification { background: var(--info-100); color: var(--info-700); }
.badge--green, .badge--completed, .badge--closed, .badge--approved, .badge--verified, .badge--resolved, .badge--effective { background: var(--success-100); color: var(--success-700); }
.badge--amber, .badge--warning, .badge--pending, .badge--pending_review, .badge--effectiveness_review, .badge--due_soon { background: var(--warning-100); color: var(--warning-800); }
.badge--violet, .badge--revision_required, .badge--root_cause_analysis { background: #eee8ff; color: #5d428d; }
.badge--danger, .badge--blocked, .badge--overdue, .badge--rejected, .badge--cancelled, .badge--ineffective { background: var(--danger-100); color: var(--red-800); }
.badge--draft, .badge--archived, .badge--neutral { background: var(--ink-100); color: var(--ink-700); }
.badge--in_progress, .badge--action_in_progress, .badge--corrective { background: #fff0e0; color: #92510b; }
.badge--preventive { background: #e4f3ff; color: #23628c; }
.badge--open { background: var(--danger-100); color: var(--red-800); }
.badge--priority-low { background: var(--ink-100); color: var(--ink-700); }
.badge--priority-medium { background: var(--info-100); color: var(--info-700); }
.badge--priority-high { background: var(--warning-100); color: var(--warning-800); }
.badge--priority-critical { background: var(--danger-100); color: var(--red-800); }

.table-card { overflow: hidden; border: 1px solid var(--ink-150); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-xs); }
.table-scroll { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--ink-300) transparent; }
.table-card .data-table { min-width: 860px; }
.task-row { position: relative; }
.task-row--overdue td:first-child { box-shadow: inset 3px 0 0 var(--red-600); }
.task-row--today td:first-child, .task-row--due_soon td:first-child { box-shadow: inset 3px 0 0 #d58a1b; }
.task-link { display: flex; max-width: 320px; align-items: flex-start; flex-direction: column; gap: 2px; border: 0; padding: 0; background: transparent; text-align: left; }
.task-link strong { color: var(--red-700); font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.task-link span { color: var(--ink-900); font-size: 11px; font-weight: 720; line-height: 1.35; }
.task-link:hover span { color: var(--red-800); text-decoration: underline; text-underline-offset: 2px; }
.tag-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.stacked-meta { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; }
.stacked-meta small, .data-table td > small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.person-cell { display: inline-flex; max-width: 170px; align-items: center; gap: 7px; color: var(--ink-700); font-size: 10px; }
.person-cell > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-cell { display: grid; min-width: 96px; grid-template-columns: minmax(54px, 1fr) auto; align-items: center; gap: 7px; }
.progress-cell > span { height: 6px; }
.progress-cell b { color: var(--ink-700); font-size: 9px; font-weight: 780; }
.due { color: var(--ink-700); font-size: 10px; font-weight: 700; white-space: nowrap; }
.due--overdue { color: var(--red-700) !important; font-weight: 800 !important; }
.due--today, .due--due_soon { color: var(--warning-800) !important; font-weight: 800 !important; }

.kanban-column > header { display: flex; min-height: 39px; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 3px 9px; color: var(--ink-700); font-size: 11px; font-weight: 800; }
.kanban-stack { display: grid; gap: 9px; }
.kanban-empty { margin: 0; border: 1px dashed var(--ink-300); border-radius: 9px; padding: 22px 10px; color: var(--ink-500); font-size: 10px; text-align: center; }
.kanban-card { display: grid; width: 100%; gap: 9px; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 13px; background: var(--white); color: var(--ink-700); text-align: left; box-shadow: var(--shadow-xs); }
.kanban-card:hover { border-color: #dfb5bc; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kanban-card > span:first-child { display: flex; flex-wrap: wrap; gap: 5px; }
.kanban-card > strong { color: var(--ink-900); font-size: 12px; line-height: 1.38; }
.kanban-card > small { color: var(--ink-500); font-size: 9px; }
.kanban-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--ink-100); padding-top: 9px; color: var(--ink-500); font-size: 9px; }
.kanban-card footer > span { display: flex; min-width: 0; align-items: center; gap: 6px; }

.calendar-agenda { display: grid; gap: 13px; }
.calendar-agenda > section { overflow: hidden; border: 1px solid var(--ink-150); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-xs); }
.calendar-agenda > section > header { display: flex; min-height: 49px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ink-100); padding: 10px 15px; background: var(--ink-50); }
.calendar-agenda > section > header time { color: var(--ink-900); font-size: 12px; font-weight: 800; }
.calendar-agenda > section > div > button { display: grid; width: 100%; min-height: 55px; grid-template-columns: 12px minmax(170px, 1fr) auto 42px; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 9px 15px; background: transparent; text-align: left; }
.calendar-agenda > section > div > button:last-child { border-bottom: 0; }
.calendar-agenda > section > div > button:hover { background: var(--coral-50); }
.calendar-agenda button > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.calendar-agenda button strong { overflow: hidden; color: var(--ink-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-agenda button small { color: var(--ink-500); font-size: 9px; }
.calendar-agenda button > b { color: var(--ink-700); font-size: 10px; text-align: right; }
.calendar-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--info-700); }
.calendar-dot--low { background: var(--ink-400); }
.calendar-dot--medium { background: var(--info-700); }
.calendar-dot--high { background: #c27712; }
.calendar-dot--critical { background: var(--red-700); box-shadow: 0 0 0 4px var(--danger-100); }

/* Attention, reports, audit and master data */
.attention-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.attention-card { overflow: hidden; }
.attention-card--overdue, .attention-card--blocked { border-top: 3px solid var(--red-600); }
.attention-card--pending_review { border-top: 3px solid #7253a7; }
.attention-card--due_soon { border-top: 3px solid #ca7a12; }
.attention-list { padding: 5px 11px 11px; }
.attention-list > button { display: flex; width: 100%; min-height: 62px; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 9px 7px; background: transparent; text-align: left; }
.attention-list > button:last-child { border-bottom: 0; }
.attention-list > button:hover { border-radius: 9px; background: var(--coral-50); }
.attention-list > button > span { display: flex; min-width: 0; align-items: center; gap: 8px; }
.attention-list > button > span:first-child > span:last-child { flex-direction: column; align-items: flex-start; }
.attention-list > button > span:last-child { align-items: flex-end; flex-direction: column; }
.attention-list strong { overflow: hidden; max-width: 300px; color: var(--ink-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attention-list small, .attention-list time { color: var(--ink-500); font-size: 9px; }

.extension-list { padding: 5px 12px 12px; }
.extension-list > button { display: flex; width: 100%; min-height: 59px; align-items: center; justify-content: space-between; gap: 16px; border: 0; border-bottom: 1px solid var(--ink-100); padding: 9px 7px; background: transparent; text-align: left; }
.extension-list > button:last-child { border-bottom: 0; }
.extension-list > button:hover { border-radius: 9px; background: var(--coral-50); }
.extension-list > button > span { display: flex; flex-direction: column; }
.extension-list strong, .extension-list b { color: var(--ink-900); font-size: 11px; }
.extension-list small, .extension-list s { color: var(--ink-500); font-size: 9px; }

.report-sheet { border: 1px solid var(--ink-150); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 30px); background: var(--white); box-shadow: var(--shadow-sm); }
.report-sheet > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 2px solid var(--red-800); padding-bottom: 16px; }
.report-sheet > header h2 { margin: 0; color: var(--red-900); font-size: 20px; letter-spacing: -.025em; }
.report-sheet > header p { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.report-sheet > header > span { border-radius: 999px; padding: 5px 10px; background: var(--coral-50); color: var(--red-800); font-size: 10px; font-weight: 800; }
.report-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 18px 0; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); background: var(--ink-150); }
.report-kpis > div { display: flex; min-height: 75px; justify-content: center; flex-direction: column; padding: 10px; background: var(--white); text-align: center; }
.report-kpis span { color: var(--ink-500); font-size: 9px; }
.report-kpis strong { margin-top: 3px; color: var(--ink-950); font-size: 19px; }

.timeline--compact { display: grid; gap: 0; padding: 10px 16px 15px; }
.timeline--compact > li, .timeline--audit > li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 8px 0 13px; }
.timeline--compact > li:not(:last-child)::before, .timeline--audit > li:not(:last-child)::before { position: absolute; width: 1px; top: 25px; bottom: -1px; left: 5px; background: var(--ink-150); content: ""; }
.timeline__dot { z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 3px solid var(--white); border-radius: 50%; background: var(--red-600); box-shadow: 0 0 0 1px var(--red-300, #e9a6af); }
.timeline--compact p { margin: 0; color: var(--ink-700); font-size: 10px; line-height: 1.45; }
.timeline--compact time { color: var(--ink-500); font-size: 8px; }
.timeline--audit { display: grid; gap: 0; margin: 0; border: 1px solid var(--ink-150); border-radius: var(--radius-md); padding: 10px 18px; background: var(--white); box-shadow: var(--shadow-xs); }
.timeline--audit > li { grid-template-columns: 19px minmax(0, 1fr); padding-block: 13px; }
.timeline--audit > li > div { min-width: 0; border-bottom: 1px solid var(--ink-100); padding-bottom: 13px; }
.timeline--audit > li:last-child > div { border-bottom: 0; }
.timeline--audit header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline--audit header > span { display: flex; min-width: 0; align-items: center; gap: 7px; }
.timeline--audit header strong { color: var(--ink-800); font-size: 10px; }
.timeline--audit time { color: var(--ink-500); font-size: 9px; white-space: nowrap; }
.timeline--audit p { margin: 7px 0 0; color: var(--ink-700); font-size: 11px; }
.timeline--audit details { margin-top: 8px; border-radius: 8px; padding: 7px 9px; background: var(--ink-50); color: var(--ink-600); font-size: 9px; }
.timeline--audit pre { max-width: 100%; overflow: auto; white-space: pre-wrap; }

.info-banner { margin-bottom: 16px; border: 1px solid #bad3f4; border-radius: var(--radius-sm); padding: 12px 14px; background: var(--info-100); color: #234d80; font-size: 11px; font-weight: 650; }
.master-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.master-list > div { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--ink-100); padding: 9px 7px; }
.master-list > div:last-child { border-bottom: 0; }
.master-list > div > span { display: flex; min-width: 0; align-items: center; gap: 8px; }
.master-list > div > span:first-child > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.master-list strong { overflow: hidden; color: var(--ink-800); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.master-list small { color: var(--ink-500); font-size: 8px; }
.master-list > div > span:last-child { justify-content: flex-end; }
.settings-card { margin-top: 16px; padding-bottom: 16px; }
.settings-card > dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 17px; }
.settings-card > dl > div { border-radius: var(--radius-sm); padding: 12px; background: var(--ink-50); }
.settings-card dt { color: var(--ink-500); font-size: 9px; }
.settings-card dd { margin: 4px 0 0; color: var(--ink-900); font-size: 13px; font-weight: 800; }
.settings-card > .btn { margin-left: 17px; }

/* Drawers and task/CAPA details */
.detail-drawer {
  position: fixed;
  z-index: 102;
  top: 0;
  right: 0;
  display: grid;
  width: min(650px, 100vw);
  height: 100vh;
  height: 100dvh;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  animation: drawer-in .26s var(--ease);
}

.detail-drawer .drawer-header { position: relative; display: flex; min-height: 96px; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 20px 15px; }
.detail-drawer .drawer-header > div { min-width: 0; }
.detail-drawer .drawer-header > div > span { color: var(--red-700); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.detail-drawer .drawer-header h2 { margin: 3px 0 8px; color: var(--ink-950); font-size: 19px; letter-spacing: -.025em; line-height: 1.3; }
.detail-drawer .drawer-header > div > div { display: flex; flex-wrap: wrap; gap: 5px; }
.drawer-tabs { display: flex; min-height: 46px; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--ink-150); padding: 0 13px; background: var(--white); scrollbar-width: thin; }
.drawer-tabs button { position: relative; min-height: 45px; flex: 0 0 auto; border: 0; padding: 8px 10px; background: transparent; color: var(--ink-600); font-size: 10px; font-weight: 720; white-space: nowrap; }
.drawer-tabs button:hover { color: var(--red-800); }
.drawer-tabs button.is-active { color: var(--red-800); }
.drawer-tabs button.is-active::after { position: absolute; height: 2px; right: 7px; bottom: 0; left: 7px; background: var(--red-700); content: ""; }
.detail-drawer .drawer-body { min-height: 0; overflow-y: auto; padding: 20px; }
.drawer-actions { display: flex; min-height: 68px; align-items: center; justify-content: flex-end; gap: 8px; overflow-x: auto; border-top: 1px solid var(--ink-150); padding: 11px 16px max(11px, env(safe-area-inset-bottom)); background: var(--ink-50); }

.detail-section { display: grid; gap: 17px; }
.detail-section > h3 { margin: 0; color: var(--ink-900); font-size: 16px; }
.detail-section > p { margin: -10px 0 0; color: var(--ink-600); font-size: 11px; }
.progress-hero { display: grid; grid-template-columns: auto minmax(130px, 1fr) auto; align-items: center; gap: 13px; border: 1px solid #f0c9ce; border-radius: var(--radius-md); padding: 15px; background: linear-gradient(135deg, var(--coral-50), var(--white)); }
.progress-hero > div:first-child { display: flex; flex-direction: column; }
.progress-hero span { color: var(--ink-600); font-size: 9px; }
.progress-hero strong { color: var(--red-900); font-size: 24px; letter-spacing: -.035em; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 0; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); background: var(--ink-150); }
.detail-grid > div { min-width: 0; padding: 11px 12px; background: var(--white); }
.detail-grid dt { color: var(--ink-500); font-size: 8px; font-weight: 720; text-transform: uppercase; letter-spacing: .05em; }
.detail-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--ink-800); font-size: 11px; font-weight: 700; }
.description-block, .scope-note, .rca-block { border-radius: var(--radius-sm); padding: 14px; background: var(--ink-50); }
.description-block h3, .rca-block h3 { margin: 0 0 6px; color: var(--ink-800); font-size: 12px; }
.description-block p, .scope-note p, .rca-block p { margin: 0; color: var(--ink-600); font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.scope-note { border: 1px solid #bad3f4; background: var(--info-100); }
.scope-note strong { display: block; margin-bottom: 4px; color: #234d80; font-size: 11px; }
.rca-block { border-left: 4px solid var(--red-600); background: var(--coral-50); }
.rca-block header { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.rca-block header > div { display: flex; align-items: center; gap: 7px; }
.rca-block header span { color: var(--ink-500); font-size: 8px; text-transform: uppercase; }
.rca-block header strong { border-radius: 6px; padding: 3px 6px; background: var(--white); color: var(--red-800); font-size: 9px; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; }
.section-heading h3 { margin: 0; color: var(--ink-900); font-size: 15px; }
.section-heading p { margin: 3px 0 0; color: var(--ink-500); font-size: 10px; }
.checklist-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.checklist-list li { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 6px 7px 6px 12px; background: var(--white); }
.checklist-list label { display: flex; min-width: 0; min-height: 38px; flex: 1; align-items: center; gap: 10px; cursor: pointer; }
.checklist-list input { width: 19px; height: 19px; flex: 0 0 19px; accent-color: var(--red-700); }
.checklist-list label span { color: var(--ink-700); font-size: 11px; }
.checklist-list input:checked + span { color: var(--ink-500); text-decoration: line-through; }

.blocker-list, .capa-action-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.blocker-item, .capa-action-list article { min-width: 0; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 13px; background: var(--white); }
.blocker-item--open, .blocker-item--active { border-top: 3px solid var(--red-600); }
.blocker-item--resolved { border-top: 3px solid var(--success-700); opacity: .85; }
.blocker-item header, .capa-action-list article > header { display: flex; flex-wrap: wrap; gap: 5px; }
.blocker-item h4, .capa-action-list h4 { margin: 10px 0 5px; color: var(--ink-900); font-size: 12px; }
.blocker-item > p, .capa-action-list article > p { margin: 0; color: var(--ink-600); font-size: 10px; line-height: 1.55; }
.blocker-item dl, .capa-action-list dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 11px 0; }
.blocker-item dl > div, .capa-action-list dl > div { border-radius: 7px; padding: 7px; background: var(--ink-50); }
.blocker-item dt, .capa-action-list dt { color: var(--ink-500); font-size: 8px; }
.blocker-item dd, .capa-action-list dd { margin: 2px 0 0; color: var(--ink-800); font-size: 9px; font-weight: 700; }
.resolution { margin-top: 11px; border-radius: 8px; padding: 9px; background: var(--success-100); }
.resolution strong { color: var(--success-700); font-size: 9px; }
.resolution p { margin: 3px 0 0; color: #275d45; font-size: 9px; }

.evidence-list { display: grid; gap: 8px; }
.evidence-list article { display: grid; min-height: 60px; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 8px; background: var(--white); }
.file-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--coral-50); color: var(--red-700); font-size: 18px; }
.evidence-list article > div { display: flex; min-width: 0; flex-direction: column; }
.evidence-list strong { overflow: hidden; color: var(--ink-800); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.evidence-list small { color: var(--ink-500); font-size: 8px; }

.extension-history { display: grid; gap: 10px; }
.extension-history article { border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 13px; background: var(--white); }
.extension-history article > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.extension-history article > p { margin: 8px 0 0; color: var(--ink-600); font-size: 10px; }
.extension-history article > p:nth-of-type(1) { color: var(--ink-800); font-size: 11px; }
.extension-history time { color: var(--ink-500); font-size: 9px; }
.extension-history blockquote, .capa-action-list blockquote { margin: 10px 0 0; border-left: 3px solid var(--red-500); padding: 8px 10px; background: var(--coral-50); color: var(--ink-700); font-size: 9px; }
.extension-history article > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.capa-action-list { grid-template-columns: 1fr; }
.capa-action-list .progress-cell { margin-top: 11px; }
.capa-action-list article > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.effectiveness-result { border: 1px solid var(--ink-150); border-radius: var(--radius-md); padding: 15px; background: var(--ink-50); }
.effectiveness-result--effective { border-color: #a9dec6; background: var(--success-100); }
.effectiveness-result--ineffective { border-color: #f1b8bf; background: var(--danger-100); }
.effectiveness-result p { margin: 9px 0 4px; color: var(--ink-700); font-size: 11px; }
.effectiveness-result time { color: var(--ink-500); font-size: 9px; }

/* Modal forms */
.modal-root:not(:empty) {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgb(23 24 28 / 64%);
  backdrop-filter: blur(5px);
  animation: fade-in .16s ease;
}

.modal-form { width: min(820px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid rgb(255 255 255 / 30%); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-lg); animation: modal-in .24s var(--ease); }
.modal-form--sm { width: min(520px, 100%); }
.modal-form .modal-header { position: sticky; z-index: 2; top: 0; align-items: flex-start; background: rgb(255 255 255 / 96%); backdrop-filter: blur(14px); }
.modal-form .modal-header > div > span { color: var(--red-700); font-size: 9px; font-weight: 820; letter-spacing: .06em; text-transform: uppercase; }
.modal-form .modal-header h2 { margin-top: 2px; }
.modal-form .modal-body { padding: 20px 22px; }
.modal-form .form-grid { align-items: start; }
.modal-form .form-grid > label { min-width: 0; }
.modal-form textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.modal-form input:disabled { cursor: not-allowed; background: var(--ink-100); color: var(--ink-500); }
.field--wide { grid-column: 1 / -1; }
.modal-actions { position: sticky; z-index: 2; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--ink-150); padding: 13px 22px; background: rgb(247 247 249 / 96%); backdrop-filter: blur(12px); }

.choice-field { min-width: 0; margin: 0; border: 1px solid var(--ink-150); border-radius: var(--radius-sm); padding: 12px; }
.choice-field legend { padding: 0 5px; color: var(--ink-700); font-size: 10px; font-weight: 750; }
.bu-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.bu-choice-grid > label { display: flex; min-height: 46px; min-width: 0; align-items: center; gap: 7px; border: 1px solid var(--ink-150); border-radius: 9px; padding: 7px 9px; background: var(--white); color: var(--ink-700); font-size: 10px; cursor: pointer; }
.bu-choice-grid > label:hover { border-color: #dfb3ba; background: var(--coral-50); }
.bu-choice-grid input { width: 18px; min-height: 18px; flex: 0 0 18px; padding: 0; accent-color: var(--red-700); }
.bu-choice-grid > label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-config-list { border-radius: var(--radius-sm); padding: 14px; background: var(--ink-50); }
.scope-config-list > h3 { margin: 0; color: var(--ink-900); font-size: 13px; }
.scope-config-list > p { margin: 3px 0 12px; color: var(--ink-500); font-size: 9px; }
.scope-config { margin-top: 9px; border: 1px solid var(--ink-150); border-radius: 10px; padding: 11px; background: var(--white); }
.scope-config > header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.scope-config > header strong { color: var(--ink-800); font-size: 10px; }
.immutable-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: 11px 12px; background: var(--ink-50); color: var(--ink-600); font-size: 10px; }
.checkbox-field { display: flex !important; min-height: 44px; align-items: center; grid-template-columns: none; gap: 9px !important; align-self: end; border: 1px solid var(--ink-150); border-radius: 9px; padding: 9px 11px; background: var(--ink-50); cursor: pointer; }
.checkbox-field input { width: 18px; min-width: 18px; min-height: 18px; padding: 0; accent-color: var(--red-700); }
.checkbox-field > span { color: var(--ink-700); font-size: 10px; line-height: 1.35 !important; }

/* Top-bar popovers */
.popover {
  position: fixed;
  z-index: 110;
  top: calc(var(--topbar-height) + 10px);
  right: 18px;
  width: min(370px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-md);
  animation: menu-in .18s var(--ease);
}

.notification-popover > header { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ink-100); padding: 12px 14px; }
.notification-popover > header h2 { margin: 0; color: var(--ink-900); font-size: 15px; }
.notification-popover > header p { margin: 2px 0 0; color: var(--ink-500); font-size: 9px; }
.notification-list { max-height: min(510px, calc(100vh - 170px)); overflow-y: auto; padding: 5px; }
.notification-list > button { position: relative; display: grid; width: 100%; min-height: 70px; grid-template-columns: 9px minmax(0, 1fr); align-items: start; gap: 8px; border: 0; border-bottom: 1px solid var(--ink-100); border-radius: 8px; padding: 10px; background: transparent; text-align: left; }
.notification-list > button:last-child { border-bottom: 0; }
.notification-list > button:hover { background: var(--ink-50); }
.notification-list > button.is-unread { background: var(--coral-50); }
.notification-list .notification-dot { position: static; width: 7px; min-width: 7px; height: 7px; margin-top: 5px; border: 0; }
.notification-list > button:not(.is-unread) .notification-dot { background: var(--ink-300); }
.notification-list > button > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.notification-list strong { color: var(--ink-800); font-size: 10px; }
.notification-list small { margin-top: 2px; color: var(--ink-600); font-size: 9px; line-height: 1.45; }
.notification-list time { margin-top: 4px; color: var(--ink-400); font-size: 8px; }
.notification-page { overflow: hidden; }
.notification-page .notification-popover { position: static; width: 100%; border: 0; border-radius: inherit; box-shadow: none; animation: none; }
.notification-page .notification-list { max-height: none; }

.popover.profile-menu { display: grid; padding: 7px; }
.profile-menu__user { display: flex; min-width: 0; align-items: center; gap: 10px; border-bottom: 1px solid var(--ink-100); margin-bottom: 5px; padding: 9px 8px 13px; }
.profile-menu__user > span:last-child { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.profile-menu__user strong { overflow: hidden; max-width: 235px; color: var(--ink-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu__user small { overflow: hidden; max-width: 235px; margin: 2px 0 5px; color: var(--ink-500); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.popover.profile-menu > label { display: grid; gap: 5px; margin: 4px 3px 7px; color: var(--ink-500); font-size: 9px; font-weight: 700; }
.popover.profile-menu > button { display: flex; width: 100%; min-height: 42px; align-items: center; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--ink-700); font-size: 11px; font-weight: 650; text-align: left; }
.popover.profile-menu > button:hover { background: var(--coral-50); color: var(--red-800); }

/* Runtime mount compatibility */
[data-mode="demo"] #app-shell:not([hidden]) #demo-banner[hidden] { display: flex !important; }
[data-mode="supabase"] [data-action="reset-demo"] { display: none !important; }

.notification-button [data-notification-count] {
  top: 1px;
  right: 1px;
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-width: 2px;
  padding: 0 4px;
  color: var(--white);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}

.toast {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.toast > span { min-width: 0; color: var(--ink-800); font-size: 11px; font-weight: 650; line-height: 1.45; }
.toast > button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-500); font-size: 18px; }
.toast > button:hover { background: var(--ink-100); color: var(--red-800); }
.toast--error { border-left-color: var(--red-700); background: #fffafa; }
.toast--info { border-left-color: var(--info-700); }

.modal-shell { position: relative; z-index: 101; width: min(820px, 100%); max-height: calc(100dvh - 48px); }
.modal-shell:has(.modal-form--sm) { width: min(520px, 100%); }
.modal-shell > .modal-form { width: 100%; }

#profile-dropdown:not([hidden]):has(> .popover) { border: 0; padding: 0; background: transparent; box-shadow: none; }

.portfolio-row:has(> .avatar:first-child) { grid-template-columns: auto minmax(0, 1fr) auto; }
.portfolio-row:has(> .avatar:first-child) > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.portfolio-row:has(> .avatar:first-child) > span:nth-child(2) strong { overflow: hidden; color: var(--ink-800); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-row:has(> .avatar:first-child) > span:nth-child(2) small { color: var(--ink-500); font-size: 9px; }

@media (max-width: 1360px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-card { min-height: 128px; }
  .master-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .dashboard-grid:not(.dashboard-grid--wide) { grid-template-columns: 1fr 1fr; }
  .dashboard-grid:not(.dashboard-grid--wide) > :last-child { grid-column: 1 / -1; }
  .report-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .dashboard-grid--wide, .dashboard-grid:not(.dashboard-grid--wide), .attention-page, .master-grid { grid-template-columns: 1fr; }
  .dashboard-grid:not(.dashboard-grid--wide) > :last-child { grid-column: auto; }
  .filter-bar > label { flex: 1 1 160px; }
  .page-actions { align-items: stretch; }
  .detail-drawer { width: min(620px, 100vw); }
}

@media (max-width: 600px) {
  .page-header h1 { font-size: 25px; }
  .page-header p { font-size: 11px; }
  .page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-actions > .segmented { grid-column: 1 / -1; }
  .page-actions > .btn:only-child { grid-column: 1 / -1; }
  .filter-bar { align-items: stretch; padding: 11px; }
  .filter-bar > label, .filter-bar--wrap > label, .filter-bar .filter-search { min-width: 0; flex: 1 1 calc(50% - 5px); }
  .filter-bar .filter-search { flex-basis: 100%; }
  .filter-bar .btn { flex: 1 1 calc(50% - 5px); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi-card { min-height: 126px; padding: 14px; }
  .kpi-card strong { font-size: 28px; }
  .portfolio-row { grid-template-columns: minmax(120px, 1fr) 80px; }
  .portfolio-row > span:nth-child(2) { display: none; }
  .portfolio-row:has(> .avatar:first-child) { grid-template-columns: auto minmax(0, 1fr); }
  .portfolio-row:has(> .avatar:first-child) > span:nth-child(2) { display: flex; }
  .portfolio-row:has(> .avatar:first-child) > span:last-child { grid-column: 2; align-items: flex-start; }
  .workstream-row { grid-template-columns: 10px minmax(110px, 1fr) 34px; }
  .workstream-row .mini-progress { display: none; }
  .workload-list > button { grid-template-columns: minmax(120px, 1fr) 28px; }
  .workload-meter { display: none; }
  .attention-list > button { align-items: flex-start; flex-direction: column; }
  .attention-list > button > span:last-child { width: 100%; align-items: center; justify-content: space-between; flex-direction: row; }
  .extension-list > button { align-items: flex-start; flex-direction: column; }
  .report-sheet { margin-inline: -4px; padding: 14px; }
  .report-sheet > header { flex-direction: column; }
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .timeline--audit { padding-inline: 12px; }
  .timeline--audit header { align-items: flex-start; flex-direction: column; }
  .timeline--audit time { white-space: normal; }
  .settings-card > dl { grid-template-columns: 1fr; }

  /* Renderer tables have no data-label attributes, so labels are supplied here. */
  .table-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-scroll { overflow: visible; }
  .table-card .data-table { min-width: 0; }
  .table-card .data-table td::before { content: "Data"; }
  .table-card:has(.task-row) .data-table td:nth-child(1)::before { content: "Scope pekerjaan"; }
  .table-card:has(.task-row) .data-table td:nth-child(2)::before { content: "BU / Workstream"; }
  .table-card:has(.task-row) .data-table td:nth-child(3)::before { content: "PIC"; }
  .table-card:has(.task-row) .data-table td:nth-child(4)::before { content: "Status"; }
  .table-card:has(.task-row) .data-table td:nth-child(5)::before { content: "Progres"; }
  .table-card:has(.task-row) .data-table td:nth-child(6)::before { content: "Tenggat"; }
  .table-card:not(:has(.task-row)) .data-table td:nth-child(1)::before { content: "Kasus"; }
  .table-card:not(:has(.task-row)) .data-table td:nth-child(2)::before { content: "BU / Owner"; }
  .table-card:not(:has(.task-row)) .data-table td:nth-child(3)::before { content: "Severity"; }
  .table-card:not(:has(.task-row)) .data-table td:nth-child(4)::before { content: "Status"; }
  .table-card:not(:has(.task-row)) .data-table td:nth-child(5)::before { content: "Tindakan"; }
  .table-card:not(:has(.task-row)) .data-table td:nth-child(6)::before { content: "Target"; }
  .table-card .data-table td:nth-child(7)::before { content: "Aksi"; }
  .table-card .data-table td { text-align: right; }
  .table-card .data-table td > * { justify-self: end; }
  .table-card .data-table td:first-child { display: grid; }
  .table-card .task-link { align-items: flex-end; text-align: right; }
  .table-card .tag-line { justify-content: flex-end; }
  .table-card .person-cell, .table-card .stacked-meta { align-items: flex-end; }
  .table-card .progress-cell { width: min(160px, 100%); }
  .table-card .data-table td:last-child { display: flex; align-items: center; justify-content: space-between; }
  .table-card .data-table td:last-child::before { margin-right: auto; }

  .calendar-agenda > section > div > button { grid-template-columns: 10px minmax(0, 1fr) auto; padding-inline: 11px; }
  .calendar-agenda > section > div > button > .badge { display: none; }
  .calendar-agenda > section > div > button > b { grid-column: 3; }
  .detail-drawer { width: 100vw; }
  .detail-drawer .drawer-header { padding-inline: 15px; }
  .detail-drawer .drawer-body { padding: 15px; }
  .drawer-actions { justify-content: flex-start; }
  .progress-hero { grid-template-columns: 1fr auto; }
  .progress-hero .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .progress-hero .link-btn { grid-column: 1 / -1; justify-self: start; }
  .blocker-list { grid-template-columns: 1fr; }
  .modal-root:not(:empty) { align-items: end; padding: 0; }
  .modal-shell, .modal-shell:has(.modal-form--sm) { width: 100%; max-height: calc(100dvh - 24px); }
  .modal-form { width: 100%; max-height: calc(100dvh - 24px); border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation-name: sheet-in; }
  .modal-form .modal-header, .modal-form .modal-body, .modal-actions { padding-inline: 15px; }
  .modal-form .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .bu-choice-grid { grid-template-columns: 1fr; }
  .modal-actions { padding-bottom: max(13px, env(safe-area-inset-bottom)); }
  .popover { top: calc(var(--topbar-height) + 5px); right: 8px; width: calc(100vw - 16px); }
  .popover.profile-menu { display: grid; }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 108px; }
  .page-actions { grid-template-columns: 1fr; }
  .page-actions > .segmented { grid-column: auto; }
  .filter-bar > label, .filter-bar--wrap > label { flex-basis: 100%; }
  .segmented button { flex: 1; padding-inline: 7px; }
  .detail-grid { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; }
  .section-heading .btn { width: 100%; }
  .evidence-list article { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .evidence-list article .icon-btn:last-child { grid-column: 3; }
}

/* Semantic variants emitted by CAPA and work-item renderers. */
.badge--correction { background: var(--coral-100); color: var(--red-800); }
.badge--corrective_action { background: #fff0e0; color: #92510b; }
.badge--preventive_action { background: #e4f3ff; color: #23628c; }
.badge--action_plan_review, .badge--pending_verification { background: var(--warning-100); color: var(--warning-800); }
.badge--implementation { background: #f2eaff; color: #6d3baa; }
.badge--effectiveness_monitoring { background: var(--success-100); color: var(--success-700); }
.badge--reopened { background: #eee8ff; color: #5d428d; }
.badge--void { background: var(--ink-100); color: var(--ink-600); }

.workflow-hint {
  display: inline-flex;
  max-width: 36ch;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-sm);
  background: var(--ink-50);
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 650;
}

.action-evidence { margin-top: 12px; }
.action-evidence .btn { width: 100%; justify-content: center; }

.task-row--on_track td:first-child, .task-row--completed td:first-child { box-shadow: inset 3px 0 0 var(--success-700); }
.task-row--cancelled, .task-row--archived { opacity: .72; }
.due--on_track, .due--completed { color: var(--success-700) !important; font-weight: 700 !important; }
.due--cancelled, .due--archived { color: var(--ink-500) !important; }

@media print {
  .btn, .icon-btn, .link-btn, .filter-bar, .segmented, .result-summary, .popover, .detail-drawer, .drawer-backdrop, .modal-form, .info-banner { display: none !important; }
  .page-header h1 { color: #000; font-size: 18pt; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 3mm; }
  .kpi-card { min-height: 25mm; break-inside: avoid; border-color: #aaa; padding: 3mm; }
  .kpi-card::before { background: #777 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dashboard-grid, .dashboard-grid--wide, .dashboard-grid:not(.dashboard-grid--wide), .attention-page, .master-grid { display: block; }
  .dashboard-grid > *, .attention-page > *, .master-grid > * { margin-bottom: 4mm; break-inside: avoid; }
  .table-card { overflow: visible; border-color: #aaa; }
  .table-scroll { overflow: visible; }
  .table-card .data-table { min-width: 0; }
  .report-sheet { border: 0; padding: 0; }
  .report-kpis { grid-template-columns: repeat(6, 1fr); border-color: #999; }
  .report-kpis > div { min-height: 18mm; }
  .timeline--audit { border-color: #aaa; }
  .badge, .bu-chip { border: 1px solid #888; background: #fff !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
