/* Chart palette variables (light theme defaults) */
:root {
  --cp-chart-bg: #f5f7fa;
  --cp-chart-card: #ffffff;
  --cp-chart-text: #1f2937;
  --cp-chart-grid: #e4e7ef;
  --cp-chart-accent: #78c043;
  --cp-chart-accent-2: #f0a500;
  --cp-chart-accent-danger: #d94343;
  --cp-chart-muted: #9aa4b2;
  --cp-chip-bg: #f8fafc;
  --cp-chip-border: #cbd5f5;
  --cp-chip-text: #0f172a;
  --cp-chip-hover-bg: #e2e8f0;
  --cp-chip-icon: #0d9488;
  --cp-chip-tooltip-bg: #0f172a;
  --cp-chip-tooltip-text: #ffffff;
  --cp-chip-empty-bg: #eceff3;
  --cp-chip-empty-border: #c5cedd;
  --cp-chip-empty-text: #475569;
}

/* ================================================================ */
/*     Dark theme preload (prevents light flash before dark.css)    */
/* ================================================================ */
html.theme-preload,
html.theme-preload body,
html.theme-preload .main-content,
html.theme-preload .menu-screen,
html.theme-preload .stats-container,
html.theme-preload .tool-section,
html.theme-preload .tool-grid,
html.theme-preload footer {
  background: #0f1115 !important;
  color: #e0e0e0 !important;
}

html.theme-preload .sidebar,
html.theme-preload .sidebar nav a,
html.theme-preload .sidebar-header button {
  background: #1b1b1b !important;
  color: #ffffff !important;
}

html.theme-preload .card,
html.theme-preload .stat-card,
html.theme-preload .nice-table,
html.theme-preload .nice-table2,
html.theme-preload .data-table,
html.theme-preload #wpSitesTable,
html.theme-preload #domTable,
html.theme-preload #sitesInfoTable,
html.theme-preload #qTable,
html.theme-preload #outputText,
html.theme-preload #top-ddos-ips,
html.theme-preload #top-ipdb-ips,
html.theme-preload .login-container {
  background: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #2f2f2f !important;
  box-shadow: none !important;
}

html.theme-preload .sidebar nav a.active,
html.theme-preload .sidebar nav a:hover {
  background: rgba(222, 152, 13, 0.30) !important;
  color: #ffffff !important;
}

html.theme-preload .server-dropdown {
  background: rgba(222, 152, 13, 0.30) !important;
  color: #f8f3dc !important;
}

html.theme-preload .server-dropdown label {
  color: #f5e7b8 !important;
}

html.theme-preload .server-dropdown select,
html.theme-preload .server-dropdown input {
  background: #1b1b1b !important;
  color: #f0f0f0 !important;
  border-color: #3a3a3a !important;
}

html.theme-preload .server-dropdown select {
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23de980d' d='M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/></svg>") !important;
}

html.theme-preload .tool-section-title {
  background: #2d3a2d !important;
  color: #f5f5f5 !important;
  border-left: 4px solid #de980d !important;
}

html.theme-preload .stat-card::before,
html.theme-preload .stat-card.wide::before {
  background-color: rgba(222, 152, 13, 0.15) !important;
  filter: invert(1) brightness(0.35);
  opacity: 1 !important;
}

html.theme-preload .login-form input,
html.theme-preload input,
html.theme-preload select,
html.theme-preload textarea {
  background: #161616 !important;
  color: #f6f6f6 !important;
  border-color: #3a3a3a !important;
}

html.theme-preload .login-form input[type="submit"],
html.theme-preload .menu-button,
html.theme-preload .menu-sub-btn,
html.theme-preload .back-btn,
html.theme-preload .data-table button,
html.theme-preload .pager button,
html.theme-preload #qRestoreBtn,
html.theme-preload .qPreviewBtn {
  background: #064e3b !important;
  color: #ffffff !important;
}

html.theme-preload footer {
  border-top: 1px solid #2c2c2c !important;
}

html.theme-preload footer p,
html.theme-preload footer span {
  color: #d9d9d9 !important;
}

html.theme-preload {
  --cp-chip-bg: #18212f;
  --cp-chip-border: #2f3c51;
  --cp-chip-text: #d1d5db;
  --cp-chip-hover-bg: #1f2a3d;
  --cp-chip-icon: #5eead4;
  --cp-chip-tooltip-bg: #0f192d;
  --cp-chip-tooltip-text: #e0f2fe;
  --cp-chip-empty-bg: rgba(71, 85, 105, 0.45);
  --cp-chip-empty-border: #4b5563;
  --cp-chip-empty-text: #e2e8f0;
}

@media (max-width: 768px) {
  #metrics-history-card .metrics-toolbar {
    gap: 10px;
    align-items: center;
    justify-content: center;
  }

  #metrics-history-card .metrics-select-group {
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 6px;
    justify-content: center;
  }

  #metrics-history-card .metrics-select-group select {
    width: auto;
    min-width: 100px;
    max-width: 125px;
    height: 28px;
    padding: 2px 20px 2px 10px;
    font-size: 11.5px;
    border-radius: 6px;
  }

  #metrics-history-card .metrics-summary {
    width: 100%;
    max-width: 320px;
    display: grid;
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    gap: 5px;
    padding: 4px 12px;
    margin: 0 auto;
  }

  #metrics-history-card .metrics-summary-item {
    padding: 5px 4px;
    flex: initial;
    text-align: center;
  }

  #metrics-history-card .metrics-summary-item .summary-label {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  #metrics-history-card .metrics-summary-item .summary-value {
    font-size: 0.82rem;
  }
}

/* Global */
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f9fbfd;
  color: #333;
}

h1, h2 {
    font-size: 22px;
}

/* ===================== */
/*       Login Page      */
/* ===================== */

/* Login page overrides (for the body only on the login page) */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh; /* Full viewport height */
  margin: 0;
  background: #f5f9fc; /* Subtle background color */
}

