/* ========================================
   NelcPanel — Core Stylesheet
   Custom cPanel/WHM clone with Light/Dark themes
   ======================================== */

/* ---------- CSS Custom Properties (Light) ---------- */
:root {
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-light: #e8f0fe;
  --primary-dark: #0d47a1;

  --bg-body: #f0f4f8;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-header: #1a2533;
  --bg-sidebar: #1a2533;
  --bg-sidebar-hover: #243044;
  --bg-sidebar-active: #2d3f57;
  --bg-input: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --bg-secondary: #f0f4f8;

  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --text-inverse: #ffffff;
  --text-link: #1a73e8;

  --border: #e2e8f0;
  --border-light: #edf2f7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

  --sidebar-width: 260px;
  --header-height: 56px;

  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  --progress-height: 6px;
  --progress-bg: #e2e8f0;
  --progress-fill: #1a73e8;

  --success: #38a169;
  --warning: #d69e2e;
  --danger: #e53e3e;

  --np-bg: #ffffff;
  --np-text: #1a1a1a;
  --np-border: #ddd;
  --np-muted: #f5f5f5;
  --np-primary: #1a73e8;
  --np-danger: #d32f2f;
  --np-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ---------- Dark Theme ---------- */
[data-theme="dark"] {
  --bg-body: #0f1419;
  --bg-card: #1a2332;
  --bg-card-alt: #1e2a3d;
  --bg-header: #0d1117;
  --bg-sidebar: #0d1117;
  --bg-sidebar-hover: #161f2e;
  --bg-sidebar-active: #1a2533;
  --bg-input: #1a2332;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --bg-secondary: #1e2a3d;

  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted: #4a5568;
  --text-inverse: #1a202c;
  --text-link: #63b3ed;

  --border: #2d3748;
  --border-light: #1a202c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);

  --progress-bg: #2d3748;
  --progress-fill: #63b3ed;

  --success: #48bb78;
  --warning: #ecc94b;
  --danger: #fc8181;

  --np-bg: #1a2332;
  --np-text: #e0e0e0;
  --np-border: #444;
  --np-muted: #2a2a2a;
  --np-primary: #8ab4f8;
  --np-danger: #f28b82;
  --np-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition:
    background var(--transition-slow),
    color var(--transition-slow);
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* ---------- Pre-loader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#preloader .loader-logo svg {
  width: 180px;
  height: auto;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Button Base ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-card-alt);
  border-color: var(--text-muted);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group-inner-flex {
  display: flex;
  gap: 8px;
}

.form-inline-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group-compact {
  margin: 0;
}

.form-label-sm {
  font-size: 0.75rem;
}

.bg-inset {
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.max-w-400 {
  max-width: 400px;
}

.d-none {
  display: none !important;
}

.d-inline {
  display: inline;
}

.col-name {
  flex: 1;
  min-width: 120px;
}

.col-type {
  flex: 0 0 90px;
}

.col-value {
  flex: 2;
  min-width: 180px;
}

.col-small {
  flex: 0 0 80px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* D-Flex */

.d-flex {
  display: flex;
  align-items: center;
}

.d-flex.gap-2 {
  gap: 10px;
}
.np-no-data {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg);
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px 0;
}

.empty-state small {
  color: var(--text-muted);
  font-size: 13px;
}

.np-no-data {
  text-align: center;
  background: var(--np-bg);
}

/* ---------- Form Control (alias) ---------- */
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
  font-family: var(--font);
}

.form-control.short {
  max-width: fit-content;
}

.form-note {
  font-size: 13px;
  margin: 0;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: auto;
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ---------- Password Toggle ---------- */
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.875rem;
}
.pw-toggle:hover {
  color: var(--text-primary);
}

/* ---------- Password Strength Bar ---------- */
.password-strength {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
}

/* ---------- Button Danger ---------- */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-hover, #c53030);
  border-color: var(--danger-hover, #c53030);
  text-decoration: none;
}

.btn-outline.btn--danger {
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline.btn--danger:hover {
  background: var(--danger);
  color: #fff;
}

/* ---------- Button Success ---------- */
.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #2f855a;
  border-color: #2f855a;
  text-decoration: none;
}

/* ---------- Button Danger Outline ---------- */
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger-outline:hover {
  background: var(--danger);
  color: #fff;
  text-decoration: none;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 8px 0;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--text-muted);
  user-select: none;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}

