/* ═══════════════════════════════════════════════════════════
   Waifly Dashboard — UI Redesign Layer
   Applies over existing CSS. No HTML or JS changes.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --wf-accent:        #38b1ed;
  --wf-accent-2:      #6dd2ff;
  --wf-accent-soft:   rgba(56, 177, 237, 0.12);
  --wf-accent-line:   rgba(56, 177, 237, 0.32);

  --wf-bg:            #060d1f;
  --wf-surface-1:     #0c1734;
  --wf-surface-2:     #111f42;
  --wf-surface-3:     #1a2c54;
  --wf-surface-elev:  #142348;

  --wf-border:        rgba(255,255,255,0.06);
  --wf-border-strong: rgba(255,255,255,0.12);

  --wf-text:          #f1f5fb;
  --wf-muted:         #9ab0d2;
  --wf-dim:           #6a7fa3;

  --wf-ok:            #22c55e;
  --wf-ok-soft:       rgba(34,197,94,0.16);
  --wf-warn:          #f59e0b;
  --wf-warn-soft:     rgba(245,158,11,0.16);
  --wf-bad:           #ef4444;
  --wf-bad-soft:      rgba(239,68,68,0.16);
  --wf-info:          var(--wf-accent);
  --wf-info-soft:     var(--wf-accent-soft);

  --wf-r-sm: 8px;
  --wf-r-md: 12px;
  --wf-r-lg: 16px;
  --wf-r-xl: 22px;

  --wf-shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.18);
  --wf-shadow-2: 0 8px 28px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);

  --wf-font-sans: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wf-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Override legacy tokens */
  --primary-color:  var(--wf-accent);
  --primary-dark:   #2a9fd9;
  --dark-bg:        var(--wf-bg);
  --secondary-bg:   var(--wf-surface-1);
  --tertiary-bg:    var(--wf-surface-2);
  --border-color:   var(--wf-border);
  --text-light:     var(--wf-text);
  --text-secondary: var(--wf-muted);
  --text-muted:     var(--wf-dim);
  --shadow:         0 4px 20px rgba(0,0,0,0.4);
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--wf-font-sans) !important;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  background-color: var(--wf-bg) !important;
  background-image:
    linear-gradient(180deg, rgba(6,13,31,0.75) 0%, rgba(6,13,31,0.92) 100%),
    url('../images/background.webp') !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  background-position: center !important;
  color: var(--wf-text) !important;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════ */
.navbar {
  background: linear-gradient(180deg, #142348 0%, #0e1c3e 100%) !important;
  border-bottom: 1px solid var(--wf-border) !important;
  box-shadow: 0 1px 0 var(--wf-border), 0 4px 24px rgba(0,0,0,0.4) !important;
  padding: 0 22px !important;
  height: 60px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  backdrop-filter: blur(12px) !important;
}

.nav-logo {
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 4px 12px rgba(56,177,237,0.25) !important;
}

.nav-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  color: var(--wf-text) !important;
}

.nav-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 7px 11px !important;
  border-radius: var(--wf-r-sm) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: var(--wf-muted) !important;
  transition: background 0.15s, color 0.15s !important;
  text-decoration: none !important;
}
.nav-link:hover {
  color: var(--wf-text) !important;
  background: rgba(255,255,255,0.05) !important;
}
.nav-link.active {
  color: var(--wf-accent) !important;
  background: var(--wf-accent-soft) !important;
}
.nav-link img {
  width: 16px !important;
  height: 16px !important;
  filter: brightness(0) invert(1) !important;
  opacity: 0.7;
}
.nav-link.active img {
  filter: brightness(0) saturate(100%) invert(60%) sepia(60%) saturate(600%) hue-rotate(175deg) !important;
  opacity: 1;
}

#user-submenu,
.nav-submenu {
  background: var(--wf-surface-elev) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: var(--wf-r-md) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55) !important;
  padding: 6px !important;
}
.nav-submenu .nav-link,
#user-submenu .nav-link {
  border-radius: 7px !important;
  font-size: 13px !important;
}

/* ══════════════════════════════════════════════════════════════
   PAGE CONTAINERS
   ══════════════════════════════════════════════════════════════ */
.container {
  max-width: 1240px !important;
  margin: 0 auto !important;
  padding: 28px 24px 80px !important;
}

/* ══════════════════════════════════════════════════════════════
   HOME PAGE LAYOUT — grid matching design intent
   HTML order: [0]Summary [1]Notifications [2]Info [3]Contact
   Layout: Summary(2fr) + Notifications(1fr), then Info+Contact(1fr each)
   ══════════════════════════════════════════════════════════════ */
main.container {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important;
  grid-template-rows: auto auto !important;
  grid-template-areas:
    "summary notifications"
    "info    contact" !important;
  gap: 16px !important;
  align-items: start !important;
  flex-wrap: unset !important;
}
main.container > .module:nth-child(1) { grid-area: summary !important; }
main.container > .module:nth-child(2) { grid-area: notifications !important; }
main.container > .module:nth-child(3) { grid-area: info !important; }
main.container > .module:nth-child(4) { grid-area: contact !important; }

/* Fix flex sizing from home.css (max-width: calc(50%…)) */
main.container > .module {
  max-width: none !important;
  min-width: 0 !important;
  flex: unset !important;
  width: 100% !important;
}

/* ══════════════════════════════════════════════════════════════
   CARDS / MODULES
   ══════════════════════════════════════════════════════════════ */
.module {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 22px 24px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.18) !important;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}
.module:hover { border-color: var(--wf-border-strong) !important; }

/* Section headings inside modules */
.module h2,
.module section h2 {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--wf-dim) !important;
  margin: 0 0 14px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid var(--wf-border) !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
}
/* Nested h2 (Waifly App inside Summary) */
.module h2 ~ h2,
.module section h2 ~ h2 {
  margin-top: 22px !important;
  padding-top: 4px !important;
}

.module p { font-size: 13px !important; color: var(--wf-muted) !important; line-height: 1.6 !important; margin-bottom: 10px !important; }
.module a { color: var(--wf-accent) !important; text-decoration: none !important; }
.module a:hover { text-decoration: underline !important; }
.module ul { padding: 0 !important; list-style: none !important; }
.module li {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  padding: 7px 0 !important;
  border-bottom: 1px solid var(--wf-border) !important;
}
.module li:last-child { border-bottom: 0 !important; }

/* Summary module — server count prominent display */
#total-servers {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: var(--wf-text) !important;
  letter-spacing: -0.03em !important;
}
#max-servers { font-size: 16px !important; color: var(--wf-dim) !important; font-weight: 500 !important; }
#summary > ul > li {
  display: flex !important;
  align-items: center !important;
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  padding: 4px 0 10px !important;
  border-bottom: none !important;
}

/* Notification items */
#notification-list li {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 10px 0 !important;
}
#notification-list a {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--wf-text) !important;
}
#notification-list .date {
  font-size: 11px !important;
  color: var(--wf-dim) !important;
  margin-left: 6px !important;
}
#notification-list .message {
  font-size: 12px !important;
  color: var(--wf-muted) !important;
  margin: 2px 0 0 !important;
  display: block !important;
}

/* Info + Contact — style as feature cards like the design's bottom row */
#info, #contact {
  padding: 20px 22px !important;
}
#info p, #contact p {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  margin-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
#contact img.icons {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

/* ══════════════════════════════════════════════════════════════
   HOME PAGE — specific element fixes
   ══════════════════════════════════════════════════════════════ */