/* The login container box */
.login-container {
  width: 400px;
  max-width: 90%;
  padding: 30px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

/* Logo styling */
.login-container img {
  max-width: 160px;
  margin-bottom: 20px;
}

/* Error message styling if login fails */
.login-container .error-message {
  color: #dc3545;
  margin-bottom: 10px;
  font-weight: 500;
}

/* The form wrapper for better control over spacing */
.login-form {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 14px;
  margin-top: 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* Focus outline for inputs */
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Submit button */
.login-form input[type="submit"] {
  border: none;
  border-radius: 6px;
  background: #007bff;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 20px; /* Extra space above the button */
  padding: 14px;
}

/* Hover and focus state for submit button */
.login-form input[type="submit"]:hover,
.login-form input[type="submit"]:focus {
  background: #0056b3;
  outline: none;
}

/* ===================== */
/*       Sidebar         */
/* ===================== */

.sidebar {
  width: 250px;
  background: #1f2b3a;
  color: #fff;
  height: 100vh;
  position: fixed;
  padding: 20px 0;
  transition: width 0.3s ease;
  overflow-x: hidden;
  font-size: 13px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 0 20px;
}

.sidebar-logo {
    max-height: 35px;
    margin: 10px 0;
    max-width: 140px;
    padding-bottom: 10px;
}

/* Hamburger (toggle) button styling */
/* Default for Chrome and other browsers */
.sidebar-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  margin-left: -15px;
}

/* Firefox only */
@supports (-moz-appearance: none) {
  .sidebar-header button {
    margin-left: -13px;
  }
}

/* Sidebar Navigation */
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #ddd;
  text-decoration: none;
  transition: background 0.2s ease;
}

.sidebar nav a:hover {
  background: #2e3d50;
  color: #fff;
}

.sidebar nav a.active {
  background: #2e3d50;
  color: #fff;
  font-weight: bold;
}

/* Icons inside nav links */
.sidebar nav a i {
  min-width: 20px;
  text-align: center;
  font-size: 20px;
}
.sidebar nav a svg {
  width: 20px;
  height: 20px;
}

/* ===================== */
/*    Collapsed Sidebar  */
/* ===================== */

.sidebar.collapsed,
html.cpf-sidebar-collapsed .sidebar {
  width: 40px;
}

.sidebar.collapsed .sidebar-logo,
html.cpf-sidebar-collapsed .sidebar-logo {
  display: none;
}

.sidebar.collapsed nav a,
html.cpf-sidebar-collapsed .sidebar nav a {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed nav a span,
html.cpf-sidebar-collapsed .sidebar nav a span {
  display: none;
}

.sidebar.collapsed nav a i,
html.cpf-sidebar-collapsed .sidebar nav a i {
  margin: 0 auto;
}

/* Optional tooltip for collapsed items */
.sidebar.collapsed nav a,
html.cpf-sidebar-collapsed .sidebar nav a {
  position: relative;
}

.sidebar.collapsed nav a::after,
html.cpf-sidebar-collapsed .sidebar nav a::after {
  content: attr(data-title);
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: #2e3d50;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  font-size: 13px;
  z-index: 999;
}

.sidebar.collapsed nav a:hover::after,
html.cpf-sidebar-collapsed .sidebar nav a:hover::after {
  opacity: 1;
}

/* ===================== */
/*      Main Content     */
/* ===================== */

.main-content {
  margin-left: 250px;
  padding:  0px 30px 30px 30px;
  transition: margin-left 0.3s ease;
}

.main-content.collapsed,
html.cpf-sidebar-collapsed .main-content {
  margin-left: 60px;
}

/* ===================== */
/*   Server Dropdown     */
/* ===================== */

.sidebar.collapsed .server-dropdown,
html.cpf-sidebar-collapsed .sidebar .server-dropdown {
  display: none;
}

.server-dropdown {
  margin: 16px 20px;
  padding: 10px 12px;
  background: #2e3d50;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.server-dropdown label {
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

.server-dropdown select {
  width: 100%;
  background: #1f2b3a;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 36px 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23fff" d="M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.server-dropdown input {
  width: 100%;
  background: #1f2b3a;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

/* Slide in from below */
@keyframes fadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Slide out upwards */
@keyframes fadeOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-20px); opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.3s forwards ease;
}

.fade-out {
  animation: fadeOut 0.3s forwards ease;
}

/* ========== Multi-Screen Menu Layout ========== */

.menu-screen {
  display: none;
  padding: 15px 0px 30px 0px;
}

@media (min-width: 800px) { 
  #configFilesScreen.menu-screen {
    padding: 15px 30px 30px 0px !important;
  }
}

.menu-list,
.sub-menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.menu-button,
.menu-sub-btn,
.back-btn {
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
  max-width: 270px; /* Button Width */
}

/* narrower param buttons */
.param-btn {
  width: auto;
  min-width: 80px;
  max-width: 170px;
  white-space: nowrap;
}

.menu-button:hover,
.menu-sub-btn:hover,
.back-btn:hover {
  background: #8cc63f;
}

.menu-button[aria-disabled="true"],
.menu-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.menu-button[aria-disabled="true"]:hover,
.menu-button.is-disabled:hover {
  background: #6c757d;
}

.edit-conf-tip {
  margin: 12px 0 20px;
  padding: 12px 16px;
  background: #e6f7d9;
  border-left: 4px solid #8cc63f;
  color: #2d5830;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.edit-conf-tip strong {
  display: block;
  margin-bottom: 4px;
}

.back-btn {
  margin-top: 20px;
  background: #6c757d; /* Slightly gray for distinction */
}
.back-btn:hover {
  background: #8cc63f;
}

/* Input groups (for email, IP, etc.) */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 350px; /* Adjust as desired */
}

.input-group label {
  font-weight: 500;
  color: #333;
}

.input-group input {
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

.input-group select {
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  background-color: #fff;
  color: #333;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 36px;
}

.input-group select:disabled {
  background-color: #f5f5f5;
  color: #777;
  cursor: not-allowed;
}

.menu-lead {
  margin: 8px 0 18px;
  color: #5b6475;
  font-size: 14px;
  line-height: 1.5;
  max-width: 680px;
}

.check-ip-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.toggle-btn {
  border: 1px solid rgba(92, 105, 117, 0.3);
  background: #1f2933;
  color: #f5f5f5;
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
  background: #8cc63f;
  color: #10231e;
  border-color: #8cc63f;
}

.check-ip-mode {
  display: none;
  margin-bottom: 25px;
}

.check-ip-mode.active {
  display: block;
}

.input-group-full {
  max-width: 100%;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.custom-scan-account-group {
  margin-top: 18px;
}

.custom-scan-account-group select {
  max-width: 350px;
}

.custom-scan-note {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  margin-top: 4px;
  max-width: 350px;
}

/* Output screen elements */
#outputTitle {
  margin-bottom: 10px;
}

#serverStatus {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 15px;
}

#outputText {
  width: 100%;
  min-height: 300px;
  background: #141729;        /* dark terminal background */
  color: #1DB55E;             /* bright green text */
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 15px 0px 15px 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: monospace;  
}

/* Footer styling */
footer {
  border-top: 1px solid #ddd;          /* softer light border */
  background: #f9f9f9;                 /* light neutral background */
  padding-top: 1rem;                   /* spacing similar to dark theme */
  padding-bottom: 1rem;
  text-align: center;                  /* same alignment as your original */
  font-size: 13px;
}