.badge-info {
  background: var(--primary-light);
  color: var(--primary);
}

/* ---------- Pre / Code ---------- */
pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition:
    background var(--transition-slow),
    border-color var(--transition-slow),
    box-shadow var(--transition-slow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.card-header:hover {
  background: var(--bg-card-alt);
}

.card-header h2,
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-header .collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
  transition:
    transform var(--transition),
    color var(--transition);
}

.card-header .collapse-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-card-alt);
}

.card-header .collapse-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform var(--transition);
}

.card-header .collapse-btn.collapsed svg {
  transform: rotate(-90deg);
}

.card-body {
  padding: 20px;
  transition: all var(--transition);
  overflow: hidden;
}

.card-body.hidden {
  display: none;
}

/* ---------- Tool Grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.tool-item:hover {
  background: var(--bg-card-alt);
  border-color: var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
}

.tool-item svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-item span {
  display: block;
  line-height: 1.3;
  color: var(--text-secondary);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: #c6f6d5;
  color: #276749;
}

.badge-warning {
  background: #fefcbf;
  color: #975a16;
}

.badge-danger {
  background: #fed7d7;
  color: #9b2c2c;
}

[data-theme="dark"] .badge-success {
  background: #1a3a2a;
  color: #68d391;
}

[data-theme="dark"] .badge-warning {
  background: #3a3520;
  color: #f6e05e;
}

[data-theme="dark"] .badge-danger {
  background: #3a2020;
  color: #fc8181;
}

/* ========================================
   LOGIN PAGES
   ======================================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg-body);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 28px;
  transition:
    background var(--transition-slow),
    border-color var(--transition-slow);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.login-logo svg {
  height: 44px;
  width: auto;
}

.login-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.login-subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.form-alert {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.form-alert--error {
  background: var(--danger-bg, #fef2f2);
  border: 1px solid var(--danger-border, #fecaca);
  border-left: 4px solid var(--danger, #dc2626);
  color: var(--danger-text, #991b1b);
}

[data-theme="dark"] .form-alert--error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  border-left-color: #ef4444;
  color: #fca5a5;
}

.login-form .btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-top: 4px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 20px;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.login-footer span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.login-footer .theme-toggle-login {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.login-footer .theme-toggle-login:hover {
  border-color: var(--text-muted);
  background: var(--bg-card-alt);
}

.login-footer .theme-toggle-login svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ========================================
   HEADER / TOP NAV
   ======================================== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: background var(--transition-slow);
}

.top-header .header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.top-header .header-logo svg {
  height: 32px;
  width: auto;
}

.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.header-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  font-size: 0.875rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
  outline: none;
  transition: all var(--transition);
}

.header-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.header-search input:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.15);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-right .theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition);
}

.header-right .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.header-right .theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Standalone theme toggle (used in WHM topbar) */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-card-alt);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  color: rgba(255, 255, 255, 0.85);
  border: none;
  background: transparent;
}

.header-user:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-user .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
}

.user-dropdown-chevron {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  opacity: 0.7;
  transition: transform var(--transition);
}

.user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1100;
  padding: 8px 0;
  animation: dropdownFadeIn 0.15s ease;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown.open .user-dropdown-chevron {
  transform: rotate(180deg);
}

.user-dropdown.open .header-user {
  background: rgba(255, 255, 255, 0.1);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-dropdown-info {
  min-width: 0;
}

.user-dropdown-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition);
  cursor: pointer;
}

.user-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

.user-dropdown-item:hover {
  background: var(--bg-card-alt);
}

.user-dropdown-item--danger {
  color: var(--danger);
}

.user-dropdown-item--danger svg {
  stroke: var(--danger);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   DASHBOARD LAYOUT (Client)
   ======================================== */
.dashboard-layout {
  display: flex;
  gap: 24px;
  padding: calc(var(--header-height) + 24px) 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: flex-start;
}

/* ---------- Info Panel (Sidebar) ---------- */
.info-panel,
.stats-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    background var(--transition-slow),
    border-color var(--transition-slow);
}

