:root {
  --bg-main: #05090d;
  --bg-soft: #0a1118;
  --ink: #c7f8f0;
  --brand: #00f5a0;
  --brand-2: #00d9ff;
  --line: #17303d;
  --panel: #0a161f;
  --panel-2: #0f2230;

  --bs-primary: #00f5a0;
  --bs-primary-rgb: 0, 245, 160;
  --bs-info: #00d9ff;
  --bs-info-rgb: 0, 217, 255;
  --bs-success: #46ff9a;
  --bs-warning: #ffc857;
  --bs-danger: #ff4e78;
  --bs-body-color: #c7f8f0;
  --bs-body-bg: #05090d;
}

body {
  font-family: "Exo 2", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 10% -5%, rgba(0, 245, 160, 0.22) 0%, transparent 62%),
    radial-gradient(860px 500px at 105% 115%, rgba(0, 217, 255, 0.2) 0%, transparent 60%),
    linear-gradient(rgba(0, 255, 170, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 170, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg-main), var(--bg-soft));
  background-size: auto, auto, 36px 36px, 36px 36px, auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.28;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(0, 16, 24, 0.06) 0%, rgba(0, 0, 0, 0.18) 100%);
}

.app-shell {
  position: relative;
}

.neural-canvas-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.46;
  filter: none;
}

#app::before {
  content: none;
}

@media (prefers-reduced-motion: reduce) {
  #app::before {
    animation: none;
  }

  .server-card {
    animation: none;
  }

  .neural-canvas-bg {
    display: none;
  }
}

h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.stat-value,
.gauge-value {
  font-family: "Orbitron", "Exo 2", sans-serif;
  letter-spacing: 0.03em;
}

.modal {
  z-index: 2100;
}

#serviceFormModal {
  z-index: 2220;
}

.modal-backdrop {
  z-index: 2090;
  background: rgba(1, 8, 12, 0.82);
}

.modal.show {
  pointer-events: auto;
}

.top-hero {
  border: 1px solid rgba(0, 245, 160, 0.35);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(3, 24, 33, 0.96), rgba(7, 41, 58, 0.92));
  box-shadow: 0 0 0 1px rgba(0, 217, 255, 0.2), 0 22px 48px rgba(0, 0, 0, 0.45), 0 0 30px rgba(0, 245, 160, 0.2);
  color: #defff8;
}

.glass-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(10, 22, 31, 0.95), rgba(11, 31, 43, 0.84));
  backdrop-filter: none;
  box-shadow: inset 0 0 0 1px rgba(0, 217, 255, 0.1), 0 14px 34px rgba(0, 0, 0, 0.45);
}

.server-card {
  border: 1px solid #1a3b4e;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(9, 24, 33, 0.98) 0%, rgba(8, 18, 26, 0.98) 100%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: cardReveal 420ms ease both;
}

.server-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(0, 245, 160, 0.25), 0 18px 35px rgba(0, 0, 0, 0.55), 0 0 22px rgba(0, 245, 160, 0.12);
}

.stat-card {
  border-left: 5px solid var(--brand-2);
}

