:root {
  --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.45);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --brand: #3B7397;
  --brand-deep: #2E5E7E;
  --gold: #F5B82E;
  --gold-text: #F5B82E;
  --gold-bg: rgba(245, 184, 46, 0.14);
  --focus-ring: rgba(245, 184, 46, 0.35);
  --bg-app: #09111A;
  --bg-surface: rgba(14, 24, 38, 0.93);
  --bg-surface-solid: #0E1826;
  --bg-elevated: #162436;
  --bg-hover: rgba(59, 115, 151, 0.24);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.3);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #5BA4CF;
  --accent-bg: rgba(59, 115, 151, 0.2);
  --success: #10B981;
  --warning: #F5B82E;
  --danger: #EF4444;
  --map-bg: #0B1120;
}

[data-theme="light"] {
  --brand: #3B7397;
  --brand-deep: #2E5E7E;
  --gold: #F5B82E;
  --gold-text: #9A6700;
  --gold-bg: rgba(245, 184, 46, 0.16);
  --focus-ring: rgba(245, 184, 46, 0.4);
  --bg-app: #F4F7FA;
  --bg-surface: rgba(255, 255, 255, 0.95);
  --bg-surface-solid: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --bg-hover: rgba(59, 115, 151, 0.1);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(46, 94, 126, 0.25);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --accent: #2E5E7E;
  --accent-bg: rgba(59, 115, 151, 0.12);
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --map-bg: #E2E8F0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ar);
  background: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

td.mono, th.mono {
  display: table-cell;
  text-align: right;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

/* App Shell */
.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Top Header */
.noc-header {
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  flex-shrink: 0;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 600;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Global Search */
.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 480px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 38px 8px 34px;
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.86rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-clear {
  position: absolute;
  left: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 6px;
}
.search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 2000;
}

.search-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.15s;
}
.search-item:last-child {
  border-bottom: none;
}
.search-item:hover {
  background: var(--bg-hover);
}

.search-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-item-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-switcher {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.role-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.role-btn.active-admin {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(245, 184, 46, 0.45);
}

.role-btn.active-tech {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
}

.btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-color: rgba(245, 184, 46, 0.4);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(1.08);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-color: var(--gold);
  box-shadow: 0 6px 16px -4px rgba(46, 94, 126, 0.45);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.24);
}

.btn-icon {
  padding: 7px 9px;
}

/* Filter Row */
.header-row-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 2px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.chip.active {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: var(--text-primary);
}

.color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.noc-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 99px;
}
.stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

/* Map Stage */
.map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Map Area */
.map-container-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: var(--map-bg);
  overflow: hidden;
}

#noc-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Floating Map Controls */
.map-floating-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-switcher {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  display: flex;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.map-switch-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.map-switch-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(245, 184, 46, 0.4);
}

.map-layer-toggles {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.76rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--text-secondary);
}
.toggle-row input {
  accent-color: var(--accent);
  cursor: pointer;
}

/* Pick on Map Banner */
.pick-map-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.45);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Tower Side Drawer */
.tower-drawer {
  position: absolute;
  top: 72px;
  right: 14px;
  bottom: 14px;
  width: 420px;
  max-width: calc(100vw - 28px);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 800;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.22s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title-group h2 {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.drawer-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.info-card-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.info-card-value {
  font-size: 0.85rem;
  font-weight: 700;
}

.notes-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.5;
}

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

.section-heading {
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
}

.dish-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.dish-row {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.dish-row:hover {
  border-color: var(--border-strong);
}
.dish-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2), 0 4px 14px rgba(56, 189, 248, 0.14);
  background: rgba(56, 189, 248, 0.08);
}

.dish-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.dish-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.dish-row-title .dish-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.dish-row-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.dish-azimuth-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.14);
  color: var(--gold-text);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.dish-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  font-size: 0.74rem;
  min-width: 0;
}

.dish-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.dish-meta-lbl {
  color: var(--text-muted);
  font-size: 0.69rem;
  flex-shrink: 0;
}

