:root {
  --bg-dark: #040806;
  --bg-card: #0a1310;
  --bg-subcard: #060d0a;
  --border-card: #152620;
  --border-emerald: #10b981;
  --emerald: #10b981;
  --emerald-dark: #064e3b;
  --emerald-light: #34d399;
  --text-white: #ffffff;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --danger-red: #ef4444;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
  text-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.text-emerald {
  color: var(--emerald) !important;
}

/* =========================================================================
   1. MASTER LOCK SCREEN (CLEAN FLAT TACTICAL - ZERO GLOW)
========================================================================= */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: #030705;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  overflow-y: auto;
}

/* Subtle Geometric Wireframe (No Glow) */
.globe-bg-wrap {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 480px;
  pointer-events: none;
  z-index: 1;
}

.globe-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(16, 185, 129, 0.12);
}

.globe-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(16, 185, 129, 0.12);
  transform: translate(-50%, -50%) rotateX(65deg);
}

.ring-1 {
  width: 440px;
  height: 220px;
}

.ring-2 {
  width: 520px;
  height: 260px;
}

.master-login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 390px;
  background: #09120f;
  border: 1.5px solid #1a2e26;
  border-radius: 24px;
  padding: 32px 24px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tactical Corner Stripe (Flat) */
.master-login-card::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 26px;
  height: 26px;
  border-top: 2.5px solid #10b981;
  border-left: 2.5px solid #10b981;
  border-top-left-radius: 10px;
}

.secure-mode-chip {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #34d399;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.05em;
}

.secure-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.hex-logo-wrap {
  margin-top: 10px;
  margin-bottom: 12px;
}

.root-command-chip {
  background: #064e3b;
  border: 1px solid #10b981;
  color: #10b981;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

.master-lock-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
}

.lock-title-line {
  flex: 1;
  height: 1px;
  background: #1a2e26;
}

.master-lock-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.master-lock-sub {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 4px;
  text-align: center;
}

.master-lock-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.master-input-box {
  position: relative;
  width: 100%;
  background: #050a08;
  border: 1px solid #1a2e26;
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 50px;
  transition: border-color 0.15s ease;
}

.master-input-box:focus-within {
  border-color: #10b981;
}

.input-lock-icon {
  margin-right: 10px;
  flex-shrink: 0;
}

.master-lock-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
}

.master-lock-input::placeholder {
  color: #475569;
}

.eye-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.master-submit-btn {
  width: 100%;
  height: 48px;
  background: #059669;
  border: 1px solid #10b981;
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 18px;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.master-submit-btn:hover {
  background: #10b981;
}

.master-submit-btn:active {
  background: #047857;
}

.login-err-banner {
  background: #2a1215;
  border: 1px solid #ef4444;
  color: #f87171;
  font-size: 12px;
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}

.lock-footer-security {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #10b981;
  font-size: 11.5px;
  font-weight: 700;
}

.lock-bottom-motto {
  position: relative;
  z-index: 10;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.bottom-lock-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: #1a2e26;
}

.divider-lock-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #1a2e26;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060e0a;
}

.motto-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.18em;
}

/* =========================================================================
   2. MAIN MASTER DASHBOARD (CLEAN FLAT - ZERO GLOW)
========================================================================= */
.master-layout {
  width: 100%;
  max-width: 960px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  padding-bottom: 90px;
  border-left: 1px solid #10201a;
  border-right: 1px solid #10201a;
}

/* Top Header Bar */
.master-topbar {
  background: #060d0a;
  border-bottom: 1px solid #12221b;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

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

.topbar-hex-icon {
  display: flex;
  align-items: center;
}

.topbar-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.topbar-root-badge {
  background: #064e3b;
  border: 1px solid #10b981;
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.topbar-brand-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 1px;
}

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

.topbar-action-btn {
  background: #091510;
  border: 1px solid #182e25;
  border-radius: 8px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.topbar-action-btn:hover {
  border-color: #10b981;
}

.btn-exit:hover {
  border-color: #ef4444;
  color: #f87171;
}

/* Main Content */
.master-main-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.master-tab-view {
  display: none;
}

.master-tab-view.active {
  display: block;
}

.master-section {
  display: flex;
  flex-direction: column;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}

.section-indicator {
  position: absolute;
  top: -12px;
  left: 0;
  width: 42px;
  height: 3px;
  background: #10b981;
  border-radius: 2px;
}

.section-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #10b981;
}

/* Overview 4-Card Grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.overview-card {
  background: #08110e;
  border: 1px solid #13241e;
  border-radius: 12px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.overview-card:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: #0b1813;
  transform: translateY(-2px);
}

.overview-card.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.overview-icon-box {
  margin-bottom: 6px;
}

.overview-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  color: #ffffff;
}

.overview-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.2;
}

/* Directory Header */
.directory-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.directory-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #08110e;
  border: 1px solid #13241e;
  border-radius: 8px;
  padding: 4px 10px;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  width: 70px;
}