/* Stats styling */
/* Container layout */
.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  /*max-width: 1200px;*/
  margin: 1.5rem auto;
  /* padding: 0 1rem; */
}

/* All stat cards */
.stat-card {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

/* Content container inside each card */
.stat-content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Main number - now larger and bold */
.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #de980d;
}

/* Label below the number */
.stat-label {
  font-size: 0.85rem;
  color: #4a9a15;
  margin-top: 0.60rem;
}

/* Wide cards span full width */
.stat-card.wide {
  grid-column: span 3;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 1rem 1.5rem;
  text-align: left;
}

/* .stat-card.chart-card {
  align-items: stretch;
  grid-column: span 3;
}

.stat-card.chart-card .stat-content {
  align-items: stretch;
  justify-content: flex-start;
} */

/* Wide card content aligned to top-left */
.stat-card.wide .stat-content {
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

#homeScreen .stat-card.wide .stat-content {
  width: 85%;
}

#homeScreen .stat-card.wide .stat-label {
  width: 85%;
}

#homeScreen .stat-card.chart-card .stat-content,
#homeScreen .stat-card.chart-card .stat-label {
  width: 100%;
}

@media (max-width: 768px) { /* Adjust the max-width as needed for your mobile breakpoint */
  #homeScreen .stat-card.wide .stat-label {
    margin-left: 20px;
  }
  #top-ddos-ips, #top-ipdb-ips {
  width: 230px;
  }
}

/* ICONS (left-aligned default) */
.stat-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

/* ICONS for wide cards */
.stat-card.wide::before {
  left: auto;
  right: -12px;       
  top: 55px;         
  opacity: 0.08;    
}

.stat-card.chart-card::before {
  display: none;
}

#metrics-history-card {
  grid-column: 1 / -1;
}

/* Nudge the metrics summary rightwards on larger screens */
@media (min-width: 1100px) {
  #metrics-history-card .metrics-summary {
    margin-left: 300px;
  }
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: clamp(220px, 32vw, 280px);
  margin-top: 0.75rem;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-empty-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.95rem;
  color: var(--cp-chart-muted);
  text-align: center;
  padding: 0 1rem;
  display: none;
}

.chart-loading-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.95rem;
  color: var(--cp-chart-muted);
  text-align: center;
  padding: 0 1rem;
  display: none;
}

.chart-wrapper.is-empty canvas {
  opacity: 0;
  pointer-events: none;
}

.chart-wrapper.is-empty .chart-empty-message {
  display: block;
}

.chart-wrapper.is-loading canvas {
  opacity: 0;
  pointer-events: none;
}

.chart-wrapper.is-loading .chart-loading-message {
  display: block;
}

.chart-wrapper.is-loading .chart-empty-message {
  display: none;
}

@media (max-width: 768px) {
  .chart-wrapper {
    height: 220px;
  }
}

/* Map icons to SVGs */
.icon-shield::before       { background-image: url("/static/icons/shield.svg"); }
.icon-zap::before          { background-image: url("/static/icons/zap.svg"); }
.icon-globe::before        { background-image: url("/static/icons/globe.svg"); }
.icon-shield-off::before   { background-image: url("/static/icons/shield-off.svg"); }
.icon-bug::before          { background-image: url("/static/icons/bug.svg"); }
.icon-activity::before     { background-image: url("/static/icons/activity.svg"); }
.icon-target::before       { background-image: url("/static/icons/target.svg"); }
.icon-crosshair::before    { background-image: url("/static/icons/crosshair.svg"); }
.icon-layers::before       { background-image: url("/static/icons/layers.svg"); }
.icon-wordpress::before    { background-image: url("/static/icons/wordpress.svg"); }
.icon-server::before       { background-image: url("/static/icons/server.svg"); left: -16px !important; }

/* Responsive layout */
@media (max-width: 992px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
  .stat-card.wide {
    grid-column: span 1;
  }
}

/* Smaller page heading */
.dashboard-title {
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}

/* Section title above buttons */
.tool-section-title {
  font-size: 1rem;
  font-weight: 500;
  color: #444;
  text-align: left;
}

/* Slightly smaller title font for wide card headers */
.stat-card.wide .stat-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2B2B2B;
  text-align: left;
}

/* Style for the blocked IP lists */
#top-ddos-ips,
#top-ipdb-ips {
  font-family: 'Courier New', monospace;
  /*font-size: 0.95rem;*/
  color: #333;
  background: #f6f8fa;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  white-space: pre-line;
  line-height: 1.5;
}

/* Optional: Emphasize hit count */
#top-ddos-ips span,
#top-ipdb-ips span {
  color: #4a9a15;
  font-weight: 600;
}

/* Align Top IP lists side-by-side on wider screens */
@media (min-width: 1100px) {
  .stats-container {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: row dense;
  }

  .stats-container .stat-card {
    grid-column: span 2;
  }

  .stats-container .stat-card.wide.icon-target,
  .stats-container .stat-card.wide.icon-crosshair {
    grid-column: span 3;
    align-self: stretch;
  }

  .stats-container .stat-card.chart-card {
    grid-column: span 3;
  }

  .stats-container .stat-card.wide.icon-target #top-ddos-ips,
  .stats-container .stat-card.wide.icon-crosshair #top-ipdb-ips {
    width: 100%;
  }
}

/* Optional: Add hover for clarity */
#top-ddos-ips div:hover,
#top-ipdb-ips div:hover {
  background-color: #eef2f6;
  border-radius: 4px;
}

.nice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.nice-table th,
.nice-table td {
  overflow-wrap: anywhere;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  font-size: 14px;
}

.nice-table th {
  width: 25%;
  background: #f8fafc;
  color: #333;
  font-weight: 600;
  border-right: 1px solid #eee;
}

.nice-table tr:nth-child(even) {
  background: #fcfcfc;
}

.nice-table tr:hover {
  background: #f1f5f9;
}

.nice-table input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  box-sizing: border-box;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nice-table input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  outline: none;
}

/* textarea style */
textarea#manualTextarea {
  font-family: monospace;
  font-size: 14px;
  padding: 14px 0px 14px 14px;
  border: 1px solid #ccd1d9;
  margin-top:2em;
  border-radius: 8px;
  background-color: #fefefe;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 600px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea#manualTextarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Improve config textarea styling */
textarea.config-textarea {
  font-family: monospace;
  font-size: 14px;
  padding: 14px;
  border: 1px solid #ccd1d9;
  border-radius: 8px;
  background-color: #fefefe;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 500px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-top: 1.2em;
}

textarea.config-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Center button group and add spacing */
.button-group {
  display: flex;
  gap: 10px;
  margin-top: 1em;
  margin-bottom: 1em;
}

