/* =====================================================================
   Seldom FW — Main Stylesheet
   ===================================================================== */

/* ── CSS Custom Properties ──────────────────────────────────────────── */
:root {
  --c-bg:           #080c14;
  --c-surface:      #0d1421;
  --c-card:         #0f1828;
  --c-card-hover:   #132035;
  --c-border:       #1b2a3e;
  --c-border-2:     #243550;
  --c-text:         #dce8f8;
  --c-text-2:       #8aa8c8;
  --c-text-muted:   #4a6a8a;
  --c-accent:       #00c8ff;
  --c-accent-dim:   rgba(0,200,255,.1);
  --c-accent-glow:  rgba(0,200,255,.22);
  --c-blue:         #3b82f6;
  --c-blue-dim:     rgba(59,130,246,.13);
  --c-purple:       #a855f7;
  --c-purple-dim:   rgba(168,85,247,.13);
  --c-orange:       #f97316;
  --c-orange-dim:   rgba(249,115,22,.13);
  --c-red:          #ef4444;
  --c-red-dim:      rgba(239,68,68,.13);
  --c-green:        #22c55e;
  --c-green-dim:    rgba(34,197,94,.13);
  --c-warning:      #f59e0b;
  --c-warning-dim:  rgba(245,158,11,.13);
  --sidebar-w:      260px;
  --topbar-h:       62px;
  --radius:         14px;
  --radius-sm:      8px;
  --shadow:         0 8px 40px rgba(0,0,0,.55);
  --shadow-sm:      0 2px 12px rgba(0,0,0,.3);
  --transition:     .2s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
svg { display: block; flex-shrink: 0; }
input, button { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-surface); }
::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 3px; }

/* ── Utility ────────────────────────────────────────────────────────── */
.accent    { color: var(--c-accent); }
.text-red  { color: var(--c-red); }
.text-green{ color: var(--c-green); }


/* =====================================================================
   LOGIN PAGE
   ===================================================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  overflow: hidden;
  position: relative;
}

/* Animated grid */
.login-page::before {
  content: '';
  position: fixed;
  inset: -60px;
  background-image:
    linear-gradient(rgba(0,200,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-drift 25s linear infinite;
  z-index: 0;
}

/* Radial ambient glows */
.login-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 600px at 85% 5%,  rgba(0,200,255,.07) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 5%  95%,  rgba(168,85,247,.07) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

@keyframes grid-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(60px, 60px); }
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 24px 16px;
}

.login-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 42px 38px 36px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  animation: card-enter .5s cubic-bezier(.22,1,.36,1) both;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}
.login-card.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }

/* Brand */
.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  background: var(--c-accent-dim);
  border: 1px solid var(--c-accent-glow);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent);
  box-shadow: 0 0 24px var(--c-accent-glow);
}
.login-brand-icon svg { width: 26px; height: 26px; }

.login-brand h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--c-text);
  line-height: 1;
}

.login-brand p {
  font-size: .75rem;
  color: var(--c-text-muted);
  margin-top: 6px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .8625rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.alert svg { width: 16px; height: 16px; margin-top: 2px; }

.alert-error {
  background: var(--c-red-dim);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
}
.alert-warning {
  background: var(--c-warning-dim);
  border: 1px solid rgba(245,158,11,.25);
  color: #fcd34d;
}

/* Form */
.field-group { margin-bottom: 18px; }

.field-group label {
  display: block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-text-2);
  margin-bottom: 7px;
}

.field-wrap { position: relative; }

.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--c-text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.field-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  font-size: .9375rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-wrap input::placeholder { color: var(--c-text-muted); }
.field-wrap input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-dim);
}
.field-wrap:focus-within .field-icon { color: var(--c-accent); }

/* Submit */
.btn-signin {
  width: 100%;
  margin-top: 8px;
  padding: 13px 24px;
  background: var(--c-accent);
  color: #03111a;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-signin .btn-icon { width: 17px; height: 17px; }
.btn-signin:hover { background: #29d5ff; }
.btn-signin:active { transform: scale(.98); }
.btn-signin.loading { opacity: .6; pointer-events: none; }

/* Shimmer sweep on hover */
.btn-signin::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  transform: translateX(-120%);
  transition: transform .45s ease;
}
.btn-signin:hover::after { transform: translateX(120%); }

/* Notice */
.login-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 22px;
  font-size: .74rem;
  color: var(--c-text-muted);
}
.login-notice svg { width: 12px; height: 12px; }