/* "Upgrade" badge */
#upgrade-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 10px !important;
  margin-left: 8px !important;
  background: var(--wf-accent-soft) !important;
  color: var(--wf-accent) !important;
  border: 1px solid var(--wf-accent-line) !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  vertical-align: middle !important;
  box-shadow: none !important;
  transform: none !important;
}
#upgrade-btn:hover {
  background: rgba(56,177,237,0.2) !important;
  color: var(--wf-accent) !important;
  transform: none !important;
  text-decoration: none !important;
}
#upgrade-btn img {
  width: 13px !important;
  height: 13px !important;
  margin: 0 !important;
  filter: brightness(0) saturate(100%) invert(60%) sepia(60%) saturate(600%) hue-rotate(175deg) !important;
}

/* Google Play button — home.css uses background: var(--primary-color) → cyan, fix to dark store badge */
a[href*="play.google.com"],
#google-play {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #1a1f3a !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
a[href*="play.google.com"]:hover,
#google-play:hover {
  background: #212747 !important;
  border-color: rgba(255,255,255,0.22) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4) !important;
  text-decoration: none !important;
}
a[href*="play.google.com"] * { color: #fff !important; }
a[href*="play.google.com"] .get-it-on { font-size: 10px !important; font-weight: 400 !important; opacity: 0.8; }
a[href*="play.google.com"] .google-play { font-size: 14px !important; font-weight: 700 !important; }
.icons-download { width: 28px !important; height: 28px !important; }
.icons-qrcode {
  width: 90px !important;
  height: 90px !important;
  border-radius: 8px !important;
  border: 1px solid var(--wf-border) !important;
  vertical-align: middle !important;
}

/* Contact section social links */
#contact p { display: flex !important; align-items: center !important; gap: 6px !important; }
#contact img.icons { width: 18px !important; height: 18px !important; vertical-align: middle !important; }

/* General .icons sizing */
.icons { width: 18px !important; height: 18px !important; vertical-align: middle !important; }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}

thead, thead tr { background: transparent !important; }

th {
  text-align: left !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--wf-dim) !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--wf-border) !important;
}

td {
  padding: 13px 16px !important;
  border-bottom: 1px solid var(--wf-border) !important;
  vertical-align: middle !important;
  color: var(--wf-muted) !important;
}
tr:last-child td { border-bottom: 0 !important; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: var(--wf-surface-3) !important; }
td:last-child, th:last-child { text-align: right !important; }

/* Scrollable tbody */
tbody {
  display: block;
  max-height: 58vh;
  overflow-y: auto;
}
tbody::-webkit-scrollbar { width: 4px; }
tbody::-webkit-scrollbar-thumb { background: var(--wf-border-strong); border-radius: 4px; }
thead, tbody tr { display: table; width: 100%; table-layout: fixed; }

/* Server name */
.link-server {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--wf-text) !important;
}
.link-server:hover { color: var(--wf-accent) !important; text-decoration: underline !important; }
.link-server.suspended { color: #fca5a5 !important; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
button,
.btn {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 9px !important;
  padding: 8px 14px !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
  background: rgba(255,255,255,0.05) !important;
  color: var(--wf-text) !important;
}
button:hover, .btn:hover {
  background: rgba(255,255,255,0.09) !important;
  transform: translateY(-1px) !important;
}

/* Primary — create server, submit */
#create-server,
#submit-btn,
button[type="submit"],
.btn.btn-primary {
  background: var(--wf-accent) !important;
  color: #08172d !important;
  border-color: transparent !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 14px -4px rgba(56,177,237,0.55) !important;
}
#create-server:hover,
#submit-btn:hover,
button[type="submit"]:hover,
.btn.btn-primary:hover {
  background: #4cbeef !important;
  box-shadow: 0 6px 20px -4px rgba(56,177,237,0.6) !important;
}

/* Secondary */
.btn,
.btn-secondary {
  background: rgba(255,255,255,0.05) !important;
  color: var(--wf-text) !important;
  border-color: var(--wf-border-strong) !important;
}
.btn:hover,
.btn-secondary:hover {
  background: rgba(255,255,255,0.09) !important;
  border-color: var(--wf-accent-line) !important;
}

/* Danger */
#delete-btn,
.btn-danger {
  background: var(--wf-bad-soft) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,0.3) !important;
  box-shadow: none !important;
}
#delete-btn:hover,
.btn-danger:hover {
  background: var(--wf-bad) !important;
  color: #fff !important;
  border-color: var(--wf-bad) !important;
  box-shadow: 0 4px 14px rgba(239,68,68,0.35) !important;
}

/* Cancel (grey) */
#cancel-btn {
  background: rgba(255,255,255,0.05) !important;
  color: var(--wf-muted) !important;
  border-color: var(--wf-border) !important;
}

/* Icon buttons in header */
#refresh-btn,
#shop-btn,
#resources-btn {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-sm) !important;
  padding: 8px !important;
  color: var(--wf-muted) !important;
}
#refresh-btn:hover,
#shop-btn:hover,
#resources-btn:hover {
  color: var(--wf-accent) !important;
  border-color: var(--wf-accent-line) !important;
  background: var(--wf-accent-soft) !important;
  transform: none !important;
}
#refresh-btn img,
#shop-btn img,
#resources-btn img {
  width: 20px !important;
  height: 20px !important;
  filter: brightness(0) invert(1) !important;
}
#refresh-btn:hover img,
#shop-btn:hover img,
#resources-btn:hover img {
  filter: brightness(0) saturate(100%) invert(60%) sepia(60%) saturate(600%) hue-rotate(175deg) !important;
}

/* Icon buttons inside table cells */
td button {
  padding: 0 !important;
  width: 30px !important;
  height: 30px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-sm) !important;
  color: var(--wf-muted) !important;
  display: inline-grid !important;
  place-items: center !important;
  transition: all 0.14s !important;
}
td button:hover {
  border-color: var(--wf-accent-line) !important;
  color: var(--wf-accent) !important;
  background: var(--wf-accent-soft) !important;
  transform: none !important;
}
td button img {
  width: 15px !important;
  height: 15px !important;
  filter: brightness(0) invert(1) !important;
}
td button:hover img {
  filter: brightness(0) saturate(100%) invert(60%) sepia(60%) saturate(600%) hue-rotate(175deg) !important;
}

button:disabled, .btn:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
.btn-small, .btn-sm {
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

/* ══════════════════════════════════════════════════════════════
   STATUS PILLS
   ══════════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  border: 1px solid !important;
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-active  { background: var(--wf-ok-soft) !important; color: #6ee7a3 !important; border-color: rgba(34,197,94,.25) !important; }
.status-active::before { animation: wf-pulse 1.6s infinite; }

.status-suspended { background: var(--wf-bad-soft) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,.25) !important; }
.status-cancelled { background: rgba(156,163,175,.12) !important; color: #9ca3af !important; border-color: rgba(156,163,175,.2) !important; }
.status-expired   { background: rgba(156,163,175,.12) !important; color: #9ca3af !important; border-color: rgba(156,163,175,.2) !important; }
.status-past_due  { background: var(--wf-warn-soft) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.25) !important; }

/* Servers table status dots */
span[class*="status-running"],
span[class*="status-online"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  background: var(--wf-ok-soft) !important;
  color: #6ee7a3 !important;
  border: 1px solid rgba(34,197,94,.25) !important;
}
span[class*="status-installing"],
span[class*="status-starting"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  background: var(--wf-warn-soft) !important;
  color: #fcd34d !important;
  border: 1px solid rgba(245,158,11,.25) !important;
}
span[class*="status-offline"],
span[class*="status-stopped"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  background: var(--wf-bad-soft) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239,68,68,.25) !important;
}