/* Improved dropdown styling for config file selection */
.config-select {
  width: 100%;
  max-width: 400px;
  padding: 10px 36px 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 6px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23333' d='M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.config-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
  outline: none;
}

/* Ensure mouse pointer is visible in all text inputs and textareas */
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select {
  cursor: pointer;
}

select {
  cursor: pointer;
}

/* ===================== */
/*  MonitorPro Table UI  */
/* ===================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  font-size: 14px;
}

.data-table th {
  background-color: #f1f5f9;
  padding: 12px 10px;
  text-align: left;
  color: #333;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.data-table input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.data-table input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
  outline: none;
}

/* Buttons in actions */
.data-table button {
  background-color: #6c757d;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 5px;
  transition: background 0.2s ease;
}

.data-table button:hover {
  background-color: #8cc63f;
}

.data-table tfoot td {
  background: #f8fafc;
  font-weight: 500;
}

.data-table tr:hover {
  background: #f6f9fc;
}

/* ===================== */
/*     Error Message     */
/* ===================== */
.error-banner {
  background-color: #ffe5e5;
  color: #b30000;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #ffcccc;
  font-weight: 500;
}

/* ===================== */
/*    Success Message     */
/* ===================== */
.success-banner {
  background-color: #e6ffed;
  color: #176f3b;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #c2f0d3;
  font-weight: 500;
}

/* MonitorPro: search box wrapper */
.search-wrapper {
  margin-bottom: 1rem;
  text-align: right;
}

/* Search wrapper for alignment and spacing */
.search-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

/* MonitorPro: styled search input */
#domainSearch {
  padding: 10px 14px;
  width: 340px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", sans-serif;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#domainSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.tools-page .menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  max-width: 900px;
  padding: 0 2rem;
  margin-top: 2rem;
}

.tools-page .menu-button {
  min-width: 320px;
  background: #007bff;
  color: #fff;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  text-align: center;
  white-space: nowrap;
  margin: 6px 8px;
}

.tools-page .menu-button:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.tools-page .menu-screen > p {
  text-align: left;
  margin-top: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 15px;
  color: #444;
  font-weight: normal;
}

.tools-page .sub-menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.tools-page .sub-menu-title {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 4px;
  color: #444;
}

textarea.bulk-textarea {
  font-family: monospace;
  font-size: 14px;
  padding: 14px;
  border: 1px solid #ccd1d9;
  border-radius: 8px;
  background-color: #fefefe;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 320px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-top: 1.2em;
}

textarea.bulk-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.tool-section {
  margin: 2.5rem auto;
  max-width: 680px;
  padding: 0 1rem;
}

.tool-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1f2b;
  text-align: left;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: #e6f7d9; /* light green tint */
  border-left: 4px solid #8cc63f;
  width: auto;
  max-width: 100%;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

/* only domain col gets fixed-width + ellipsis */
.domain-cell {
  display: inline-block;      /* shrink to content */
  max-width: 120px; 
  white-space: nowrap;        /* no line-wrap */
  text-overflow: ellipsis;    /* show “…” */
  vertical-align: middle;     /* align nicely in the cell */
  cursor: default;            /* so title tooltip still works */
}

/* Cluster sites info table */
#sitesInfoTable th:nth-child(1),
#sitesInfoTable td:nth-child(1) {
  width: 60px; /* UID */
  white-space: nowrap;
}

#sitesInfoTable th:nth-child(4),
#sitesInfoTable td:nth-child(4) {  
  width: 60px !important;
  white-space: nowrap !important;
}

#sitesInfoTable th:nth-child(3),
#sitesInfoTable td:nth-child(3) {
  width: 1% !important;
  white-space: nowrap !important;
}

#sitesInfoTable th:nth-child(2),
#sitesInfoTable td:nth-child(2) {
  width: 1% !important;
  white-space: nowrap !important;
}

#sitesInfoTable th:nth-child(5),
#sitesInfoTable td:nth-child(5) {
  width: 60px;
  max-width: 60px;
}

#sitesInfoTable th:nth-child(6),
#sitesInfoTable td:nth-child(6) {
  width: 60px; /* User */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sitesInfoTable th:nth-child(7),
#sitesInfoTable td:nth-child(7),
#sitesInfoTable th:nth-child(8),
#sitesInfoTable td:nth-child(8) {
  width: 40px; /* Created + Status */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-down {
  color: red;
  font-weight: 500;
}
.status-up {
  color: green;
  font-weight: 500;
}

/* Cluster Sites Info styled search input */
#sitesSearch {
  padding: 10px 14px;
  width: 340px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", sans-serif;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#sitesSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.apps-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.uuid-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.uuid-value {
  font-family: monospace;
  word-break: break-word;
}

.app-entry {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--cp-chip-border);
  background: var(--cp-chip-bg);
  color: var(--cp-chip-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
  position: relative;
}

.app-icon svg {
  width: 14px;
  height: 14px;
}

.app-icon:hover {
  background: var(--cp-chip-hover-bg);
  border-color: var(--cp-chip-icon);
  color: var(--cp-chip-icon);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.app-icon.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.app-icon.disabled:hover {
  background: var(--cp-chip-bg);
  border-color: var(--cp-chip-border);
  color: var(--cp-chip-text);
}

.app-icon:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 2px;
}

.app-icon[data-copy-status]::after {
  content: attr(data-copy-status);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cp-chip-tooltip-bg);
  color: var(--cp-chip-tooltip-text);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.no-apps-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px 3px 5px;
  border-radius: 999px;
  border: 1px solid var(--cp-chip-empty-border);
  background: var(--cp-chip-empty-bg);
  color: var(--cp-chip-empty-text);
  font-size: 11px;
  line-height: 1.2;
}

/* Adjusted widths for wpSitesTable */
#wpSitesTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#wpSitesTable th,
#wpSitesTable td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  white-space: nowrap;
}

#wpSitesTable th:first-child,
#wpSitesTable td:first-child {
  width: 20px; /* Checkbox column */
  text-align: center;
}

#wpSitesTable th:nth-child(2),
#wpSitesTable td:nth-child(2) {
  width: 120px; /* Server column */
}

#wpSitesTable th:nth-child(3),
#wpSitesTable td:nth-child(3) {
  width: 260px; /* Domain or Website ID */
}

#wpSitesTable th:nth-child(4),
#wpSitesTable td:nth-child(4) {
  width: 40px; /* Owner column */
}

#wpSitesTable th:nth-child(5),
#wpSitesTable td:nth-child(5) {
  width: auto; /* Path - allow to fill remaining space */
  word-break: break-all;
}

