:root {
  --ph-bg: #0b1020;
  --ph-bg-soft: #10162a;
  --ph-surface: rgba(19, 22, 47, 0.82);
  --ph-surface-strong: #13162f;
  --ph-surface-alt: rgba(23, 29, 56, 0.92);
  --ph-surface-light: rgba(255, 255, 255, 0.04);
  --ph-border: rgba(255, 255, 255, 0.08);
  --ph-border-strong: rgba(255, 255, 255, 0.14);
  --ph-text: rgba(255, 255, 255, 0.92);
  --ph-text-soft: rgba(255, 255, 255, 0.72);
  --ph-text-dim: rgba(255, 255, 255, 0.48);
  --ph-green: #00a34f;
  --ph-green-soft: rgba(0, 163, 79, 0.16);
  --ph-gold: #ffd700;
  --ph-gold-soft: rgba(255, 215, 0, 0.14);
  --ph-sky: #60a5fa;
  --ph-sky-soft: rgba(96, 165, 250, 0.16);
  --ph-lime: #b7c958;
  --ph-danger: #ef4444;
  --ph-danger-soft: rgba(239, 68, 68, 0.14);
  --ph-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --ph-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.18);
  --ph-radius-xl: 28px;
  --ph-radius-lg: 22px;
  --ph-radius-md: 18px;
  --ph-radius-sm: 14px;
  --ph-sidebar-width: 292px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.52;
  color: var(--ph-text);
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 163, 79, 0.18), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(96, 165, 250, 0.16), transparent 24%),
    radial-gradient(circle at 60% 92%, rgba(255, 215, 0, 0.08), transparent 22%),
    linear-gradient(180deg, #0a0f1d 0%, #0c1222 40%, #090e1b 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

body.systems-page * {
  scrollbar-color: rgba(96, 165, 250, 0.34) rgba(255, 255, 255, 0.05);
}

body.systems-page *::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

body.systems-page *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.52), rgba(0, 163, 79, 0.48));
  border-radius: 999px;
  border: 2px solid rgba(8, 13, 27, 0.65);
}

body.systems-page *::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

body.systems-page.systems-idle,
body.systems-page.systems-idle * {
  cursor: none !important;
}

body.systems-page.systems-idle * {
  scrollbar-width: none !important;
}

body.systems-page.systems-idle *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

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

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--ph-sidebar-width) 1fr;
  min-height: 100vh;
}

.app-aurora {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.app-aurora-left {
  width: 260px;
  height: 260px;
  left: 64px;
  top: 56px;
  background: rgba(0, 163, 79, 0.18);
}

.app-aurora-right {
  width: 320px;
  height: 320px;
  right: 80px;
  top: 24px;
  background: rgba(96, 165, 250, 0.14);
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 4;
  padding: 24px 18px 22px;
}

.side-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(19, 22, 47, 0.94) 0%, rgba(14, 19, 40, 0.96) 100%);
  border: 1px solid var(--ph-border);
  border-radius: 30px;
  padding: 22px 18px;
  box-shadow: var(--ph-shadow);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ph-border);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(0, 163, 79, 0.28), rgba(255, 215, 0, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--ph-text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-profile,
.side-section,
.hero-card,
.metric-card,
.section-card,
.table-card,
.system-card,
.summary-card,
.automation-card,
.form-card,
.worker-card,
.insight-card,
.request-card {
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-lg);
  backdrop-filter: blur(18px);
  box-shadow: var(--ph-shadow-soft);
}

.side-profile {
  padding: 14px 16px;
}

.side-profile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.side-label,
.menu-title,
.section-label,
.metric-label,
.table-label,
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ph-text-dim);
}

.side-badge,
.mini-badge,
.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ph-border);
  color: var(--ph-text-soft);
  background: rgba(255, 255, 255, 0.04);
}

.side-profile strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.side-profile small {
  display: block;
  color: var(--ph-text-soft);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 4px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--ph-text-soft);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.menu-link:hover,
.menu-link.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--ph-border);
  color: var(--ph-text);
  transform: translateX(2px);
}

.menu-link.active {
  box-shadow: inset 0 0 0 1px rgba(0, 163, 79, 0.18);
}