@keyframes wf-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 3px transparent; opacity: 0.5; }
}

/* ══════════════════════════════════════════════════════════════
   FORM CONTROLS
   ══════════════════════════════════════════════════════════════ */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]),
select,
textarea {
  width: 100% !important;
  padding: 10px 12px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: 9px !important;
  color: var(--wf-text) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s !important;
  outline: none !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):focus,
select:focus,
textarea:focus {
  border-color: var(--wf-accent) !important;
  background: rgba(56,177,237,0.05) !important;
  box-shadow: 0 0 0 3px var(--wf-accent-soft) !important;
}
input::placeholder { color: var(--wf-dim) !important; }

select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a7fa3' stroke-width='1.4' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 36px !important;
}

label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--wf-muted) !important;
  margin-bottom: 6px !important;
  display: block !important;
}

#search-bar {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-sm) !important;
  padding: 9px 14px !important;
  color: var(--wf-text) !important;
  font-size: 13px !important;
}
#search-bar:focus {
  border-color: var(--wf-accent-line) !important;
  background: rgba(56,177,237,0.05) !important;
  box-shadow: 0 0 0 3px var(--wf-accent-soft) !important;
}
#search-bar::placeholder { color: var(--wf-dim) !important; }

/* ══════════════════════════════════════════════════════════════
   SERVERS PAGE — TABLE WRAPPER
   ══════════════════════════════════════════════════════════════ */
.container > table,
#servers-table {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  overflow: hidden !important;
  backdrop-filter: blur(8px);
}

.header {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 16px !important;
  flex-wrap: wrap !important;
  background: transparent !important;
  padding: 0 !important;
}

.tooltip {
  background: var(--wf-surface-elev) !important;
  color: var(--wf-text) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  padding: 5px 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */

/* Generic wf-modal-overlay — base centering (page CSS adds specifics) */
.wf-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 9000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  overscroll-behavior: contain !important;
}
.wf-modal-overlay.active,
.wf-modal-overlay.show,
.wf-modal-overlay.visible,
.wf-modal-overlay[style*="flex"] {
  display: flex !important;
  animation: wf-backdrop-in .2s ease !important;
}

#view-modal,
#edit-create-modal,
#delete-modal {
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  display: none;
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  overscroll-behavior: contain !important;
}

#view-modal.show,
#edit-create-modal.show,
#delete-modal.show,
#view-modal.active,
#edit-create-modal.active,
#delete-modal.active,
#view-modal[style*="block"],
#edit-create-modal[style*="block"],
#delete-modal[style*="block"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  animation: wf-backdrop-in .2s ease !important;
}

.modal-overlay {
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  overscroll-behavior: contain !important;
}

/* Show overlay when activated via JS class toggling or inline style */
.modal-overlay.active,
.modal-overlay.visible,
.modal-overlay.show,
.modal-overlay[style*="block"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  animation: wf-backdrop-in .2s ease !important;
}

.modal-content {
  background: var(--wf-surface-1, #0c1734) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: var(--wf-r-lg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) !important;
  padding: 28px !important;
  color: var(--wf-text) !important;
  max-width: 480px !important;
  width: 92% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  position: relative !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
}

.modal-overlay .modal {
  background: #0d1b38 !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: var(--wf-r-lg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7) !important;
  padding: 28px !important;
  color: var(--wf-text) !important;
}

.modal-content h2,
.modal-overlay .modal h3 {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  margin: 0 0 8px !important;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.modal-content p,
.modal-overlay .modal p {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  line-height: 1.6 !important;
}
.modal-content .close {
  color: var(--wf-dim) !important;
  font-size: 20px !important;
  transition: color 0.15s !important;
  background: transparent !important;
  border: none !important;
  width: auto !important;
  height: auto !important;
  padding: 4px !important;
}
.modal-content .close:hover { color: var(--wf-text) !important; transform: none !important; }

.modal-actions {
  display: flex !important;
  gap: 10px !important;
  justify-content: flex-end !important;
  margin-top: 22px !important;
}

/* .active .modal-content — removed: flex-based centering replaces transform approach */

/* ══════════════════════════════════════════════════════════════
   BILLING PAGE
   ══════════════════════════════════════════════════════════════ */
.billing-container {
  max-width: 1100px !important;
  margin: 32px auto 60px !important;
  padding: 0 24px !important;
}
.billing-header h2 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  letter-spacing: -0.01em !important;
}
.billing-header p { color: var(--wf-muted) !important; font-size: 13px !important; }

.tabs {
  display: flex !important;
  gap: 4px !important;
  padding: 4px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  margin-bottom: 24px !important;
  width: fit-content !important;
}
.tab {
  background: transparent !important;
  border: none !important;
  padding: 8px 18px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--wf-dim) !important;
  cursor: pointer !important;
  border-radius: var(--wf-r-sm) !important;
  transition: all 0.15s !important;
  transform: none !important;
}
.tab:hover { color: var(--wf-text) !important; background: rgba(255,255,255,0.04) !important; }
.tab.active {
  background: var(--wf-accent) !important;
  color: #08172d !important;
  box-shadow: 0 2px 8px rgba(56,177,237,0.35) !important;
}

.subscriptions-grid { display: flex !important; flex-direction: column !important; gap: 12px !important; }

.subscription-card {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  padding: 18px 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px !important;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
.subscription-card:hover {
  border-color: var(--wf-accent-line) !important;
  box-shadow: 0 4px 20px rgba(56,177,237,0.1) !important;
}
.subscription-title h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--wf-text) !important;
  margin: 0 0 4px !important;
  border: none !important;
  padding: 0 !important;
}
.subscription-meta { font-size: 12px !important; color: var(--wf-muted) !important; }
.subscription-meta span { display: inline-flex !important; align-items: center !important; gap: 4px !important; }

.invoices-table {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  overflow: hidden !important;
  backdrop-filter: blur(8px);
}
.invoices-table thead { background: rgba(56,177,237,0.06) !important; }
.invoices-table th { color: var(--wf-accent) !important; }
.invoice-number {
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--wf-text) !important;
}
.invoice-amount { font-weight: 600 !important; color: var(--wf-text) !important; }

.loading-spinner {
  border: 3px solid rgba(255,255,255,0.06) !important;
  border-top-color: var(--wf-accent) !important;
  border-radius: 50% !important;
  width: 34px !important;
  height: 34px !important;
  animation: wf-spin 0.8s linear infinite !important;
}
@keyframes wf-spin { to { transform: rotate(360deg); } }

.empty-state {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 48px 24px !important;
  text-align: center !important;
  backdrop-filter: blur(8px);
}
.empty-icon { font-size: 2.6rem !important; margin-bottom: 12px !important; }
.empty-state h3 {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--wf-text) !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 6px !important;
}
.empty-state p { font-size: 13px !important; color: var(--wf-muted) !important; }

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--wf-border-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--wf-dim); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding: 16px 14px 60px !important; }
  .billing-container { padding: 0 14px !important; margin-top: 20px !important; }
  .tabs { flex-direction: column !important; width: 100% !important; }
  .subscription-card { flex-direction: column !important; align-items: flex-start !important; }
  .modal-content,
  .modal-overlay .modal { padding: 20px !important; width: 96% !important; }
  .modal-actions { flex-direction: column !important; }
  .modal-actions button { width: 100% !important; }
  .invoices-table { display: block !important; overflow-x: auto !important; }
}

@media (max-width: 600px) {
  .popup-content { width: 96% !important; }
}