.stat-title {
  font-size: 0.82rem;
  color: #66d7cf;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e2fffb;
  text-shadow: 0 0 14px rgba(0, 245, 160, 0.25);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-online,
.status-running,
.status-completed {
  background: #19f3a0;
  box-shadow: 0 0 10px rgba(25, 243, 160, 0.75);
}

.status-offline,
.status-failed,
.status-crashed {
  background: #ff4e78;
  box-shadow: 0 0 10px rgba(255, 78, 120, 0.65);
}

.status-unknown,
.status-stopped,
.status-pending,
.status-executing,
.status-hung {
  background: #ffc857;
  box-shadow: 0 0 10px rgba(255, 200, 87, 0.6);
}

.muted-mini {
  color: #83bfb9;
  font-size: 0.83rem;
  line-height: 1.35;
}

.form-label {
  color: #9feee3;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.modal-title {
  color: #b6fff2;
}

.small,
small {
  color: #86d7cd;
}

.token-box {
  font-family: Consolas, monospace;
  font-size: 0.75rem;
  background: #07131b;
  border: 1px solid #194055;
  color: #9bfbe4;
  border-radius: 8px;
  padding: 6px 8px;
  word-break: break-all;
}

.pm2-output {
  font-family: Consolas, monospace;
  font-size: 0.74rem;
  background: #06121a;
  border: 1px solid #194055;
  color: #cfe9ff;
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0;
}

.pm2-log-body {
  font-family: Consolas, monospace;
  font-size: 0.74rem;
  background: #051017;
  border: 1px solid #194055;
  border-radius: 10px;
  height: 300px;
  overflow-y: auto;
  padding: 8px 10px;
  color: #d4e9ff;
}

.pm2-log-line {
  display: flex;
  gap: 8px;
  padding: 1px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.pm2-log-line.pm2-log-err {
  color: #ff9aa2;
}

.pm2-log-name {
  flex: 0 0 auto;
  min-width: 92px;
  color: #5ad1ff;
  opacity: 0.85;
}

#serverNotesEditor .toastui-editor-defaultUI {
  border: 1px solid #1b4356;
  border-radius: 14px;
  overflow: hidden;
  background: #07131b;
  box-shadow: inset 0 0 0 1px rgba(0, 217, 255, 0.06);
}

#serverNotesEditor .toastui-editor-tabs,
#serverNotesEditor .toastui-editor-mode-switch,
#serverNotesEditor .toastui-editor-md-tab-container,
#serverNotesEditor .toastui-editor-ww-tab-container {
  display: none;
}

#serverNotesEditor .tab-item,
#serverNotesEditor .tab-item.active,
#serverNotesEditor .toastui-editor-dropdown-toolbar,
#serverNotesEditor .toastui-editor-pseudo-clipboard,
#serverNotesEditor .toastui-editor-ww-container {
  background: #07131b !important;
  color: #d8fff9 !important;
}

#serverNotesEditor .toastui-editor-dropdown-toolbar {
  border-color: #20516a !important;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar,
