:root {
  color-scheme: dark;
  --bg: #090e17;
  --panel: #111a28;
  --panel-2: #0d1521;
  --border: #263348;
  --text: #e8eef7;
  --muted: #8d9bb0;
  --accent: #51d4ac;
  --accent-2: #26b990;
  --danger: #ef7777;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 0%, #14243a 0, var(--bg) 58%); }
.login-card { width: min(100%, 420px); padding: 38px; border: 1px solid var(--border); border-radius: 18px; background: rgba(17,26,40,.96); box-shadow: 0 24px 80px rgba(0,0,0,.38); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #53e0b4, #187f75); color: #05221c; font-weight: 900; letter-spacing: -.08em; margin-bottom: 24px; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 10px; font-size: 13px; margin: 0; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .19em; font-weight: 800; }
h1 { font-size: 28px; line-height: 1.2; margin: 9px 0 8px; letter-spacing: -.04em; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 26px; }
label { display: block; margin: 16px 0 7px; color: #c8d3e1; font-size: 12px; font-weight: 650; }
input { display: block; width: 100%; height: 46px; padding: 0 13px; border: 1px solid #33425a; border-radius: 9px; background: #0a121e; color: var(--text); outline: none; font-size: 14px; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(81,212,172,.12); }
.primary-button { width: 100%; min-height: 46px; margin-top: 24px; border: 0; border-radius: 9px; background: var(--accent); color: #06271f; font-size: 14px; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: #74e7c4; }
.primary-button:disabled { opacity: .6; cursor: wait; }
.error-message { min-height: 18px; color: #ff9494; font-size: 12px; margin: 12px 0 0; }
.security-note { display: flex; align-items: center; gap: 8px; color: #718198; font-size: 11px; margin: 20px 0 0; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(81,212,172,.65); }
.admin-screen { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--border); background: #0d1521; }
.topbar-brand, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.topbar-subtitle { color: var(--muted); font-size: 10px; margin-top: 2px; }
.connection-state { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 7px; }
.connection-state.disconnected .status-dot { background: var(--danger); box-shadow: 0 0 10px rgba(239,119,119,.45); }
.quiet-button, .terminal-footer-button { border: 1px solid #33425a; border-radius: 7px; background: transparent; color: #b8c5d6; padding: 8px 11px; font-size: 11px; cursor: pointer; }
.quiet-button:hover, .terminal-footer-button:hover { border-color: var(--accent); color: var(--text); }
.workspace { width: min(100%, 1600px); margin: 0 auto; padding: 22px 28px 16px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.commandbar { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 14px; }
.commandbar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #9aabc1; font-size: 10px; font-weight: 800; letter-spacing: .14em; margin: 0 2px 12px; }
.commandbar-hint { color: #687991; font-size: 10px; font-weight: 400; letter-spacing: 0; }
.command-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.command-button { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 13px; border: 1px solid #33445c; border-radius: 8px; background: #152235; color: #d6e1ee; font-size: 11px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s; }
.command-button:hover:not(:disabled) { border-color: var(--accent); background: #1b3040; }
.command-button:disabled { opacity: .37; cursor: not-allowed; }
.button-icon { color: var(--accent); font-size: 16px; line-height: 1; }
.danger-button .button-icon { color: var(--danger); }
.terminal-card { min-height: 420px; height: clamp(420px, calc(100vh - 260px), 820px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #27364a; border-radius: 12px; background: #080d14; box-shadow: 0 16px 50px rgba(0,0,0,.22); }
.terminal-titlebar { height: 40px; flex: 0 0 40px; display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; padding: 0 14px; border-bottom: 1px solid #1b2738; background: #111a27; }
.terminal-lights { display: flex; gap: 6px; }
.terminal-lights i { width: 8px; height: 8px; border-radius: 50%; background: #526176; }
.terminal-lights i:first-child { background: #e87979; }
.terminal-lights i:nth-child(2) { background: #e5bd69; }
.terminal-lights i:nth-child(3) { background: #62c69c; }
.terminal-caption { text-align: center; color: #9aabc0; font-size: 10px; }
.terminal-indicator { text-align: right; color: #718198; font-size: 9px; letter-spacing: .1em; }
.terminal-container { min-height: 0; flex: 1; padding: 13px 14px 8px; }
.terminal-container .xterm { height: 100%; }
.terminal-container .xterm-viewport { scrollbar-width: thin; scrollbar-color: #34445a #080d14; }
.terminal-footer { height: 33px; flex: 0 0 33px; display: flex; align-items: center; gap: 14px; padding: 0 13px; border-top: 1px solid #1b2738; background: #0d1521; color: #72839a; font-size: 9px; letter-spacing: .06em; }
.terminal-footer-button { margin-left: auto; padding: 4px 8px; border-color: #2a394d; font-size: 9px; }
.workspace-footnote { color: #75849a; font-size: 10px; line-height: 1.5; margin: 0 2px; }
.workspace-footnote code { color: #b5c6d9; }
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .workspace { padding: 12px 10px; }
  .commandbar-hint { display: none; }
  .command-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-button { justify-content: flex-start; padding: 0 9px; font-size: 10px; }
  .command-button:last-child { grid-column: 1 / -1; }
  .terminal-card { height: calc(100vh - 300px); min-height: 360px; }
  .terminal-titlebar { grid-template-columns: 56px 1fr 72px; padding: 0 9px; }
  .terminal-caption { font-size: 9px; }
  .terminal-footer span:nth-child(2) { display: none; }
  .login-card { padding: 28px 22px; }
}


/* Server supervision panels */
.dashboard-grid { display: grid; grid-template-columns: minmax(260px, .95fr) minmax(300px, 1.05fr); gap: 12px; }
.dashboard-card { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.panel-heading h2 { margin: 3px 0 0; color: var(--text); font-size: 13px; letter-spacing: -.01em; }
.panel-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.panel-meta { color: #75869d; font-size: 9px; white-space: nowrap; }
.panel-button, .mini-action { border: 1px solid #33445c; border-radius: 7px; background: #152235; color: #c9d6e5; padding: 6px 9px; font-size: 10px; cursor: pointer; }
.panel-button:hover, .mini-action:hover { border-color: var(--accent); color: white; }
.metric-list { display: grid; gap: 12px; }
.metric-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: #aab8ca; font-size: 10px; }
.metric-label strong { color: #e2ebf5; font-size: 10px; font-weight: 650; text-align: right; }
.metric-track { height: 6px; overflow: hidden; border-radius: 8px; background: #202d3e; }
.metric-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #27a984, #72dfbd); transition: width .35s ease; }
.network-stats { display: flex; gap: 20px; border-top: 1px solid #263348; margin-top: 14px; padding-top: 10px; color: #8292a8; font-size: 10px; }
.network-stats strong { color: #d8e4f1; font-weight: 650; }
.services-list { display: grid; gap: 8px; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #202d3e; padding: 5px 0 8px; }
.service-info { display: grid; gap: 3px; min-width: 0; }
.service-info strong { color: #dbe5f1; font-size: 10px; }
.service-info span { color: #72839a; font-size: 9px; }
.service-state { flex: 0 0 auto; border-radius: 5px; padding: 4px 6px; font-size: 9px; }
.service-state.is-active { background: rgba(39,169,132,.13); color: #70dfb9; }
.service-state.is-inactive { background: rgba(239,119,119,.12); color: #ef9999; }
.service-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.logs-output { height: 190px; overflow: auto; margin: 0; padding: 9px; border: 1px solid #202d3e; border-radius: 7px; background: #080d14; color: #aebdd0; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-list { height: 190px; overflow: auto; margin: 0; padding: 0 0 0 23px; color: #7e90a8; }
.history-list li { padding: 3px 0; font-size: 9px; }
.history-list code { color: #c5d3e3; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.panel-empty { color: #8292a8; font-size: 10px; list-style: none; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .dashboard-card { padding: 11px; } .panel-heading h2 { font-size: 12px; } .metric-label strong { max-width: 68%; } }


/* Unified GraphPins Admin action confirmation modal */
.action-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 7, 13, .78);
  backdrop-filter: blur(7px);
}
.action-modal[hidden] { display: none !important; }
.action-modal-panel {
  width: min(100%, 460px);
  padding: 25px;
  border: 1px solid #34465c;
  border-radius: 15px;
  background: #111a28;
  box-shadow: 0 25px 90px rgba(0,0,0,.58);
  animation: modal-appear .16s ease-out;
}
@keyframes modal-appear {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.action-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.action-modal-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(81,212,172,.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}
.action-modal-eyebrow {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
}
.action-modal-panel h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 19px;
}
.action-modal-panel p {
  margin: 0;
  color: #b5c3d5;
  font-size: 13px;
  line-height: 1.65;
}
.action-modal-warning {
  margin-top: 17px;
  padding: 11px 12px;
  border: 1px solid #33445c;
  border-radius: 8px;
  background: #0c1521;
  color: #91a2b8;
  font-size: 11px;
  line-height: 1.5;
}
.action-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 23px;
}
.action-modal-buttons button {
  min-width: 105px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.modal-cancel {
  border: 1px solid #394b62;
  background: #172335;
  color: #c4d0df;
}
.modal-cancel:hover { border-color: #70839c; }
.modal-confirm {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #06271f;
}
.modal-confirm:hover { background: #74e7c4; }
.modal-confirm.is-danger {
  border-color: #e87979;
  background: #b94f55;
  color: white;
}
.modal-confirm.is-danger:hover { background: #d26168; }
.action-modal-buttons button:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

/* GraphPins confirmation modal — centered layout */
.action-modal {
  display: grid;
  place-items: center;
  text-align: center;
}

.action-modal-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.action-modal-header {
  justify-content: center;
  width: 100%;
}

.action-modal-panel h2,
.action-modal-panel p,
.action-modal-warning {
  width: 100%;
  text-align: center;
}

.action-modal-buttons {
  justify-content: center;
  width: 100%;
}


/* Confirmation modal: centered content */
.action-modal-panel,
.action-modal-panel h2,
.action-modal-panel p,
.action-modal-warning {
  text-align: center;
}
.action-modal-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.action-modal-header,
.action-modal-buttons {
  justify-content: center;
  width: 100%;
}

/* Modal header aligned to the upper-left corner */
.action-modal-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  width: auto;
  margin: 0 0 25px 0;
  text-align: left;
}

.action-modal-icon {
  flex-shrink: 0;
}

.action-modal-eyebrow {
  text-align: left;
}


/* Revert icon-only positioning */
.action-modal-header {
  position: static;
  justify-content: center;
  width: 100%;
}

.action-modal-icon {
  position: static;
}

.action-modal-eyebrow {
  text-align: left;
  width: auto;
}


.action-modal-panel {
  position: relative;
}

#action-modal-task-icon {
  position: absolute;
  top: 24px;
  left: 25px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(81, 212, 172, .14);
  color: var(--accent);
  font-size: 23px;
  font-weight: 800;
}


/* Center task icon at the top of the modal */
#action-modal-task-icon {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(81, 212, 172, .14);
  color: var(--accent);
  font-size: 27px;
  font-weight: 800;
}


/* Fix vertical spacing between task icon and title */
#action-modal-task-icon {
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.action-modal-panel h2 {
  margin-top: 58px !important;
}



/* Reconnexion manuelle du terminal */
.terminal-status-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.terminal-reconnect {
  padding: 5px 10px;
  border: 1px solid rgba(81, 212, 172, .35);
  border-radius: 7px;
  background: rgba(81, 212, 172, .09);
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.terminal-reconnect:hover {
  background: rgba(81, 212, 172, .17);
}
.terminal-reconnect:disabled {
  opacity: .65;
  cursor: wait;
}
.terminal-reconnect[hidden] {
  display: none !important;
}


/* Security audit link in the admin topbar */
.security-audit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