/* =====================================================================
   DASHBOARD PAGE
   ===================================================================== */

.dash-page { overflow: hidden; }

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: left .28s cubic-bezier(.22,1,.36,1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--c-border);
}

.sidebar-brand-icon {
  width: 38px; height: 38px;
  background: var(--c-accent-dim);
  border: 1px solid var(--c-accent-glow);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-accent);
  flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 19px; height: 19px; }

.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-name { font-size: .9375rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.sidebar-brand-ver  { font-size: .68rem; color: var(--c-text-muted); letter-spacing: .06em; margin-top: 1px; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-section {
  display: block;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  padding: 10px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--c-text-2);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: var(--c-card); color: var(--c-text); }
.nav-item.active {
  background: var(--c-accent-dim);
  color: var(--c-accent);
  border-color: rgba(0,200,255,.12);
}
.nav-item.nav-disabled { opacity: .45; pointer-events: none; }

.nav-badge {
  margin-left: auto;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--c-border-2);
  color: var(--c-text-muted);
  padding: 2px 7px;
  border-radius: 99px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 33px; height: 33px;
  background: var(--c-border-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-2);
  flex-shrink: 0;
}
.user-avatar svg { width: 16px; height: 16px; }

.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name {
  font-size: .875rem; font-weight: 600; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.user-role { font-size: .68rem; color: var(--c-text-muted); }

.btn-logout {
  width: 33px; height: 33px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.btn-logout svg { width: 17px; height: 17px; }
.btn-logout:hover { color: var(--c-red); background: var(--c-red-dim); }

/* ── Sidebar overlay (mobile) ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(2px);
  z-index: 199;
}

/* ── Main wrapper ───────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  background: var(--c-bg);
}

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--c-border);
}

.topbar-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  color: var(--c-text-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.topbar-toggle svg { width: 20px; height: 20px; }
.topbar-toggle:hover { color: var(--c-text); background: var(--c-card); }

.topbar-brand {
  display: none;
  align-items: center;
  gap: 7px;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--c-text);
}
.topbar-brand svg { width: 17px; height: 17px; color: var(--c-accent); }

.topbar-spacer { flex: 1; }

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-refresh {
  display: flex;
  align-items: center;
  color: var(--c-text-muted);
}
.topbar-refresh svg { width: 15px; height: 15px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin-icon { animation: spin .9s linear infinite; }

.topbar-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: var(--c-text-2);
}
.topbar-user-info svg { width: 15px; height: 15px; }

/* ── Main content ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 28px 48px;
  max-width: 960px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 12px;
}
.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -.025em;
}
.page-subtitle {
  font-size: .8rem;
  color: var(--c-text-muted);
  margin-top: 2px;
}
.page-header-right {
  font-size: .775rem;
  color: var(--c-text-muted);
  flex-shrink: 0;
  padding-top: 4px;
}
.page-header-right strong { color: var(--c-text-2); font-weight: 500; }

/* ── Stats Grid ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ── Stat Card ──────────────────────────────────────────────────────── */
.stat-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  opacity: 0;
  transform: translateY(14px);
}

.stat-card.loaded {
  animation: stat-card-in .4s cubic-bezier(.22,1,.36,1) both;
}

@keyframes stat-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-card:hover {
  border-color: var(--c-border-2);
  box-shadow: 0 4px 28px rgba(0,0,0,.35);
  transform: translateY(-2px);
}

/* Card top */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-text-2);
}

.card-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.card-icon-wrap svg { width: 19px; height: 19px; }

.accent-blue   { background: var(--c-blue-dim);   color: var(--c-blue);   }
.accent-purple { background: var(--c-purple-dim); color: var(--c-purple); }
.accent-orange { background: var(--c-orange-dim); color: var(--c-orange); }
.accent-red    { background: var(--c-red-dim);    color: var(--c-red);    }

/* Value */
.card-value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--c-text);
  margin-bottom: 14px;
}

/* Loading pulse */
@keyframes pulse-load {
  0%, 100% { opacity: .3; }
  50%       { opacity: .7; }
}
.loading { animation: pulse-load 1.4s ease-in-out infinite; }
.card-value.loading { color: var(--c-text-muted); font-size: 2rem; }

