:root {
  --bg: #05040a;
  --panel: rgba(18, 14, 30, .86);
  --panel-2: rgba(29, 20, 48, .82);
  --ink: #f7f3ff;
  --muted: #c9bdea;
  --soft: #a78bfa;
  --purple: #9b5cff;
  --purple-2: #c084fc;
  --cyan: #22d3ee;
  --line: rgba(192, 132, 252, .26);
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 18% 18%, rgba(34, 211, 238, .18), transparent 28%),
    radial-gradient(circle at 74% 10%, rgba(168, 85, 247, .26), transparent 34%),
    radial-gradient(circle at 68% 78%, rgba(124, 58, 237, .22), transparent 34%),
    #05040a;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

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

button {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 900;
  min-height: 40px;
  padding: 10px 14px;
  transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
}

button.danger {
  background: rgba(251, 113, 133, .17);
  border-color: rgba(251, 113, 133, .45);
  color: #ffe4e9;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

select {
  background-color: #201631;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(192, 132, 252, .9);
  box-shadow: 0 0 0 3px rgba(155, 92, 255, .18);
}

#particles {
  inset: 0;
  position: fixed;
  z-index: -2;
}

.glow-orbit {
  animation: orbitPulse 8s ease-in-out infinite;
  background:
    radial-gradient(circle at 40% 35%, rgba(34, 211, 238, .62), transparent 12%),
    radial-gradient(circle at 67% 42%, rgba(168, 85, 247, .64), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(124, 58, 237, .7), transparent 45%);
  border-radius: 999px;
  filter: blur(18px);
  height: 420px;
  opacity: .45;
  position: fixed;
  right: -120px;
  top: -90px;
  width: 420px;
  z-index: -1;
}

.hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.loader-card,
.panel,
.metric,
.role-card,
.session-card,
.orb-card,
.personnel-hero,
.command-card,
.timeline-panel,
.community-card,
.resource-card {
  background: linear-gradient(180deg, rgba(22, 17, 35, .9), rgba(10, 7, 18, .86));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
}

.loader-card {
  animation: rise .7s ease both;
  max-width: 520px;
  padding: 34px;
  text-align: center;
  width: min(100%, 520px);
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #22d3ee, #9b5cff 45%, #c084fc);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  box-shadow: 0 0 32px rgba(155, 92, 255, .34);
  display: inline-flex;
  font-weight: 950;
  height: 64px;
  justify-content: center;
  margin-bottom: 18px;
  width: 64px;
}

.brand-mark.small {
  flex: 0 0 auto;
  height: 42px;
  margin: 0;
  width: 42px;
}

.portal-logo {
  display: block;
  filter: drop-shadow(0 0 28px rgba(168, 85, 247, .5));
  height: 118px;
  margin: 0 auto 18px;
  object-fit: contain;
  width: auto;
}

.brand-icon {
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, .42));
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.eyebrow {
  color: var(--soft);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

.loader-card h1 {
  font-size: clamp(34px, 8vw, 64px);
  line-height: .95;
}

.muted,
.fine-print {
  color: var(--muted);
}

.login-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 24px;
}

.fine-print {
  font-size: 12px;
  margin: 18px 0 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  width: 100%;
}

.sidebar {
  background: rgba(8, 5, 16, .78);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.session-card span,
.session-card small,
.metric span,
label span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.nav button {
  background: transparent;
  border-color: rgba(192, 132, 252, .18);
  color: var(--muted);
  text-align: left;
}

.nav button.active {
  background: rgba(155, 92, 255, .22);
  border-color: rgba(192, 132, 252, .55);
  color: white;
}

.session-card {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 16px;
}

.workspace {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-width: 0;
}

.topbar h2 {
  font-size: 28px;
}

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

.view {
  display: none;
}

.view.active {
  animation: rise .35s ease both;
  display: block;
}

.hero-panel {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 190px;
  margin-bottom: 20px;
}

.hero-panel h1 {
  color: var(--purple-2);
  font-size: clamp(34px, 5vw, 72px);
  line-height: .96;
  max-width: 860px;
  text-shadow: 0 0 24px rgba(192, 132, 252, .22);
}

.orb-card {
  align-content: center;
  display: grid;
  min-height: 160px;
  padding: 20px;
  place-items: center;
  text-align: center;
}

.orb-card img {
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, .3));
  height: 48px;
  object-fit: contain;
  width: 48px;
}

.orb-card strong {
  color: var(--cyan);
  font-size: 32px;
}

.metric-grid,
.meeting-grid,
.admin-grid,
.portal-grid,
.resource-grid,
.broadcast-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meeting-grid,
.admin-grid,
.broadcast-grid {
  grid-template-columns: 1fr 1fr;
}

.metric,
.panel,
.role-card,
.command-card,
.timeline-panel,
.community-card,
.resource-card {
  min-width: 0;
  padding: 18px;
}

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.portal-grid,
.resource-grid {
  margin-top: 18px;
}

.command-card,
.resource-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
}

.command-card h3,
.resource-card h3,
.community-card h3,
.timeline-panel h3 {
  color: var(--ink);
  font-size: 22px;
}

