/* ======================================================== */
/* DESIGN SYSTEM: MONOCHROME OBSIDIAN & ORGANIC SMOOTH FLOW  */
/* ======================================================== */

:root {
  --bg-black: #000000;
  --bg-deep: #070709;
  --bg-surface: #0f0f13;
  --bg-surface-hover: #16161b;
  --bg-glass: rgba(18, 18, 24, 0.75);
  --bg-input: #0a0a0e;
  
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(255, 255, 255, 0.35);
  --border-white: #ffffff;

  --text-pure: #ffffff;
  --text-primary: #ededed;
  --text-secondary: #9e9ea7;
  --text-muted: #5e5e67;
  --text-dim: #3e3e46;

  --accent-white: #ffffff;
  --accent-white-glow: rgba(255, 255, 255, 0.15);
  --emerald-live: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --crimson-stop: #ef4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s var(--spring-ease);
  --transition-smooth: all 0.25s var(--spring-ease);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-black);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Views */
.view {
  display: none !important;
  animation: viewFadeIn 0.3s var(--spring-ease);
}
.view.active {
  display: block !important;
}
#login-view.active {
  display: flex !important;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-pure);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-accent {
  color: #71717a;
  font-weight: 400;
}

/* ======================================================== */
/* ORGANIC SMOOTH BUTTONS                                   */
/* ======================================================== */
.btn-organic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-organic:active {
  transform: scale(0.96);
}

/* Primary White */
.btn-primary-white {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.12);
}
.btn-primary-white:hover {
  background-color: #f0f0f0;
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

/* Glass Dark */
.btn-glass {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}
.btn-glass:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-pure);
  transform: translateY(-1px);
}

/* Danger Black */
.btn-danger-black {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.btn-danger-black:hover {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Ghost Dark */
.btn-ghost-dark {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost-dark:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-pure);
}

/* Button Sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}
.btn-xs {
  padding: 4px 10px;
  font-size: 0.72rem;
}
.btn-full {
  width: 100%;
}

/* Form inputs */
.input-field {
  margin-bottom: 16px;
}
.input-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.req { color: #f87171; }

.input-box {
  display: flex;
  align-items: center;
  position: relative;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}
.input-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-box input, 
.input-box select, 
.input-box textarea {
  width: 100%;
  padding: 12px 14px;
  padding-left: 42px;
  background: transparent;
  border: none;
  color: var(--text-pure);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
}
.input-box input::placeholder {
  color: var(--text-dim);
}

.pw-eye-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.pw-eye-btn:hover { color: var(--text-pure); }

/* Switch Toggle */
.organic-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.organic-switch input { display: none; }
.switch-slider {
  width: 40px;
  height: 22px;
  background-color: #27272a;
  border-radius: var(--radius-pill);
  position: relative;
  transition: var(--transition-smooth);
}
.switch-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: var(--transition-smooth);
}
.organic-switch input:checked + .switch-slider {
  background-color: #ffffff;
}
.organic-switch input:checked + .switch-slider::after {
  transform: translateX(18px);
  background-color: #000000;
}
.switch-label {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}


/* ======================================================== */
/* LOGIN VIEW (MONOCHROME LUXURY)                           */
/* ======================================================== */
#login-view {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--bg-black);
}

.login-mesh-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.login-brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.brand-symbol {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}
.brand-symbol.sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}
.brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
}

.login-glass-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
}

/* Role Selector Tabs */
.auth-role-tabs {
  display: flex;
  background-color: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  margin-bottom: 26px;
}
.auth-role-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fast);
}
.auth-role-tab.active {
  background-color: #ffffff;
  color: #000000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-title {
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.auth-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.auth-error-banner {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border-hairline);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.auth-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* ======================================================== */
/* TOPBAR                                                   */
/* ======================================================== */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background-color: rgba(10, 10, 14, 0.85);
  border-bottom: 1px solid var(--border-hairline);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}
.role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.role-badge.admin {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.nav-segment {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fast);
}
.nav-pill:hover {
  color: #ffffff;
}
.nav-pill.active {
  background-color: #ffffff;
  color: #000000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.live-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #27272a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}
.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}


/* ======================================================== */
/* CANVAS & HERO                                            */
/* ======================================================== */
.app-canvas {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px;
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 20px;
}
.hero-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.hero-title {
  font-size: 1.75rem;
  line-height: 1.2;
}
.hero-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: var(--text-muted);
}
.search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-primary);
  width: 140px;
  transition: width 0.2s ease;
}
.search-box input:focus { width: 190px; }