#serverNotesEditor .toastui-editor-toolbar {
  width: 100% !important;
  min-width: 0;
  height: 64px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid #173748;
  background: linear-gradient(180deg, #0d2230, #091722) !important;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 -1px 0 rgba(0, 217, 255, 0.08);
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar .toastui-editor-toolbar-group,
#serverNotesEditor .toastui-editor-toolbar-group {
  flex-shrink: 0;
  border-color: rgba(82, 153, 172, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  margin-right: 4px;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button,
#serverNotesEditor .toastui-editor-toolbar button,
#serverNotesEditor .toastui-editor-toolbar-icons {
  color: #8beedf;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  background-image: none !important;
  opacity: 1;
  position: relative;
  overflow: hidden;
  text-indent: -9999px;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 160ms ease, opacity 140ms ease;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button::before,
#serverNotesEditor .toastui-editor-toolbar button::before {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-indent: 0;
  color: #9deee2;
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.heading::before,
#serverNotesEditor .toastui-editor-toolbar button.heading::before { content: "H"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.bold::before,
#serverNotesEditor .toastui-editor-toolbar button.bold::before { content: "B"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.italic::before,
#serverNotesEditor .toastui-editor-toolbar button.italic::before {
  content: "I";
  font-style: italic;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.strike::before,
#serverNotesEditor .toastui-editor-toolbar button.strike::before {
  content: "S";
  text-decoration: line-through;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.hrline::before,
#serverNotesEditor .toastui-editor-toolbar button.hrline::before { content: "—"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.quote::before,
#serverNotesEditor .toastui-editor-toolbar button.quote::before { content: "❞"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.bullet-list::before,
#serverNotesEditor .toastui-editor-toolbar button.bullet-list::before { content: "••"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.ordered-list::before,
#serverNotesEditor .toastui-editor-toolbar button.ordered-list::before { content: "1."; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.task-list::before,
#serverNotesEditor .toastui-editor-toolbar button.task-list::before { content: "☑"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.table::before,
#serverNotesEditor .toastui-editor-toolbar button.table::before { content: "▦"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.link::before,
#serverNotesEditor .toastui-editor-toolbar button.link::before { content: "⌁"; }

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.code::before,
#serverNotesEditor .toastui-editor-toolbar button.code::before {
  content: "</>";
  font-size: 0.72rem;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button.codeblock::before,
#serverNotesEditor .toastui-editor-toolbar button.codeblock::before {
  content: "{}";
  font-size: 0.78rem;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button:hover,
#serverNotesEditor .toastui-editor-defaultUI-toolbar button.active,
#serverNotesEditor .toastui-editor-toolbar button:hover,
#serverNotesEditor .toastui-editor-toolbar button.active {
  background: linear-gradient(135deg, rgba(0, 245, 160, 0.18), rgba(0, 217, 255, 0.14)) !important;
  border-color: rgba(0, 245, 160, 0.24) !important;
  box-shadow: 0 0 0 1px rgba(0, 217, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.18) !important;
  transform: translateY(-1px);
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button:hover::before,
#serverNotesEditor .toastui-editor-defaultUI-toolbar button.active::before,
#serverNotesEditor .toastui-editor-toolbar button:hover::before,
#serverNotesEditor .toastui-editor-toolbar button.active::before {
  color: #effffb;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button:focus-visible,
#serverNotesEditor .toastui-editor-toolbar button:focus-visible {
  outline: none;
  border-color: rgba(0, 217, 255, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.18) !important;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button:disabled,
#serverNotesEditor .toastui-editor-toolbar button:disabled {
  opacity: 0.35;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar button:disabled::before,
#serverNotesEditor .toastui-editor-toolbar button:disabled::before {
  color: #5f8b8b;
}

#serverNotesEditor .toastui-editor-defaultUI-toolbar .scroll-sync,
#serverNotesEditor .toastui-editor-defaultUI-toolbar .tab-item,
#serverNotesEditor .toastui-editor-toolbar .scroll-sync,
#serverNotesEditor .toastui-editor-toolbar .tab-item {
  margin-left: 6px;
}

#serverNotesEditor .toastui-editor-main {
  border-top: 1px solid rgba(100, 170, 190, 0.22);
  background: linear-gradient(180deg, rgba(6, 18, 26, 0.98), rgba(8, 25, 36, 0.98));
}

#serverNotesEditor .toastui-editor-md-container,
#serverNotesEditor .toastui-editor-contents,
#serverNotesEditor .toastui-editor-md-preview {
  background: linear-gradient(180deg, rgba(6, 18, 26, 0.98), rgba(8, 25, 36, 0.98));
  font-family: "Exo 2", "Segoe UI", Tahoma, sans-serif;
  font-size: 0.96rem;
  line-height: 1.65;
  color: #d8fff9;
}

#serverNotesEditor .toastui-editor-md-container {
  min-height: 300px;
  width: 100% !important;
  border-right: 0 !important;
}

#serverNotesEditor .toastui-editor-ww-container {
  display: none !important;
}

#serverNotesEditor .toastui-editor-md-container .toastui-editor {
  padding: 14px 18px 18px;
}

#serverNotesEditor .toastui-editor-md-container .toastui-editor-md-placeholder {
  color: rgba(184, 240, 234, 0.44);
}

#serverNotesEditor .toastui-editor-md-container .placeholder.ProseMirror-widget {
  background: transparent !important;
  color: rgba(184, 240, 234, 0.44) !important;
  box-shadow: none !important;
}

#serverNotesEditor .toastui-editor-md-container .ProseMirror,
#serverNotesEditor .toastui-editor-md-container [contenteditable="true"] {
  color: #d8fff9;
  caret-color: #00f5a0;
  background: transparent !important;
}