.menu-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.side-section {
  padding: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.side-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.side-section-head span {
  color: var(--ph-text-soft);
  font-size: 12px;
  font-weight: 600;
}

.system-shortcuts {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.system-shortcut {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.system-shortcut:hover,
.system-shortcut.active {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.system-shortcut-dot,
.dot,
.status-dot,
.userbar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
}

.system-shortcut-copy {
  display: block;
  min-width: 0;
}

.system-shortcut-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.system-shortcut-copy small {
  display: block;
  margin-top: 4px;
  color: var(--ph-text-dim);
  font-size: 11px;
  line-height: 1.45;
}

.empty-shortcuts {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--ph-text-dim);
  font-size: 12px;
  text-align: center;
}

.main {
  position: relative;
  z-index: 1;
  padding: 28px 30px 36px 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 24px;
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-xl);
  background: linear-gradient(180deg, rgba(19, 22, 47, 0.74) 0%, rgba(12, 17, 34, 0.8) 100%);
  backdrop-filter: blur(18px);
  box-shadow: var(--ph-shadow-soft);
}

.topbar-copy h1 {
  margin: 8px 0 4px;
  font-size: clamp(20px, 1.65vw, 28px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.topbar-copy p {
  margin: 0;
  max-width: 720px;
  color: var(--ph-text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 163, 79, 0.14);
  border: 1px solid rgba(0, 163, 79, 0.24);
  color: var(--ph-lime);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.userbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.userbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ph-border);
  font-size: 12px;
  color: var(--ph-text-soft);
}

.userbar-dot {
  background: var(--ph-green);
  box-shadow: 0 0 14px rgba(0, 163, 79, 0.44);
}

.userbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--ph-text-soft);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.userbar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ph-border-strong);
  color: var(--ph-text);
}

.page-body {
  display: grid;
  gap: 18px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.msg {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(96, 165, 250, 0.08);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
}

.msg.error {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  padding: 24px;
}

.hero-card.compact {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.hero-copy h2,
.section-title {
  margin: 0;
  font-size: clamp(20px, 1.5vw, 26px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.hero-copy p {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--ph-text-soft);
  font-size: 13px;
  line-height: 1.8;
}

.hero-actions,
.section-actions,
.chips,
.status-line,
.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 18px;
}

.hero-kpis {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-kpis .summary-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.hero-aside,
.chart-card,
.summary-card,
.insight-card {
  padding: 18px;
}

.hero-aside {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 132px;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 163, 79, 0.16), transparent 68%);
  pointer-events: none;
}

.metric-label {
  margin-bottom: 16px;
}

.metric-value {
  font-size: clamp(22px, 1.65vw, 30px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.metric-value[data-tone="success"] {
  color: #c7f9d8;
}

.metric-value[data-tone="gold"] {
  color: #ffe68f;
}

.metric-value[data-tone="sky"] {
  color: #dbeafe;
}

.metric-meta,
.item-meta,
.subtle,
.muted,
.empty-state,
.form-help,
.card-note {
  color: var(--ph-text-dim);
  font-size: 12px;
  line-height: 1.65;
}

.metric-meta {
  margin-top: 8px;
}

.section-card,
.table-card,
.form-card,
.summary-card,
.system-card,
.worker-card,
.automation-card,
.request-card,
.panel {
  padding: 20px;
}

.section-header,
.table-head,
.card-head,
.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-copy,
.card-copy {
  min-width: 0;
}

.section-copy h3,
.card-copy h3,
.table-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-copy p,
.table-head p,
.card-copy p {
  margin: 8px 0 0;
  color: var(--ph-text-dim);
  font-size: 12px;
  line-height: 1.7;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.dashboard-local-grid {
  align-items: start;
}

.dashboard-local-grid .section-card,
.dashboard-local-grid .summary-card {
  height: 100%;
}

.cards-grid,
.dashboard-system-grid,
.summary-grid,
.worker-grid,
.system-portfolio-grid,
.automation-grid,
.request-grid,
.stat-cards {
  display: grid;
  gap: 14px;
}

.dashboard-system-grid,
.cards-grid,
.summary-grid,
.system-portfolio-grid,
.automation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.worker-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.system-card {
  display: grid;
  gap: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.system-card[href]:hover,
.summary-card:hover,
.automation-card:hover,
.request-card:hover {
  transform: translateY(-2px);
  border-color: var(--ph-border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.is-clickable {
  cursor: pointer;
}

.automation-card[data-href] {
  cursor: pointer;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-head strong {
  display: block;
  font-size: 14px;
  font-weight: 560;
}

.item-meta strong {
  display: block;
  font-size: 18px;
  font-weight: 620;
  color: var(--ph-text);
  margin-bottom: 4px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ph-green), #5fe49a);
  transition: width 0.3s ease;
}

.progress-fill.gold {
  background: linear-gradient(90deg, var(--ph-gold), #ffe68f);
}

.progress-fill.sky {
  background: linear-gradient(90deg, #2563eb, #7dd3fc);
}

.progress-fill.danger {
  background: linear-gradient(90deg, #dc2626, #fca5a5);
}

.status-pill {
  font-weight: 600;
}

.status-idle {
  background: rgba(255, 255, 255, 0.05);
}

.status-running {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.18);
  color: #dbeafe;
}

.status-success {
  background: rgba(0, 163, 79, 0.16);
  border-color: rgba(0, 163, 79, 0.18);
  color: #c7f9d8;
}

.status-error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.is-admin {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.18);
  color: #ffe68f;
}

.pill.success {
  background: rgba(0, 163, 79, 0.16);
  color: #c7f9d8;
}

.pill.warn {
  background: rgba(255, 215, 0, 0.12);
  color: #ffe68f;
}

.pill.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ph-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ph-border-strong);
}

.btn.primary {
  background: linear-gradient(135deg, var(--ph-green), #17c964);
  border-color: rgba(0, 163, 79, 0.34);
  color: #08110b;
}

.btn.secondary {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(96, 165, 250, 0.08));
  border-color: rgba(96, 165, 250, 0.24);
  color: #dbeafe;
}

.btn.gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.24), rgba(255, 215, 0, 0.12));
  border-color: rgba(255, 215, 0, 0.24);
  color: #ffe68f;
}

.btn.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(239, 68, 68, 0.12));
  border-color: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.02);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

.data-table thead th {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ph-border);
  color: var(--ph-text-dim);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--ph-text-soft);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.18s ease;
}