/* Bottom-sheet modals and popups on mobile */
@media (max-width: 480px) {
  /* Modal overlays become bottom-anchored */
  .wf-modal-overlay,
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* Modal content slides up as a sheet */
  .modal-content,
  .modal-overlay .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Drag handle on modal-content */
  .modal-content::before,
  .modal-overlay .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: -10px auto 14px;
  }

  .modal-actions {
    flex-direction: column !important;
  }

  .modal-actions button {
    width: 100% !important;
    justify-content: center !important;
    min-height: 44px !important;
  }

  /* Popup (account edit popup) bottom-sheet on mobile */
  .popup {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .popup-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .popup-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: -10px auto 14px;
  }
}

/* ══════════════════════════════════════════════════════════════
   ACCOUNT PAGE
   ══════════════════════════════════════════════════════════════ */

/* Main card wrapper on account.html */
body > main:not(.container):not(.community-container) {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important;
  backdrop-filter: blur(8px);
  margin-top: 28px !important;
  padding: 28px !important;
}

.account-details h1 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  margin-bottom: 20px !important;
}

.account-info p {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  margin-bottom: 10px !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid var(--wf-border) !important;
}

.account-info p strong {
  color: var(--wf-text) !important;
  font-weight: 600 !important;
}

.account-avatar {
  border-radius: 14px !important;
  border: 2px solid var(--wf-border-strong) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 4px var(--wf-accent-soft) !important;
}

/* Account action buttons */
.btn-edit,
.btn-reset-password {
  background: rgba(255,255,255,0.05) !important;
  color: var(--wf-text) !important;
  border: 1px solid var(--wf-border-strong) !important;
  padding: 10px 20px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.14s !important;
  margin-right: 8px !important;
  margin-top: 4px !important;
}
.btn-edit:hover,
.btn-reset-password:hover {
  background: rgba(255,255,255,0.09) !important;
  border-color: var(--wf-accent-line) !important;
  transform: translateY(-1px) !important;
}

.btn-delete,
.btn-delete-confirm {
  background: var(--wf-bad-soft) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239,68,68,0.3) !important;
  padding: 10px 20px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.14s !important;
  margin-top: 4px !important;
}
.btn-delete:hover,
.btn-delete-confirm:hover {
  background: var(--wf-bad) !important;
  color: #fff !important;
  border-color: var(--wf-bad) !important;
  box-shadow: 0 4px 14px rgba(239,68,68,0.35) !important;
}

.deactivated-banner {
  background: var(--wf-bad-soft) !important;
  border: 1px solid rgba(239,68,68,0.3) !important;
  border-radius: var(--wf-r-md) !important;
  padding: 20px !important;
}
.deactivated-banner h3 { color: #fca5a5 !important; font-size: 15px !important; }
.deactivated-banner p { color: var(--wf-muted) !important; }

/* Popup modal (account.html uses .popup / .popup-content) */
.popup {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 9000 !important;
  display: none;
  overscroll-behavior: contain !important;
}
.popup.active,
.popup[style*="block"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  animation: wf-backdrop-in .2s ease !important;
}

@keyframes wf-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.popup-content {
  background: var(--wf-surface-1, #0c1734) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: var(--wf-r-lg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) !important;
  padding: 24px !important;
  width: 92% !important;
  max-width: 480px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  color: var(--wf-text) !important;
}
.popup-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--wf-border) !important;
}
.popup-header h2 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.popup-body label { margin-top: 10px !important; }
.popup-body .btn-save {
  background: var(--wf-accent) !important;
  color: #08172d !important;
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 9px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin-top: 14px !important;
  width: 100% !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(56,177,237,0.4) !important;
}
.popup-body .btn-save:hover {
  background: #4cbeef !important;
}

/* ══════════════════════════════════════════════════════════════
   SHOP PAGE
   ══════════════════════════════════════════════════════════════ */

/* Hero header */
.header-section {
  text-align: center !important;
  padding: 60px 40px !important;
  background: var(--wf-surface-1) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  margin: 32px 0 48px !important;
  position: relative !important;
  overflow: hidden !important;
}
.header-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(56,177,237,0.12), transparent) !important;
  pointer-events: none;
}
.header-section h1 {
  font-size: clamp(2rem, 5vw, 3.2rem) !important;
  font-weight: 800 !important;
  color: var(--wf-text) !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(135deg, #fff 0%, #9ab0d2 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  position: relative !important;
  z-index: 1 !important;
}
.header-section p {
  font-size: 1.1rem !important;
  color: var(--wf-muted) !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Plan grid */
.plan-cards {
  display: grid !important;
  gap: 20px !important;
  margin: 32px 0 !important;
}

/* Individual pricing card */
.pricing-table {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  backdrop-filter: blur(8px) !important;
  overflow: hidden !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s !important;
  display: flex !important;
  flex-direction: column !important;
  cursor: pointer !important;
}
.pricing-table:hover {
  border-color: var(--wf-border-strong) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35) !important;
  transform: translateY(-4px) !important;
}

/* Featured / Popular plan */
.pricing-table.table-featured {
  border: 2px solid var(--wf-accent-line) !important;
  background: linear-gradient(180deg, rgba(56,177,237,0.07) 0%, var(--wf-surface-1) 60%) !important;
  transform: scale(1.03) !important;
}
.pricing-table.table-featured:hover {
  border-color: var(--wf-accent) !important;
  box-shadow: 0 8px 40px rgba(56,177,237,0.2) !important;
  transform: scale(1.03) translateY(-4px) !important;
}

/* Custom / Perso plan */
.pricing-table.table-perso {
  border: 2px solid rgba(245,158,11,0.4) !important;
  background: linear-gradient(180deg, rgba(245,158,11,0.07) 0%, var(--wf-surface-1) 60%) !important;
}
.pricing-table.table-perso:hover {
  border-color: rgba(245,158,11,0.7) !important;
  box-shadow: 0 8px 32px rgba(245,158,11,0.15) !important;
}

/* Card top section */
.pricing-table .top {
  padding: 24px 22px 20px !important;
  border-bottom: 1px solid var(--wf-border) !important;
  background: rgba(255,255,255,0.02) !important;
}
.pricing-table.table-featured .top {
  background: linear-gradient(135deg, rgba(56,177,237,0.1), rgba(56,177,237,0.03)) !important;
}
.pricing-table.table-perso .top,
.top.top-perso {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.04)) !important;
}
.pricing-table .top h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  margin: 0 0 8px !important;
  border: none !important;
  padding: 0 !important;
}
.pricing-table .top p {
  font-size: 12px !important;
  color: var(--wf-muted) !important;
  margin: 8px 0 0 !important;
}

/* Price number */
.price {
  font-size: 3rem !important;
  font-weight: 800 !important;
  color: var(--wf-text) !important;
  letter-spacing: -0.03em !important;
  line-height: 1 !important;
}
.price-container {
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  margin: 10px 0 !important;
}
.price-container::after {
  content: '€ / mo' !important;
  font-size: 12px !important;
  color: var(--wf-dim) !important;
  align-self: flex-end !important;
  margin-bottom: 4px !important;
}
/* Hide default €/mo text injected by JS and show via pseudo-element approach */
.price-label,
.per-month {
  font-size: 12px !important;
  color: var(--wf-dim) !important;
}

/* Card bottom / features list */
.pricing-table .bottom {
  padding: 20px 22px !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}