#serverNotesEditor .toastui-editor-md-container .ProseMirror p,
#serverNotesEditor .toastui-editor-md-container [contenteditable="true"] p {
  margin: 0;
}

#serverNotesEditor .toastui-editor-md-container .toastui-editor-md-preview-highlight::selection,
#serverNotesEditor .toastui-editor-md-container [contenteditable="true"]::selection {
  background: rgba(0, 217, 255, 0.2);
}

#serverNotesEditor .toastui-editor-md-preview,
#serverNotesEditor .toastui-editor-md-preview .toastui-editor-contents,
#serverNotesEditor .toastui-editor-contents pre,
#serverNotesEditor .toastui-editor-contents code {
  color: #d8fff9;
}

#serverNotesEditor .toastui-editor-popup,
#serverNotesEditor .toastui-editor-context-menu {
  background: #0a1b27;
  border-color: #20516a;
  color: #d8fff9;
}

#serverNotesEditor .toastui-editor-tooltip {
  z-index: 1;
}

#serverNotesEditor .toastui-editor-popup-body,
#serverNotesEditor .toastui-editor-popup-add-heading,
#serverNotesEditor .toastui-editor-popup-add-link,
#serverNotesEditor .toastui-editor-popup-body input,
#serverNotesEditor .toastui-editor-popup-body label {
  background: #0a1b27;
  color: #d8fff9;
  border-color: #20516a;
}

#serverNotesEditor .toastui-editor-contents pre,
#serverNotesEditor .toastui-editor-contents code {
  background: #0d2230;
  color: #9efee6;
}

#serverNotesEditor .toastui-editor-contents blockquote {
  border-left-color: rgba(0, 245, 160, 0.45);
  color: #9edfd6;
}

.metric-grid {
  border: 1px solid #1c3a4c;
  border-radius: 10px;
  background: #0a1923;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.gauge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-gauge-card {
  border: 1px solid #1b394a;
  border-radius: 10px;
  background: #0a1c28;
  padding: 8px;
}

.metric-gauge {
  position: relative;
  width: min(82px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
}

.metric-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: #1e3d4e;
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 240ms ease, stroke 220ms ease;
}

.gauge-low {
  stroke: #19f3a0;
}

.gauge-medium {
  stroke: #ffc857;
}

.gauge-high {
  stroke: #ff4e78;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  color: #e3fffb;
}

.gauge-label {
  margin-top: 4px;
  font-size: 0.62rem;
  color: #7ecfc7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  color: #77bfb7;
  font-size: 0.8rem;
}

.metric-value {
  color: #dffef8;
  font-size: 0.86rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.server-card > .d-flex > div:first-child {
  min-width: 0;
}

.server-card h5,
.modal-title {
  overflow-wrap: anywhere;
  min-width: 0;
}

.server-card > .d-flex {
  gap: 12px;
  flex-wrap: wrap;
}

.server-actions-menu {
  flex-shrink: 0;
}

.server-actions-menu .dropdown-menu {
  min-width: 210px;
  border: 1px solid #20516a;
  background: #0a1b27;
  color: #c7f8f0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.server-actions-menu .dropdown-item {
  color: #c7f8f0;
}

.server-actions-menu .dropdown-item:hover,
.server-actions-menu .dropdown-item:focus {
  color: #051015;
  background: linear-gradient(90deg, rgba(0, 245, 160, 0.92), rgba(0, 217, 255, 0.86));
}

.server-menu-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #25566f;
  color: #9efee6;
  background: #0b1d2a;
}

.server-menu-icon i {
  font-size: 1rem;
  line-height: 1;
}

.server-actions-menu .dropdown-item:disabled {
  opacity: 0.55;
}