#wpSitesSearch, #domSearch {
  padding: 10px 14px;
  width: 340px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", sans-serif;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#wpSitesSearch:focus, #domSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.pager{
  display:flex;               /* horizontal pills */
  gap:6px;
  justify-content:center;
  margin:14px 0;
}
.pager button{
  background:#6c757d;
  color:#fff;
  border:none;
  padding:6px 12px;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
}
.pager button[disabled]{        /* active page pill */
  opacity:.45;
  cursor:default;
}
.pager button:hover {
  background: #8cc63f;
}

/* Fix checkbox column width for domain selector */
.nice-table2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.nice-table2 th,
.nice-table2 td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  font-size: 14px;
}

.nice-table2 th {
  background: #f8fafc;
  color: #333;
  font-weight: 600;
  border-right: 1px solid #eee;
}

.nice-table2 tr:nth-child(even) {
  background: #fcfcfc;
}

.nice-table2 tr:hover {
  background: #f1f5f9;
}

.nice-table2 input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  box-sizing: border-box;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nice-table2 input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  outline: none;
}

#domTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#domTable th,
#domTable td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  white-space: nowrap;
}

#domTable th:first-child,
#domTable td:first-child {
  width: 20px; /* Checkbox column */
  text-align: center;
}

.refresh-note {
  text-align: right;
  font-size: 0.9rem;
  margin-top: 4px;
  margin-right: 12px;
  width: 100%;
  box-sizing: border-box;
}

.refresh-note a {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

/* restore page */
#qTopControls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  max-width: 100%;
}

#qTopControls input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  background: #fff;
  flex: 1;
  max-width: 360px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#qTopControls input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  outline: none;
}

#qTopControls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 14px;
  margin: 0;
}

#qHelperText {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  margin-top: -4px;
}

#qBtnWrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

#qRestoreBtn {
  background: #6c757d;
  color: white;
  padding: 10px 18px; /* reduced vertical padding */
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#quarantineScreen #qBackBtn {
  margin-top: 0 !important;
}

#qRestoreBtn:hover {
  background: #8cc63f;
}

#qBackBtn {
  background: #6c757d;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#qBackBtn:hover {
  background: #5a6268;
}

#qTable {
  table-layout: fixed;
}

#qTable th {
  width: auto !important;
}
#qTable th:first-child,
#qTable td:first-child {
  width: 30px !important;
  max-width: 30px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

#qTable th:nth-child(2),
#qTable td:nth-child(2){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Make Original Path wrap so it remains readable (scope: this table only) */
#qTable th:nth-child(3),
#qTable td:nth-child(3){
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

#qTable th.actions,
#qTable td.actions {
  width: 65px !important;
  text-align: center;
}

.qPreviewBtn {
  background: #6c757d; /* align with palette of other buttons (light theme) */
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.qPreviewBtn:hover {
  background: #8cc63f; /* same hover accent as other buttons */
}

.qPreviewBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #555;
}

#qPreviewCard {
  border: 1px solid #dcdcdc;          /* light-mode panel border */
  background: #f7f7f7;                /* light-mode panel bg */
  color: #333;                        /* readable text */
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
}

#qPreviewCard pre {
  max-height: 260px;
  overflow: auto;
  background: #ffffff;                /* light-mode code bg */
  border: 1px solid #e5e7eb;         /* subtle border to separate content */
  color: #333;                        /* readable text */
  padding: 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.q-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#qPreviewCard button {
  background: #6c757d; /* match primary button base in light theme */
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

#qPreviewCard button:hover {
  background: #8cc63f; /* same hover accent as other buttons */
}

#qPreviewMeta {
  font-size: 12px;
  color: #8c96ad;
  margin: 0;
}

/* Quarantine list: visually dim restored rows and emphasize status */
.nice-table tr.restored,
#qTable tr.restored {
  opacity: 0.55;
}

.nice-table tr.restored .status,
#qTable tr.restored .status {
  color: #1fb36b; /* green accent for restored */
  font-weight: 600;
}

#qTable tr.restored input[type="checkbox"],
.nice-table tr.restored input[type="checkbox"] {
  filter: grayscale(100%);
  opacity: 0.7;
}

/* Danger Button Style (for Cancel buttons) */
.menu-button.danger {
  background-color: #dc3545; /* Bootstrap Red */
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.menu-button.danger:hover {
  background-color: #c82333; /* Slightly darker red on hover */
}

.bulk-create-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}
.bulk-create-toolbar .menu-sub-btn {
  margin: 0;
}
.bulk-create-toolbar .primary {
  background: #8cc63f;
  color: #1f3d1f;
}
.bulk-create-toolbar .primary:hover {
  background: #7ab835;
  color: #132612;
}
.bulk-apply-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 18px;
}
.bulk-apply-item {
  flex: 0 0 260px;
  max-width: 260px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bulk-apply-item label {
  font-weight: 600;
  font-size: 13px;
  display: block;
}
.bulk-apply-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bulk-apply-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #cbd5f5;
  border-radius: 4px;
}
.bulk-apply-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.bulk-apply-bar .config-select {
  width: 100%;
}
.bulk-apply-more {
  margin-bottom: 12px;
}
.bulk-apply-more summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
}
.bulk-apply-more[open] summary {
  margin-bottom: 4px;
}

@media (min-width: 992px) {
  .bulk-apply-bar {
    gap: 10px;
  }
  .bulk-apply-item {
    flex: 0 0 210px;
    max-width: 210px;
    padding: 8px 10px;
    gap: 4px;
  }
  .bulk-apply-item label {
    font-size: 12px;
  }
  .bulk-apply-actions {
    gap: 6px;
  }
  .bulk-apply-item .config-select {
    min-height: 32px;
    padding: 4px 30px 4px 10px;
    font-size: 13px;
  }
}

.bulk-create-status {
  display: none;
  margin-bottom: 12px;
}
.bulk-create-bulk-panel {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
}
.bulk-domain-textarea {
  width: 100%;
  min-height: 120px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  box-sizing: border-box;
  resize: vertical;
}
.bulk-domain-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.bulk-paste-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.bulk-create-table-wrapper {
  overflow-x: auto;
  margin-top: 10px;
}
.bulk-create-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
}
.bulk-create-table th,
.bulk-create-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}
.bulk-create-table th {
  background: #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 1;
}
.bulk-core-row.even td {
  background: #fafbfa;
}
.bulk-core-row.odd td {
  background: #ffffff;
}
.bulk-details-row.even td,
.bulk-details-row.odd td {
  background: #fdfdfd;
}
.bulk-create-table th:nth-child(1) { width: 40px; }
.bulk-create-table th:nth-child(2) { min-width: 190px; }
.bulk-create-table th:nth-child(3) { min-width: 140px; }
.bulk-create-table th:nth-child(4) { min-width: 130px; }
.bulk-create-table th:nth-child(5) { min-width: 150px; }
.bulk-create-table th:nth-child(6) { min-width: 110px; }
.bulk-create-table th:nth-child(7) { min-width: 160px; }
.bulk-create-table th:nth-child(8) { width: 80px; }
.bulk-create-table input[type="text"],
.bulk-create-table input[type="password"],
.bulk-create-table select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #cbd5f5;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
}
.bulk-create-table input:focus,
.bulk-create-table select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* UFW rules editor – scoped tweaks */
#ufwRulesMenu .bulk-create-table th,
#ufwRulesMenu .bulk-create-table td { padding: 6px 10px; }