.pricing-table .bottom ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 18px !important;
  display: grid !important;
  gap: 8px !important;
  flex: 1 !important;
}
.pricing-table .bottom ul li {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  padding: 0 !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.pricing-table .bottom ul li::before {
  content: '✓' !important;
  color: var(--wf-ok) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  flex-shrink: 0 !important;
}

/* CTA button on plan cards */
.btn-main {
  display: block !important;
  width: 100% !important;
  padding: 12px 16px !important;
  background: rgba(255,255,255,0.06) !important;
  color: var(--wf-text) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.16s !important;
  margin-bottom: 0 !important;
  text-align: center !important;
}
.btn-main:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: var(--wf-accent-line) !important;
  transform: translateY(-1px) !important;
}
.pricing-table.table-featured .btn-main {
  background: var(--wf-accent) !important;
  color: #08172d !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(56,177,237,0.45) !important;
}
.pricing-table.table-featured .btn-main:hover {
  background: #4cbeef !important;
  box-shadow: 0 6px 20px rgba(56,177,237,0.55) !important;
}
.btn-main.btn-perso {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #3a2400 !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(245,158,11,0.35) !important;
}
.btn-main.btn-perso:hover {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  box-shadow: 0 6px 20px rgba(245,158,11,0.5) !important;
}

/* Ribbon badge (Popular / Custom) */
.ribbon {
  position: absolute !important;
  top: 22px !important;
  left: -38px !important;
  padding: 8px 48px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  transform: rotate(-45deg) !important;
  z-index: 10 !important;
  background: var(--wf-accent) !important;
  color: #08172d !important;
}
.ribbon.ribbon-perso {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #3a2400 !important;
}

/* Payment container (Stripe/PayPal options) */
.payment-container {
  margin-top: 12px !important;
  padding: 14px !important;
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
}

/* ══════════════════════════════════════════════════════════════
   COMMUNITY PAGE
   ══════════════════════════════════════════════════════════════ */

.community-container {
  max-width: 980px !important;
  margin: 0 auto !important;
  padding: 28px 20px 80px !important;
}

.community-header h1 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  letter-spacing: -0.01em !important;
}
.community-header p {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  margin-top: 4px !important;
}

/* Filter pill tabs */
.community-container .filter-tab {
  padding: 7px 14px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: rgba(255,255,255,0.04) !important;
  color: var(--wf-muted) !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.14s !important;
  box-shadow: none !important;
  transform: none !important;
}
.community-container .filter-tab:hover {
  background: rgba(255,255,255,0.08) !important;
  color: var(--wf-text) !important;
  transform: none !important;
  box-shadow: none !important;
}
.community-container .filter-tab.active {
  background: var(--wf-accent-soft) !important;
  color: var(--wf-accent) !important;
  border-color: var(--wf-accent-line) !important;
}

/* Search box */
.search-box {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-sm) !important;
  padding: 8px 14px !important;
}
.search-box:focus-within {
  border-color: var(--wf-accent-line) !important;
  background: rgba(56,177,237,0.05) !important;
}
.search-box svg { color: var(--wf-dim) !important; }
.search-box input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 100% !important;
  font-size: 13px !important;
  color: var(--wf-text) !important;
}
.search-box input::placeholder { color: var(--wf-dim) !important; }

/* Post cards */
.post-card {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  backdrop-filter: blur(8px) !important;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.14s !important;
  overflow: hidden !important;
}
.post-card:hover {
  border-color: var(--wf-accent-line) !important;
  box-shadow: 0 4px 20px rgba(56,177,237,0.1) !important;
  transform: translateY(-2px) !important;
}
.post-card-body { padding: 18px 20px !important; }
.post-card-author { color: var(--wf-text) !important; font-weight: 600 !important; font-size: 13px !important; }
.post-card-date { color: var(--wf-dim) !important; font-size: 11px !important; }
.post-card-title,
.post-card h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--wf-text) !important;
  margin: 6px 0 !important;
  line-height: 1.45 !important;
}
.post-card-excerpt,
.post-card p { font-size: 12px !important; color: var(--wf-muted) !important; }

/* Category badges */
.post-card-badge,
.badge-question,
.badge-discussion,
.badge-tutorial,
.badge-bug,
.badge-announcement,
.badge-project {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
.badge-question  { background: rgba(167,139,250,0.15) !important; color: #a78bfa !important; }
.badge-discussion{ background: rgba(56,177,237,0.15) !important; color: #38b1ed !important; }
.badge-tutorial  { background: rgba(34,197,94,0.15) !important; color: #6ee7a3 !important; }
.badge-bug       { background: var(--wf-bad-soft) !important; color: #fca5a5 !important; }
.badge-announcement { background: var(--wf-warn-soft) !important; color: #fcd34d !important; }
.badge-project   { background: rgba(251,146,60,0.15) !important; color: #fb923c !important; }

/* Stats footer on post card */
.post-card-stats {
  display: flex !important;
  gap: 14px !important;
  font-size: 12px !important;
  color: var(--wf-dim) !important;
  margin-top: 10px !important;
}

/* ══════════════════════════════════════════════════════════════
   SUPPORT PAGE
   ══════════════════════════════════════════════════════════════ */

.support-container,
#contact-form,
body > main section {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 28px !important;
  backdrop-filter: blur(8px);
}

#contact-form h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  margin-bottom: 6px !important;
}
#contact-form > p {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
  margin-bottom: 18px !important;
}

.form-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
}
.form-group { margin-bottom: 14px !important; }
.form-group label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--wf-muted) !important;
  margin-bottom: 6px !important;
  display: block !important;
}
.req { color: var(--wf-bad) !important; }

/* ══════════════════════════════════════════════════════════════
   LOGIN / SIGNUP PAGE
   ══════════════════════════════════════════════════════════════ */

.login-container,
.auth-container,
.signup-container {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5) !important;
  padding: 36px !important;
}

.login-container h1,
.auth-container h1,
.signup-container h1 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  letter-spacing: -0.01em !important;
  margin-bottom: 6px !important;
}
.login-container p,
.auth-container p,
.signup-container p {
  font-size: 13px !important;
  color: var(--wf-muted) !important;
}

/* ══════════════════════════════════════════════════════════════
   TOAST / ALERTS
   ══════════════════════════════════════════════════════════════ */

.toast,
#toast,
.alert-message {
  background: var(--wf-surface-elev) !important;
  border: 1px solid var(--wf-border-strong) !important;
  border-radius: var(--wf-r-md) !important;
  color: var(--wf-text) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 12px 18px !important;
}
.toast.success { border-left: 3px solid var(--wf-ok) !important; }
.toast.error   { border-left: 3px solid var(--wf-bad) !important; }
.toast.warning { border-left: 3px solid var(--wf-warn) !important; }

/* ══════════════════════════════════════════════════════════════
   RESOURCES PAGE
   ══════════════════════════════════════════════════════════════ */

.resources-container,
#resources-content {
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 28px 20px !important;
}

.resource-card,
.resource-item {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  padding: 18px 20px !important;
  margin-bottom: 12px !important;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s !important;
}
.resource-card:hover,
.resource-item:hover { border-color: var(--wf-border-strong) !important; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE ADDITIONS
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  main.container {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "summary"
      "notifications"
      "info"
      "contact" !important;
  }
}

