:root {
  color-scheme: light;
  --page: #edf3f8;
  --page-strong: #e4ecf4;
  --surface: #ffffff;
  --surface-soft: #eaf4ff;
  --ink: #071c34;
  --ink-soft: #18314f;
  --muted: #586a82;
  --line: #d9e3ee;
  --green: #21b785;
  --green-soft: #ddf6ed;
  --blue: #2474df;
  --blue-soft: #e4f0ff;
  --amber: #ff9f3f;
  --amber-soft: #fff1df;
  --red: #f3474b;
  --red-soft: #ffe5e6;
  --violet: #6956c7;
  --navy: #081b3a;
  --navy-soft: #102a54;
  --shadow: 0 18px 42px rgba(29, 58, 92, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.resize-none {
  resize: none;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.brand-block {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.42rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.wide {
  width: 100%;
}

.metric-card > div > span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 2.1rem;
  line-height: 1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 64px 286px minmax(0, 1fr);
  background: var(--page);
}

.app-rail {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 10px;
  background: linear-gradient(180deg, #071833 0%, #102a54 100%);
  color: #fff;
}

.rail-logo,
.rail-button,
.rail-avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.rail-logo {
  background: #ffffff;
  color: var(--navy);
}

.rail-button {
  background: transparent;
  color: #f1f7ff;
  cursor: pointer;
}

.rail-button:hover,
.rail-button.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.rail-spacer {
  flex: 1;
}

.rail-avatar {
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(145deg, #2474df, #21b785);
  color: #fff;
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #e8f3ff 0%, #ffffff 42%, #ffffff 100%);
}

.brand-block h1 {
  color: var(--ink);
}

.brand-mark {
  background: linear-gradient(145deg, var(--blue), #0c52b8);
  box-shadow: 0 14px 26px rgba(36, 116, 223, 0.22);
}

.sidebar-search {
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(38, 72, 112, 0.08);
}

.sidebar-search span {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.sidebar-search input {
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
}

.sidebar-search input::placeholder,
.search-field input::placeholder {
  color: #4d647e;
  opacity: 1;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-section-title {
  margin: 2px 0 3px 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  color: #344a68;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.is-active {
  background: #dceeff;
  color: var(--blue);
}

.nav-item.is-active .nav-icon {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.sidebar-status {
  margin-top: auto;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(29, 58, 92, 0.08);
}

.quick-actions-card {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border: 1px solid #ffd8a7;
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff6ea, #ffffff);
  text-align: center;
}

.quick-actions-card p {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 800;
}

.quick-actions-card button {
  min-height: 36px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.quick-actions-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.sidebar-status strong,
.sidebar-status span {
  display: block;
}

.sidebar-status strong {
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.sidebar-status span {
  color: var(--muted);
  font-size: 0.78rem;
}

.workspace {
  min-width: 0;
  padding: 0 0 32px;
  background: var(--page);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  margin-bottom: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 10px;
}

.search-field {
  width: min(30vw, 360px);
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.search-field span {
  text-align: center;
  font-size: 1.15rem;
}

.search-field input {
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-button {
  width: 44px;
  height: 44px;
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.notification-count {
  min-width: 18px;
  height: 18px;
  position: absolute;
  top: -2px;
  right: -2px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.primary-action,
.secondary-action,
.mini-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-actions .primary-action {
  min-width: 146px;
}

.primary-action {
  background: linear-gradient(180deg, #2474df, #1456b7);
  color: #fff;
  box-shadow: 0 12px 22px rgba(36, 116, 223, 0.2);
}

.secondary-action,
.mini-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.compact {
  padding: 0 12px;
}

.mini-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.notification-panel {
  width: min(380px, calc(100vw - 32px));
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 4;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-item {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding: 12px 0 0;
  margin-top: 12px;
}

.notification-item span,
.notification-item p {
  color: var(--muted);
  margin: 0;
}

.breadcrumb-bar {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  background: #fff;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumb-bar strong {
  color: var(--blue);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
  padding: 26px 28px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h3 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  letter-spacing: 0;
}

.overview-showcase {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(210px, 0.7fr) minmax(210px, 0.7fr);
  gap: 16px;
  margin-bottom: 16px;
}

.showcase-card,
.mini-insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.showcase-card {
  min-height: 182px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.26), transparent 22%),
    linear-gradient(145deg, #0b1d3b, #1766d3);
  color: #fff;
}

.showcase-card h4 {
  margin: 0 0 10px;
  font-size: 1.75rem;
}

.showcase-card p {
  max-width: 520px;
  margin-bottom: 0;
  color: #d9e8ff;
  line-height: 1.45;
}

.showcase-label {
  display: inline-flex;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.showcase-button {
  min-height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.mini-insight-card {
  min-height: 182px;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 20px;
  background: #fff;
}

.mini-insight-card.blue {
  background:
    radial-gradient(circle at 75% 16%, rgba(33, 183, 133, 0.12), transparent 30%),
    #fff;
}

.insight-icon {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(36, 116, 223, 0.15);
}

.mini-insight-card.blue .insight-icon {
  background: var(--green-soft);
  color: var(--green);
}

.mini-insight-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.date-pill,
.segmented-control,
.button-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-pill {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.segmented-control {
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented-control button {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented-control .is-selected {
  background: var(--ink);
  color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.kanban-column,
.member-card,
.alert-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 136px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 16px;
  position: relative;
  padding: 18px;
  overflow: hidden;
}

.metric-card > div {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.kpi-ring {
  width: 74px;
  height: 74px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--ring-color) var(--ring-value), #e5edf6 0);
  box-shadow: inset 0 0 0 1px rgba(7, 28, 52, 0.04);
}

.kpi-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(7, 28, 52, 0.04);
}

.kpi-ring b {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1;
}

.accent-green {
  border-top: 4px solid var(--green);
  --ring-color: var(--green);
}

.accent-blue {
  border-top: 4px solid var(--blue);
  --ring-color: var(--blue);
}

.accent-amber {
  border-top: 4px solid var(--amber);
  --ring-color: var(--amber);
}

.accent-red {
  border-top: 4px solid var(--red);
  --ring-color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.span-5 {
  grid-column: span 5;
}

.span-7 {
  grid-column: span 7;
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header.tight {
  margin-bottom: 0;
}

h4 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.panel-header span,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.timeline-list {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.timeline-list p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.timeline-list time {
  color: var(--muted);
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 0.78rem;
}

.timeline-step,
.check {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.timeline-step {
  width: 32px;
  height: 32px;
}

.timeline-step.done,
.check.done {
  background: var(--green-soft);
  color: var(--green);
}

.timeline-step.active,
.check.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.timeline-step.warning,
.check.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.mini-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #edf3f8;
}

.mini-chart span {
  min-height: 20px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--green), #75c9a7);
}

.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.amber {
  background: var(--amber);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 22px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 14px;
  border-top: 3px solid rgba(7, 28, 52, 0.45);
  background: #dfe4e9;
  box-shadow: none;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column h4 {
  font-size: 0.98rem;
}

.kanban-column header span {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.ticket-card {
  min-height: 166px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 24px rgba(20, 48, 82, 0.1);
}

.ticket-card.critical,
.ticket-card.high {
  border-left-color: var(--red);
}

.ticket-card.medium {
  border-left-color: var(--amber);
}

.ticket-card.low {
  border-left-color: var(--green);
}

.ticket-card.done {
  border-left-color: var(--violet);
}

.ticket-card header {
  display: grid;
  gap: 7px;
}

.ticket-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ticket-meta,
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ticket-actions {
  justify-content: space-between;
}

.chip,
.status-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-label.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-label.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-label.done {
  background: var(--green-soft);
  color: var(--green);
}

.check-list,
.plain-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.plain-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.check {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  margin-right: 10px;
}

.capacity-list {
  display: grid;
  gap: 15px;
}

.capacity-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--surface-soft);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--green);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.bar-chart {
  height: 300px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 14px;
  padding: 16px 16px 42px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.bar-chart span {
  height: var(--value);
  min-height: 34px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--blue), #8fb1ff);
}

.bar-chart b {
  position: absolute;
  bottom: -26px;
  color: var(--muted);
  font-size: 0.8rem;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quality-grid div {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.quality-grid strong {
  font-size: 1.9rem;
}

.quality-grid span {
  color: var(--muted);
}

.integration-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.integration-logo {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.integration-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.mapping-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.mapping-grid span,
.mapping-grid strong {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.mapping-grid span {
  color: var(--muted);
}

.alerts-list,
.team-grid {
  display: grid;
  gap: 16px;
}

.alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-left: 4px solid var(--blue);
}

.alert-row.critical {
  border-left-color: var(--red);
}

.alert-row.warning {
  border-left-color: var(--amber);
}

.alert-row p {
  margin: 5px 0 0;
  color: var(--muted);
}

.switch {
  width: 54px;
  height: 30px;
  position: relative;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}

.switch span::after {
  content: "";
  width: 24px;
  height: 24px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(24px);
}

.team-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.member-card {
  min-height: 190px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.avatar {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.avatar.teal {
  background: var(--green);
}

.avatar.blue {
  background: var(--blue);
}

.avatar.amber {
  background: var(--amber);
}

.avatar.red {
  background: var(--red);
}

.member-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.modal {
  width: min(780px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(16, 21, 20, 0.42);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compact-modal {
  max-width: 560px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  font-size: 1.55rem;
}

.ticket-detail-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-detail-strip[hidden] {
  display: none;
}

.ticket-detail-strip span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.ticket-detail-strip strong {
  color: var(--blue);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.span-all {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 700;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green), transparent 60%);
  outline-offset: 3px;
}

@media print {
  .sidebar,
  .topbar-actions,
  .section-heading button,
  .modal,
  .toast {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .workspace {
    padding: 0;
  }

  .view-panel {
    display: block;
    break-inside: avoid;
    margin-bottom: 18px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-rail {
    min-height: auto;
    position: static;
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px 16px;
  }

  .rail-spacer {
    display: none;
  }

  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .sidebar-status {
    margin-top: 0;
  }

  .quick-actions-card {
    margin-top: 0;
  }

  .metric-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-5,
  .span-7 {
    grid-column: span 12;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: auto;
    padding: 16px;
  }

  .breadcrumb-bar {
    padding: 0 16px;
  }

  .view-panel.is-active {
    padding: 20px 16px 0;
  }

  .overview-showcase {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 88px;
    align-items: stretch;
  }

  .topbar-actions .search-field {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar-actions .icon-button {
    width: 100%;
  }

  .topbar-actions .primary-action {
    width: 100%;
  }

  .topbar-actions .secondary-action {
    width: 100%;
  }

  .notification-panel {
    right: auto;
    left: 0;
  }

  .kanban-board {
    grid-template-columns: repeat(4, minmax(260px, 82vw));
  }
}

@media (max-width: 640px) {
  .app-rail {
    overflow-x: auto;
  }

  .workspace,
  .sidebar {
    padding: 16px;
  }

  .workspace {
    padding: 0 0 24px;
  }

  .brand-block {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .nav-list,
  .metric-grid,
  .team-grid,
  .quality-grid,
  .mapping-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-section-title {
    grid-column: 1 / -1;
  }

  .nav-item {
    min-height: 42px;
  }

  .metric-card {
    min-height: 126px;
    grid-template-columns: minmax(0, 1fr) 66px;
  }

  .kpi-ring {
    width: 64px;
    height: 64px;
  }

  .quick-actions-card,
  .sidebar-status {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .span-5,
  .span-7 {
    grid-column: auto;
  }

  .timeline-list li {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .timeline-list time {
    grid-column: 2;
  }

  .capacity-list div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .alert-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .primary-action,
  .modal-actions .secondary-action {
    width: 100%;
  }
}

/* Premium visual direction: analytical light surfaces with an operational dark mode. */
:root {
  --page: #eef3f8;
  --page-strong: #e3ebf4;
  --surface: #ffffff;
  --surface-soft: #edf4fb;
  --ink: #10213d;
  --ink-soft: #29405f;
  --muted: #60728b;
  --line: #dbe5ef;
  --green: #14b88a;
  --green-soft: #dcf7ed;
  --blue: #3564f5;
  --blue-soft: #e5edff;
  --amber: #f3a33b;
  --amber-soft: #fff1dc;
  --red: #ef5b67;
  --red-soft: #ffe6e9;
  --violet: #765ee8;
  --navy: #10213d;
  --navy-soft: #203a5e;
  --shadow: 0 16px 38px rgba(26, 55, 90, 0.1);
  --shadow-soft: 0 8px 22px rgba(26, 55, 90, 0.07);
  --radius: 10px;
  --kpi-track: #e4ecf5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1525;
  --page-strong: #14213a;
  --surface: #151f32;
  --surface-soft: #1b2a41;
  --ink: #f4f8ff;
  --ink-soft: #d4deed;
  --muted: #9aabc1;
  --line: #2a3c58;
  --green-soft: #143d3a;
  --blue-soft: #1a315f;
  --amber-soft: #44321b;
  --red-soft: #48242c;
  --navy: #0c1830;
  --navy-soft: #1d3d69;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.18);
  --kpi-track: #293b56;
}

html,
body,
.app-shell,
.workspace,
.sidebar,
.topbar,
.breadcrumb-bar,
.metric-card,
.panel,
.mini-insight-card,
.date-pill,
.segmented-control,
.search-field,
.icon-button,
.secondary-action,
.mini-action,
input,
select,
textarea {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

html {
  color-scheme: light;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  color: var(--ink);
}

input,
select,
textarea {
  border-color: var(--line);
  background: var(--surface);
}

.app-shell {
  grid-template-columns: 64px 286px minmax(0, 1fr);
  background: var(--page);
}

.app-rail {
  background: linear-gradient(180deg, #0c1830 0%, #19335d 100%);
}

.rail-logo {
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.rail-button {
  border-radius: 12px;
}

.rail-button:hover,
.rail-button.is-active {
  background: rgba(108, 165, 255, 0.22);
}

.sidebar {
  background: linear-gradient(180deg, #f2f7fc 0%, #ffffff 48%, #ffffff 100%);
}

:root[data-theme="dark"] .sidebar {
  background: #101a2d;
}

.brand-block h1,
.nav-section-title,
.nav-item,
.quick-actions-card p {
  color: var(--ink);
}

.brand-mark {
  border-radius: 12px;
  background: var(--blue);
  box-shadow: 0 14px 26px rgba(53, 100, 245, 0.22);
}

.sidebar-search,
.sidebar-status,
.quick-actions-card {
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.sidebar-search {
  background: var(--surface);
}

.nav-item {
  border-radius: 12px;
  color: var(--muted);
}

.nav-icon {
  border-color: var(--line);
  color: var(--blue);
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-item.is-active .nav-icon {
  border-color: var(--blue);
  background: var(--blue);
}

.quick-actions-card {
  border-color: #ffd8a7;
  background: linear-gradient(180deg, #fff4e4 0%, var(--surface) 100%);
}

:root[data-theme="dark"] .quick-actions-card {
  border-color: #5f482a;
  background: #282436;
}

:root[data-theme="dark"] .mini-insight-card.blue {
  background: var(--surface);
}

.workspace {
  background: var(--page);
}

.topbar,
.breadcrumb-bar {
  background: var(--surface);
}

.topbar {
  min-height: 74px;
  border-color: var(--line);
}

.breadcrumb-bar {
  border-bottom: 1px solid var(--line);
}

.search-field,
.icon-button,
.secondary-action,
.mini-action,
.date-pill,
.segmented-control {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.icon-button:hover,
.secondary-action:hover,
.mini-action:hover,
.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.theme-toggle {
  font-size: 1.1rem;
}

.primary-action {
  background: var(--blue);
  box-shadow: 0 10px 20px rgba(53, 100, 245, 0.2);
}

.primary-action:hover,
.showcase-button:hover,
.quick-actions-card button:hover {
  filter: brightness(1.06);
}

.notification-panel {
  border-color: var(--line);
  background: var(--surface);
}

.overview-showcase {
  gap: 18px;
}

.showcase-card,
.mini-insight-card,
.metric-card,
.panel,
.kanban-column,
.member-card,
.alert-row {
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.showcase-card {
  background: #173a72;
  box-shadow: 0 18px 38px rgba(26, 55, 90, 0.2);
}

.showcase-label {
  background: rgba(255, 255, 255, 0.12);
  letter-spacing: 0;
}

.showcase-button {
  border-radius: 9px;
  background: #ffffff;
  color: var(--blue);
}

.mini-insight-card,
.metric-card,
.panel,
.member-card,
.alert-row {
  background: var(--surface);
}

.metric-card {
  min-height: 148px;
  border-top-width: 4px;
}

.metric-card strong {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

.kpi-ring {
  background: conic-gradient(var(--ring-color) var(--ring-value), var(--kpi-track) 0);
}

.kpi-ring::after {
  background: var(--surface);
}

.kpi-ring b {
  color: var(--ink);
  font-family: "IBM Plex Mono", Consolas, "Courier New", ui-monospace, monospace;
}

.mini-chart,
.bar-chart,
.quality-grid div,
.integration-card,
.mapping-grid span,
.mapping-grid strong {
  background: var(--surface-soft);
}

.mini-chart {
  border: 1px solid var(--line);
}

.segmented-control .is-selected {
  background: var(--ink);
  color: var(--surface);
}

.kanban-board {
  gap: 18px;
}

.kanban-column {
  min-height: 560px;
  border-top: 3px solid var(--blue);
  background: var(--page-strong);
  box-shadow: none;
}

.ticket-card {
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

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

.chip,
.status-label {
  border: 1px solid transparent;
}

.table-wrap {
  scrollbar-gutter: stable;
}

th {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.modal-card {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.toast {
  border-color: var(--line);
  background: var(--surface);
}

@media (max-width: 640px) {
  .topbar-actions {
    grid-template-columns: 54px 54px minmax(0, 1fr);
  }

  .topbar-actions .theme-toggle,
  .topbar-actions .icon-button {
    width: 100%;
  }

  .topbar-actions .primary-action {
    grid-column: 3;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar-actions {
    width: 100%;
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .ticket-card:hover {
    transform: none;
  }
}

/* Priority 0: clear validation and recovery feedback. */
.field-error {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

label > .field-error[hidden] {
  display: none;
}

input.has-error,
select.has-error,
textarea.has-error,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.empty-state {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.empty-state strong {
  display: block;
  color: var(--ink);
}

.empty-state p {
  margin: 6px 0 0;
}

.confirm-description {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.danger-action {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #ffffff !important;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toast > span {
  flex: 1 1 auto;
}

.toast-action {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.toast-action:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.toast[hidden] {
  display: none;
}

button[aria-busy="true"] {
  cursor: progress;
}

@media (max-width: 560px) {
  .toast {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .toast-action {
    width: 100%;
  }
}

/* Priority 1: activity history and explicit team roles. */
.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:first-child {
  padding-top: 0;
}

.history-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.history-item-content {
  min-width: 0;
}

.history-item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.history-item-heading time {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 0.78rem;
}

.history-item p {
  margin: 5px 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.history-actor,
.role-badge,
.demo-disclosure {
  color: var(--muted);
  font-size: 0.76rem;
}

.history-actor,
.role-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.member-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.member-heading strong {
  min-width: 0;
}

.demo-disclosure {
  display: block;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .history-item-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.data-source-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.data-source-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.data-source-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.data-source-card .button-group {
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .data-source-card .button-group,
  .data-source-card .button-group button {
    width: 100%;
  }
}