.clickable-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mobile-cards {
  display: none;
}

.mobile-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--ph-border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ph-text);
}

.mobile-card strong {
  font-size: 14px;
}

.mobile-card small {
  color: var(--ph-text-dim);
  font-size: 12px;
  line-height: 1.6;
}

.search-inline,
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-inline input,
.search-inline select,
.filter-row input,
.filter-row select,
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ph-text);
  font-size: 13px;
}

select option,
select optgroup {
  background: #10162a;
  color: rgba(255, 255, 255, 0.92);
}

textarea {
  min-height: 120px;
  padding: 14px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--ph-text-dim);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(0, 163, 79, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 163, 79, 0.12);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--ph-text-soft);
  font-size: 12px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-col {
  grid-template-columns: 220px minmax(0, 1fr) 180px;
  align-items: end;
}

.field.full,
.actions,
.grow {
  grid-column: 1 / -1;
}

.field ul,
.user-edit-card ul,
.form-card ul {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.field li label,
.user-edit-card li label,
.form-card li label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ph-text-soft);
  cursor: pointer;
}

.error {
  color: #fecaca;
  font-size: 11px;
  line-height: 1.5;
}

.inline-check,
.toggle-check,
.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ph-text-soft);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ph-green);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-edit-panel,
.request-layout,
.approval-layout,
.variables-layout {
  display: grid;
  gap: 18px;
}