.search-input::placeholder {
  color: #475569;
}

/* Tenant Cards List */
.tenants-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tenant-card-v2 {
  background: #09120f;
  border: 1px solid #152720;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tenant-card-v2.tenant-frozen {
  border-color: #7f1d1d;
  background: #11090a;
}

/* Card Top Row */
.tenant-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tenant-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tenant-index-badge {
  background: transparent;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  border: none;
}

.tenant-name-heading {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.icon-btn-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: #64748b;
  padding: 2px;
}

.icon-btn-edit:hover {
  color: #10b981;
}

.tenant-date-sub {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

.badge-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.badge-404-off {
  background: #0f1a16;
  border: 1px solid #1d332b;
  color: #94a3b8;
}

.badge-404-on {
  background: #361114;
  border: 1px solid #ef4444;
  color: #f87171;
}

.status-online {
  background: #064e3b;
  border: 1px solid #10b981;
  color: #34d399;
}

.status-warning {
  background: #382508;
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.status-offline {
  background: #361114;
  border: 1px solid #ef4444;
  color: #f87171;
}

/* Triple Box Grid */
.tenant-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
}

.tenant-chip-box {
  background: #050b09;
  border: 1px solid #13221c;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chip-box-label {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chip-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
}

.chip-box-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.chip-action-link {
  background: transparent;
  border: none;
  color: #10b981;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.chip-action-link:hover {
  text-decoration: underline;
}

.btn-launch-panel {
  background: #047857;
  border: 1px solid #10b981;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  width: 100%;
}

.btn-launch-panel:hover {
  background: #059669;
}

/* Bottom Action Buttons Row */
.tenant-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pill-action-btn {
  background: #060d0a;
  border: 1px solid #182e25;
  border-radius: 8px;
  color: #10b981;
  font-size: 10.5px;
  font-weight: 800;
  padding: 7px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.pill-action-btn:hover {
  border-color: #10b981;
  background: #0a1712;
}

.btn-danger-pill {
  border-color: #3b171a;
  color: #ef4444;
}

.btn-danger-pill:hover {
  border-color: #ef4444;
  background: #1f0b0d;
}

/* Quick Copy Action Bar */
.tenant-copy-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.btn-tenant-copy {
  background: #091510;
  border: 1px solid #1c362b;
  border-radius: 8px;
  color: #34d399;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tenant-copy:hover {
  background: #0d1e18;
  border-color: #10b981;
  color: #ffffff;
}

.btn-tenant-copy-env {
  border-color: #1a3026;
  color: #a7f3d0;
}

/* Master Cards Generic (Broadcast, Logs, Settings) */
.master-content-card {
  background: #09120f;
  border: 1px solid #152720;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.broadcast-textarea {
  width: 100%;
  background: #050a08;
  border: 1px solid #152720;
  border-radius: 12px;
  padding: 12px;
  color: #ffffff;
  font-size: 13px;
  font-family: var(--font-sans);
  resize: vertical;
  outline: none;
}

.broadcast-textarea:focus {
  border-color: #10b981;
}

.broadcast-preview-box {
  background: #060d0a;
  border: 1px solid #182e25;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #34d399;
  margin-top: 6px;
}

.logs-stream-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.log-entry {
  font-family: var(--font-mono);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #0e1d17;
}

.log-time {
  color: #64748b;
}

.log-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-green {
  background: #064e3b;
  color: #34d399;
}

.tag-blue {
  background: #07384d;
  color: #38bdf8;
}

.log-msg {
  color: #e2e8f0;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-label {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.settings-sub {
  font-size: 11px;
  color: #64748b;
}

.root-sec-card {
  border-color: #3a270f;
}

/* =========================================================================
   3. BOTTOM TAB NAVIGATION (CLEAN FLAT - ZERO GLOW)
========================================================================= */
.master-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #060d0a;
  border-top: 1px solid #14261f;
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px 0;
  z-index: 100;
}

.master-nav-tab {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  padding: 4px 16px;
}

.master-nav-tab.active {
  color: #10b981;
}

.master-nav-tab.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: #10b981;
  border-radius: 2px;
}

/* =========================================================================
   4. MODALS & POPUPS
========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: #0a1310;
  border: 1px solid #152720;
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.modal-header h4 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-label {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.modal-input {
  width: 100%;
  background: #050a08;
  border: 1px solid #1a2e26;
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease;
}

.modal-input:focus {
  border-color: #10b981;
}

.modal-input::placeholder {
  color: #475569;
}

.loading-state {
  text-align: center;
  padding: 30px;
  color: #64748b;
  font-weight: 600;
}