/* Progress bar */
.progress-wrap { margin-bottom: 10px; }
.progress-track {
  height: 5px;
  background: var(--c-border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width .85s cubic-bezier(.22,1,.36,1);
}
.fill-purple { background: var(--c-purple); }
.fill-orange { background: var(--c-orange); }

/* Card detail */
.card-detail {
  font-size: .8rem;
  color: var(--c-text-muted);
  margin: 0;
}

/* Firewall indicator */
.fw-value { font-size: 2rem; }
.fw-value.text-red   { color: var(--c-red); }
.fw-value.text-green { color: var(--c-green); }

.fw-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fw-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--c-text-muted);
}

@keyframes fw-pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%     { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}
@keyframes fw-pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%     { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.fw-dot.disabled {
  background: var(--c-red);
  animation: fw-pulse-red 2s ease infinite;
}
.fw-dot.active {
  background: var(--c-green);
  animation: fw-pulse-green 2s ease infinite;
}


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

@media (max-width: 900px) {
  .main-content { max-width: 100%; }
}

@media (max-width: 768px) {
  .sidebar        { left: calc(-1 * var(--sidebar-w)); }
  .sidebar.open   { left: 0; box-shadow: var(--shadow); }
  .sidebar-overlay.active { display: block; }

  .main-wrapper   { margin-left: 0; }

  .topbar         { padding: 0 16px; }
  .topbar-toggle  { display: flex; }
  .topbar-brand   { display: flex; }

  .main-content   { padding: 20px 16px 36px; }

  .page-header    { flex-direction: column; gap: 6px; }
  .page-header-right { padding-top: 0; }
}

@media (max-width: 540px) {
  .stats-grid     { grid-template-columns: 1fr; }
  .login-card     { padding: 30px 22px 26px; }
  .sysinfo-bar    { flex-direction: column; gap: 10px; }
}


/* =====================================================================
   FIREWALL PAGE — Status bar
   ===================================================================== */

.fw-status-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.fw-status-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .88rem;
  font-weight: 700;
  padding-right: 20px;
}

.fw-indicator-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--c-text-muted);
}
.fw-indicator-dot.online {
  background: var(--c-green);
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
  animation: fw-pulse-green 2s ease infinite;
}
.fw-indicator-dot.offline { background: var(--c-red); }

.fw-status-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--c-text-2);
  padding: 0 20px;
  border-left: 1px solid var(--c-border);
}
.fw-status-stat svg { flex-shrink: 0; }
.fw-status-stat strong { color: var(--c-text); font-weight: 700; }

.fw-status-offline-msg {
  margin-left: auto;
  font-size: .78rem;
  color: var(--c-red);
  background: var(--c-red-dim);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,.25);
}


/* =====================================================================
   FIREWALL PAGE — Panels grid
   ===================================================================== */

.fw-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.fw-panel {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fw-panel-disabled { opacity: .5; pointer-events: none; }

.fw-panel-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--c-border);
}

.fw-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 14px;
}
.fw-panel-title svg { width: 16px; height: 16px; stroke: var(--c-accent); }

.ip-add-form {
  display: flex;
  gap: 8px;
}
.ip-add-form input {
  flex: 1;
  min-width: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  padding: 8px 12px;
  font-size: .82rem;
  transition: border-color var(--transition);
}
.ip-add-form input:focus   { outline: none; border-color: var(--c-accent); }
.ip-add-form input.invalid { border-color: var(--c-red); animation: shake .35s ease; }
.ip-add-form input::placeholder { color: var(--c-text-muted); }
.ip-add-form input:disabled { opacity: .45; }

.ip-add-form button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition);
}
.ip-add-form button:disabled { opacity: .4; cursor: not-allowed; }

.btn-block { background: var(--c-red-dim);   color: var(--c-red);   border: 1px solid rgba(239,68,68,.3); }
.btn-allow { background: var(--c-green-dim); color: var(--c-green); border: 1px solid rgba(34,197,94,.3); }
.btn-block:hover:not(:disabled) { background: rgba(239,68,68,.22); }
.btn-allow:hover:not(:disabled) { background: rgba(34,197,94,.22); }


/* ── IP list ─────────────────────────────────────────────────────── */

.ip-list {
  flex: 1;
  max-height: 340px;
  overflow-y: auto;
}

