/* ==========================================================================
   Netly Monitoring — Web Admin
   Restrained infrastructure-console styling. Light theme, neutral surfaces.
   ========================================================================== */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #d9e1ea;
  --border-strong: #c3cedb;
  --text: #102033;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #2563eb;
  --accent-weak: #eaf1ff;
  --accent-press: #1d4ed8;
  --success: #16a34a;
  --success-weak: #e7f6ec;
  --warning: #d97706;
  --warning-weak: #fdf0dd;
  --danger: #dc2626;
  --danger-weak: #fdeaea;
  --gray: #94a3b8;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.12);
  --shadow-pop: 0 18px 50px rgba(15, 23, 42, 0.22);

  --sidebar-w: 232px;
  --topbar-h: 56px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

#app {
  min-height: 100%;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--muted);
}

.icon {
  flex: none;
  display: block;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ------------------------------ Buttons ----------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s, box-shadow 0.12s;
  user-select: none;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-press);
  border-color: var(--accent-press);
}
.btn--danger {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--danger);
}
.btn--danger:hover {
  background: var(--danger-weak);
  border-color: var(--danger);
}
.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn--sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}
.btn--full {
  width: 100%;
}
.btn.is-loading {
  position: relative;
  color: transparent !important;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: #fff;
}
.btn--secondary.is-loading::after,
.btn--ghost.is-loading::after,
.btn--danger.is-loading::after {
  color: var(--text);
}

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

/* ------------------------------ Brand ------------------------------------- */

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(180deg, #2f6df0, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex: none;
}
.brand__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand__tag {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* =========================================================================
   AUTH
   ========================================================================= */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(120% 80% at 50% -10%, #eef3fb 0%, var(--bg) 60%);
}
.auth__card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 24px;
}
.auth__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}
.auth__lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.auth__tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 18px;
}
.auth__tab {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-weight: 550;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.auth__tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.auth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth__error {
  background: var(--danger-weak);
  border: 1px solid #f3c7c7;
  color: #a01616;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12.5px;
}

/* ------------------------------ Fields ------------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.field__hint {
  font-size: 11.5px;
  color: var(--muted-2);
}
.field__input {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field__input::placeholder {
  color: var(--muted-2);
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.field__textarea {
  height: auto;
  padding: 9px 11px;
  resize: vertical;
  min-height: 64px;
  line-height: 1.4;
}

/* ------------------------------ Chips ------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 540;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.chip.is-active {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent-press);
}

/* =========================================================================
   LAYOUT
   ========================================================================= */

.layout {
  display: flex;
  min-height: 100vh;
}
.layout__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ------------------------------ Sidebar ----------------------------------- */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
}
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  flex: 1;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 540;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav__item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav__item.is-active {
  background: var(--accent-weak);
  color: var(--accent-press);
  font-weight: 600;
}
.nav__item.is-active .icon {
  color: var(--accent);
}
.sidebar__foot {
  padding: 14px 18px;
  font-size: 11px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
}

/* ------------------------------ Topbar ------------------------------------ */

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__burger {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.topbar__title {
  font-weight: 700;
  font-size: 15px;
  display: none;
}
.topbar__spacer {
  flex: 1;
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__email {
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------ Main -------------------------------------- */

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 48px;
  max-width: 1180px;
  width: 100%;
}

.page__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page__title {
  margin: 0;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.01em;
}
.page__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.page__actions {
  flex: none;
}

/* =========================================================================
   OVERVIEW
   ========================================================================= */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 84px;
  box-shadow: var(--shadow-sm);
}
.tile__value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.tile__label {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.tile--accent {
  border-left: 3px solid var(--accent);
}
.tile--online {
  border-left: 3px solid var(--success);
}
.tile--online .tile__value {
  color: var(--success);
}
.tile--pending {
  border-left: 3px solid var(--warning);
}
.tile--pending .tile__value {
  color: var(--warning);
}
.tile--skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f5f8fb 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-color: var(--border);
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------ Panel ------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 640;
}
.panel__foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.checklist__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.checklist__item:first-child {
  border-top: 0;
}
.checklist__mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.checklist__item.is-done .checklist__mark {
  background: var(--success);
  border-color: var(--success);
}
.checklist__item.is-done .checklist__text {
  color: var(--muted);
}

/* =========================================================================
   TOOLBAR
   ========================================================================= */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  min-width: 240px;
  flex: 1;
  max-width: 360px;
}
.toolbar__search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.toolbar__search-input {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
}
.toolbar__search-input:focus {
  outline: none;
}
.toolbar__filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.segmented__btn {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* =========================================================================
   RESOURCE TABLE
   ========================================================================= */

.resources__host {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.rtable {
  display: flex;
  flex-direction: column;
}
.rtable__head,
.rtable__row {
  display: grid;
  grid-template-columns:
    120px minmax(140px, 1.4fr) 110px 100px minmax(120px, 1fr)
    150px 110px 116px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.rtable__head {
  height: 40px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.rtable__row {
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.rtable__row:last-child {
  border-bottom: 0;
}
.rtable__row:hover {
  background: var(--surface-2);
}
.rcol {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rcol--status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rname {
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rname__sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}
.rname__sub--mobile {
  display: none;
}
.rcol--actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}
.status-label {
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--gray);
}
.dot--online {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-weak);
}
.dot--pending {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-weak);
}
.dot--warning {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-weak);
}
.dot--offline {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-weak);
}
.dot--unknown {
  background: var(--gray);
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--surface-2);
}
.tag--personal {
  color: #3730a3;
  background: #eef0ff;
  border-color: #d8dcff;
}
.tag--work {
  color: #155e63;
  background: #e6f6f6;
  border-color: #cdebec;
}