/* ======================================================== */
/* WORKER CARDS GRID (ORGANIC HIGH-END DESIGN)             */
/* ======================================================== */
.cards-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.organic-unit-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.organic-unit-card:hover {
  background-color: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-unit-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-pure);
}
.game-capsule {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.card-pulse-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
}
.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: relative;
}
.live-pulse-dot.online {
  background-color: var(--emerald-live);
  box-shadow: 0 0 10px var(--emerald-live);
}
.live-pulse-dot.online::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--emerald-live);
  animation: radarPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}
.live-pulse-dot.offline {
  background-color: var(--crimson-stop);
}
.card-state-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-pure);
}

.card-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.metric-box {
  background-color: var(--bg-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.metric-box-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.metric-box-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-pure);
  margin-top: 3px;
}

.card-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: auto;
}
.card-actions-row .btn-organic {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 8px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Empty State */
.empty-glass-card {
  text-align: center;
  padding: 60px 24px;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 480px;
  margin: 40px auto;
}
.empty-symbol {
  color: var(--text-muted);
  margin-bottom: 16px;
}
.empty-glass-card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.empty-glass-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}


/* ======================================================== */
/* ADMIN: FLEET COMMAND STACK                               */
/* ======================================================== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-pill-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}
.stat-caption {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.stat-number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.stat-big-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-pure);
}
.health-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.health-tag.success {
  background-color: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.health-tag.info {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ededed;
  border: 1px solid var(--border-subtle);
}

.server-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.filter-chip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}
.filter-chip:hover {
  color: #ffffff;
  border-color: var(--border-subtle);
}
.filter-chip.active {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.servers-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.server-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.server-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background-color: #121217;
  border-bottom: 1px solid var(--border-hairline);
}
.server-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.server-name-tag {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-pure);
}
.ip-capsule {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-deep);
  border: 1px solid var(--border-hairline);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}


/* ======================================================== */
/* MONOCHROME DATA TABLES                                   */
/* ======================================================== */
.monochrome-table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.mono-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}
.mono-table th {
  padding: 14px 20px;
  background-color: #0b0b0f;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-hairline);
}
.mono-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-primary);
  vertical-align: middle;
}
.mono-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}
.mono-table tr:last-child td {
  border-bottom: none;
}

.unit-chip {
  display: inline-block;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  margin: 2px;
}


/* ======================================================== */
/* MODALS & BACKDROP                                        */
/* ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: modalFade 0.2s var(--spring-ease);
}
.modal-backdrop.hidden { display: none; }

.modal-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 35px 70px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.modal-sm { max-width: 440px; }
.modal-xl { max-width: 820px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border-hairline);
}
.modal-title {
  font-size: 1.15rem;
}
.modal-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover { color: #ffffff; }

.modal-body {
  padding: 24px 26px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px;
  border-top: 1px solid var(--border-hairline);
  background-color: #0b0b0f;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.toggle-field {
  display: flex;
  align-items: center;
  margin-top: 26px;
}

/* UNIT ASSIGNMENT MATRIX */
.assignment-matrix-panel {
  margin-top: 20px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 18px;
  background-color: var(--bg-deep);
}
.matrix-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.matrix-title {
  font-size: 0.92rem;
  margin-bottom: 2px;
}
.matrix-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.counter-badge {
  background-color: #ffffff;
  color: #000000;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.worker-view-preview-banner {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-tag {
  font-weight: 700;
  color: var(--text-muted);
}
.preview-text {
  color: #ffffff;
  font-weight: 500;
}

.catalog-scroll-area {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.catalog-server-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.catalog-server-bar {
  padding: 8px 12px;
  background-color: #121217;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-hairline);
}
.catalog-unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: var(--radius-xs);
}
.catalog-unit-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}
.catalog-unit-row.selected {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.catalog-unit-row:last-child { border-bottom: none; }
.catalog-unit-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
  user-select: none;
}
.bot-assign-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  accent-color: #ffffff;
  cursor: pointer;
}
.catalog-unit-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.alias-input-box {
  width: 160px;
  padding: 8px 12px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-fast);
}
.alias-input-box:focus {
  border-color: #ffffff;
  background-color: #121217;
}
.alias-input-box:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