.ip-list-loading {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ip-list-loading span {
  display: block;
  height: 34px;
  background: linear-gradient(90deg, var(--c-border) 25%, var(--c-border-2) 50%, var(--c-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

.ip-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: .82rem;
}
.ip-empty svg {
  width: 30px; height: 30px;
  margin: 0 auto 10px;
  stroke: var(--c-text-muted);
  opacity: .4;
  display: block;
}

.ip-row {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid var(--c-border);
  gap: 10px;
  transition: background var(--transition);
}
.ip-row:first-child { border-top: none; }
.ip-row:hover       { background: var(--c-card-hover); }

.ip-addr {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .82rem;
  color: var(--c-text);
  letter-spacing: .02em;
}

.btn-remove {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: .74rem;
  font-weight: 700;
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-remove:hover         { border-color: var(--c-red); color: var(--c-red); background: var(--c-red-dim); }
.btn-remove.confirming    { border-color: var(--c-red); color: #fff; background: var(--c-red); }
.btn-remove:disabled      { opacity: .4; cursor: not-allowed; }


/* =====================================================================
   FIREWALL PAGE — Port reference
   ===================================================================== */

.port-ref {
  margin-top: 18px;
  padding: 16px 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.port-ref-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 12px;
}

.port-ref-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.port-ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  font-size: .78rem;
}
.port-ref-item .port-label {
  color: var(--c-text-muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
.port-ref-item .port-nums {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--c-text);
  font-weight: 600;
}
.port-ref-item.public   { border-color: rgba(34,197,94,.3);  background: var(--c-green-dim); }
.port-ref-item.ssh      { border-color: rgba(245,158,11,.3); background: var(--c-warning-dim); }
.port-ref-item.restrict { border-color: rgba(59,130,246,.3); background: var(--c-blue-dim); }


/* =====================================================================
   TOAST NOTIFICATIONS
   ===================================================================== */

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: .83rem;
  font-weight: 600;
  max-width: 320px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto;
  box-shadow: var(--shadow-sm);
}
.toast.show     { opacity: 1; transform: translateX(0); }
.toast-success  { background: var(--c-green-dim);   border: 1px solid rgba(34,197,94,.35);  color: var(--c-green); }
.toast-error    { background: var(--c-red-dim);     border: 1px solid rgba(239,68,68,.35);  color: var(--c-red); }


/* =====================================================================
   RESPONSIVE — Firewall page
   ===================================================================== */

@media (max-width: 768px) {
  .fw-panels        { grid-template-columns: 1fr; }
  .fw-status-bar    { gap: 10px; }
  .fw-status-stat   { border-left: none; padding-left: 0; }
}


.fill-green  { background: linear-gradient(90deg, var(--c-green)   0%, #16a34a 100%); }
.fill-yellow { background: linear-gradient(90deg, var(--c-warning)  0%, #d97706 100%); }
.fill-red    { background: linear-gradient(90deg, var(--c-red)      0%, #b91c1c 100%); }


/* =====================================================================
   SYSINFO BAR
   ===================================================================== */

.sysinfo-bar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.sysinfo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--c-border);
}
.sysinfo-item:last-child { border-right: none; padding-right: 0; }

.sysinfo-item > svg {
  width: 16px; height: 16px;
  stroke: var(--c-accent);
  flex-shrink: 0;
}

.sysinfo-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.sysinfo-value {
  font-size: .88rem;
  font-weight: 600;
  color: var(--c-text);
  margin-left: auto;
  white-space: nowrap;
}

.sysinfo-value.loading {
  display: inline-block;
  width: 64px; height: 12px;
  background: linear-gradient(90deg, var(--c-border) 25%, var(--c-border-2) 50%, var(--c-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  vertical-align: middle;
}


/* =====================================================================
   TOPBAR REFRESH BUTTON
   ===================================================================== */

.topbar-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: .78rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}
.topbar-refresh:hover {
  background: var(--c-accent-dim);
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.topbar-refresh.refreshing {
  color: var(--c-accent);
  border-color: var(--c-accent);
}
.topbar-refresh svg {
  width: 15px; height: 15px;
}
#refresh-countdown {
  min-width: 22px;
  text-align: center;
}


/* =====================================================================
   PASSWORD EYE TOGGLE
   ===================================================================== */

.field-wrap.has-toggle { position: relative; }
.field-wrap.has-toggle input { padding-right: 42px; }

.field-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--c-text-muted);
  transition: color var(--transition), background var(--transition);
}
.field-eye:hover { color: var(--c-accent); background: var(--c-accent-dim); }
.field-eye.active { color: var(--c-accent); }
.field-eye svg { width: 17px; height: 17px; }