#ufwRulesMenu .ufw-delete-btn {
  padding: 4px 10px;
  font-size: 12px;
  max-width: 90px;
}

#ufwHeaderBar { flex-direction: column; align-items: flex-start; gap: 8px; }
#ufwHeaderBar .ufw-header-buttons { margin-top: 0; }
#ufwHeaderBar #ufwSearchGroup { width: 100%; max-width: 520px; }
#ufwHeaderBar #ufwSearchGroup input { width: 100%; }

#ufwRulesToolbar { flex-wrap: nowrap; }
#ufwRulesToolbar .ufw-input-group { max-width: none; flex: 1 1 260px; }
#ufwRulesToolbar .ufw-input-group.ufw-port-group { flex: 0 0 120px; max-width: 140px; }
#ufwRulesToolbar .ufw-protocol-group { flex: 0 0 80px; max-width: 120px; }
#ufwRulesToolbar .ufw-direction-group { flex: 0 0 80px; max-width: 120px; }
#ufwRulesToolbar .ufw-action-group { flex: 0 0 80px; max-width: 120px; }
#ufwRulesToolbar .ufw-time-group { flex: 0 0 160px; max-width: 200px; }
#ufwRulesToolbar .ufw-time-inner { display: flex; gap: 6px; }
#ufwRulesToolbar .ufw-time-inner input,
#ufwRulesToolbar .ufw-time-inner select { flex: 1 1 50%; min-width: 140px; }

@media (min-width: 900px) and (max-width: 1600px) {
  #ufwRulesToolbar {
    flex-wrap: wrap;
  }
  #ufwRulesToolbar .ufw-from-group,
  #ufwRulesToolbar .ufw-comment-group {
    flex: 1 1 100%;
    max-width: none;
  }
}

#ufwRulesMenu .ufw-add-btn {
  align-self: flex-end;
  padding: 8px 16px;
  font-size: 13px;
  max-width: 140px;
}

@media (max-width: 768px) {
  #ufwRulesToolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  #ufwRulesToolbar .ufw-input-group,
  #ufwRulesToolbar .ufw-protocol-group,
  #ufwRulesToolbar .ufw-direction-group,
  #ufwRulesToolbar .ufw-action-group,
  #ufwRulesToolbar .ufw-input-group.ufw-port-group {
    flex: 1 1 100%;
    max-width: none;
  }
  #ufwRulesMenu .ufw-add-btn {
    align-self: stretch;
    width: 100%;
    max-width: none;
  }
}
.bulk-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bulk-select-wrapper .custom-input {
  display: none;
}
.bulk-select-wrapper.custom-active select {
  display: none;
}
.bulk-select-wrapper.custom-active .custom-input {
  display: block;
}
.bulk-row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.bulk-expand-btn,
.bulk-remove-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid #cbd5f5;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.bulk-expand-btn:hover {
  background: #eef2ff;
}
.bulk-remove-btn {
  border-color: #f8b4b4;
  color: #b91c1c;
  background: rgba(248, 180, 180, 0.18);
}
.bulk-remove-btn:hover {
  background: rgba(185, 28, 28, 0.15);
}
.bulk-custom-reset {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #4b5563;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-self: flex-start;
}
.bulk-custom-reset:hover {
  background: #f3f4f6;
}
.bulk-create-help {
  margin-top: 14px;
  font-size: 13px;
  color: #475569;
}
.bulk-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 12px 4px 4px;
}
.bulk-details-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
}
.bulk-details-group h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #1f2937;
}
.bulk-details-group label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 8px;
}
.bulk-details-group label:last-child {
  margin-bottom: 0;
}
.bulk-row-select {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.bulk-row-select input {
  width: 16px;
  height: 16px;
}
.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.menu-sub-btn.sm {
  padding: 6px 10px;
  font-size: 12px;
  max-width: none;
  width: auto;
}
.menu-sub-btn.sm.ghost {
  background: #f5f5f5;
  color: #1f2937;
}
.menu-sub-btn.sm.ghost:hover {
  background: #e2e8f0;
}
.info-banner {
  background: #eef6ff;
  border-left: 4px solid #2563eb;
  padding: 10px 14px;
  border-radius: 6px;
  color: #1d3b6c;
  margin-bottom: 12px;
}
.info-banner.error {
  background: #fdeaea;
  border-left-color: #d93025;
  color: #7f1d1d;
}

/* === Mobile tweaks (≤768 px) ==================================== */
@media (max-width: 768px) {
	
  .tool-section-title {
    width: 85% !important;
    font-size: 14px;
  }	
  
	.param-btn {
		margin-top: 15px; }
	label {
		margin-top: 15px;
	}
	
	.data-table button {
		margin-top: 5px;
	}
	
  /* --- Sidebar --- */
  .sidebar.collapsed,
  html.cpf-sidebar-collapsed .sidebar { width: 40px; height: 100%;}
  .main-content.collapsed,
  html.cpf-sidebar-collapsed .main-content { margin-left: 60px; }

  /* hide labels, keep icons */
  .sidebar.collapsed nav a,
  html.cpf-sidebar-collapsed .sidebar nav a { justify-content: center; padding: 12px 0; }
  .sidebar.collapsed nav a span,
  html.cpf-sidebar-collapsed .sidebar nav a span,
  .sidebar.collapsed .sidebar-logo,
  html.cpf-sidebar-collapsed .sidebar .sidebar-logo { display:none; }

  /* make toggle button always visible */
  #toggleSidebar { font-size: 21px;}

  /* — Stats cards — */
  .stats-container { grid-template-columns: 1fr; }
  .stat-card.wide  { grid-column: span 1; }

  /* smaller heading */
  .dashboard-title { font-size: 1.1rem; }
  
/* =========================================================
   Extra mobile-first tweaks – Tools & Utilities (≤ 768 px)
   ========================================================= */
   
  /* Sub-menus (menu-screen) gain breathing room */
  .menu-screen {
    padding: 12px 15px 32px 0px;
  }
  #outputText {
  padding: 15px 10px 15px 15px;
  }
  .tools-page .sub-menu-list {
    gap: 10px;
    margin: 1rem 0;
  }
  .menu-sub-btn,
  .back-btn {
    width: 100%;
    max-width: none;
    font-size: 13px;
  }

  /* Input groups: stretch to full width */
  .input-group,
  .input-group input,
  .input-group textarea,
  textarea.bulk-textarea {
    max-width: 95% !important;
    /*width: 95% !important;*/
  }

  /* Big textareas shrink to a saner height on phones */
  textarea.bulk-textarea,
  textarea#manualTextarea,
  textarea.config-textarea {
    height: 220px;
	width: 90%;
  }

  /* Data tables: make them horizontally scrollable instead of spilling off-screen */
  .nice-table,
  .nice-table2,
  .data-table,
  #wpSitesTable,
  #domTable,
  #sitesInfoTable,
  #qTable {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Quarantine table: allow horizontal pan with sensible column widths */
  #qTable{
    table-layout: auto !important; /* disable fixed layout on mobile */
    /* min-width: 980px;               /* keep columns readable; scroll horizontally */
  }
  /* Date column */
  #qTable th:nth-child(2),
  #qTable td:nth-child(2){
    min-width: 140px;
    white-space: nowrap;
  }
  /* Original Path column */
  #qTable th:nth-child(3),
  #qTable td:nth-child(3){
    min-width: 360px;
    white-space: nowrap;        /* avoid per-character wrapping */
    overflow-wrap: normal;
    word-break: normal;
    text-overflow: initial;
  }
  /* Quarantined Path column */
  #qTable th:nth-child(4),
  #qTable td:nth-child(4){
    min-width: 360px;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    text-overflow: initial;
  }
  /* Status & Actions - keep touch targets visible */
  #qTable th:nth-child(5),
  #qTable td:nth-child(5){
    min-width: 120px;
    white-space: nowrap;
  }
  #qTable th.actions,
  #qTable td.actions{
    min-width: 110px;
    white-space: nowrap;
  }
  .nice-table thead,
  .nice-table2 thead,
  .data-table thead,
  #wpSitesTable thead,
  #domTable thead,
  #sitesInfoTable thead,
  #qTable thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  /* Output terminal box: allow horizontal pan if long lines exist */
  #outputText {
    overflow: auto;
    word-wrap: normal;     /* keep long hashed strings intact */
  }

  /* Hide Lucide icons’ titles in the off-canvas sidebar when collapsed */
  .sidebar.collapsed nav a::after {
    display: none;
  }
  
	#wpSitesSearch,
	#sitesSearch,
	#domSearch, 
	#domainSearch {
		width: 90% !important;
	}
	
	
  .main-content { 
    padding: 0 0px 0px !important;
  }

  .stat-card::before    { width: 60px; height: 60px; left: -21px; }
  .stat-card.wide::before {
    width: 60px; height: 60px; top: 40px; right: -25px;
  }

  .stat-number          { font-size: 1.55rem; }
  .stat-label           { font-size: 0.80rem; } 
  .stat-card.wide .stat-number { font-size: 1.0rem;padding-top: 15px;padding-bottom:8px;padding-left: 15px; }

  .stat-card.wide .stat-label {
    overflow-x: auto;
	-webkit-overflow-scrolling: touch;
  }
  
  #top-ddos-ips,
  #top-ipdb-ips {
    white-space: nowrap !important;           /* stop breaking lines */
    overflow-x: scroll !important;              /* enable scroll */
    display: block !important;
    padding-left: 8px !important;             /* reduce padding */
    padding-right: 8px !important;
    font-size: 0.85rem;	/* optional: tighter fit */
	  width: 85%;
	  max-width: 85%;
    -webkit-overflow-scrolling: touch;        /* smoother on iOS */
  }
  
  .stat-card.wide {
    padding: inherit !important;
    padding-bottom: 15px !important;
  }
  
  .stat-card.wide.icon-crosshair {
    padding-right: 2rem !important;
  }
  
	footer p {
	  font-size: 0.8rem !important;
	  color: #555;                         /* soft gray for readability */
      margin: 0;
	}  
  
  #outputText {
	width: 90% !important;
	white-space: pre !important;
  }
 