/* ======================================================== */
/* TERMINAL MODAL (HACKER OBSIDIAN)                        */
/* ======================================================== */
.modal-terminal {
  max-width: 920px;
  height: 640px;
  background-color: #030305;
  border-color: var(--border-subtle);
}
.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background-color: #09090d;
  border-bottom: 1px solid var(--border-hairline);
}
.terminal-dots {
  display: flex;
  gap: 6px;
}
.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tdot.red { background-color: #ef4444; }
.tdot.yellow { background-color: #eab308; }
.tdot.green { background-color: #10b981; }

.terminal-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.terminal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.terminal-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.toggle-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.terminal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #34d399;
  background-color: #010103;
}
.terminal-body pre {
  white-space: pre-wrap;
  word-break: break-all;
}


/* ======================================================== */
/* TOAST NOTIFICATIONS                                      */
/* ======================================================== */
.organic-toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast-pill {
  background-color: #121217;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.25s var(--spring-ease);
}
.toast-pill.success { border-color: rgba(16, 185, 129, 0.4); }
.toast-pill.error { border-color: rgba(239, 68, 68, 0.4); }

/* Animation Keyframes */
@keyframes radarPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.8); opacity: 0; }
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalFade {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes toastSlide {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ======================================================== */
/* SIMPLE ASSIGNMENT MECHANISM (MAX 4 UNITS)                */
/* ======================================================== */
.simple-assign-container {
  margin-top: 20px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 20px;
}
.assign-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.assign-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-pure);
}
.assign-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.assigned-slots-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assigned-slot-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: viewFadeIn 0.2s var(--spring-ease);
}
.slot-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slot-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.slot-badge-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}
.slot-remove-btn {
  background: none;
  border: none;
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}
.slot-remove-btn:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ffffff;
}
.slot-fields-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
.slot-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slot-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.slot-select, .slot-alias-input {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.86rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-fast);
}
.slot-select:focus, .slot-alias-input:focus {
  border-color: #ffffff;
  background-color: #121217;
}

/* ======================================================== */
/* HAMBURGER & MOBILE DRAWER NAVIGATION                     */
/* ======================================================== */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: #ffffff;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.hamburger-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 150;
  display: flex;
  justify-content: flex-end;
  animation: modalFade 0.2s var(--spring-ease);
}
.mobile-drawer-backdrop.hidden { display: none; }

.mobile-drawer-panel {
  width: 320px;
  max-width: 85%;
  height: 100%;
  background-color: #0b0b0f;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px;
  animation: slideInRight 0.25s var(--spring-ease);
}
.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.mobile-drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.mobile-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}
.mobile-nav-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}
.mobile-nav-btn.active {
  background-color: #ffffff;
  color: #000000;
}
.mobile-drawer-foot {
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .app-topbar { padding: 12px 18px; }
  .nav-segment { display: none !important; }
  .user-profile-badge { display: none !important; }
  #btn-logout { display: none !important; }
  .hamburger-btn { display: inline-flex !important; }
  .slot-fields-grid { grid-template-columns: 1fr; }
  .app-canvas { padding: 20px 16px; }
  .cards-layout { grid-template-columns: 1fr; }
  .dashboard-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .app-topbar { padding: 10px 16px; }
  .topbar-logo { font-size: 1.15rem; letter-spacing: 0.06em; }
  .hero-title { font-size: 1.45rem; }
  .hero-sub { font-size: 0.82rem; }
  .worker-hero { margin-bottom: 20px; }
  .worker-hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 10px;
  }
  .worker-hero-actions .btn-organic {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  .organic-unit-card {
    padding: 18px 16px;
    border-radius: 18px;
  }
  .card-top { margin-bottom: 12px; }
  .card-unit-title { font-size: 1.15rem; }
  .card-pulse-row {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .card-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .metric-box {
    padding: 9px 12px;
    border-radius: 10px;
  }
  .metric-box-title { font-size: 0.62rem; }
  .metric-box-value { font-size: 0.86rem; }
  .card-actions-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .card-actions-row .btn-organic {
    padding: 10px 6px;
    font-size: 0.82rem;
    font-weight: 600;
  }
}

/* ======================================================== */
/* GAME SWITCH MODAL & SELECTION CARDS                      */
/* ======================================================== */
.game-switch-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.game-select-card {
  display: block;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.game-select-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.game-select-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-select-card:hover .game-select-card-inner {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.game-select-card input[type="radio"]:checked + .game-select-card-inner {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  box-shadow: 0 0 0 1px #ffffff, 0 8px 24px rgba(0, 0, 0, 0.4);
}

.game-select-card.is-current {
  cursor: default;
}

.game-select-card.is-current .game-select-card-inner {
  opacity: 0.65;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.02);
}

.game-select-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.game-select-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #ffffff;
}

.game-select-desc {
  font-size: 0.78rem;
  color: #71717A;
}

.game-select-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #A1A1AA;
  transition: all 0.2s ease;
}

.game-select-card input[type="radio"]:checked + .game-select-card-inner .game-select-badge {
  background: #ffffff;
  color: #000000;
}

.game-select-card.is-current .game-select-badge {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #71717A;
}

/* Loading box inside switch modal */
.switch-loading-box {
  margin-top: 16px;
  padding: 22px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 4px;
}

.loading-sub {
  font-size: 0.78rem;
  color: #71717A;
}