.user-edit-card,
.profile-summary {
  border: 1px solid var(--ph-border);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.user-edit-card h4,
.profile-summary h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.user-edit-grid {
  display: grid;
  gap: 12px;
}

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

.fixed-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.systems-table {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.systems-head,
.systems-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 12px;
  align-items: center;
}

.systems-head {
  padding: 0 12px;
  color: var(--ph-text-dim);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.systems-row {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.04);
}

.systems-row.off {
  opacity: 0.62;
}

.system-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.system-name strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.request-grid .request-card,
.automation-grid .automation-card {
  display: grid;
  gap: 12px;
}

.request-card-head,
.automation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.definition-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.definition-item span:first-child {
  color: var(--ph-text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.definition-item span:last-child {
  text-align: right;
  font-size: 12px;
  color: var(--ph-text);
}

.radar-shell {
  display: grid;
  gap: 12px;
}

.radar-card {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.radar-card svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  overflow: visible;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: var(--ph-text-soft);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.radar-legend-item:hover {
  transform: translateY(-1px);
  border-color: var(--ph-border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.radar-legend-item.is-muted {
  opacity: 0.45;
}

.radar-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.radar-swatch.total {
  background: rgba(0, 163, 79, 0.22);
  border-color: rgba(23, 201, 100, 0.54);
}

.radar-swatch.child {
  background: rgba(76, 201, 125, 0.18);
  border-color: rgba(76, 201, 125, 0.76);
}

.radar-swatch.current {
  background: rgba(255, 132, 39, 0.24);
  border-color: rgba(255, 132, 39, 0.7);
}

.filter-panel {
  overflow: hidden;
}

.filter-panel[open] {
  background: rgba(255, 255, 255, 0.03);
}

.filter-panel-summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 4px 0;
}

.filter-panel-summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--ph-text-dim);
  font-size: 16px;
  line-height: 1;
}

.filter-panel[open] .filter-panel-summary::after {
  content: "−";
}

.filter-panel-summary::-webkit-details-marker {
  display: none;
}

.filter-panel-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.radar-caption {
  display: grid;
  gap: 6px;
}

.radar-caption small {
  color: var(--ph-text-dim);
  font-size: 11px;
  line-height: 1.6;
}

.radar-meta {
  display: grid;
  gap: 10px;
}

.radar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.radar-row span:first-child {
  color: var(--ph-text-dim);
}

.radar-row strong {
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.62);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--ph-border);
  background: linear-gradient(180deg, rgba(19, 22, 47, 0.98) 0%, rgba(12, 17, 34, 0.98) 100%);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.42);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 620;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ph-text);
  cursor: pointer;
}

.modal-grid {
  display: grid;
  gap: 14px;
}

.modal-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-stack {
  display: grid;
  gap: 12px;
}

.detail-stack .definition-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.worker-grid .worker-card {
  display: grid;
  gap: 10px;
}

.worker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.worker-pid {
  font-size: 12px;
  font-weight: 700;
  color: #dbeafe;
}

.worker-status {
  color: var(--ph-text-dim);
  font-size: 11px;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.stack-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.03);
}

.stack-item strong {
  font-size: 14px;
}

.table-meta {
  color: var(--ph-text-dim);
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.panel.narrow {
  max-width: 640px;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.side-overlay {
  display: none;
}

.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ph-text);
  font-size: 18px;
}

@media (max-width: 1180px) {
  .metric-grid,
  .summary-grid,
  .dashboard-system-grid,
  .cards-grid,
  .system-portfolio-grid,
  .automation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .worker-grid,
  .request-grid,
  .split-grid,
  .hero-card,
  .hero-card.compact {
    grid-template-columns: 1fr;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }
}

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

  .side {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 340px);
    transform: translateX(-108%);
    transition: transform 0.24s ease;
    padding: 14px;
  }

  body.mobile-side-open .side {
    transform: translateX(0);
  }

  .side-overlay {
    position: fixed;
    inset: 0;
    z-index: 3;
    background: rgba(3, 7, 18, 0.48);
  }

  body.mobile-side-open .side-overlay {
    display: block;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    padding: 18px;
  }

  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    margin-bottom: 10px;
  }
}

@media (max-width: 760px) {
  .metric-grid,
  .summary-grid,
  .dashboard-system-grid,
  .cards-grid,
  .system-portfolio-grid,
  .automation-grid,
  .request-grid,
  .worker-grid,
  .fixed-two,
  .fixed-three,
  .form-grid.two-col,
  .form-grid.three-col {
    grid-template-columns: 1fr;
  }

  .systems-head {
    display: none;
  }

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

  .desktop-only {
    display: none;
  }

  .mobile-only,
  .mobile-cards {
    display: grid;
    gap: 12px;
  }

  .topbar {
    flex-direction: column;
  }

  .modal-grid.two-col {
    grid-template-columns: 1fr;
  }

  .userbar {
    width: 100%;
    justify-content: flex-start;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}