/* fix settings page on mobile */ 
  .settings-page #singleKeysContainer .nice-table,
  .settings-page #allKeysContainer    .nice-table{
    table-layout: fixed;              /* stop the first column hogging width   */
    width:100%;
  }

  /* Key column */
  .settings-page #singleKeysContainer .nice-table th:nth-child(1),
  .settings-page #singleKeysContainer .nice-table td:nth-child(1),
  .settings-page #allKeysContainer    .nice-table th:nth-child(1),
  .settings-page #allKeysContainer    .nice-table td:nth-child(1){
    width:40%;                        /* let it wrap if needed                 */
    word-break:break-all;
  }

  /* Value column */
  .settings-page #singleKeysContainer .nice-table th:nth-child(2),
  .settings-page #singleKeysContainer .nice-table td:nth-child(2),
  .settings-page #allKeysContainer    .nice-table th:nth-child(2),
  .settings-page #allKeysContainer    .nice-table td:nth-child(2){
    width:60%;
  }

  /* Make the input fill the cell */
  .settings-page .nice-table input[type="text"]{
    width:100%;
  }
}

/* === Very small screens (≤480 px) =============================== */
@media (max-width: 480px) {

  /* login box stretches almost full width */
  .login-container { width: 100%; max-width: 350px; padding: 24px 22px; }

  /* buttons & inputs slightly taller */
  .login-form input[type="text"],
  .login-form input[type="password"],
  .login-form input[type="submit"] {
    padding: 12px;
    font-size: 15px;
  }

  /* collapse server-dropdown nicely */
  .server-dropdown label { font-size: 12px; }
  .server-dropdown select{ font-size: 13px; padding: 6px 28px 6px 8px; }
}
.security-tip {
  display: flex;
  align-items: flex-start;   /* icon aligns at top of text */
  gap: .75rem;
  margin: .75rem 0 1.25rem;
  padding: 6px 10px;
  border-left: 4px solid #38a169;  /* emerald-500 */
  background: #d4edda;             /* emerald-50 */
  color: #155724;                  /* emerald-900 */
  font-size: .90rem;
  line-height: 1.5;
  border-radius: .4rem;
}
.security-tip svg {
  flex: none;
  width: 24px;
  height: 24px;
  fill: #10b981;
  margin-top: .2rem;  /* nudge it up a bit */
}
@media (prefers-color-scheme:dark) {
  .security-tip {
    background: #064e3b;           /* emerald-900 */
    border-color: #6ee7b7;         /* emerald-300 */
  }
  .security-tip svg {
    fill: #6ee7b7;
  }
}
.tool-tip-note {
  background: #d4edda;
  color: #155724;
  padding: 6px 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.45;
  border-left: 4px solid #38a169;
}
.tool-tip-note a {
  color: #0c5460;
  font-weight: 600;
}
.tool-tip-note code {
  color: inherit;
  background: transparent;
  font-weight: 600;
}
.smtp-allowed-note {
  background: #d4edda;
  color: #155724;
  padding: 6px 8px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 13px;
}
 /* visual cue for locked fields */
