* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #1e1e1e;
  background: #8e8e8e;
  user-select: text;
  -webkit-user-select: text;
}

/* Login Screen */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #8e8e8e;
}
.login-window {
  width: 340px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Main Winbox App Layout */
.wb-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Toolbar (matches Winbox image 1) */
.wb-topbar {
  min-height: 30px;
  background: linear-gradient(to bottom, #f7f7f7, #e4e4e4);
  border-bottom: 1px solid #9e9e9e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}
.wb-topbar-left, .wb-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.wb-tool-btn {
  height: 22px;
  padding: 0 8px;
  background: linear-gradient(to bottom, #ffffff, #e2e2e2);
  border: 1px solid #a0a0a0;
  border-radius: 2px;
  font-size: 11px;
  color: #1e1e1e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.wb-menu-toggle {
  display: none;
  font-size: 13px;
  padding: 0 7px;
}
.wb-tool-btn:hover {
  background: linear-gradient(to bottom, #f5f9ff, #d6e4f7);
  border-color: #6b91c2;
}
.wb-tool-btn:active {
  background: #d0d0d0;
}
.wb-top-label {
  font-size: 11px;
  color: #333;
}
.wb-session-box {
  background: #ffffff;
  border: 1px solid #b0b0b0;
  padding: 1px 6px;
  font-size: 11px;
  min-width: 140px;
  color: #111;
  user-select: text;
}
.wb-cpu-box {
  background: #ffffff;
  border: 1px solid #b0b0b0;
  padding: 1px 5px;
  font-size: 11px;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wb-cpu-led {
  width: 11px;
  height: 11px;
  background: #2f7d32;
  border: 1px solid #1b4d1d;
  display: inline-block;
}
.wb-cpu-led.warn { background: #d98200; border-color: #8f5500; }
.wb-cpu-led.crit { background: #c62828; border-color: #7f1414; }

.wb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
  display: inline-block;
}
.wb-sms-pill {
  background: linear-gradient(to bottom, #f0f9f2, #d8eedc);
  border-color: #6aa173;
  color: #154a21;
  font-weight: 600;
}
.wb-sms-pill:hover {
  background: linear-gradient(to bottom, #e4f6e8, #c5e6cb);
  border-color: #3d7d47;
}
.wb-profile-btn {
  font-weight: 600;
}
.wb-profile-menu {
  position: fixed;
  z-index: 9500;
  min-width: 195px;
  background: #f5f5f5;
  border: 1px solid #8a8a8a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  padding: 4px 0;
}
.wb-profile-head {
  padding: 6px 10px;
  border-bottom: 1px solid #d4d4d4;
  background: #eaeaea;
}
.wb-profile-name {
  font-weight: 600;
  font-size: 12px;
  color: #111;
}
.wb-profile-meta {
  font-size: 10px;
  color: #555;
  margin-top: 2px;
}
.wb-profile-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-size: 11px;
  color: #1e1e1e;
  cursor: pointer;
  display: block;
}
.wb-profile-item:hover {
  background: #d8e6f7;
  color: #0e3a6e;
}
.wb-profile-danger {
  color: #9e1c1c;
  font-weight: 600;
}
.wb-profile-danger:hover {
  background: #fae2e2;
  color: #7c1111;
}
.wb-profile-sep {
  height: 1px;
  background: #d4d4d4;
  margin: 3px 0;
}
.wb-dot.ok { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.7); }
.wb-dot.err { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.7); }

/* Shell */
.wb-shell {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Sidebar (Winbox menu style) */
.wb-sidebar {
  width: 178px;
  background: #f5f5f5;
  border-right: 1px solid #8a8a8a;
  overflow-y: auto;
  flex-shrink: 0;
}
.wb-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  color: #1e1e1e;
  font-size: 12px;
  background: #f8f8f8;
}
.wb-menu-item:hover {
  background: #e2ecf8;
}
.wb-menu-item.active {
  background: #c2daf6;
  font-weight: 700;
  color: #0b3363;
  border-left: 3px solid #2b63a8;
  padding-left: 5px;
}
.wb-menu-item.active-parent {
  background: #e1eefb;
  font-weight: 600;
  color: #0e3a6e;
  border-left: 3px solid #5c8bc4;
  padding-left: 5px;
}
.wb-menu-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.wb-menu-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #365f91;
}
.wb-menu-arrow {
  font-size: 10px;
  color: #666;
  transition: transform 0.12s;
}
.wb-menu-item.open .wb-menu-arrow {
  transform: rotate(90deg);
}
.wb-submenu {
  display: none;
  background: #ffffff;
}
.wb-submenu.open {
  display: block;
}
.wb-submenu-item {
  padding: 5px 8px 5px 28px;
  border-bottom: 1px solid #ededed;
  cursor: pointer;
  font-size: 11.5px;
  color: #2a2a2a;
}
.wb-submenu-item:hover {
  background: #e6f0fc;
}
.wb-submenu-item.active {
  background: #c2daf6;
  font-weight: 700;
  color: #0b3363;
  border-left: 3px solid #2b63a8;
  padding-left: 25px;
}

/* Grey Desktop Workspace */
.wb-workspace {
  flex: 1;
  background: #8e8e8e;
  padding: 10px;
  overflow: auto;
  user-select: text;
}
.wb-loading {
  color: #fff;
  font-size: 13px;
  padding: 12px;
}

/* Inner Desktop Window */
.wb-window {
  background: #f4f4f4;
  border: 1px solid #585858;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  margin-bottom: 10px;
}
.wb-win-header {
  min-height: 26px;
  background: linear-gradient(to bottom, #e6eef7, #c5d6ea);
  border-bottom: 1px solid #8ea6c2;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.wb-win-title {
  font-weight: 600;
  font-size: 12px;
  color: #162f4d;
}
.wb-win-badge {
  font-size: 10.5px;
  color: #335275;
}
.wb-win-toolbar {
  background: #ececec;
  border-bottom: 1px solid #c6c6c6;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wb-win-body {
  background: #ffffff;
  padding: 10px;
}
.wb-win-body.no-pad {
  padding: 0;
}

/* Buttons */
.wb-btn {
  height: 24px;
  padding: 0 10px;
  background: linear-gradient(to bottom, #ffffff, #e1e1e1);
  border: 1px solid #9a9a9a;
  border-radius: 2px;
  font-size: 11.5px;
  color: #1e1e1e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wb-btn:hover { background: linear-gradient(to bottom, #f5f9ff, #d5e4f7); border-color: #5d86ba; }
.wb-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.wb-btn-primary {
  background: linear-gradient(to bottom, #4b83c3, #3164a3);
  border-color: #244c7e;
  color: #ffffff;
}
.wb-btn-primary:hover {
  background: linear-gradient(to bottom, #5a91cf, #3a70b2);
  border-color: #1d3f69;
}
.wb-btn-danger {
  background: linear-gradient(to bottom, #d9534f, #b52b27);
  border-color: #8c1f1c;
  color: #fff;
}
.wb-btn-danger:hover {
  background: linear-gradient(to bottom, #e06561, #c43632);
}
.wb-btn-sm {
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
}

/* Data Tables */
.wb-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.wb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  background: #fff;
}
.wb-table th {
  background: linear-gradient(to bottom, #f5f5f5, #e2e2e2);
  border: 1px solid #c8c8c8;
  padding: 4px 7px;
  text-align: left;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}
.wb-table td {
  border: 1px solid #e0e0e0;
  padding: 4px 7px;
  vertical-align: middle;
}
.wb-table tbody tr:nth-child(even) { background: #f9fafb; }
.wb-table tbody tr:hover { background: #e8f2fe; }

/* Cards / KPI grid */
.wb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.wb-kpi {
  background: #f8f9fb;
  border: 1px solid #c8d2de;
  padding: 8px 10px;
}
.wb-kpi-label { font-size: 11px; color: #555; }
.wb-kpi-val { font-size: 18px; font-weight: 700; color: #163a63; margin-top: 2px; }
.wb-kpi-sub { font-size: 10.5px; color: #666; margin-top: 2px; }

/* Forms */
.wb-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.wb-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}
.wb-field.full { grid-column: 1 / -1; }
.wb-field label {
  font-size: 11px;
  font-weight: 600;
  color: #333;
}
.wb-req {
  color: #d32f2f;
  font-weight: 700;
}
.wb-field input[type="text"],
.wb-field input[type="password"],
.wb-field input[type="email"],
.wb-field input[type="number"],
.wb-field input[type="date"],
.wb-field input[type="time"],
.wb-field input[type="datetime-local"],
.wb-field select,
.wb-field textarea {
  border: 1px solid #a8a8a8;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  border-radius: 1px;
}
.wb-field input:focus, .wb-field select:focus, .wb-field textarea:focus {
  outline: none;
  border-color: #3a70b2;
}
.wb-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}
.wb-form-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* Badges & Alerts */
.wb-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 600;
}
.wb-badge-ok { background: #16a34a; color: #ffffff; border: 1px solid #15803d; }
.wb-badge-err { background: #dc2626; color: #ffffff; border: 1px solid #b91c1c; }
.wb-badge-info { background: #d9edf7; color: #245269; border: 1px solid #a6d5ec; }

.wb-alert {
  padding: 7px 10px;
  border-radius: 2px;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
}
.wb-alert-ok { background: #16a34a; color: #ffffff; border: 1px solid #15803d; }
.wb-alert-err { background: #dc2626; color: #ffffff; border: 1px solid #b91c1c; }

/* Terminal / Log Console */
.wb-console {
  background: #14181e;
  color: #d7e3f4;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  padding: 8px;
  height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #444;
}

/* Modal (Strict: ONLY closes via Close button) */
.wb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.wb-modal {
  background: #f4f4f4;
  border: 1px solid #454545;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  width: 540px;
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.wb-modal-header {
  height: 28px;
  background: linear-gradient(to bottom, #e6eef7, #c5d6ea);
  border-bottom: 1px solid #8ea6c2;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.wb-modal-x {
  background: #e9e9e9;
  border: 1px solid #999;
  width: 20px;
  height: 18px;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
}
.wb-modal-x:hover { background: #d9534f; color: #fff; border-color: #a12b28; }
.wb-modal-body {
  padding: 12px;
  background: #fff;
  overflow-y: auto;
  flex: 1;
}
.wb-modal-footer {
  padding: 8px 12px;
  background: #ececec;
  border-top: 1px solid #c6c6c6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Permissions checklist inside modal */
.wb-perm-group {
  border: 1px solid #d8d8d8;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #fafafa;
}
.wb-perm-group-title {
  font-weight: 700;
  font-size: 11.5px;
  color: #1d4370;
  margin-bottom: 5px;
}
.wb-perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}

/* Toast */
.wb-toast {
  position: fixed;
  bottom: 14px;
  right: 14px;
  background: #1c3d66;
  color: #fff;
  padding: 8px 14px;
  border: 1px solid #0e2440;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  z-index: 2000;
}
.wb-toast.err { background: #a82522; border-color: #6e1513; }

.wb-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #b5b5b5;
  margin-bottom: 10px;
}
.wb-tab {
  padding: 5px 12px;
  background: #e6e6e6;
  border: 1px solid #b5b5b5;
  border-bottom: none;
  cursor: pointer;
  font-size: 11.5px;
}
.wb-tab.active {
  background: #fff;
  font-weight: 600;
  color: #163a63;
}

/* Sidebar Interactive Search */
.wb-sidebar-search {
  padding: 5px 6px;
  background: #ececec;
  border-bottom: 1px solid #d0d0d0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.wb-sidebar-search input {
  width: 100%;
  height: 22px;
  padding: 2px 6px;
  font-size: 11.5px;
  border: 1px solid #a8a8a8;
  border-radius: 2px;
  background: #ffffff;
  color: #1e1e1e;
}
.wb-sidebar-search input:focus {
  outline: none;
  border-color: #3a70b2;
}
.wb-sidebar-empty {
  padding: 10px 8px;
  color: #666;
  font-size: 11px;
  text-align: center;
}

/* Password Show/Hide Wrapper */
.wb-pw-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.wb-pw-wrap input {
  flex: 1;
  min-width: 0;
  border-right: none !important;
  border-radius: 1px 0 0 1px !important;
}
.wb-pw-toggle {
  padding: 0 8px;
  font-size: 11px;
  background: linear-gradient(to bottom, #ffffff, #e4e4e4);
  border: 1px solid #a8a8a8;
  border-radius: 0 1px 1px 0;
  cursor: pointer;
  color: #222;
  white-space: nowrap;
  flex-shrink: 0;
}
.wb-pw-toggle:hover {
  background: linear-gradient(to bottom, #f5f9ff, #d5e4f7);
  border-color: #5d86ba;
}

/* Mobile Sidebar Drawer Backdrop */
.wb-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 30px 0 0 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 890;
}
.wb-sidebar-backdrop.open {
  display: block;
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .wb-menu-toggle {
    display: inline-flex;
  }
  .wb-sidebar {
    position: fixed;
    top: 30px;
    bottom: 0;
    left: 0;
    width: 220px;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.35);
  }
  .wb-sidebar.mobile-open {
    transform: translateX(0);
  }
  .wb-workspace {
    padding: 8px;
  }
  .wb-session-box {
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 640px) {
  .wb-hide-sm {
    display: none;
  }
  .wb-form-grid,
  .wb-perm-grid {
    grid-template-columns: 1fr;
  }
  .wb-kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }
  .wb-tabs {
    flex-wrap: wrap;
  }
  .wb-modal {
    width: 96vw;
    max-height: 92vh;
  }
  .login-window {
    width: 92vw;
    max-width: 340px;
  }
}

@media (max-width: 480px) {
  .wb-hide-xs {
    display: none;
  }
  .wb-topbar {
    padding: 2px 4px;
    gap: 4px;
  }
  .wb-topbar-left, .wb-topbar-right {
    gap: 4px;
  }
  .wb-tool-btn {
    padding: 0 6px;
  }
  .wb-console {
    height: 220px;
  }
}

/* Responsive Winbox DataTables */
.wb-dt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  background: #f2f2f2;
  border-bottom: 1px solid #d4d4d4;
  font-size: 11.5px;
}
.wb-dt-left, .wb-dt-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wb-dt-bar select,
.wb-dt-bar input {
  height: 22px;
  border: 1px solid #a8a8a8;
  padding: 0 6px;
  font-size: 11.5px;
  background: #fff;
  border-radius: 2px;
}
.wb-dt-bar input {
  width: 190px;
  max-width: 100%;
}
.wb-dt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  background: #f2f2f2;
  border-top: 1px solid #d4d4d4;
  font-size: 11px;
  color: #333;
}
.wb-dt-pager {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.wb-dt-pager button {
  height: 21px;
  min-width: 24px;
  padding: 0 6px;
  background: linear-gradient(to bottom, #ffffff, #e2e2e2);
  border: 1px solid #a0a0a0;
  border-radius: 2px;
  font-size: 11px;
  cursor: pointer;
}
.wb-dt-pager button:hover:not(:disabled) {
  background: linear-gradient(to bottom, #f5f9ff, #d5e4f7);
  border-color: #5d86ba;
}
.wb-dt-pager button.active {
  background: #3164a3;
  border-color: #204472;
  color: #fff;
  font-weight: 600;
}
.wb-dt-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wb-table th.wb-dt-sortable {
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
  position: relative;
  padding-right: 18px;
}
.wb-table th.wb-dt-sortable::after {
  content: '⇅';
  position: absolute;
  right: 5px;
  color: #888;
  font-size: 10px;
}
.wb-table th.wb-dt-sortable.sort-asc::after {
  content: '▲';
  color: #163a63;
}
.wb-table th.wb-dt-sortable.sort-desc::after {
  content: '▼';
  color: #163a63;
}

/* Smooth horizontal scroll for DataTables on small screens */
.wb-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .wb-dt-bar input {
    width: 140px;
  }
  .wb-table th,
  .wb-table td {
    white-space: nowrap;
  }
}

/* SweetAlert-style Auto-Closing Popup */
.wb-swal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  animation: wbFadeIn 0.14s ease-out;
}
.wb-swal-box {
  background: #ffffff;
  border: 1px solid #8ea6c2;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  width: 310px;
  max-width: 90vw;
  padding: 20px 18px 14px;
  text-align: center;
  animation: wbPopIn 0.18s ease-out;
}
.wb-swal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}
.wb-swal-icon.ok {
  background: #dcfce7;
  color: #16a34a;
  border: 2px solid #22c55e;
}
.wb-swal-icon.err {
  background: #fee2e2;
  color: #dc2626;
  border: 2px solid #ef4444;
}
.wb-swal-title {
  font-size: 15px;
  font-weight: 700;
  color: #1c2b3a;
  margin-bottom: 4px;
}
.wb-swal-msg {
  font-size: 12px;
  color: #4a5568;
  margin-bottom: 12px;
  word-break: break-word;
}
.wb-swal-progress {
  height: 3px;
  background: #e6e6e6;
  border-radius: 2px;
  overflow: hidden;
}
.wb-swal-bar {
  height: 100%;
  width: 100%;
  background: #22c55e;
  transform-origin: left;
}
.wb-swal-bar.err {
  background: #ef4444;
}
@keyframes wbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes wbPopIn {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes wbTimerShrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Select2-style Searchable Dropdowns */
.wb-s2 {
  position: relative;
  width: 100%;
}
.wb-s2-control {
  width: 100%;
  min-height: 26px;
  padding: 3px 24px 3px 7px;
  border: 1px solid #a8a8a8;
  border-radius: 1px;
  background: #ffffff;
  color: #1e1e1e;
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  position: relative;
}
.wb-s2.disabled .wb-s2-control {
  background: #f0f0f0;
  color: #777;
  cursor: not-allowed;
}
.wb-s2.open .wb-s2-control {
  border-color: #3a70b2;
}
.wb-s2-caret {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #555;
}
.wb-s2-placeholder {
  color: #888;
}
.wb-s2-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.wb-s2-tag {
  background: #d9edf7;
  border: 1px solid #a6d5ec;
  color: #1b4b6b;
  padding: 0 5px;
  border-radius: 2px;
  font-size: 11px;
}
.wb-s2-dropdown {
  display: none;
  position: fixed;
  background: #ffffff;
  border: 1px solid #3a70b2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  z-index: 3000;
}
.wb-s2-dropdown.open {
  display: block;
}
.wb-s2-search-wrap {
  padding: 5px;
  background: #f3f3f3;
  border-bottom: 1px solid #dcdcdc;
}
.wb-s2-search {
  width: 100%;
  height: 24px;
  padding: 2px 6px;
  border: 1px solid #a8a8a8;
  font-size: 11.5px;
}
.wb-s2-options {
  max-height: 190px;
  overflow-y: auto;
}
.wb-s2-opt {
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid #f2f2f2;
}
.wb-s2-opt:hover {
  background: #e6f0fc;
}
.wb-s2-opt.selected {
  background: #cfe2fa;
  font-weight: 600;
  color: #0e3a6e;
}
.wb-s2-empty {
  padding: 8px;
  text-align: center;
  color: #777;
  font-size: 11.5px;
}

/* Hotspot Router Interactive Wizard */
.wb-wiz-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.wb-wiz-step {
  flex: 1;
  padding: 5px 8px;
  background: #ececec;
  border: 1px solid #c5c5c5;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-align: center;
}
.wb-wiz-step.active {
  background: #d5e5f8;
  border-color: #4b83c3;
  color: #0e3a6e;
}
.wb-wiz-step.done {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}
.wb-script-box {
  background: #14181e;
  color: #d9e7ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  padding: 8px;
  height: 195px;
  overflow: auto;
  white-space: pre;
  border: 1px solid #444;
  user-select: text;
  margin-bottom: 8px;
}
.wb-detect-box {
  border: 1px solid #b8c9dc;
  background: #f5f9ff;
  padding: 9px 10px;
  margin-top: 8px;
  font-size: 12px;
}
.wb-detect-box.ok {
  border-color: #22c55e;
  background: #dcfce7;
  color: #14532d;
}
.wb-pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d98200;
  margin-right: 6px;
  animation: wbPulse 1.1s infinite;
}
.wb-pulse.ok {
  background: #22c55e;
  animation: none;
}
@keyframes wbPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* Interactive Button Loading Spinner & Anti-Double-Click */
.wb-btn.wb-btn-loading,
.wb-tool-btn.wb-btn-loading {
  opacity: 0.72;
  cursor: wait !important;
  pointer-events: none;
}
.wb-btn.wb-btn-loading::before,
.wb-tool-btn.wb-btn-loading::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  margin-right: 4px;
  animation: wbSpin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes wbSpin {
  to { transform: rotate(360deg); }
}

/* Custom Confirm / Alert / Prompt Modal */
.wb-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9800;
}
.wb-dialog-box {
  background: #f4f4f4;
  border: 1px solid #454545;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  width: 410px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
}
.wb-dialog-body {
  padding: 14px 14px 16px;
  background: #ffffff;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.wb-dialog-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.wb-dialog-icon.warn { background: #fff3cd; color: #9a6700; border: 1.5px solid #e0a800; }
.wb-dialog-icon.danger { background: #fee2e2; color: #dc2626; border: 1.5px solid #ef4444; }
.wb-dialog-icon.info { background: #dbeafe; color: #1d4ed8; border: 1.5px solid #3b82f6; }
.wb-dialog-content { flex: 1; min-width: 0; }
.wb-dialog-msg { font-size: 12.5px; line-height: 1.45; color: #1e1e1e; word-break: break-word; }
