:root {
  --navy-950: #061522;
  --navy-900: #081c2d;
  --navy-850: #0b263b;
  --navy-800: #10344d;
  --blue-700: #0b5b85;
  --cyan-600: #009fc4;
  --cyan-500: #16b9d4;
  --cyan-100: #dff8fc;
  --ink: #132b3e;
  --muted: #687b8b;
  --muted-2: #91a0ac;
  --line: #dfe7ec;
  --line-soft: #edf2f5;
  --surface: #ffffff;
  --canvas: #f3f7f9;
  --danger: #c43f4f;
  --danger-bg: #fff0f2;
  --warning: #b86d0d;
  --warning-bg: #fff6e6;
  --success: #16805f;
  --success-bg: #e8f7f1;
  --info: #17739b;
  --info-bg: #e9f6fb;
  --shadow: 0 8px 28px rgba(11, 38, 59, .075);
  --radius: 16px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(22, 185, 212, .42);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -80px;
  background: white;
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: top .18s ease;
}
.skip-link:focus { top: 16px; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 23px 16px 18px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: white;
  box-shadow: 16px 0 46px rgba(2, 19, 31, .08);
}

.brand, .mobile-brand { display: flex; align-items: center; gap: 11px; }
.brand { padding: 0 7px 20px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  color: var(--navy-950);
  background: linear-gradient(145deg, #37d4e6, #8df0ee);
  box-shadow: 0 9px 22px rgba(22, 185, 212, .22);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.brand strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand span { display: block; color: #7bd9e4; font-size: 14px; font-weight: 650; letter-spacing: .06em; }

.demo-stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 7px 24px;
  color: #a9becb;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.demo-stamp span { width: 7px; height: 7px; border-radius: 999px; background: var(--cyan-500); box-shadow: 0 0 0 4px rgba(22, 185, 212, .12); }

.nav-label {
  margin: 0 10px 9px;
  color: #708898;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.role-nav { display: grid; gap: 4px; }
.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #adc0cc;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: white; transform: translateX(2px); }
.nav-item.is-active { background: linear-gradient(90deg, rgba(22,185,212,.17), rgba(22,185,212,.07)); border-color: rgba(94, 220, 230, .19); color: white; }
.nav-item.is-active svg { color: #58dbe6; }
.nav-item span:nth-of-type(1) { font-size: 14px; font-weight: 680; }
.nav-count { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.07); color: #8fa7b5; font-size: 11px; text-align: center; }
.nav-item.is-active .nav-count { background: rgba(22,185,212,.18); color: #7ce5eb; }

.sidebar-source { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-source > div {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: #b0c0ca;
  font-size: 12px;
}
.sidebar-source small { color: #708999; font-size: 11px; }
.source-dot { width: 7px; height: 7px; border-radius: 999px; }
.source-ok { background: #3ed1a2; }
.source-info { background: #49bddf; }
.source-warn { background: #eba846; }

.sidebar-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.07); color: #78909e; font-size: 11px; }
.sidebar-footer span { color: #9fb1bc; font-weight: 650; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255,255,255,.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.breadcrumb svg { width: 15px; height: 15px; color: var(--muted-2); }
.breadcrumb strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  height: 39px;
  padding: 0 10px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.global-search svg { width: 17px; height: 17px; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.global-search input::placeholder { color: #8e9daa; }
kbd { padding: 2px 6px; border: 1px solid #d5dfe5; border-radius: 5px; background: white; color: var(--muted-2); font-family: inherit; font-size: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: #526a7a;
  cursor: pointer;
}
.icon-button:hover { color: var(--cyan-600); border-color: #b8dbe4; background: #f9fdfe; }
.icon-button.is-loading svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-button.small { width: 32px; height: 32px; border: 0; background: var(--canvas); }
.notification-button > span { position: absolute; right: 7px; top: 7px; width: 7px; height: 7px; border: 2px solid white; border-radius: 99px; background: #e15865; }
.profile { display: flex; align-items: center; gap: 9px; padding: 0 6px 0 0; border: 0; background: transparent; cursor: pointer; }
.profile > span:first-child { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: var(--navy-900); color: white; font-size: 12px; font-weight: 800; }
.profile-copy { display: grid; text-align: left; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: var(--muted); font-size: 11px; }
.profile svg { width: 15px; height: 15px; color: var(--muted-2); }
.mobile-brand, .menu-button { display: none; }

main { width: min(1600px, 100%); margin: 0 auto; padding: 31px 34px 18px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.eyebrow-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.demo-badge { padding: 4px 8px; border-radius: 5px; background: var(--cyan-100); color: #087a95; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
h1 { margin: 0; color: var(--navy-900); font-size: clamp(27px, 2.2vw, 36px); line-height: 1.1; letter-spacing: -.035em; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; gap: 9px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.button:hover { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--cyan-600); color: white; box-shadow: 0 7px 18px rgba(0,159,196,.18); }
.button-primary:hover { background: #008eb0; }
.button-secondary { border-color: var(--line); background: white; color: #405b6d; }
.button-secondary:hover { border-color: #b8d4de; background: #fbfdfe; }
.button-dark { background: var(--navy-900); color: white; }
.button-dark:hover { background: var(--navy-800); }
.button.full { width: 100%; }
.small-button { min-height: 35px; padding: 7px 12px; }

.source-banner {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 19px;
  padding: 11px 13px;
  border: 1px solid #cde8ee;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0fbfd, #f7fcfd);
}
.source-banner-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: white; color: var(--cyan-600); box-shadow: 0 4px 12px rgba(0,159,196,.1); }
.source-banner > div:nth-child(2) { display: grid; }
.source-banner strong { color: #17506a; font-size: 13px; }
.source-banner span { color: #5a7887; font-size: 12px; }
.sync-state { display: flex; align-items: center; gap: 7px; color: #597583; font-size: 11px; white-space: nowrap; }
.sync-state > span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22,128,95,.09); }
.sync-state strong { font-size: 11px; }

.view-panel { display: none; }
.view-panel.is-active { display: block; animation: reveal .22s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.kpi-grid { display: grid; gap: 14px; margin-bottom: 15px; }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card {
  min-width: 0;
  padding: 17px 17px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 680; }
.icon-tile { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border-radius: 9px; }
.icon-tile svg { width: 18px; height: 18px; }
.icon-tile.navy { background: #eaf0f4; color: var(--navy-800); }
.icon-tile.cyan { background: var(--cyan-100); color: var(--cyan-600); }
.icon-tile.red { background: var(--danger-bg); color: var(--danger); }
.icon-tile.amber { background: var(--warning-bg); color: var(--warning); }
.icon-tile.green { background: var(--success-bg); color: var(--success); }
.kpi-value { display: block; margin-top: 4px; color: var(--navy-900); font-size: 31px; line-height: 1.18; letter-spacing: -.04em; }
.muted-value { color: #9eacb6; }
.kpi-card p { min-height: 22px; margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.trend { font-weight: 750; }
.trend.bad { color: var(--danger); }

.mini-chip, .status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
}
.mini-chip { padding: 3px 7px; font-size: 10px; }
.status { padding: 5px 9px; font-size: 11px; }
.mini-chip.info, .status.info { background: var(--info-bg); color: var(--info); }
.mini-chip.danger, .status.danger { background: var(--danger-bg); color: var(--danger); }
.mini-chip.warn, .status.warn { background: var(--warning-bg); color: var(--warning); }
.mini-chip.neutral, .status.neutral { background: #eff3f6; color: #627687; }
.status.good { background: var(--success-bg); color: var(--success); }

.content-grid { display: grid; gap: 15px; }
.ceo-grid { grid-template-columns: minmax(0, 1.65fr) minmax(310px, .8fr); }
.wide-left { grid-template-columns: minmax(0, 1.8fr) minmax(300px, .72fr); }
.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 15px; }
.full-span { grid-column: 1 / -1; }
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2 { margin: 0; color: var(--navy-900); font-size: 15px; letter-spacing: -.015em; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.text-button, .row-action { border: 0; background: transparent; color: var(--info); cursor: pointer; font-size: 11px; font-weight: 750; }
.text-button:hover, .row-action:hover { color: var(--cyan-600); text-decoration: underline; }

.priority-list { display: grid; }
.priority-item {
  display: grid;
  grid-template-columns: 4px minmax(220px, 1fr) 88px 75px 18px;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 17px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: white;
  text-align: left;
  cursor: pointer;
}
.priority-item:last-child { border-bottom: 0; }
.priority-item:hover { background: #fbfdfe; }
.priority-severity { align-self: stretch; border-radius: 99px; background: #8aa1af; }
.priority-severity.critical { background: var(--danger); }
.priority-severity.warning { background: #e7a735; }
.priority-severity.normal { background: var(--cyan-500); }
.priority-main { display: grid; gap: 3px; min-width: 0; }
.priority-main strong { color: var(--navy-900); font-size: 12px; }
.priority-main small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.priority-item > svg { width: 16px; color: var(--muted-2); }
.owner { display: flex; align-items: center; gap: 7px; }
.owner b, .avatar, .person b { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #eaf2f6; color: #31576d; font-size: 9px; }
.owner small { color: var(--muted); font-size: 10px; }
.deadline { color: var(--muted); font-size: 10px; font-weight: 700; }
.deadline.overdue, .date.urgent { color: var(--danger); font-weight: 750; }

.flow-chart { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 22px; padding: 18px; }
.donut {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan-500) 0 33%, #407da0 33% 66%, #df5965 66% 83%, #3bb793 83% 100%);
  position: relative;
}
.donut::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: white; }
.donut > div { z-index: 1; display: grid; text-align: center; }
.donut strong { font-size: 26px; line-height: 1; }
.donut span { color: var(--muted); font-size: 10px; }
.legend { display: grid; gap: 8px; }
.legend > div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.legend > div strong { color: var(--ink); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.cyan-dot { background: var(--cyan-500); }.blue-dot { background: #407da0; }.red-dot { background: #df5965; }.green-dot { background: #3bb793; }
.panel-note { display: flex; align-items: center; gap: 8px; padding: 10px 17px; border-top: 1px solid var(--line-soft); background: #fafcfd; color: var(--muted); font-size: 10px; }
.panel-note svg { width: 15px; height: 15px; color: var(--info); }

.decision-panel { min-height: 220px; }
.timeline { padding: 4px 18px 15px; }
.timeline.compact { padding-top: 4px; }
.timeline > div { position: relative; display: grid; grid-template-columns: 13px 54px 1fr; gap: 8px; min-height: 56px; padding-top: 13px; }
.timeline > div:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 27px; bottom: -1px; width: 1px; background: var(--line); }
.timeline-dot { z-index: 1; width: 11px; height: 11px; margin-top: 2px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); background: #91a0ac; }
.timeline-dot.done { background: var(--success); box-shadow: 0 0 0 1px #93d8c0; }
.timeline-dot.pending { background: #e5a133; box-shadow: 0 0 0 1px #f1ce8f; }
.timeline-dot.danger { background: var(--danger); box-shadow: 0 0 0 1px #ecadb5; }
.timeline time { color: var(--muted); font-size: 10px; font-weight: 700; }
.timeline p { display: grid; gap: 2px; margin: 0; }
.timeline p strong { font-size: 11px; }
.timeline p small { color: var(--muted); font-size: 10px; }

.powerbi-panel { display: flex; flex-direction: column; justify-content: center; padding: 22px; background: linear-gradient(145deg, #0b263b, #071a2b); color: white; }
.powerbi-top { display: flex; align-items: center; gap: 13px; }
.powerbi-top h2 { margin: 4px 0 0; font-size: 17px; }
.powerbi-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #f3c74f; color: #5b4604; }
.powerbi-icon svg { width: 25px; height: 25px; }
.powerbi-panel p { margin: 14px 0 18px; color: #a9bfcc; font-size: 12px; line-height: 1.55; }
.powerbi-panel .button-dark { align-self: flex-start; background: white; color: var(--navy-900); }

.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); }
.segmented button { padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.segmented button.is-active { background: white; color: var(--ink); box-shadow: 0 2px 5px rgba(11,38,59,.09); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 14px; background: #f8fafb; color: #788a96; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--line-soft); color: #344f61; font-size: 11px; vertical-align: middle; white-space: nowrap; }
tbody tr:hover { background: #fbfdfe; }
td strong { display: block; color: var(--ink); font-size: 11px; }
td small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.table-wrap .status { padding: 4px 7px; font-size: 9px; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.select-filter { min-height: 35px; padding: 6px 29px 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #526a7a; font-size: 10px; }
.country { display: inline-grid; place-items: center; width: 24px; height: 20px; margin-right: 5px; border-radius: 5px; background: #eff4f7; color: #416376; font-size: 8px; font-weight: 800; }
.doc-progress, .bar-progress { display: inline-block; width: 54px; height: 5px; margin-right: 7px; border-radius: 99px; background: #e6edf1; overflow: hidden; vertical-align: middle; }
.doc-progress i, .bar-progress i { display: block; height: 100%; border-radius: inherit; background: var(--cyan-500); }
.person { display: flex; align-items: center; gap: 7px; }

.task-list { display: grid; padding: 5px 14px 11px; }
.task-list button { display: grid; grid-template-columns: 10px 1fr 28px; align-items: center; gap: 10px; padding: 11px 2px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.task-list button:last-child { border-bottom: 0; }
.task-list button:hover strong { color: var(--cyan-600); }
.task-list button > span:nth-child(2) { display: grid; gap: 2px; }
.task-list strong { font-size: 11px; }
.task-list small { color: var(--muted); font-size: 9px; }
.task-check, .notification-icon { width: 8px; height: 8px; border-radius: 50%; }
.danger-bg { background: var(--danger); }.warn-bg { background: #e5a133; }.neutral-bg { background: var(--cyan-500); }
.avatar { font-weight: 800; }

.workload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 19px; padding: 18px; }
.workload-grid > div > span { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.workload-grid b { font-size: 11px; }
.workload-grid em { color: var(--muted); font-size: 9px; font-style: normal; }
.workload-grid > div > div { height: 6px; border-radius: 99px; background: #e8eef2; overflow: hidden; }
.workload-grid i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-600), var(--cyan-500)); }

.document-checklist { padding-bottom: 9px; }
.progress-ring { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at center, white 55%, transparent 57%), conic-gradient(var(--cyan-500) 0 75%, #e5edf1 75%); color: var(--ink); font-size: 9px; font-weight: 800; }
.document-checklist label { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); color: #395466; font-size: 11px; }
.document-checklist label:last-child { border-bottom: 0; }
.document-checklist input { accent-color: var(--success); }
.document-checklist em { color: var(--success); font-size: 9px; font-style: normal; font-weight: 750; }
.document-checklist label.missing { background: #fffafb; }
.document-checklist label.missing em { color: var(--danger); }

.audit-warning {
  display: grid;
  grid-template-columns: 37px 1fr auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 15px;
  padding: 13px 15px;
  border: 1px solid #efd6a9;
  border-left: 4px solid #e5a133;
  border-radius: 12px;
  background: #fffaf1;
}
.audit-warning > svg { width: 25px; height: 25px; color: var(--warning); }
.audit-warning > div { display: grid; gap: 2px; }
.audit-warning strong { font-size: 12px; }
.audit-warning span:not(.status) { color: #786748; font-size: 11px; }
.compact-warning { padding-block: 10px; }

.cold-map { display: grid; gap: 9px; padding: 18px; }
.cold-map > div { display: grid; grid-template-columns: 54px repeat(4, 1fr); gap: 6px; align-items: center; }
.cold-map strong { color: var(--muted); font-size: 9px; }
.cell { display: grid; place-items: center; min-height: 37px; border: 1px dashed #cbd8df; border-radius: 7px; color: #8b9ba6; background: #f9fbfc; font-size: 8px; font-weight: 750; }
.cell.busy { border-style: solid; border-color: #6ed0dc; background: #e4f8fa; color: #0d7d94; }
.cell.reserved { border-style: solid; border-color: #efc471; background: #fff4dc; color: #9c6614; }
.map-legend { display: flex; gap: 14px; padding: 10px 18px 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend i { width: 8px; height: 8px; border: 1px dashed #cbd8df; border-radius: 2px; background: #f9fbfc; }
.map-legend i.busy { border: 1px solid #6ed0dc; background: #e4f8fa; }.map-legend i.reserved { border: 1px solid #efc471; background: #fff4dc; }

.risk-card { padding: 20px; }
.risk-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); }
.risk-card h3 { margin: 13px 0 5px; font-size: 16px; }
.risk-card > p { margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.risk-card dl { display: grid; gap: 8px; margin: 0 0 18px; }
.risk-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft); font-size: 10px; }
.risk-card dt { color: var(--muted); }.risk-card dd { margin: 0; color: var(--ink); font-weight: 750; }

.control-dots { display: inline-flex; gap: 3px; margin-right: 7px; }
.control-dots i { width: 7px; height: 7px; border-radius: 50%; background: #e4eaee; }
.control-dots i.done { background: var(--success); }.control-dots i.pending { background: #e4a13a; }
.gate-list { display: grid; padding: 8px 18px 17px; }
.gate { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.gate:last-child { border-bottom: 0; }
.gate > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; }
.gate > span svg { width: 16px; height: 16px; }
.gate.done > span { background: var(--success-bg); color: var(--success); }.gate.pending > span { background: var(--warning-bg); color: var(--warning); }
.gate p { display: grid; gap: 2px; margin: 0; }.gate strong { font-size: 11px; }.gate small { color: var(--muted); font-size: 9px; }
.gate-list + .button { width: calc(100% - 36px); margin: 0 18px 18px; }

.page-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 17px; padding: 12px 2px 0; color: #8a9aa5; font-size: 9px; }

.drawer-backdrop { position: fixed; z-index: 70; inset: 0; visibility: hidden; background: rgba(3,18,29,.46); opacity: 0; transition: opacity .2s ease, visibility .2s ease; }
.drawer-backdrop.is-open { visibility: visible; opacity: 1; }
.detail-drawer {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(450px, 92vw);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: white;
  box-shadow: -20px 0 60px rgba(3,18,29,.18);
  transform: translateX(105%);
  transition: transform .24s ease;
}
.detail-drawer.is-open { transform: translateX(0); }
.detail-drawer > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px; border-bottom: 1px solid var(--line); }
.detail-drawer h2 { margin: 7px 0 0; font-size: 21px; letter-spacing: -.025em; }
#drawer-content { overflow-y: auto; padding: 21px 22px; }
.detail-drawer > footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); }
.drawer-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 20px; }
.drawer-summary > div { padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: #f9fbfc; }
.drawer-summary span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.drawer-summary strong { display: block; margin-top: 4px; font-size: 12px; }
.drawer-section { margin-top: 20px; }
.drawer-section h3 { margin: 0 0 9px; font-size: 12px; }
.drawer-section p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.drawer-alert { display: flex; gap: 10px; padding: 12px; border: 1px solid #f0cbd0; border-radius: 10px; background: var(--danger-bg); color: #80323c; font-size: 11px; line-height: 1.5; }
.drawer-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.drawer-list li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; color: #40596a; font-size: 11px; }
.drawer-list li::before { content: ""; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--cyan-500); }

.notifications-popover {
  position: fixed;
  z-index: 60;
  top: 62px;
  right: 122px;
  width: min(360px, calc(100vw - 28px));
  visibility: hidden;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 18px 55px rgba(3,18,29,.17);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.notifications-popover.is-open { visibility: visible; opacity: 1; transform: translateY(0); }
.notifications-popover header { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.notifications-popover > button { display: grid; grid-template-columns: 9px 1fr; gap: 10px; width: 100%; padding: 13px 15px; border: 0; border-bottom: 1px solid var(--line-soft); background: white; text-align: left; cursor: pointer; }
.notifications-popover > button:hover { background: #fafcfd; }
.notifications-popover > button > span:last-child { display: grid; gap: 2px; }
.notifications-popover strong { font-size: 11px; }.notifications-popover small { color: var(--muted); font-size: 9px; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid #aee0d0;
  border-radius: 10px;
  background: #f0fbf7;
  color: #236b55;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 17px; height: 17px; }

.is-search-hidden, tr.is-search-hidden { display: none !important; }
.search-empty { padding: 30px 18px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1180px) {
  :root { --sidebar: 218px; }
  .topbar, main { padding-left: 24px; padding-right: 24px; }
  .global-search { min-width: 220px; }
  .profile-copy { display: none; }
  .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ceo-grid, .wide-left { grid-template-columns: 1fr; }
  .powerbi-panel { min-height: 220px; }
  .workload-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .sidebar { width: min(290px, 86vw); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .topbar { height: 64px; padding: 0 17px; }
  .mobile-brand { display: flex; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; font-size: 10px; }
  .mobile-brand strong { font-size: 14px; }
  .menu-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: white; }
  .breadcrumb, .global-search, .profile { display: none; }
  main { padding: 23px 17px 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .source-banner { grid-template-columns: 35px 1fr; }
  .sync-state { grid-column: 2; }
  .equal { grid-template-columns: 1fr; }
  .priority-item { grid-template-columns: 4px 1fr 18px; }
  .priority-item .owner, .priority-item .deadline { display: none; }
  .audit-warning { grid-template-columns: 32px 1fr; }
  .audit-warning .status { grid-column: 2; }
  .notifications-popover { right: 16px; top: 58px; }
}

@media (max-width: 560px) {
  .kpi-grid.four { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 29px; }
  .heading-actions { flex-direction: column; }
  .source-banner-icon { align-self: start; }
  .sync-state { flex-wrap: wrap; }
  .flow-chart { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .panel-header { flex-direction: column; }
  .panel-header .toolbar { width: 100%; flex-wrap: wrap; }
  .panel-header .toolbar .select-filter { flex: 1; }
  .segmented { align-self: stretch; }
  .segmented button { flex: 1; }
  .workload-grid { grid-template-columns: 1fr; }
  .page-footer { flex-direction: column; }
  .drawer-summary { grid-template-columns: 1fr; }
  .detail-drawer > footer { flex-direction: column-reverse; }
  .detail-drawer > footer .button { width: 100%; }
}

@media print {
  :root { --canvas: white; }
  .sidebar, .topbar, .heading-actions, .source-banner, .page-footer, .notifications-popover, .drawer-backdrop, .detail-drawer, .toast { display: none !important; }
  .workspace { margin: 0; }
  main { width: 100%; padding: 12px; }
  .view-panel:not(.is-active) { display: none !important; }
  .view-panel.is-active { display: block; }
  .page-heading { margin-bottom: 14px; }
  .kpi-card, .panel { box-shadow: none; break-inside: avoid; }
  .content-grid, .kpi-grid { gap: 9px; }
  .table-wrap { overflow: visible; }
  table { font-size: 9px; }
  .panel, .kpi-card { border-color: #ccd5db; }
}

.profile-menu {
  position: absolute;
  right: 24px;
  top: 72px;
  z-index: 80;
  width: 250px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(7, 26, 43, .18);
}
.profile-menu[hidden] { display: none; }
.profile-menu-identity { display: grid; gap: 3px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); }
.profile-menu-identity small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.profile-menu a,
.profile-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--navy); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.profile-menu a:hover,
.profile-menu button:hover { background: var(--soft-blue); }
.fatal-state { max-width: 620px; margin: 12vh auto; padding: 36px; }