.info-panel .panel-header,
.stats-panel .panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-panel .panel-header svg,
.stats-panel .panel-header svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-panel .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-light);
}

.info-panel .info-row:last-child {
  border-bottom: none;
}

.info-panel .info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.info-panel .info-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: right;
  word-break: break-all;
}

/* ---------- Statistics (Sidebar) ---------- */
.stats-panel .stat-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.stats-panel .stat-item:last-child {
  border-bottom: none;
}

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

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-bar {
  width: 100%;
  height: var(--progress-height);
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 999px;
  transition: width 0.6s ease;
  min-width: 2%;
}

/* ========================================
   WHM SIDEBAR
   ======================================== */
.whm-layout {
  display: flex;
  min-height: 100vh;
}

.whm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    background var(--transition-slow),
    transform var(--transition-slow);
}

.whm-sidebar .sidebar-logo {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  text-decoration: none;
}

.whm-sidebar .sidebar-logo svg {
  height: 32px;
  width: auto;
}

.whm-sidebar .sidebar-logo span {
  margin-left: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.menu-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.menu-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.menu-label:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.menu-label svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.menu-label .menu-text {
  flex: 1;
}

.menu-label .menu-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
  opacity: 0.5;
}

.menu-label.open .menu-chevron {
  transform: rotate(90deg);
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.15);
}

.submenu.open {
  max-height: 600px;
}

.submenu a {
  display: block;
  padding: 10px 20px 10px 50px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  transition: all var(--transition);
  text-decoration: none;
}

.submenu a:hover {
  color: #fff;
  background: var(--bg-sidebar-hover);
}

.submenu a.active {
  color: #fff;
  background: var(--bg-sidebar-active);
  border-left: 3px solid var(--primary);
}

/* ---------- WHM Main Content ---------- */
.whm-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
  transition: background var(--transition-slow);
}

.whm-topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  width: 100% !important;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition-slow),
    border-color var(--transition-slow);
}

.whm-topbar .sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-secondary);
}

.whm-topbar .sidebar-toggle:hover {
  background: var(--bg-card-alt);
}

.whm-topbar .sidebar-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.whm-topbar .topbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.whm-topbar .topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 0.875rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}

.whm-topbar .topbar-search input:focus {
  border-color: var(--primary);
}

.whm-topbar .header-user {
  color: var(--text-primary);
}

.whm-topbar .header-user:hover {
  background: var(--bg-card-alt);
}

.whm-topbar .header-user .user-name {
  color: var(--text-primary);
}

.whm-topbar .header-user .user-role {
  color: var(--text-muted);
}

.whm-topbar .topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-actions .alert-bell {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.topbar-actions .alert-bell:hover {
  background: var(--bg-card-alt);
  color: var(--text-primary);
}

.topbar-actions .alert-bell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53e3e;
}

/* ---------- Notification Panel ---------- */
.notif-wrapper {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  z-index: 1000;
  overflow: hidden;
}
.notif-panel.open {
  display: flex;
  flex-direction: column;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.notif-mark-all {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: .8rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition);
}
.notif-mark-all:hover {
  background: rgba(26,115,232,.08);
}
.notif-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
}
.notif-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.notif-tab:hover {
  color: var(--text-primary);
}
.notif-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.notif-list {
  overflow-y: auto;
  flex: 1;
  max-height: 400px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: default;
}
.notif-item:hover {
  background: var(--bg-card-alt);
}
.notif-item.unread {
  background: rgba(26,115,232,.04);
}
.notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.notif-icon.severity-info {
  background: rgba(26,115,232,.1);
  color: var(--primary);
}
.notif-icon.severity-warning {
  background: rgba(214,158,46,.12);
  color: #d69e2e;
}
.notif-icon.severity-danger {
  background: rgba(229,62,62,.1);
  color: #e53e3e;
}
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-msg {
  font-size: .78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: .72rem;
  color: var(--text-muted);
}
.notif-cat {
  text-transform: capitalize;
}
.notif-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.notif-item:hover .notif-actions {
  opacity: 1;
}
.notif-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.notif-btn:hover {
  background: var(--bg-card-alt);
  color: var(--text-primary);
}
.notif-btn-del:hover {
  color: #e53e3e;
}
.notif-loading, .notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}
.notif-panel {
  border-color: var(--border);
}