@media (max-width: 768px) {
  .plan-cards { grid-template-columns: 1fr !important; }
  .pricing-table.table-featured { transform: none !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .community-filters { flex-direction: column !important; align-items: stretch !important; }
  .filter-tabs { flex-wrap: wrap !important; }
  .search-box { min-width: unset !important; width: 100% !important; }
}

@media (max-width: 480px) {
  main.container {
    gap: 12px !important;
  }
  main.container > .module {
    padding: 16px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   LOGIN / SIGNUP PAGE
   login.css aggressively resets: * { color: black; background: none; }
   We must override every property explicitly with !important and
   direct hex values (no CSS vars that could fail to resolve).
   ══════════════════════════════════════════════════════════════ */

/* Two-column card (section = outer wrapper) */
body > section {
  border-radius: 16px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7) !important;
  max-height: 540px !important;
}

/* Right panel — hard override of #fff background */
html body #loginForm,
html #loginForm {
  background-color: #0e1b3a !important;
  background: #0e1b3a !important;
  color: #f1f5fb !important;
  padding-top: 50px !important;
  width: 320px !important;
  overflow-y: auto !important;
}

/* All text inside the form panel */
html body #loginForm *,
html #loginForm * {
  color: #f1f5fb !important;
}

#loginForm h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #f1f5fb !important;
  letter-spacing: -0.01em !important;
}
#loginForm small,
#loginForm p { color: #9ab0d2 !important; font-size: 12px !important; }
#loginForm .error,
#loginForm span.error { color: #fca5a5 !important; }

/* Inputs */
html body #loginForm input[type="email"],
html body #loginForm input[type="text"],
html body #loginForm input[type="password"] {
  background-color: rgba(255,255,255,0.05) !important;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  color: #f1f5fb !important;
  border-radius: 9px !important;
  padding: 9px 12px !important;
}
html body #loginForm input[type="email"]:focus,
html body #loginForm input[type="text"]:focus,
html body #loginForm input[type="password"]:focus {
  border-color: #38b1ed !important;
  background: rgba(56,177,237,0.06) !important;
  box-shadow: 0 0 0 3px rgba(56,177,237,0.15) !important;
  outline: none !important;
}
html body #loginForm input::placeholder { color: #6a7fa3 !important; }

/* Submit button */
html body #createAccount,
html body #createAccountBtn {
  background-color: #38b1ed !important;
  background: #38b1ed !important;
  color: #08172d !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(56,177,237,0.4) !important;
}
html body #createAccount:hover:not(:disabled),
html body #createAccountBtn:hover:not(:disabled) {
  background: #4cbeef !important;
  box-shadow: 0 6px 20px rgba(56,177,237,0.55) !important;
}

/* Discord button */
html body #discordLogin {
  background-color: rgba(88,101,242,0.18) !important;
  background: rgba(88,101,242,0.18) !important;
  color: #a5b4fc !important;
  border: 1px solid rgba(88,101,242,0.35) !important;
  border-radius: 9px !important;
}
html body #discordLogin:hover {
  background: rgba(88,101,242,0.28) !important;
  border-color: rgba(88,101,242,0.55) !important;
}

/* Links at bottom */
#loginForm .login p,
#loginForm .login a,
span.login p,
span.login a {
  color: #9ab0d2 !important;
  font-size: 12px !important;
}
#loginForm .login a:hover,
span.login a:hover { color: #38b1ed !important; }

/* Google Sign-In widget — iframe injected by Google, cannot theme internals.
   Trick: show a styled dark button via ::before/::after (pointer-events:none),
   the real iframe sits on top (opacity:0) and handles the actual click. */
.g_id_signin {
  position: relative !important;
  height: 44px !important;
  width: 100% !important;
  display: block !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  cursor: pointer !important;
  margin: 4px 0 !important;
}

/* Dark button background + Google 'G' logo */
.g_id_signin::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background-color: rgba(255,255,255,0.06) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z'/%3E%3Cpath fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/%3E%3Cpath fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/%3E%3Cpath fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 16px center !important;
  background-size: 20px 20px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* Button label text */
.g_id_signin::after {
  content: 'Sign in with Google' !important;
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #f1f5fb !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Inter', sans-serif !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* Real iframe — invisible but sits on top and handles the click */
.g_id_signin > div,
.g_id_signin iframe {
  opacity: 0 !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
  cursor: pointer !important;
}

#webview_container { margin-top: 4px !important; }

/* Password container */
.password-container {
  position: relative !important;
}
.toggle-password {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  cursor: pointer !important;
  opacity: 0.6;
}
.toggle-password:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   RESOURCES PAGE — PROGRESS BARS
   ══════════════════════════════════════════════════════════════ */

.resources-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)) !important;
  gap: 20px !important;
  margin-bottom: 20px !important;
}

.resource-card {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 22px !important;
  backdrop-filter: blur(8px) !important;
}
.resource-card h2 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  margin-bottom: 16px !important;
  border-bottom: 1px solid var(--wf-border) !important;
  padding-bottom: 10px !important;
}
.resource-item { margin-bottom: 16px !important; }
.resource-item h3 {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--wf-muted) !important;
  margin-bottom: 6px !important;
  border: none !important;
  padding: 0 !important;
}

.progress-bar {
  width: 100% !important;
  height: 7px !important;
  background: rgba(255,255,255,0.06) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  margin: 6px 0 !important;
}
.progress-fill {
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, var(--wf-accent) 0%, #6dd2ff 100%) !important;
  transition: width 0.5s ease !important;
}

.resource-details {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 20px !important;
  font-size: 12px !important;
  color: var(--wf-muted) !important;
  margin-top: 6px !important;
}
.resource-details strong { color: var(--wf-text) !important; font-weight: 600 !important; }

/* ══════════════════════════════════════════════════════════════
   COMMUNITY POST DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */

.back-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: var(--wf-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-bottom: 20px !important;
  text-decoration: none !important;
  transition: color 0.14s !important;
}
.back-link:hover { color: var(--wf-accent) !important; }
.back-link svg { stroke: currentColor; }

.post-detail {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 28px !important;
  backdrop-filter: blur(8px);
  margin-bottom: 20px !important;
}
.post-detail h1,
.post-detail h2 {
  color: var(--wf-text) !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 0 !important;
}
.post-detail p { color: var(--wf-muted) !important; font-size: 14px !important; line-height: 1.7; }

.comments-section {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 24px !important;
  backdrop-filter: blur(8px);
}
.comments-section h3 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--wf-text) !important;
  margin-bottom: 16px !important;
  border: none !important;
  padding: 0 !important;
}

.comment-editor-wrapper {
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  overflow: hidden !important;
  margin-bottom: 14px !important;
}

.comment-card {
  background: rgba(255,255,255,0.025) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  padding: 16px !important;
  margin-bottom: 10px !important;
}
.comment-card .comment-author { font-weight: 600 !important; color: var(--wf-text) !important; font-size: 13px !important; }
.comment-card .comment-date { color: var(--wf-dim) !important; font-size: 11px !important; }
.comment-card .comment-body { color: var(--wf-muted) !important; font-size: 13px !important; line-height: 1.6; margin-top: 8px !important; }

/* Quill editor dark theme */
.ql-toolbar {
  background: rgba(255,255,255,0.03) !important;
  border-color: var(--wf-border) !important;
  border-radius: 0 !important;
}
.ql-toolbar button,
.ql-toolbar .ql-picker {
  color: var(--wf-muted) !important;
  filter: brightness(0) invert(0.6) !important;
}
.ql-container {
  background: rgba(255,255,255,0.02) !important;
  border-color: var(--wf-border) !important;
  color: var(--wf-text) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
}
.ql-editor { min-height: 100px !important; }
.ql-editor.ql-blank::before { color: var(--wf-dim) !important; font-style: normal !important; }

/* ══════════════════════════════════════════════════════════════
   PAYMENT SUCCESS / CANCEL PAGES
   ══════════════════════════════════════════════════════════════ */