.locked-input {
	background: #f2f2f2;
	color: #666;
	cursor: not-allowed;
}

/* ─────────────────────────────────────────────
   Masonry-style responsive grid for WebUI
   (≤768 px → 1 col  |  ≥992 px → 2 cols  |  ≥1200 px → 3 cols  |  ≥1600 px → 4 cols)
   ───────────────────────────────────────────── */

.container      { max-width: 1600px; margin: 0 auto; }  /* centred, full-width on small screens */
.grid           { column-count: 1; column-gap: 20px; }

.card {
  background: #f2f2f2;                          /* darker than pure white */
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  /* === masonry overlap fix === */
  box-sizing: border-box;        /* width 100% now INCLUDES padding + border   */
  break-inside: avoid;           /* keep whole card in one column              */
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside:    avoid;
}

.card:hover {
  background: #e9e9e9;                          /* slightly darker on hover */
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transform: translateY(-2px);
}

/* make every button span full card width */
.card .menu-button,
.card .menu-sub-btn {
  width     : 100%;
  max-width : 100%;
  display   : block;
  text-align: center;
  margin-bottom: 10px;
}

/* Compact buttons inside upload list rows */
.wp-upload-item-actions .menu-button,
.wp-upload-item-actions .menu-sub-btn {
  width: auto;
  max-width: 120px;
  min-width: 70px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 4px 10px;
  margin-bottom: 0;
  font-size: 12px;
}

.wp-upload-card {
  width: 100%;
  max-width: 620px;
  margin: 8px 0 12px;
  padding: 10px 12px 12px;
  background: #f8fafc;
  border-color: #d8e7cc;
}

.wp-upload-card-header {
  margin-bottom: 10px;
}

.wp-upload-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1f2b;
}

.wp-upload-card-subtitle {
  font-size: 13px;
  color: #4b5563;
  margin-top: 2px;
}

.wp-upload-layout {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}

.wp-upload-left,
.wp-upload-right {
  flex: 1 1 80px;
  min-width: 240px;
}

.wp-upload-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 13px;
}

.wp-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.wp-upload-actions .menu-button,
.wp-upload-actions .menu-sub-btn {
  width: auto;
  max-width: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  margin-bottom: 0;
  font-size: 13px;
}

.wp-upload-progress-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wp-upload-progress-row progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.wp-upload-status {
  font-size: 13px;
  color: #4b5563;
  min-height: 18px;
}

.wp-upload-list-header {
  font-size: 13px;
  font-weight: 600;
  color: #1f2933;
  margin-bottom: 6px;
}

.wp-upload-list {
  max-height: 220px;
  overflow-y: auto;
  background: #cddbd1;
  border-radius: 10px;
  padding: 8px 10px;
}

.wp-upload-list-empty {
  font-size: 13px;
  color: #6b7280;
  padding: 4px 2px;
}

.wp-upload-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #f8fff3;
  border: 1px solid #cbe5b5;
}

.wp-upload-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.wp-upload-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2933;
  word-break: break-all;
}

.wp-upload-item-meta {
  font-size: 12px;
  color: #4b5563;
  margin-top: 2px;
}

.wp-upload-item-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

/* 2 / 3 / 4 columns at wider break-points */
@media (min-width: 992px ) { .grid { column-count: 2; } }
@media (min-width: 1200px) { .grid { column-count: 3; } }
@media (min-width: 1600px) { .grid { column-count: 4; } }

/* @media (min-width: 1100px) {
  #homeScreen .grid {
    column-count: initial;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  #homeScreen .grid > .card {
    margin-bottom: 0;
  }
} */

.metrics-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.metrics-card-title span:first-child {
  font-size: 1.05rem;
  font-weight: 600;
}

.metrics-server-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-chart-text, #334155);
  opacity: 0.8;
}

.metrics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 16px;
  align-items: center;
}

.metrics-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.metrics-select-group label {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cp-chart-text, #64748b);
}

#metricsMetricSelect,
#metricsRangeSelect {
  max-width: 135px;
  min-width: 105px;
  height: 30px;
  padding: 3px 24px 3px 10px;
  font-size: 12px;
  border-radius: 6px;
  border-color: rgba(148, 163, 184, 0.45);
  background-position: right 10px center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.metrics-summary {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
  padding: 3px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148,163,184,0.16);
  box-shadow: inset 0 0.3px 0 rgba(255,255,255,0.4);
}

.metrics-summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--cp-chart-card, #ffffff);
  box-shadow: 0 1.5px 5px rgba(15,23,42,0.06);
  border: 1px solid rgba(15,23,42,0.06);
}

.metrics-summary-item .summary-label {
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cp-chart-text, #718096);
}

.metrics-summary-item .summary-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cp-chart-text, #0f172a);
  line-height: 1.05;
}

.metrics-toplist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-left: 10px;
}

.metrics-toplist-label {
  margin-left: 14px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-chart-text, #0f172a);
}

.metrics-top-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  background: rgba(120, 192, 67, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.metrics-top-name {
  font-weight: 600;
  color: var(--cp-chart-text, #0f172a);
}

.metrics-top-val {
  color: var(--cp-chart-text, #1e293b);
}

.metrics-toplist.metrics-error {
  color: var(--cp-chart-text, #b91c1c);
  background: rgba(185, 28, 28, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
}

@media (max-width: 900px) {
  .metrics-toolbar {
    align-items: flex-start;
  }

  .metrics-summary {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .metrics-select-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }

  #metricsMetricSelect,
  #metricsRangeSelect {
    width: 100%;
    max-width: none;
  }

  .metrics-summary {
    padding: 8px 10px;
    gap: 8px;
  }

  .metrics-summary-item {
    flex: 1 1 30%;
    min-width: 0;
    padding: 10px;
  }
}

.php-ext-checkbox-wrapper {
  max-width: 520px;
}

.php-ext-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 20px;
  margin-top: 8px;
}

.php-ext-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.php-ext-quick-actions {
  margin: 18px 0 26px;
}

.quick-select-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.quick-select-buttons .quick-select-btn {
  background: #f0f4fa;
  color: #142033;
  border: 1px solid #c2cfdf;
  box-shadow: none;
  padding: 6px 18px;
  border-radius: 8px;
  font-weight: 600;
}

.quick-select-buttons .quick-select-btn:hover {
  background: #e3eaf4;
  color: #0f172a;
}