.dish-meta-val {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-meta-ip {
  color: var(--accent);
  font-weight: 600;
}

.peer-link-compact {
  padding: 5px 8px;
  font-size: 0.72rem;
  min-width: 0;
}

.peer-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.peer-link-dist {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.dish-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.drawer-add-dish-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 6px;
}

.dish-card-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.dish-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.dish-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.dish-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.dish-action-btn {
  padding: 5px 10px;
  font-size: 0.74rem;
  gap: 5px;
  flex: 1 1 auto;
  justify-content: center;
}

.dish-action-btn.is-active-preview {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.dish-form-backdrop {
  background: rgba(2, 6, 23, 0.14);
  backdrop-filter: none;
  pointer-events: none;
  justify-content: flex-end;
  align-items: center;
  padding: 18px;
}

.dish-form-modal-panel {
  pointer-events: auto;
  max-width: 490px;
  width: 100%;
  max-height: calc(100vh - 36px);
}

.azimuth-control-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  gap: 8px;
}

.azimuth-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.azimuth-live-readout {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 2px 9px;
  border-radius: 99px;
}

.azimuth-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.azimuth-range-slider {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.azimuth-number-wrap {
  position: relative;
  width: 84px;
  flex-shrink: 0;
}

.azimuth-number-input {
  padding-left: 22px;
  text-align: center;
  font-weight: 700;
}

.azimuth-degree-unit {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.azimuth-step-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.azimuth-step-btn {
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  justify-content: center;
}

@media (max-width: 768px) {
  .dish-form-backdrop {
    justify-content: center;
    align-items: flex-end;
    padding: 8px;
  }
  .dish-form-modal-panel {
    max-width: 100%;
    max-height: 76vh;
  }
}

.dish-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  width: 100%;
}

@media (max-width: 560px) {
  .dish-modal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.drawer-compact-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.meta-coords-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.72rem;
  cursor: pointer;
}
.meta-coords-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.inline-drawer-dish-form {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.inline-drawer-form-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
}

.inline-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.inline-drawer-grid > .form-field,
.inline-drawer-grid > * {
  min-width: 0;
  max-width: 100%;
}

.inline-drawer-dish-form .form-control,
.inline-drawer-dish-form input,
.inline-drawer-dish-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .inline-drawer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dish-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dish-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.role-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}
.role-AP { background: rgba(16, 185, 129, 0.16); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.role-PTP-Master { background: rgba(56, 189, 248, 0.16); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.role-PTP-Station { background: rgba(168, 85, 247, 0.16); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.dish-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 0.76rem;
}

.spec-row {
  display: flex;
  flex-direction: column;
}
.spec-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.peer-link-box {
  background: var(--bg-surface-solid);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.peer-link-box:hover {
  border-color: var(--accent);
}

/* Management Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow-x: auto;
  flex-shrink: 0;
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--bg-surface-solid);
  color: var(--gold-text);
  border-color: var(--gold);
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Forms */
.crud-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.form-field.full-width {
  grid-column: 1 / -1;
}
.form-field label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.84rem;
  outline: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.form-control.mono-input {
  font-family: var(--font-mono);
  direction: ltr;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Data Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
th, td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.76rem;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--bg-hover);
}

/* Leaflet Customizations */
.leaflet-container {
  font-family: var(--font-ar);
  background: var(--map-bg);
}

.tower-marker-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tower-pin-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tower-selection-ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2.5px solid #38bdf8;
  pointer-events: none;
  animation: towerPulseRing 1.7s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes towerPulseRing {
  0% {
    transform: scale(0.88);
    opacity: 0.95;
  }
  70% {
    transform: scale(1.42);
    opacity: 0.25;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.tower-pin {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}
.tower-pin.is-core {
  width: 42px;
  height: 42px;
  border-width: 3px;
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.35), 0 6px 16px rgba(0, 0, 0, 0.5);
}
.tower-pin.is-selected {
  transform: scale(1.18);
}
.tower-pin:hover {
  transform: scale(1.12);
}

.tower-label-tag {
  margin-top: 3px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.tower-label-tag.is-selected {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35), 0 4px 10px rgba(0, 0, 0, 0.45);
}

.sector-badge-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sector-badge {
  display: inline-block;
  background: rgba(15, 23, 42, 0.88);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.dish-rotate-handle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.94);
  border: 2.5px solid #10b981;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22), 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dish-rotate-handle:hover {
  transform: scale(1.14);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.3), 0 6px 16px rgba(0, 0, 0, 0.55);
}

.dish-rotate-handle:active {
  cursor: grabbing;
  transform: scale(1.06);
}

.toast-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: var(--bg-surface-solid);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

.dish-focus-banner {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 820;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  padding: 8px 14px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.dish-focus-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dish-focus-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dish-rotate-btn {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 99px;
}

.dish-save-btn {
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 99px;
  background: #10b981;
  color: #ffffff;
  border: 1px solid #059669;
}

.dish-save-btn:hover {
  background: #059669;
}

@media (max-width: 768px) {
  .tower-drawer {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: 62vh;
  }
  .floating-top-right {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  .los-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    transform: none;
  }
  .los-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================================================
   FLOATING TOP-RIGHT SEARCH BAR & COLLAPSIBLE MENU
   ========================================================= */
.floating-top-right {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: calc(100vw - 28px);
}

.floating-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
}

.cloud-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.cloud-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cloud-sync-pill.is-cloud {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.cloud-sync-pill.is-cloud .cloud-sync-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.cloud-sync-pill.is-local {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.cloud-sync-pill.is-local .cloud-sync-dot {
  background: #f59e0b;
}

.btn-sync-icon {
  padding: 7px 9px;
  min-width: auto;
}

.btn-sync-icon:disabled {
  opacity: 0.65;
  cursor: wait;
}

.spin-icon {
  animation: highspeed-spin 0.9s linear infinite;
}

@keyframes highspeed-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.floating-bar .search-wrapper {
  min-width: 240px;
  width: 310px;
}

.floating-bar .search-input {
  padding: 7px 34px 7px 30px;
  font-size: 0.84rem;
}

.btn-menu-toggle {
  white-space: nowrap;
  position: relative;
}

.btn-menu-toggle.active {
  border-color: var(--gold);
  background: var(--accent-bg);
  color: var(--gold-text);
}

.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--gold);
  color: #0F172A;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.pending-badge.is-zero {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.floating-drawer-popover {
  width: 390px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 86px);
  overflow-y: auto;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInPopover 0.18s ease-out;
}

@keyframes fadeInPopover {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.popover-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.popover-section-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.noc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-box .stat-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-box .stat-lbl {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.popover-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-btn.active-user {
  background: rgba(16, 185, 129, 0.16);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-warning-outline {
  border-color: var(--warning);
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

/* =========================================================
   RIGHT-CLICK CONTEXT MENU
   ========================================================= */
.map-context-menu {
  position: fixed;
  z-index: 2500;
  width: 230px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.context-menu-coords {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
  text-align: center;
}

.context-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.context-menu-item:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* =========================================================
   RECEIVER MARKERS & LOS TARGET PIN
   ========================================================= */
.receiver-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.receiver-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}

.receiver-pin.selected {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px #fff, 0 0 14px #10b981;
}

.receiver-label-tag {
  margin-top: 2px;
  background: rgba(6, 78, 59, 0.9);
  color: #ecfdf5;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.los-target-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* =========================================================
   ELEVATION PROFILE & LINE OF SIGHT PANEL
   ========================================================= */
.los-panel {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: 620px;
  max-width: calc(100vw - 28px);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.los-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.los-title-row h3 {
  font-size: 0.96rem;
  font-weight: 800;
}

.los-coords {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.los-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.los-controls-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 10px;
}

.los-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.los-metric {
  display: flex;
  align-items: center;
  gap: 8px;
}

.los-metric-lbl {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.los-metric-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.los-status-pill {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
}

.los-status-pill.clear {
  background: rgba(16, 185, 129, 0.16);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.los-status-pill.blocked {
  background: rgba(239, 68, 68, 0.16);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.los-status-pill.loading {
  background: var(--accent-bg);
  color: var(--accent);
}

.los-chart-box {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px 6px;
}

.los-svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
}

.los-axis-txt {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}

.los-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  z-index: 2;
}

.los-footer-note {
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  text-align: center;
}

/* =========================================================
   UNIFIED TOWER + DISHES FORM & REQUESTS LIST
   ========================================================= */
.unified-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.unified-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}

.inline-dishes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-dish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.inline-dish-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.request-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.request-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.request-summary {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.request-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}


/* =========================================================
   BRANDED LOGIN SCREEN & ACCOUNT MENU
   ========================================================= */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 15% 18%, rgba(59, 115, 151, 0.22), transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 82%, rgba(245, 184, 46, 0.12), transparent 58%),
    radial-gradient(circle at 50% 50%, rgba(14, 24, 38, 0.4), var(--bg-app) 75%);
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-grid-layer {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(59, 115, 151, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 115, 151, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.78) 25%, transparent 92%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.78) 25%, transparent 92%);
}

[data-theme="light"] .login-grid-layer {
  background-image:
    linear-gradient(to right, rgba(46, 94, 126, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(46, 94, 126, 0.08) 1px, transparent 1px);
}

.login-topology-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.78;
}

[data-theme="light"] .login-topology-svg {
  opacity: 0.48;
}

.noc-pulse {
  stroke-dasharray: 42 260;
  stroke-dashoffset: 302;
  opacity: 0.85;
  animation: nocPulseFlow 7.5s linear infinite;
}

.noc-pulse-gold {
  stroke-dasharray: 36 280;
  stroke-dashoffset: 316;
  animation-duration: 9.2s;
  animation-delay: -2.4s;
}

.noc-pulse-blue-slow {
  stroke-dasharray: 48 300;
  stroke-dashoffset: 348;
  animation-duration: 11s;
  animation-delay: -5.1s;
}

.noc-wave {
  fill: none;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: nocSignalWave 4.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.noc-wave-2 {
  animation-delay: 2.3s;
}

.noc-wave-3 {
  animation-duration: 5.4s;
  animation-delay: 1.1s;
}

@keyframes nocPulseFlow {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes nocSignalWave {
  0% {
    transform: scale(0.45);
    opacity: 0.65;
  }
  70% {
    opacity: 0.18;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  background: rgba(12, 22, 36, 0.82);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  padding: 36px 32px 32px;
  box-shadow:
    0 28px 70px -18px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(59, 115, 151, 0.14) inset;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--brand) 65%, var(--brand-deep) 100%);
}

[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(46, 94, 126, 0.22);
  box-shadow:
    0 24px 60px -18px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.login-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.05;
}

.login-subtitle {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .form-field {
  gap: 7px;
}

.login-form .form-control {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(9, 17, 26, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.88rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

[data-theme="light"] .login-form .form-control {
  background: var(--bg-surface-solid);
}

.login-form .form-control::placeholder {
  font-family: var(--font-ar);
  color: var(--text-muted);
  text-align: right;
  opacity: 0.8;
}

.login-form .form-control:focus {
  border-color: var(--gold);
  background: rgba(9, 17, 26, 0.9);
  box-shadow:
    0 0 0 3px rgba(245, 184, 46, 0.22),
    0 0 18px -4px rgba(59, 115, 151, 0.45);
}

[data-theme="light"] .login-form .form-control:focus {
  background: var(--bg-surface-solid);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-control {
  width: 100%;
  padding-left: 40px;
}

.password-toggle-btn {
  position: absolute;
  left: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  transition: var(--transition);
}
.password-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
}

[data-theme="light"] .login-error {
  color: var(--danger);
}

.form-success {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
}

.login-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 4px;
}

.account-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}

.account-status-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-avatar.is-root {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: var(--gold);
  border: 1px solid rgba(245, 184, 46, 0.45);
}

.account-avatar.is-admin {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--border-strong);
}

.account-status-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.account-status-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.btn-logout {
  padding: 6px 10px;
  font-size: 0.76rem;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Tower Long-Press Repositioning & Confirmation Modal */
.tower-marker-wrap {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.tower-marker-wrap.is-repositioning {
  cursor: grab;
}

.tower-marker-wrap.is-repositioning:active {
  cursor: grabbing;
}

.tower-reposition-ring {
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 2.5px dashed #F5B82E;
  box-shadow: 0 0 18px rgba(245, 184, 46, 0.65);
  pointer-events: none;
  animation: towerRepositionPulse 1.3s ease-in-out infinite;
}

@keyframes towerRepositionPulse {
  0%, 100% {
    transform: scale(0.95) rotate(0deg);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.18) rotate(18deg);
    opacity: 0.65;
  }
}

.tower-pin.is-repositioning {
  transform: scale(1.2);
  border-color: #F5B82E;
  box-shadow: 0 0 0 4px rgba(245, 184, 46, 0.35), 0 8px 22px rgba(0, 0, 0, 0.55);
}

.tower-label-tag.is-repositioning {
  border-color: #F5B82E;
  color: #F5B82E;
  background: rgba(14, 24, 38, 0.96);
  box-shadow: 0 0 0 2px rgba(245, 184, 46, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.reposition-banner {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 825;
  background: linear-gradient(135deg, rgba(46, 94, 126, 0.96), rgba(14, 24, 38, 0.96));
  backdrop-filter: blur(16px);
  color: #F1F5F9;
  border: 1.5px solid #F5B82E;
  padding: 9px 16px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 184, 46, 0.2);
}

.reposition-banner strong {
  color: #F5B82E;
}

.reposition-cancel-btn {
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.reposition-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
}

.reposition-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(9, 17, 26, 0.68);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.16s ease-out;
}

.reposition-modal-panel {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface-solid);
  border: 1.5px solid rgba(59, 115, 151, 0.55);
  border-top: 3px solid #F5B82E;
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 184, 46, 0.15);
  text-align: center;
  direction: rtl;
}

.reposition-modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 115, 151, 0.25), rgba(245, 184, 46, 0.2));
  border: 1px solid rgba(245, 184, 46, 0.45);
  color: #F5B82E;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reposition-modal-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
}

.reposition-modal-subtitle {
  margin: 0 0 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.reposition-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-reposition-confirm {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3B7397, #2E5E7E);
  color: #FFFFFF;
  border: 1px solid #F5B82E;
  box-shadow: 0 4px 14px rgba(46, 94, 126, 0.4);
}

.btn-reposition-confirm:hover {
  background: linear-gradient(135deg, #4785ad, #3B7397);
  box-shadow: 0 6px 18px rgba(245, 184, 46, 0.28);
}

.btn-reposition-cancel {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-reposition-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