.command-card p,
.resource-card p,
.community-card p,
.timeline-list span {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.command-card.priority {
  border-color: rgba(34, 211, 238, .42);
  box-shadow: 0 22px 70px rgba(34, 211, 238, .1), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.section-header {
  margin-bottom: 16px;
  max-width: 900px;
}

.section-header h3 {
  color: var(--purple-2);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.status-pill {
  background: rgba(167, 139, 250, .15);
  border: 1px solid rgba(192, 132, 252, .26);
  border-radius: 999px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  justify-self: start;
  letter-spacing: .08em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.status-pill.live {
  background: rgba(34, 211, 238, .12);
  border-color: rgba(34, 211, 238, .36);
  color: var(--cyan);
}

.timeline-panel {
  margin-top: 16px;
}

.timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.timeline-list article {
  align-items: center;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(192, 132, 252, .18);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 12px;
}

.timeline-list strong {
  color: var(--purple-2);
}

.community-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.community-card {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 190px;
}

.community-card img {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(192, 132, 252, .18);
  border-radius: 14px;
  height: 72px;
  object-fit: contain;
  padding: 10px;
  width: 72px;
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  min-width: 0;
}

.panel-heading h3 {
  font-size: 20px;
}

.wide {
  grid-column: 1 / -1;
}

.meeting-controls,
.meeting-summary {
  display: grid;
  gap: 10px;
}

.meeting-controls {
  grid-template-columns: repeat(4, auto);
}

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

.broadcast-grid {
  align-items: start;
}

.broadcast-composer {
  min-height: 100%;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.broadcast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.broadcast-preview {
  position: sticky;
  top: 24px;
}

.announcement-preview {
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, .14), transparent 35%),
    linear-gradient(180deg, rgba(39, 26, 63, .92), rgba(12, 8, 21, .96));
  border: 1px solid rgba(192, 132, 252, .3);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 18px;
}

.announcement-preview h3 {
  color: var(--purple-2);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.announcement-preview p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.announcement-preview a {
  align-self: end;
  color: var(--cyan);
  font-weight: 900;
  text-decoration: none;
}

.error-text {
  color: #fecdd3;
}

label {
  display: grid;
  gap: 7px;
}

.role-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.role-context {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.role-context h3 {
  color: var(--purple-2);
  font-size: clamp(24px, 3vw, 38px);
}

.role-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.role-overview {
  background: linear-gradient(180deg, rgba(22, 17, 35, .9), rgba(10, 7, 18, .86));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .04);
  margin-bottom: 16px;
  padding: 18px;
}

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

.readiness-card {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(192, 132, 252, .18);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.readiness-card span,
.readiness-card small {
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.readiness-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-card em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 900;
}

.empty-console {
  grid-column: 1 / -1;
}

.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.role-tabs button {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(192, 132, 252, .22);
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 12px 14px;
  text-align: left;
}

.role-tabs button.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, .78), rgba(168, 85, 247, .76));
  border-color: rgba(255, 255, 255, .22);
}

.role-tabs strong,
.role-tabs span,
.role-tabs small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-tabs span,
.role-tabs small {
  color: rgba(247, 243, 255, .76);
  font-size: 12px;
}

.role-card {
  display: grid;
  gap: 16px;
}

.role-console-card {
  min-height: calc(100vh - 280px);
}

.role-card header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.role-card header h3 {
  color: var(--ink);
  font-size: 24px;
}

.role-card header select {
  max-width: 170px;
}

.role-responsibility,
.role-checklist {
  display: grid;
  gap: 10px;
}

.role-responsibility > strong,
.role-checklist > strong {
  color: var(--soft);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.check-row {
  align-items: start;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(192, 132, 252, .16);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 10px;
}

.check-row input {
  accent-color: var(--purple);
  margin-top: 2px;
  width: auto;
}

.check-row span {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.tool-grid,
.personnel-list,
.assignment-list,
.department-list {
  display: grid;
  gap: 10px;
}

.assignment-list.compact {
  margin-top: 14px;
}

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

.tool-card,
.person-card,
.assignment-card,
.department-card,
.personnel-stats article {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(192, 132, 252, .18);
  border-radius: 10px;
  padding: 12px;
}

.personnel-hero {
  align-items: end;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  padding: 22px;
}

.personnel-hero h3 {
  color: var(--purple-2);
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
}

.personnel-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.personnel-stats article {
  min-width: 96px;
  text-align: center;
}

.personnel-stats strong,
.personnel-stats span {
  display: block;
}

.personnel-stats strong {
  color: var(--cyan);
  font-size: 28px;
}

.personnel-stats span {
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.directory-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) 220px 220px;
  margin-bottom: 16px;
}

.directory-panel {
  overflow: hidden;
}

.personnel-list {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.person-card {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.person-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.person-main input {
  font-weight: 800;
}

.person-main small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-card input,
.person-card select,
.assignment-card input {
  min-width: 0;
}

.person-card select,
.person-card input {
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-card .icon-button {
  justify-self: start;
  min-width: 96px;
}

.meeting-assignment-card {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 150px minmax(0, 1fr) 240px;
}

.meeting-assignment-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.icon-button {
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbitPulse {
  50% {
    opacity: .7;
    transform: scale(1.06) rotate(8deg);
  }
}

@media (max-width: 1100px) {
  .app-shell,
  .hero-panel,
  .personnel-hero,
  .meeting-grid,
  .admin-grid,
  .broadcast-grid,
  .community-grid {
    grid-template-columns: 1fr;
  }

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

  .directory-toolbar {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }
}

@media (max-width: 720px) {
  .sidebar,
  .workspace {
    padding: 16px;
  }

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

  .metric-grid,
  .role-grid,
  .portal-grid,
    .resource-grid,
    .readiness-grid,
    .tool-grid,
    .meeting-controls,
    .meeting-summary,
    .broadcast-form,
    .personnel-stats,
  .meeting-assignment-card,
  .timeline-list article,
  .community-card,
  .person-card,
  .login-actions {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-heading,
  .role-context,
  .role-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .role-card header select {
    max-width: none;
  }
}