/* ---------- WHM Content Area ---------- */
.whm-content {
  padding: 24px;
  flex: 1;
  min-width: 0;
}

.whm-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.whm-content .page-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ---------- Metric Gauges ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition-slow),
    border-color var(--transition-slow);
}

.metric-card .gauge {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 12px;
  position: relative;
}

.metric-card .gauge::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--bg-card);
  transition: background var(--transition-slow);
}

.metric-card .gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-card .metric-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.metric-card .metric-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Data Tables ---------- */
.data-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition-slow),
    border-color var(--transition-slow);
}

.data-table-wrap .table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.data-table-wrap .table-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: var(--bg-card-alt);
}

.data-table th {
  padding: 12px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-card-alt);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .actions {
  display: flex;
  gap: 6px;
}

.data-table .actions .btn {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ---------- Table Search ---------- */
.table-search {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  margin-bottom: 12px;
}

.table-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: flex;
  pointer-events: none;
  color: var(--text-muted);
  transition: color var(--transition);
}

.table-search-icon svg {
  width: 16px;
  height: 16px;
}

.table-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.table-search-input::placeholder {
  color: var(--text-muted);
}

.table-search-input:focus {
  border-color: var(--text-link);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 26,115,232), 0.12);
}

.table-search-input:focus + .table-search-icon,
.table-search:focus-within .table-search-icon {
  color: var(--text-link);
}

@media (max-width: 600px) {
  .table-search {
    min-width: 100%;
    max-width: 100%;
  }
}

.record-value {
  white-space: nowrap;
}