.payment-success,
.payment-cancel,
.payment-result,
.result-container {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  padding: 40px 32px !important;
  text-align: center !important;
  backdrop-filter: blur(8px);
  max-width: 480px !important;
  margin: 60px auto !important;
}

/* ══════════════════════════════════════════════════════════════
   RESET PASSWORD / VERIF PAGES
   ══════════════════════════════════════════════════════════════ */

.reset-container,
.verif-container,
.card {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-lg) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5) !important;
  padding: 32px !important;
  max-width: 440px !important;
  margin: 60px auto !important;
}

/* ══════════════════════════════════════════════════════════════
   GENERIC .section class (billing tabs content)
   ══════════════════════════════════════════════════════════════ */

.section {
  display: none;
}
.section.active {
  display: block !important;
}

/* ══════════════════════════════════════════════════════════════
   POLL WIDGET / TICKET WIDGET (global)
   ══════════════════════════════════════════════════════════════ */

#poll-widget .poll-card,
.poll-card {
  background: var(--wf-surface-1) !important;
  border: 1px solid var(--wf-border) !important;
  border-radius: var(--wf-r-md) !important;
  padding: 16px !important;
}

#ticket-widget .ticket-btn,
.ticket-btn {
  background: var(--wf-accent) !important;
  color: #08172d !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(56,177,237,0.4) !important;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE (additions)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .plan-cards { grid-template-columns: 1fr !important; }
  .pricing-table.table-featured { transform: none !important; }
  body > section { flex-direction: column !important; max-height: none !important; width: 92vw !important; }
  #cover { display: none !important; }
  #loginForm { width: 100% !important; padding: 32px 24px !important; }
  .resources-grid { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════════════════════════
   DESIGN SYSTEM — wf-* component classes
   From the style_remaker.html reference. Use these on new pages
   or when refactoring legacy pages away from !important overrides.
   ══════════════════════════════════════════════════════════════ */

/* ── Topbar ─────────────────────────────────────────────────── */
.wf-topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  height: 60px;
  background: linear-gradient(180deg, #142348, #0e1c3e);
  border-bottom: 1px solid var(--wf-border);
  position: sticky; top: 0; z-index: 50;
}
.wf-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -.01em; font-size: 16px; color: var(--wf-text);
}
.wf-brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #38b1ed, #6dd2ff);
  display: grid; place-items: center;
  color: #0b1e3d; font-weight: 800; font-size: 15px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 6px 14px rgba(56,177,237,0.32);
}
.wf-brand-mark.is-img { background: transparent; box-shadow: none; }
.wf-brand-mark.is-img img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.wf-brand-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: var(--wf-accent-soft); color: var(--wf-accent);
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

.wf-nav { display: flex; gap: 4px; }
.wf-nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--wf-muted); font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.wf-nav-link:hover { color: var(--wf-text); background: rgba(255,255,255,0.04); }
.wf-nav-link.is-active { color: var(--wf-accent); background: var(--wf-accent-soft); }
.wf-nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.wf-topbar-spacer { flex: 1; }
.wf-topbar-actions { display: flex; align-items: center; gap: 8px; }

.wf-iconbtn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--wf-border);
  background: rgba(255,255,255,0.02); color: var(--wf-muted);
  display: grid; place-items: center; cursor: pointer; position: relative;
  transition: all .15s;
}
.wf-iconbtn:hover { color: var(--wf-text); border-color: var(--wf-border-strong); background: rgba(255,255,255,0.05); }
.wf-iconbtn svg { width: 16px; height: 16px; }
.wf-iconbtn .wf-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--wf-bad); box-shadow: 0 0 0 2px var(--wf-surface-elev);
}

.wf-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #38b1ed, #6dd2ff);
  color: #0b1e3d; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  border: 2px solid rgba(255,255,255,0.08); cursor: pointer;
}

.wf-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--wf-border);
  color: var(--wf-muted); font-size: 13px;
  min-width: 280px;
}
.wf-search:focus-within {
  border-color: var(--wf-accent-line);
  background: rgba(56,177,237,0.05);
  color: var(--wf-text);
}
.wf-search svg { width: 14px; height: 14px; }
.wf-search input {
  background: transparent; border: 0; outline: 0;
  color: inherit; font: inherit; flex: 1; min-width: 0;
  width: auto !important; padding: 0 !important;
  border-radius: 0 !important; box-shadow: none !important;
}
.wf-search-kbd {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--wf-font-mono); font-size: 11px;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--wf-dim);
  border: 1px solid var(--wf-border);
}

/* ── Page shell ─────────────────────────────────────────────── */
.wf-page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 80px; }
.wf-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.wf-page-title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; color: var(--wf-text); }
.wf-page-sub { color: var(--wf-muted); font-size: 14px; margin: 0; }
.wf-page-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--wf-accent); margin-bottom: 8px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.wf-card {
  background: var(--wf-surface-1);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-r-lg);
  padding: 20px;
}
.wf-card-tight { padding: 16px; }
.wf-card-flush { padding: 0; overflow: hidden; }
.wf-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--wf-border);
}
.wf-card-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: var(--wf-text); }
.wf-card-head-sub { color: var(--wf-muted); font-size: 12px; margin-top: 2px; }
.wf-card-body { padding: 16px 20px; }

/* ── Buttons ────────────────────────────────────────────────── */
.wf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 9px;
  font-family: var(--wf-font-sans); font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; border: 1px solid transparent;
  transition: all .14s ease;
  text-decoration: none; white-space: nowrap;
}
.wf-btn svg { width: 14px; height: 14px; }
.wf-btn-primary {
  background: var(--wf-accent); color: #08172d;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 6px 16px -4px rgba(56,177,237,0.5);
}
.wf-btn-primary:hover { background: #4cbeef; transform: translateY(-1px); }
.wf-btn-secondary {
  background: rgba(255,255,255,0.04); color: var(--wf-text);
  border-color: var(--wf-border-strong);
}
.wf-btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--wf-accent-line); }
.wf-btn-ghost { background: transparent; color: var(--wf-muted); }
.wf-btn-ghost:hover { color: var(--wf-text); background: rgba(255,255,255,0.05); }
.wf-btn-danger {
  background: var(--wf-bad-soft); color: #fca5a5;
  border-color: rgba(239,68,68,0.3);
}
.wf-btn-danger:hover { background: var(--wf-bad); color: white; border-color: var(--wf-bad); }
.wf-btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.wf-btn-lg { padding: 12px 20px; font-size: 14px; }