.rowaction {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.1s, color 0.1s;
}
.rowaction:hover {
  background: var(--border);
  color: var(--text);
}
.rowaction--danger:hover {
  background: var(--danger-weak);
  color: var(--danger);
}

/* ------------------------------ State blocks ------------------------------ */

.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
}
.state-block__title {
  font-weight: 640;
  font-size: 15px;
}
.state-block__text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 420px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =========================================================================
   OVERLAY / DRAWER / MODAL
   ========================================================================= */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}
.overlay--confirm {
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  transition: opacity 0.18s;
}
.overlay.is-open .overlay__scrim {
  opacity: 1;
}
.overlay--confirm .overlay__scrim {
  opacity: 1;
}

.drawer {
  position: relative;
  width: 460px;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.overlay.is-open .drawer {
  transform: translateX(0);
}
.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer__title {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.drawer__subtitle {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.drawer__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.drawer__close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.drawer__foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.drawer__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer__error {
  background: var(--danger-weak);
  border: 1px solid #f3c7c7;
  color: #a01616;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12.5px;
}

/* ------------------------------ Detail ------------------------------------ */

.detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail__status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail__status-label {
  font-weight: 640;
  font-size: 14px;
}
.detail__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 16px;
  margin: 0;
}
.detail__grid--wide {
  gap: 11px 20px;
}
.detail__dt {
  color: var(--muted);
  font-size: 12.5px;
}
.detail__dd {
  margin: 0;
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}
.detail__section-label {
  font-size: 12px;
  font-weight: 640;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detail__note-text {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
}
.detail__error {
  background: var(--danger-weak);
  border: 1px solid #f3c7c7;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.detail__error .detail__section-label {
  color: #a01616;
}
.detail__error-text {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: #8a1414;
  font-family: var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.install {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.install__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.install__hint {
  font-size: 11.5px;
  color: var(--muted-2);
}

.codeblock {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #0f1b2d;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.codeblock__text {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: #d6e2f3;
  overflow-x: auto;
  white-space: nowrap;
}
.codeblock__copy {
  flex: none;
  width: 40px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #b8c6dc;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.codeblock__copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.codeblock__copy.is-on {
  color: var(--accent);
}

/* ------------------------------ Modal ------------------------------------- */

.modal {
  position: relative;
  width: 400px;
  max-width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 22px;
}
.modal__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 680;
}
.modal__body {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ------------------------------ Toast ------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(16px);
  background: #0f1b2d;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 540;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--success {
  background: #14532d;
}
.toast--error {
  background: #7f1d1d;
}

/* ------------------------------ Scrim (mobile nav) ------------------------ */

.scrim {
  display: none;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 980px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .rtable__head,
  .rtable__row {
    grid-template-columns: 110px minmax(120px, 1.4fr) 100px minmax(110px, 1fr) 96px;
  }
  .rcol--agent,
  .rcol--seen,
  .rtable__head .rcol--agent,
  .rtable__head .rcol--seen {
    display: none;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 70;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
  }
  .scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .topbar__burger {
    display: inline-flex;
  }
  .topbar__title {
    display: block;
  }
  .topbar__email {
    display: none;
  }
  .main {
    padding: 18px 16px 40px;
  }
  .page__head {
    flex-direction: column;
    align-items: stretch;
  }
  .page__actions .btn {
    width: 100%;
  }

  /* Table collapses to stacked cards */
  .resources__host {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .rtable {
    gap: 10px;
  }
  .rtable__head {
    display: none;
  }
  .rtable__row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "status actions"
      "name name"
      "type scope";
    gap: 8px 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-height: 0;
  }
  .rcol {
    white-space: normal;
  }
  .rcol--status {
    grid-area: status;
  }
  .rcol--actions {
    grid-area: actions;
  }
  .rcol--name {
    grid-area: name;
  }
  .rname {
    font-size: 15px;
  }
  .rname__sub--mobile {
    display: block;
  }
  .rcol--type {
    grid-area: type;
    align-self: center;
    color: var(--muted);
    font-size: 12.5px;
  }
  .rcol--scope {
    grid-area: scope;
    justify-self: end;
    align-self: center;
  }
  /* hide redundant columns in card mode */
  .rcol--host,
  .rcol--agent,
  .rcol--seen {
    display: none;
  }

  .drawer {
    width: 100%;
    border-left: 0;
  }
  .overlay {
    justify-content: stretch;
  }
}

@media (max-width: 420px) {
  .tiles {
    grid-template-columns: 1fr 1fr;
  }
  .detail__actions .btn {
    flex: 1;
  }
}