.record-value .value-text {
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.btn-copy-value {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 2px 6px;
  font-size: 0.75rem;
  vertical-align: middle;
  transition: opacity 0.15s;
}

tr:hover .btn-copy-value {
  opacity: 1;
}

.data-table .status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.data-table .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active {
  background: #38a169;
}
.status-dot.suspended {
  background: #e53e3e;
}
.status-dot.pending {
  background: #d69e2e;
}

/* ---------- Quick Action Panels ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.quick-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.quick-item svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-item i {
  font-size: 1.5rem;
  color: var(--primary);
  line-height: 1;
}

.quick-item span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- Section spacer ---------- */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.np-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.np-modal-overlay.active {
  display: flex;
}

.np-modal {
  background: var(--np-bg);
  color: var(--np-text);
  border: 1px solid var(--np-border);
  border-radius: 8px;
  box-shadow: var(--np-shadow);
  width: 90%;
  max-width: 450px;
  animation: np-modal-in 0.2s ease;
}

@keyframes np-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.np-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--np-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.np-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.np-modal-close {
  background: none;
  border: none;
  color: var(--np-text);
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
}
.np-modal-close:hover {
  opacity: 1;
}

.np-modal-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.np-modal-body input[type="text"] {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: var(--np-bg);
  color: var(--np-text);
  border: 1px solid var(--np-border);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.np-modal-body input[type="text"]:focus {
  outline: none;
  border-color: var(--np-primary);
}

.np-modal-footer {
  padding: 12px 20px;
  background: var(--np-bg);
  border-top: 1px solid var(--np-border);
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #065f46;
  color: #d1fae5;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(6,95,70,0.35);
  z-index: 99999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast::before {
  content: '✓';
  font-size: 16px;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.np-btn {
  padding: 8px 16px;
  border: 1px solid var(--np-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  background: var(--np-bg);
  color: var(--np-text);
}
.np-btn:hover {
  filter: brightness(0.95);
}
.np-btn.primary {
  background: var(--np-primary);
  border-color: var(--np-primary);
  color: #fff;
}
.np-btn.danger {
  background: var(--np-danger);
  border-color: var(--np-danger);
  color: #fff;
}
.np-btn.warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

/* ========================================
   dots animation
   ======================================== */

/* Max 1024px — tablet landscape */

.dots::after {
  content: "";
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  33% {
    content: ".";
  }
  66% {
    content: "..";
  }
  100% {
    content: "...";
  }
}

/* ========================================
   RESPONSIVE — Mobile-First Breakpoints
   ======================================== */

/* Max 1024px — tablet landscape */
@media (max-width: 1024px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
    position: static;
    align-self: auto;
    max-height: none;
    overflow-y: visible;
  }

  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .whm-sidebar {
    width: 240px;
  }

  .whm-main {
    margin-left: 240px;
  }
}

/* Max 768px — tablet portrait / large phone */
@media (max-width: 768px) {
  .top-header {
    padding: 0 12px;
    gap: 8px;
  }

  .top-header .header-logo svg {
    height: 26px;
  }

  .header-search {
    max-width: 180px;
  }

  .header-search input {
    padding: 7px 12px 7px 34px;
    font-size: 0.8125rem;
  }

  .header-user .user-name,
  .header-user .user-role {
    display: none;
  }

  .header-user {
    padding: 4px 8px;
  }

  .header-right {
    gap: 8px;
  }

  .dashboard-layout {
    padding: calc(var(--header-height) + 12px) 12px 24px;
    gap: 14px;
  }

  .card-header {
    padding: 12px 14px;
  }

  .card-header h2 {
    font-size: 0.9375rem;
    gap: 8px;
  }

  .card-body {
    padding: 14px;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }

  .tool-item {
    padding: 14px 8px 12px;
    font-size: 0.8125rem;
    min-height: 90px;
  }

  .tool-item svg {
    width: 32px;
    height: 32px;
  }

  .tool-item span {
    font-size: 0.75rem;
  }

  .info-panel .panel-header,
  .stats-panel .panel-header {
    padding: 12px 14px;
    font-size: 0.8125rem;
  }

  .info-panel .info-row {
    padding: 8px 14px;
    font-size: 0.75rem;
  }

  .stats-panel .stat-item {
    padding: 12px 14px;
  }

  .stat-header {
    margin-bottom: 6px;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-value {
    font-size: 0.75rem;
  }

  .login-card {
    padding: 28px 20px 20px;
    max-width: 400px;
  }

  .login-logo svg {
    height: 36px;
  }

  .login-title {
    font-size: 1.125rem;
  }

  .login-subtitle {
    font-size: 0.8125rem;
    margin-bottom: 22px;
  }

  .whm-sidebar {
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .whm-sidebar.open {
    transform: translateX(0);
  }

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

  .whm-topbar {
    padding: 10px 16px;
    gap: 10px;
  }

  .whm-topbar .sidebar-toggle {
    display: flex;
  }

  .whm-topbar .topbar-search {
    max-width: 200px;
  }

  .whm-topbar .topbar-search input {
    padding: 7px 12px 7px 34px;
    font-size: 0.8125rem;
  }

  .whm-topbar .header-user .user-name,
  .whm-topbar .header-user .user-role {
    display: none;
  }

  .whm-content {
    padding: 16px;
  }

  .whm-content h1 {
    font-size: 1.25rem;
  }

  .notif-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 460px;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .metric-card {
    padding: 20px 16px;
  }

  .metric-card .gauge {
    width: 80px;
    height: 80px;
  }

  .metric-card .gauge::after {
    inset: 8px;
  }

  .metric-card .gauge-value {
    font-size: 1rem;
  }

  .metric-card .metric-label {
    font-size: 0.8125rem;
  }

  .metric-card .metric-detail {
    font-size: 0.6875rem;
  }

  .quick-item {
    padding: 20px 12px;
    min-height: 90px;
  }

  .quick-item svg {
    width: 28px;
    height: 28px;
  }

  .quick-item span {
    font-size: 0.75rem;
  }

  .section-title {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .form-group-inner-flex{
    flex-wrap: wrap;
  }
}

/* Max 600px — small phone */
@media (max-width: 600px) {
  .header-search {
    display: none;
  }

  .top-header {
    padding: 0 10px;
    gap: 6px;
  }

  .top-header .header-logo svg {
    height: 28px;
  }

  .header-right {
    gap: 6px;
  }

  .dashboard-layout {
    padding: calc(var(--header-height) + 10px) 10px 20px;
    gap: 12px;
  }

  .card-header {
    padding: 10px 12px;
  }

  .card-header h2 {
    font-size: 0.875rem;
  }

  .card-header h2 svg {
    width: 16px;
    height: 16px;
  }

  .card-body {
    padding: 12px;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .tool-item {
    padding: 12px 6px 10px;
    min-height: 84px;
    gap: 8px;
  }

  .tool-item svg {
    width: 30px;
    height: 30px;
  }

  .tool-item span {
    font-size: 0.75rem;
  }

  .whm-topbar .topbar-search {
    max-width: 140px;
  }

  .whm-content {
    padding: 12px;
  }

  .whm-content h1 {
    font-size: 1.125rem;
  }

  .whm-content .page-desc {
    font-size: 0.8125rem;
    margin-bottom: 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card {
    padding: 16px 12px;
  }

  .metric-card .gauge {
    width: 68px;
    height: 68px;
  }

  .metric-card .gauge::after {
    inset: 7px;
  }

  .metric-card .gauge-value {
    font-size: 0.875rem;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .quick-item {
    padding: 16px 10px;
    min-height: 80px;
    gap: 8px;
  }

  .quick-item svg {
    width: 24px;
    height: 24px;
  }

  .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table-wrap .table-header {
    padding: 12px 14px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 14px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .login-card {
    padding: 20px 14px 16px;
  }

  .login-logo svg {
    height: 30px;
  }

  .login-title {
    font-size: 1rem;
  }

  .login-form .form-input {
    padding: 9px 12px;
    font-size: 0.875rem;
  }

  .login-form .btn {
    padding: 11px;
    font-size: 0.9375rem;
  }

  .login-footer {
    margin-top: 18px;
    padding-top: 16px;
  }

  .notif-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Max 400px — very small phone */
@media (max-width: 400px) {
  .top-header {
    padding: 0 8px;
  }

  .top-header .header-logo svg {
    height: 26px;
  }

  .header-right .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .header-right .theme-toggle svg {
    width: 17px;
    height: 17px;
  }

  .header-user .user-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.6875rem;
  }

  .dashboard-layout {
    padding: calc(var(--header-height) + 8px) 8px 16px;
    gap: 10px;
  }

  .card-body {
    padding: 10px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tool-item {
    min-height: 80px;
    padding: 10px 6px 8px;
  }

  .tool-item svg {
    width: 28px;
    height: 28px;
  }

  .tool-item span {
    font-size: 0.75rem;
  }

  .whm-topbar {
    padding: 8px 12px;
  }

  .whm-topbar .topbar-search {
    max-width: 100px;
  }

  .whm-topbar .topbar-search input {
    padding: 6px 10px 6px 30px;
    font-size: 0.75rem;
  }

  .whm-content {
    padding: 10px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .metric-card {
    padding: 14px 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
  }

  .metric-card .gauge {
    width: 60px;
    height: 60px;
    margin: 0;
    flex-shrink: 0;
  }

  .metric-card .gauge::after {
    inset: 6px;
  }

  .metric-card .gauge-value {
    font-size: 0.8125rem;
  }

  .metric-card .metric-body {
    flex: 1;
    min-width: 0;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .quick-item {
    padding: 14px 8px;
    min-height: 72px;
    gap: 6px;
  }

  .quick-item svg {
    width: 22px;
    height: 22px;
  }

  .quick-item span {
    font-size: 0.6875rem;
  }

  .login-card {
    padding: 18px 12px 14px;
    border-radius: var(--radius);
  }

  .login-logo svg {
    height: 26px;
  }

  #preloader .loader-logo svg {
    width: 140px;
  }
}

/* ---------- Touch-friendly improvements ---------- */
@media (hover: none) and (pointer: coarse) {
  .tool-item,
  .quick-item,
  .menu-label,
  .btn,
  .form-input,
  .collapse-btn,
  .theme-toggle {
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }

  .tool-item:active,
  .quick-item:active {
    transform: scale(0.97);
  }

  .btn:active {
    transform: scale(0.97);
  }

  .menu-label:active {
    background: var(--bg-sidebar-hover);
  }
}

/* ---------- Print ---------- */
.server-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .server-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .server-info-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .top-header,
  .whm-sidebar,
  .whm-topbar {
    display: none;
  }

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

  .dashboard-sidebar {
    width: 100%;
  }

  .card {
    break-inside: avoid;
  }

  .dashboard-sidebar {
    display: none;
  }
}

/* ========================================
   Centralized Footer
   ======================================== */
.nc-footer {
  width: 100%;
  margin-top: auto;
  font-size: 0.78rem;
}

.nc-footer-bottom {
  background: #141e2b;
  color: #64748b;
  padding: 14px 0;
}

[data-theme="dark"] .nc-footer-bottom {
  background: #080d14;
  color: #4b5563;
}

.nc-footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nc-footer-bottom-right strong {
  color: #94a3b8;
}

.nc-footer-bottom-right a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.nc-footer-bottom-right a:hover {
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .nc-footer-container {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ========================================
   Template Pages — Mobile Responsive
   ======================================== */

/* Card headers: stack title and actions vertically */
@media (max-width: 600px) {
  .card-header:has(.d-flex),
  .card-header:has(.btn) {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .card-header .d-flex,
  .card-header .btn {
    width: 100%;
  }

  .card-header .d-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-header .btn {
    width: 100%;
    justify-content: center;
  }

  /* Form inline rows: stack on mobile */
  .card-body form .form-group-inline,
  .card-body form [style*="display:flex"][style*="align-items:center"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }

  .card-body form [style*="display:flex"][style*="gap:6px"],
  .card-body form [style*="display:flex"][style*="gap: 6px"] {
    flex-wrap: wrap;
  }

  .card-body form select[style*="min-width"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Form elements: full width on mobile */
  .card-body form input[type="text"],
  .card-body form input[type="password"],
  .card-body form input[type="email"],
  .card-body form input[type="number"],
  .card-body form input[type="url"],
  .card-body form select,
  .card-body form textarea {
    width: 100%;
    box-sizing: border-box;
  }

  /* Tables: horizontal scroll */
  .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 8px 10px;
  }

  /* Privilege columns: stack */
  .card-body [style*="flex-wrap: wrap"] {
    gap: 12px !important;
  }

  .card-body [style*="flex: 1 1 200px"] {
    flex: 1 1 100% !important;
  }

  /* Back button links in card headers */
  .card-header a.btn-sm {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Force inline grids to not overflow on small screens */
  [style*="grid-template-columns"][style*="minmax("] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  }

  /* Table action buttons: stack vertically */
  .data-table .actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .data-table .actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   DNS Zone Editor — Records Table
   ============================================================ */

/* DNS form grid */
.dns-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

@media (max-width: 640px) {
  .dns-form-grid {
    grid-template-columns: 1fr;
  }
}

.dns-records-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  font-size: 0.85rem;
}

.dns-records-table colgroup .col-name   { width: 18%; }
.dns-records-table colgroup .col-type   { width: 8%; }
.dns-records-table colgroup .col-value  { width: auto; }
.dns-records-table colgroup .col-prio   { width: 7%; }
.dns-records-table colgroup .col-ttl    { width: 7%; }
.dns-records-table colgroup .col-actions { width: 10%; }

.dns-records-table thead th {
  padding: 10px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-card-alt);
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.dns-records-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.dns-records-table tbody td.dns-value-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dns-records-table tbody tr:last-child td {
  border-bottom: none;
}

.dns-records-table tbody tr:hover {
  background: var(--bg-card-alt);
}

.dns-name {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dns-name-root {
  color: var(--text-muted);
  font-style: italic;
}

/* Type badges */
.dns-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.dns-type-a      { background: #e8f5e9; color: #2e7d32; }
.dns-type-aaaa   { background: #e3f2fd; color: #1565c0; }
.dns-type-mx     { background: #f3e5f5; color: #7b1fa2; }
.dns-type-cname  { background: #fff3e0; color: #e65100; }
.dns-type-txt    { background: #e0f7fa; color: #00695c; }
.dns-type-ns     { background: #fce4ec; color: #c62828; }
.dns-type-soa    { background: #ede7f6; color: #4527a0; }
.dns-type-srv    { background: #e8eaf6; color: #283593; }
.dns-type-caa    { background: #f1f8e9; color: #558b2f; }
.dns-type-default { background: var(--bg-card-alt); color: var(--text-secondary); }

[data-theme="dark"] .dns-type-a      { background: #1a3a2a; color: #68d391; }
[data-theme="dark"] .dns-type-aaaa   { background: #1a2a3a; color: #63b3ed; }
[data-theme="dark"] .dns-type-mx     { background: #2a1a3a; color: #b794f4; }
[data-theme="dark"] .dns-type-cname  { background: #3a2a1a; color: #f6ad55; }
[data-theme="dark"] .dns-type-txt    { background: #1a3a3a; color: #4fd1c5; }
[data-theme="dark"] .dns-type-ns     { background: #3a1a1a; color: #fc8181; }
[data-theme="dark"] .dns-type-soa    { background: #2a1a3a; color: #b794f4; }
[data-theme="dark"] .dns-type-srv    { background: #1a1a3a; color: #90cdf4; }
[data-theme="dark"] .dns-type-caa    { background: #2a3a1a; color: #9ae6b4; }
[data-theme="dark"] .dns-type-default { background: var(--bg-card-alt); color: var(--text-secondary); }

.dns-value-cell {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.dns-value-cell .dns-value-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* SOA multi-line formatting */
.dns-soa {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  line-height: 1.6;
}

.dns-soa-label {
  display: inline-block;
  min-width: 56px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-dns-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.7rem;
  vertical-align: middle;
  margin-left: 6px;
}

.btn-dns-copy:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.dns-actions-cell {
  white-space: nowrap;
  text-align: center;
}

.dns-actions-cell form {
  display: inline;
}

.dns-lock {
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.5;
}

.dns-row--system {
  opacity: 0.65;
}

.dns-row--system:hover {
  opacity: 1;
}

/* Mobile: card layout */
@media (max-width: 768px) {
  .dns-records-table {
    table-layout: auto;
  }

  .dns-records-table thead {
    display: none;
  }

  .dns-records-table colgroup {
    display: none;
  }

  .dns-records-table,
  .dns-records-table tbody,
  .dns-records-table tr,
  .dns-records-table td {
    display: block;
    border: none;
  }

  .dns-records-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .dns-records-table tbody tr {
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    margin: 0;
  }

  .dns-records-table tbody tr:last-child {
    border-bottom: none;
  }

  .dns-records-table tbody td {
    padding: 6px 16px;
    border-bottom: none;
    text-align: left;
    font-size: 0.8rem;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
  }

  /* Name + Type badge on one row */
  .dns-records-table tbody td:first-child,
  .dns-records-table tbody td:nth-child(2) {
    display: inline-block;
    width: auto;
    padding: 10px 0 4px;
  }

  .dns-records-table tbody td:first-child {
    padding-left: 16px;
  }

  .dns-records-table tbody td:nth-child(2) {
    padding-right: 16px;
    text-align: right;
  }

  /* Value fills full width */
  .dns-records-table tbody td.dns-value-cell {
    display: block;
    padding: 6px 16px 10px;
    border-bottom: 1px solid var(--border-light);
  }

  .dns-records-table tbody td.dns-value-cell .dns-value-text {
    white-space: normal;
    word-break: break-all;
  }

  /* Prio + TTL side by side */
  .dns-records-table tbody td[data-label="Prio"],
  .dns-records-table tbody td[data-label="TTL"] {
    display: inline-block;
    width: 50%;
    padding: 6px 16px;
    font-size: 0.75rem;
  }

  .dns-records-table tbody td[data-label="Prio"] {
    padding-left: 32px;
  }

  /* Actions */
  .dns-records-table tbody td.dns-actions-cell {
    display: block;
    padding: 8px 16px 12px;
    text-align: right;
  }

  /* Hide Name label */
  .dns-records-table tbody td[data-label="Name"]::before {
    display: none;
  }
}

/* ========================================
   Email Deliverability — Mobile Responsive
   ======================================== */

.deliverability-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.deliverability-domain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deliverability-info-row {
  display: flex;
  gap: 24px;
  font-size: 0.85em;
}

.deliverability-info-row code {
  word-break: break-all;
}

.deliverability-mx-row {
  display: flex;
  gap: 16px;
}

.remote-mysql-form > div {
  flex: 1 1 200px;
}

@media (max-width: 768px) {
  .remote-mysql-form > div {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }

  .remote-mysql-form .form-actions {
    width: 100%;
  }

  .remote-mysql-form .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .deliverability-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .deliverability-domain-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .deliverability-info-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .deliverability-mx-row {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .deliverability-status-grid {
    grid-template-columns: 1fr 1fr;
  }
}