/* ── Form controls ──────────────────────────────────────────── */
.wf-input, .wf-select, .wf-textarea {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--wf-border-strong);
  border-radius: 9px; color: var(--wf-text);
  font-family: var(--wf-font-sans); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.wf-input:focus, .wf-select:focus, .wf-textarea:focus {
  outline: 0; border-color: var(--wf-accent);
  background: rgba(56,177,237,0.05);
  box-shadow: 0 0 0 3px var(--wf-accent-soft);
}
.wf-input::placeholder { color: var(--wf-dim); }
.wf-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--wf-muted); margin-bottom: 6px;
}
.wf-helper { font-size: 11px; color: var(--wf-dim); margin-top: 6px; }
.wf-field { margin-bottom: 14px; }
.wf-fieldrow { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

/* ── Status tags ────────────────────────────────────────────── */
.wf-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  background: rgba(255,255,255,0.05); color: var(--wf-muted);
  border: 1px solid var(--wf-border);
}
.wf-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.wf-tag-ok  { background: var(--wf-ok-soft);   color: #6ee7a3; border-color: rgba(34,197,94,.25); }
.wf-tag-warn { background: var(--wf-warn-soft); color: #fcd34d; border-color: rgba(245,158,11,.25); }
.wf-tag-bad  { background: var(--wf-bad-soft);  color: #fca5a5; border-color: rgba(239,68,68,.25); }
.wf-tag-info { background: var(--wf-accent-soft); color: var(--wf-accent-2); border-color: var(--wf-accent-line); }
.wf-tag-pulse .wf-tag-dot { animation: wf-pulse 1.6s infinite; }

/* ── Tables ─────────────────────────────────────────────────── */
.wf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wf-table th {
  text-align: left; font-weight: 600; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--wf-dim); padding: 12px 16px;
  border-bottom: 1px solid var(--wf-border);
}
.wf-table td { padding: 14px 16px; border-bottom: 1px solid var(--wf-border); vertical-align: middle; color: var(--wf-muted); }
.wf-table tr:last-child td { border-bottom: 0; }
.wf-table tbody tr { transition: background .12s; }
.wf-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ── Resource bars ──────────────────────────────────────────── */
.wf-resbar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.wf-resbar-track {
  flex: 1; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.wf-resbar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--wf-accent), var(--wf-accent-2));
  transition: width .4s ease;
}
.wf-resbar-fill.is-warn { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.wf-resbar-fill.is-bad  { background: linear-gradient(90deg, #ef4444, #f87171); }
.wf-resbar-label { color: var(--wf-muted); min-width: 36px; }
.wf-resbar-val { color: var(--wf-text); font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }

/* ── Stat tiles ─────────────────────────────────────────────── */
.wf-stat {
  background: var(--wf-surface-1);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-r-md);
  padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.wf-stat-label {
  font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--wf-dim);
  display: flex; align-items: center; gap: 6px;
}
.wf-stat-value {
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--wf-text);
}
.wf-stat-sub { font-size: 12px; color: var(--wf-muted); }
.wf-stat-trend.is-up   { color: var(--wf-ok); }
.wf-stat-trend.is-down { color: var(--wf-bad); }

/* ── Empty state ────────────────────────────────────────────── */
.wf-empty { text-align: center; padding: 40px 20px; color: var(--wf-muted); }
.wf-empty-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 16px; background: var(--wf-accent-soft);
  display: grid; place-items: center; color: var(--wf-accent);
}
.wf-empty h3 { margin: 0 0 6px; color: var(--wf-text); font-size: 15px; font-weight: 600; }
.wf-empty p  { margin: 0 0 16px; font-size: 13px; }

/* ── Misc utilities ─────────────────────────────────────────── */
.wf-divider { height: 1px; background: var(--wf-border); margin: 12px 0; }
.wf-row  { display: flex; align-items: center; gap: 10px; }
.wf-grow { flex: 1; }
.wf-mono { font-family: var(--wf-font-mono); font-size: 12px; color: var(--wf-muted); }

/* ── Compact density ────────────────────────────────────────── */
.is-compact .wf-card  { padding: 14px; }
.is-compact .wf-table th { padding: 8px 12px; }
.is-compact .wf-table td { padding: 10px 12px; }
.is-compact .wf-stat  { padding: 12px; }
.is-compact .wf-stat-value { font-size: 22px; }

/* ── Light theme ────────────────────────────────────────────── */
.is-light {
  --wf-bg: #f5f7fb;
  --wf-surface-1: #ffffff;
  --wf-surface-2: #f9fbff;
  --wf-surface-3: #f1f4fa;
  --wf-surface-elev: #ffffff;
  --wf-border: rgba(11, 30, 61, 0.08);
  --wf-border-strong: rgba(11, 30, 61, 0.16);
  --wf-text: #0b1e3d;
  --wf-muted: #4d617f;
  --wf-dim: #8094b3;
  --wf-accent-soft: rgba(56, 177, 237, 0.1);
}
.is-light .wf-topbar { background: linear-gradient(180deg, #ffffff, #f5f7fb); }
.is-light .wf-brand  { color: var(--wf-text); }
.is-light .wf-btn-primary { color: white; }

@media (max-width: 768px) {
  .wf-search { min-width: unset; width: 100%; }
  .wf-fieldrow { grid-template-columns: 1fr; }
  .wf-page-head { flex-direction: column; align-items: flex-start; }
}

/* ── 480px (mobile) bottom-sheet modals & touch polish ── */
@media (max-width: 480px) {
  /* Legacy modal-overlay → bottom-sheet (include .active/.show to beat base specificity) */
  .modal-overlay,
  .modal-overlay.active,
  .modal-overlay.show,
  .modal-overlay.visible,
  .modal-overlay[style*="block"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-overlay .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 20px calc(32px + env(safe-area-inset-bottom, 0px)) !important;
    animation: wf-sheet-up .22s cubic-bezier(.32,.72,0,1);
  }

  /* Legacy centered modal-content → bottom-sheet */
  .modal-content {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 20px calc(32px + env(safe-area-inset-bottom, 0px)) !important;
    animation: wf-sheet-up .22s cubic-bezier(.32,.72,0,1);
  }

  .modal-actions {
    flex-direction: column-reverse !important;
  }

  .modal-actions button {
    width: 100% !important;
  }

  /* wf-modal components — bottom-sheet (include .active/.show to beat base specificity) */
  .wf-modal-overlay,
  .wf-modal-overlay.active,
  .wf-modal-overlay.show,
  .wf-modal-overlay.visible,
  .wf-modal-overlay[style*="flex"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .wf-modal {
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 88vh !important;
    animation: wf-sheet-up .22s cubic-bezier(.32,.72,0,1);
  }

  /* Global drag handle for all wf-modal bottom-sheets */
  .wf-modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  .wf-modal-footer {
    flex-direction: column-reverse !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .wf-modal-footer .wf-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .wf-page-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .wf-page-head-actions .wf-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

@keyframes wf-sheet-up {
  from { transform: translateY(100%); opacity: 0.7; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — 650px breakpoint (navbar collapse, page layout)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 650px) {
    .wf-page {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .wf-page-head {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .wf-page-head-actions {
        width: 100% !important;
    }

    .wf-page-head-actions .wf-btn {
        flex: 1 !important;
        justify-content: center !important;
    }

    .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .billing-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .modal-content,
    .modal-overlay .modal {
        padding: 18px !important;
        width: 96% !important;
    }

    .modal-actions {
        flex-direction: column !important;
    }

    .modal-actions button {
        width: 100% !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   ADDITIONAL RESPONSIVE — table scroll, container, home grid
   ══════════════════════════════════════════════════════════════ */

/* Tables: horizontal scroll on mobile */
@media (max-width: 768px) {
    .container > table,
    #servers-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    tbody {
        max-height: none;
    }

    thead, tbody tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    td:last-child, th:last-child {
        text-align: left !important;
    }

    /* Home page grid: stack on mobile */
    main.container {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "summary"
            "notifications"
            "info"
            "contact" !important;
    }
}

/* Navbar: reduce padding on very small screens */
@media (max-width: 400px) {
    .navbar {
        padding: 0 12px !important;
    }
    .nav-title {
        font-size: 14px !important;
    }
}

/* Server modals: standalone flex overlay IDs need explicit bottom-sheet alignment on mobile */
@media (max-width: 480px) {
    #view-modal.show,
    #edit-create-modal.show,
    #delete-modal.show,
    #view-modal.active,
    #edit-create-modal.active,
    #delete-modal.active,
    #view-modal[style*="block"],
    #edit-create-modal[style*="block"],
    #delete-modal[style*="block"] {
        align-items: flex-end !important;
        padding: 0 !important;
    }
}