.btn-group .spinner-border {
  width: 0.8rem;
  height: 0.8rem;
}

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.app-toast {
  overflow-wrap: anywhere;
  border-radius: 12px;
  color: #fff;
  padding: 10px 12px;
  box-shadow: 0 14px 30px rgba(15, 35, 60, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toast-success {
  background: linear-gradient(135deg, #0da66b, #1bffab);
}

.toast-error {
  background: linear-gradient(135deg, #bc2f67, #ff4e78);
}

.toast-warning {
  background: linear-gradient(135deg, #a66f10, #ffc857);
}

.toast-info {
  background: linear-gradient(135deg, #007f9f, #00d9ff);
}

.btn-primary {
  color: #03140d;
  border-color: #00b9c8;
  background: linear-gradient(135deg, #00c9dd, #00e7bf);
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #02100b;
  border-color: #33d7e5;
  background: linear-gradient(135deg, #27d9ea, #30efc9);
}

.btn-outline-primary {
  color: #9ceee5;
  border-color: #2b7987;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #051312;
  border-color: #00c9dd;
  background-color: #00c9dd;
}

.btn-warning {
  color: #03130f;
  border-color: #00b9c8;
  background: linear-gradient(135deg, #00c3d6, #00e0b8);
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.18);
}

.btn-warning:hover,
.btn-warning:focus {
  color: #02100c;
  border-color: #33d7e5;
  background: linear-gradient(135deg, #28d5e7, #2debc4);
}

.btn-light {
  color: #a9f5ed;
  border-color: #285c72;
  background: linear-gradient(135deg, #102838, #143247);
}

.btn-light:hover,
.btn-light:focus {
  color: #d0fff8;
  border-color: #3285a0;
  background: linear-gradient(135deg, #153448, #1a4560);
}

.btn-outline-light {
  color: #b4f5ef;
  border-color: #2f6f86;
  background: transparent;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  color: #041312;
  border-color: #00b8ce;
  background: #00b8ce;
}

.btn-outline-secondary {
  color: #a2d4cd;
  border-color: #2a5567;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: #031112;
  border-color: #6ad1c5;
  background: #6ad1c5;
}

.btn-link {
  color: #72f8cd;
}

.btn-link:hover,
.btn-link:focus {
  color: #b6ffe9;
}

.btn {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 140ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
}

.btn i {
  font-size: 0.9em;
}

.btn-sm {
  font-size: 0.74rem;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 48%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 35%,
    rgba(255, 255, 255, 0.45) 48%,
    rgba(255, 255, 255, 0.1) 62%,
    transparent 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
}

.btn:hover::after,
.btn:focus-visible::after {
  animation: btnSweep 720ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.form-control,
.form-select {
  color: #d8fff8;
  background-color: #0a1b27;
  border-color: #1f4860;
  caret-color: #00f5a0;
  text-shadow: 0 0 10px rgba(0, 245, 160, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 217, 255, 0.08);
}

.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
  color: #7cefe0;
  opacity: 1;
  letter-spacing: 0.015em;
}

.form-control::-ms-input-placeholder,
.form-select::-ms-input-placeholder,
input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  color: #7cefe0;
}

.form-control::-webkit-input-placeholder,
.form-select::-webkit-input-placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #7cefe0;
}

.form-control:focus,
.form-select:focus {
  color: #e7fffb;
  background-color: #0d2230;
  border-color: #00d9ff;
  box-shadow: 0 0 0 0.2rem rgba(0, 217, 255, 0.2), inset 0 0 18px rgba(0, 245, 160, 0.08);
}

.form-control:focus::placeholder,
.form-select:focus::placeholder {
  color: #a3fff1;
}

.form-control::selection,
.form-select::selection,
input::selection,
textarea::selection {
  color: #02110f;
  background: rgba(0, 245, 160, 0.78);
}

.input-group-text {
  color: #7cefe0;
  background-color: #0d2433;
  border-color: #1f4860;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.input-group .form-control {
  border-color: #1f4860;
}

.input-group .form-control:focus {
  z-index: 3;
}

.modal-body code {
  color: #7cefe0;
  background: rgba(13, 36, 51, 0.9);
  border: 1px solid #1f4860;
  border-radius: 5px;
  padding: 0 5px;
}

.modal-content {
  color: #c7f8f0;
  background: linear-gradient(180deg, #08151e 0%, #0a1d29 100%);
  border: 1px solid #1f4b62;
}

.modal-header,
.modal-footer {
  border-color: #1f4255;
}

.btn-close {
  filter: invert(1) sepia(14%) saturate(620%) hue-rotate(118deg) brightness(102%) contrast(96%);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: #d8fff8;
  --bs-table-border-color: #19415a;
}

.table thead th {
  color: #9dfff0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  border-bottom-color: #24556f;
}

.table tbody td,
.table tbody th {
  color: #dbfff8;
}

.table .text-muted,
.text-muted {
  color: #8ed6cd !important;
}

.table tbody tr:hover {
  background: rgba(0, 217, 255, 0.06);
}

.table .badge {
  font-size: 0.69rem;
  letter-spacing: 0.02em;
}

.badge.text-bg-success {
  color: #03130f !important;
  background: linear-gradient(135deg, #27d9ea, #30efc9) !important;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.18);
}

.badge.text-bg-danger {
  color: #ffeef4 !important;
  background: linear-gradient(135deg, #5c3142, #7b4258) !important;
  box-shadow: 0 0 10px rgba(169, 103, 128, 0.2);
}

.badge.text-bg-warning {
  color: #03120f !important;
  background: linear-gradient(135deg, #1b7183, #2ca48f) !important;
  box-shadow: 0 0 10px rgba(44, 164, 143, 0.18);
}

.btn-success {
  color: #03130f;
  border-color: #00b9c8;
  background: linear-gradient(135deg, #00c6d9, #00e3bc);
}

.btn-success:hover,
.btn-success:focus {
  color: #02100c;
  border-color: #37d7e8;
  background: linear-gradient(135deg, #2bd7e9, #35edc8);
}

.btn-info {
  color: #03120f;
  border-color: #00b9c8;
  background: linear-gradient(135deg, #00c2d6, #00dcff);
}

.btn-info:hover,
.btn-info:focus {
  color: #03110f;
  border-color: #3bdaf0;
  background: linear-gradient(135deg, #2ad4e8, #37e3ff);
}

.btn-secondary {
  color: #b9eee8;
  border-color: #335f74;
  background: linear-gradient(135deg, #132d3d, #193d50);
}

.btn-secondary:hover,
.btn-secondary:focus {
  color: #d8faf5;
  border-color: #4383a0;
  background: linear-gradient(135deg, #1a4056, #24566f);
}

.btn-danger {
  color: #ffeef4;
  border-color: #88556a;
  background: linear-gradient(135deg, #4b2a36, #613545);
}

.btn-danger:hover,
.btn-danger:focus {
  color: #fff6f9;
  border-color: #a96780;
  background: linear-gradient(135deg, #603545, #754257);
}

.btn-outline-danger {
  color: #e4a6bd;
  border-color: #7a4d5f;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  color: #1d0c13;
  border-color: #a96780;
  background: #a96780;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes signalFlickerOnline {
  0% { opacity: 0.35; transform: scale(0.88); box-shadow: 0 0 3px rgba(25, 243, 160, 0.32); }
  9% { opacity: 1; transform: scale(1.02); box-shadow: 0 0 12px rgba(25, 243, 160, 0.82); }
  14% { opacity: 0.42; transform: scale(0.9); box-shadow: 0 0 4px rgba(25, 243, 160, 0.3); }
  22% { opacity: 0.95; transform: scale(1); box-shadow: 0 0 11px rgba(25, 243, 160, 0.76); }
  36% { opacity: 0.48; transform: scale(0.92); box-shadow: 0 0 4px rgba(25, 243, 160, 0.32); }
  47% { opacity: 1; transform: scale(1.04); box-shadow: 0 0 13px rgba(25, 243, 160, 0.86); }
  58% { opacity: 0.4; transform: scale(0.9); box-shadow: 0 0 4px rgba(25, 243, 160, 0.3); }
  71% { opacity: 0.9; transform: scale(0.99); box-shadow: 0 0 10px rgba(25, 243, 160, 0.72); }
  84% { opacity: 0.5; transform: scale(0.93); box-shadow: 0 0 4px rgba(25, 243, 160, 0.28); }
  100% { opacity: 1; transform: scale(1.02); box-shadow: 0 0 12px rgba(25, 243, 160, 0.82); }
}

@keyframes signalFlickerOffline {
  0% { opacity: 0.3; transform: scale(0.88); box-shadow: 0 0 3px rgba(255, 78, 120, 0.3); }
  7% { opacity: 0.95; transform: scale(1.02); box-shadow: 0 0 11px rgba(255, 78, 120, 0.78); }
  16% { opacity: 0.36; transform: scale(0.9); box-shadow: 0 0 3px rgba(255, 78, 120, 0.28); }
  28% { opacity: 1; transform: scale(1.04); box-shadow: 0 0 13px rgba(255, 78, 120, 0.86); }
  39% { opacity: 0.44; transform: scale(0.91); box-shadow: 0 0 4px rgba(255, 78, 120, 0.3); }
  52% { opacity: 0.92; transform: scale(1.01); box-shadow: 0 0 10px rgba(255, 78, 120, 0.76); }
  63% { opacity: 0.34; transform: scale(0.89); box-shadow: 0 0 3px rgba(255, 78, 120, 0.25); }
  79% { opacity: 1; transform: scale(1.03); box-shadow: 0 0 12px rgba(255, 78, 120, 0.84); }
  91% { opacity: 0.48; transform: scale(0.92); box-shadow: 0 0 4px rgba(255, 78, 120, 0.3); }
  100% { opacity: 0.98; transform: scale(1.02); box-shadow: 0 0 11px rgba(255, 78, 120, 0.8); }
}

@keyframes neuralRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.04);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes btnSweep {
  from {
    left: -140%;
  }
  to {
    left: 160%;
  }
}

.discovered-search {
  max-width: 560px;
}

.discovered-search .input-group-text {
  color: var(--brand-2);
  background: var(--panel-2);
  border-color: var(--line);
}

.discovered-search .input-group-text i {
  color: inherit;
}

.discovered-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .discovered-cell {
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .gauge-grid {
    gap: 6px;
  }

  .metric-gauge {
    width: min(70px, 100%);
  }

  .gauge-value {
    font-size: 0.68rem;
  }

  .gauge-label {
    font-size: 0.57rem;
  }

  .btn {
    font-size: 0.78rem;
  }

  .toast-stack {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 768px) {
  #serverServicesModal .table-responsive {
    overflow-x: visible;
  }

  .apps-table thead {
    display: none;
  }

  .apps-table,
  .apps-table tbody,
  .apps-table tr {
    display: block;
    width: 100%;
  }

  .apps-table td {
    display: block;
  }

  .apps-table tbody tr {
    border: 1px solid #1f465c;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(11, 28, 39, 0.96), rgba(9, 22, 31, 0.96));
    margin-bottom: 10px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .apps-table tbody td {
    border: 0;
    padding: 4px 0;
  }

  .apps-table tbody td::before {
    content: attr(data-label);
    display: block;
    color: #8fe5d9;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
  }

  .apps-table tbody td[data-label="İşlemler"] .d-flex {
    margin-top: 2px;
  }

  .apps-table tbody td[data-label="Mesaj"],
  .apps-table tbody td[data-label="İşlemler"] {
    grid-column: 1 / -1;
  }

  .apps-table tbody td[data-label="İşlemler"] .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .apps-table tbody tr td[colspan] {
    grid-column: 1 / -1;
    text-align: center;
    padding: 10px 0;
  }

  .apps-table tbody tr td[colspan]::before {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  #app::before {
    animation: none !important;
  }

  .neural-canvas-bg {
    display: none;
  }

  .server-card,
  .btn::after {
    animation: none !important;
  }
}
