/* ====================================================================
   HavenCraft SMP — Official Admin Dashboard Theme
   Aesthetics: HavenCraft Emerald & Dark Palette + AdminLTE v4 Layout
   Zero Emojis — Pure Professional Typography and Iconography
   ==================================================================== */

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

:root {
  /* ===== Primary — TEAL (final) ===== */
  --primary: #00c896;
  --primary-hover: #00e5ab;
  --primary-rgb: 0, 200, 150;
  --primary-dim: rgba(0, 200, 150, 0.12);
  --on-primary: #051410;          /* text on primary fills */

  /* ===== Secondary accent — orange (highlights only, never fills) ===== */
  --accent: #ff8a00;
  --accent-dim: rgba(255, 138, 0, 0.15);

  /* ===== Status — one value each ===== */
  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --info: #38bdf8;
  --info-dim: rgba(56, 189, 248, 0.12);

  /* ===== Category accents ===== */
  --pink: #f472b6;
  --pink-dim: rgba(244, 114, 182, 0.12);

  /* ===== Backgrounds — one near-black family ===== */
  --bg-app: #070911;
  --bg-sidebar: rgba(11, 15, 25, 0.88);
  --bg-header: rgba(13, 18, 30, 0.75);
  --bg-card: rgba(15, 21, 36, 0.65);
  --bg-card-hover: rgba(24, 33, 56, 0.82);
  --bg-surface: rgba(20, 27, 45, 0.75);
  --bg-input: rgba(10, 14, 26, 0.85);

  /* ===== Glass ===== */
  --glass-bg: rgba(11, 15, 25, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(20px);
  --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  /* ===== Text ===== */
  --text-main: #f0f6fc;
  --text-secondary: #9aa5b8;
  --text-muted: #647087;

  /* ===== Borders ===== */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-primary: rgba(0, 200, 150, 0.3);

  /* ===== Shadows ===== */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

  /* ===== Layout ===== */
  --sidebar-width: 260px;
  --sidebar-mini-width: 72px;
  --header-height: 64px;

  /* ===== Typography — 2 families max ===== */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* ===== Radius ===== */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* ===== Motion ===== */
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at 12% 15%, rgba(0, 200, 150, 0.07) 0%, transparent 42%),
              radial-gradient(circle at 88% 22%, rgba(0, 200, 150, 0.08) 0%, transparent 45%),
              radial-gradient(circle at 50% 85%, rgba(56, 189, 248, 0.05) 0%, transparent 50%),
              var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Anti-FOUC Route Shield: Protected pages remain 100% hidden until session is verified */
html:not(.hvn-auth-ready):not(.hvn-public-page) body {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.hvn-auth-ready body {
  visibility: visible !important;
  opacity: 1 !important;
  transition: opacity 0.15s ease-in;
}

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

a:hover {
  color: var(--primary-hover);
}

/* Layout Framework */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Main Sidebar (Mini Rail + Hover Expand Architecture) */
.main-sidebar {
  width: var(--sidebar-mini-width);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

.brand-link {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  text-decoration: none;
  transition: padding 0.3s ease;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--info));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-primary);
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 200, 150, 0.35);
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-text span {
  color: var(--primary);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid var(--border-primary);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 12px 6px;
  margin-top: 8px;
  white-space: nowrap;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link i {
  font-size: 1.15rem;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.25s ease, transform 0.25s ease;
  flex-shrink: 0;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-link:hover i {
  color: var(--primary);
  transform: scale(1.1);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(0, 200, 150, 0.2), rgba(0, 200, 150, 0.08));
  color: var(--primary);
  border-color: var(--border-primary);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 200, 150, 0.15);
}

.nav-link.active i {
  color: var(--primary);
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.staff-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: padding 0.3s ease;
}

.staff-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid var(--border-primary);
  background: var(--bg-surface);
  object-fit: cover;
  flex-shrink: 0;
}

.staff-meta {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.staff-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-role {
  font-size: 0.72rem;
  color: var(--primary);
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  transition: var(--transition);
}

/* Top Navbar (Header) */
.main-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(12px);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: var(--transition);
}

.btn-sidebar-toggle:hover {
  background: var(--bg-surface);
  color: var(--primary);
  border-color: var(--border-primary);
}

.server-quick-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 200, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-logout {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-logout:hover {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: var(--danger);
}

/* Page Content */
.content-wrapper {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title i {
  color: var(--primary);
  font-size: 1.45rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  list-style: none;
}

.breadcrumb-list li a {
  color: var(--text-muted);
}

.breadcrumb-list li a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--border-strong);
}

/* AdminLTE Info Box Widgets */
.info-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.info-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.info-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--border);
  transition: var(--transition);
}

.info-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.info-box.primary::before { background: var(--primary); }
.info-box.accent::before { background: var(--accent); }
.info-box.danger::before { background: var(--danger); }
.info-box.info::before { background: var(--info); }
.info-box.warning::before { background: var(--warning); }

.info-box-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-primary { background: var(--primary-dim); color: var(--primary); border: 1px solid var(--border-primary); }
.icon-accent { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(255, 138, 0, 0.3); }
.icon-danger { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.icon-info { background: var(--info-dim); color: var(--info); border: 1px solid rgba(2, 132, 199, 0.3); }
.icon-warning { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }

.info-box-content {
  flex: 1;
  min-width: 0;
}

.info-box-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 4px;
}

.info-box-number {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.info-box-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Card Component (AdminLTE Style) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--primary);
  font-size: 1.15rem;
}

.card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
  flex: 1;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tables (AdminLTE Dark) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  text-align: left;
}

.admin-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: var(--transition);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(0, 200, 150, 0.35);
  color: var(--on-primary);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger-dim);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-warning {
  background: var(--warning-dim);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}

.btn-warning:hover {
  background: var(--warning);
  color: var(--bg-app);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-success {
  background: var(--success-dim);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}

.btn-success:hover {
  background: var(--success);
  color: var(--bg-app);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-info {
  background: var(--info-dim);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--info);
}

.btn-info:hover {
  background: var(--info);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

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

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--on-primary);
}

.btn.active, .btn-secondary.active {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(0, 200, 150, 0.35) !important;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* ==========================================================
   UNIFIED MODAL SYSTEM (HavenCraft Dark Theme)
   ========================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 10, 16, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 200, 150, 0.1);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
  min-width: 0;
}

.form-row-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}

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

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-main);
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background: var(--bg-surface);
}

/* Input with Icon Group (Fixes floating icon separation bug) */
.input-icon-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-group i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  margin: 0 !important;
  padding: 0 !important;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-icon-group:focus-within i {
  color: var(--primary);
}

.input-icon-group .form-control,
.input-icon-group input {
  padding-left: 38px !important;
  width: 100%;
  box-sizing: border-box;
}

/* Toggle Switch */
.switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--on-primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-open { background: var(--primary-dim); color: var(--primary); border: 1px solid var(--border-primary); }
.badge-closed { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); border: 1px solid var(--border); }
.badge-pending { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Main Footer */
.main-footer {
  height: 52px;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.main-footer strong {
  color: var(--text-main);
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
  box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.8);
}

/* ==========================================================
   SIDEBAR MINI + HOVER EXPAND (Desktop) & OFF-CANVAS (Mobile)
   ========================================================== */
@media (min-width: 993px) {
  .main-sidebar {
    width: var(--sidebar-mini-width);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  }

  .main-sidebar:hover,
  body.sidebar-pinned .main-sidebar {
    width: var(--sidebar-width);
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 200, 150, 0.08);
    z-index: 1045;
  }

  .main-wrapper {
    margin-left: var(--sidebar-mini-width);
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .main-sidebar:hover ~ .main-wrapper,
  body.sidebar-pinned .main-wrapper {
    margin-left: var(--sidebar-width);
  }

  /* Mini State - Collapse text elements */
  .main-sidebar .brand-text,
  .main-sidebar .brand-badge,
  .main-sidebar .sidebar-heading,
  .main-sidebar .nav-text,
  .main-sidebar .staff-meta,
  .main-sidebar .chevron-icon {
    opacity: 0;
    display: none;
    white-space: nowrap;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .main-sidebar .brand-link {
    justify-content: center;
    padding: 0;
  }

  .main-sidebar .nav-link {
    justify-content: center;
    padding: 12px 0;
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border-radius: 12px;
  }

  .main-sidebar .nav-link i {
    font-size: 1.25rem;
    width: auto;
    margin: 0;
  }

  .main-sidebar .staff-info-card {
    justify-content: center;
    padding: 4px 0;
  }

  /* Expanded on Hover State */
  .main-sidebar:hover .brand-text,
  .main-sidebar:hover .brand-badge,
  .main-sidebar:hover .sidebar-heading,
  .main-sidebar:hover .nav-text,
  .main-sidebar:hover .staff-meta,
  .main-sidebar:hover .chevron-icon,
  body.sidebar-pinned .main-sidebar .brand-text,
  body.sidebar-pinned .main-sidebar .brand-badge,
  body.sidebar-pinned .main-sidebar .sidebar-heading,
  body.sidebar-pinned .main-sidebar .nav-text,
  body.sidebar-pinned .main-sidebar .staff-meta,
  body.sidebar-pinned .main-sidebar .chevron-icon {
    display: inline-block;
    opacity: 1;
  }

  .main-sidebar:hover .brand-link,
  body.sidebar-pinned .main-sidebar .brand-link {
    justify-content: flex-start;
    padding: 0 20px;
    gap: 12px;
  }

  .main-sidebar:hover .nav-link,
  body.sidebar-pinned .main-sidebar .nav-link {
    justify-content: flex-start;
    width: 100%;
    height: auto;
    padding: 10px 14px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  .main-sidebar:hover .nav-link i,
  body.sidebar-pinned .main-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 22px;
  }

  .main-sidebar:hover .staff-info-card,
  body.sidebar-pinned .main-sidebar .staff-info-card {
    justify-content: flex-start;
    padding: 0;
  }

  .sidebar-backdrop {
    display: none !important;
  }
  .btn-sidebar-close {
    display: none !important;
  }
}

/* Mobile & Zoomed Screen Breakpoint (<= 992px) */
@media (max-width: 992px) {
  .main-sidebar {
    width: var(--sidebar-width) !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1050 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  body.sidebar-open .main-sidebar {
    transform: translateX(0) !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.85);
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .main-sidebar .brand-text,
  .main-sidebar .brand-badge,
  .main-sidebar .sidebar-heading,
  .main-sidebar .nav-text,
  .main-sidebar .staff-meta,
  .main-sidebar .chevron-icon {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .main-sidebar .nav-link {
    width: 100% !important;
    height: auto !important;
    justify-content: flex-start !important;
    padding: 10px 14px !important;
  }

  .main-sidebar .brand-link {
    justify-content: flex-start !important;
    padding: 0 20px !important;
  }

  .main-sidebar .staff-info-card {
    justify-content: flex-start !important;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 7, 12, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1045;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block !important;
    opacity: 1 !important;
  }

  .btn-sidebar-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    margin-left: auto;
  }

  .btn-sidebar-close:hover {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-strong);
  }
}

/* ==========================================================
   GLASSY CRM CARD SYSTEM & RADIANT STATS
   ========================================================== */
.glass-card, .card {
  background: var(--glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s ease;
}

.glass-card:hover, .card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.stat-card-teal {
  background: linear-gradient(135deg, rgba(0, 200, 150, 0.22) 0%, rgba(15, 21, 36, 0.75) 100%) !important;
  border-color: rgba(0, 200, 150, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 200, 150, 0.16) !important;
}

.stat-card-teal:hover {
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.65), 0 0 36px rgba(0, 200, 150, 0.3) !important;
}

.stat-card-pink {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.2) 0%, rgba(15, 21, 36, 0.75) 100%) !important;
  border-color: rgba(244, 114, 182, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(244, 114, 182, 0.14) !important;
}

.stat-card-pink:hover {
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.65), 0 0 36px rgba(244, 114, 182, 0.28) !important;
}

.stat-card-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(15, 21, 36, 0.75) 100%) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(16, 185, 129, 0.16) !important;
}

.stat-card-emerald:hover {
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.65), 0 0 36px rgba(16, 185, 129, 0.3) !important;
}

.stat-card-cyan {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(15, 21, 36, 0.75) 100%) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(56, 189, 248, 0.16) !important;
}

.stat-card-cyan:hover {
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.65), 0 0 36px rgba(56, 189, 248, 0.3) !important;
}

.stat-card-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(15, 21, 36, 0.75) 100%) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(245, 158, 11, 0.16) !important;
}

.stat-card-amber:hover {
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.65), 0 0 36px rgba(245, 158, 11, 0.3) !important;
}

/* ==========================================================
   MODAL COMPONENT & FILE UPLOAD SYSTEM
   ========================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 7, 12, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1060; /* Always above sidebar (1040) and header (1020) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 200, 150, 0.08);
  overflow: hidden;
  position: relative;
  animation: modalEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-dialog.modal-lg {
  max-width: 760px;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-dim);
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
  box-shadow: 0 0 14px var(--primary-dim);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* Tab Switcher inside Modal */
.modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.modal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.modal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.modal-tab-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 10px rgba(0, 200, 150, 0.35);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(0, 200, 150, 0.35);
  background: rgba(0, 200, 150, 0.02);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(0, 200, 150, 0.07);
  box-shadow: 0 0 24px rgba(0, 200, 150, 0.2);
  transform: translateY(-2px);
}

.dropzone-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.45rem;
  transition: transform 0.3s ease;
}


.upload-dropzone:hover .dropzone-icon-circle {
  transform: scale(1.1);
}

.dropzone-text-main {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-text-main span {
  color: var(--primary);
  text-decoration: underline;
}

.dropzone-text-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Image Preview Container */
.image-preview-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  box-shadow: var(--shadow-md);
}

.image-preview-media {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.image-preview-card:hover .image-preview-media {
  transform: scale(1.02);
}

.preview-overlay-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-meta-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.65);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Category Pill Badges for selection */
.category-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-pill-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.category-pill-btn.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 200, 150, 0.25);
  font-weight: 600;
}


/* Sidebar Brand Header with Mobile Close Button */
.sidebar-brand-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand-wrapper .brand-link {
  flex: 1;
  border-bottom: none;
}

.btn-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: 0 16px;
  height: var(--header-height);
  cursor: pointer;
  transition: color 0.2s;
  align-items: center;
  justify-content: center;
}

.btn-sidebar-close:hover {
  color: var(--primary);
}

/* Responsive Grid Form Utility */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }
}

/* Desktop Collapsed Sidebar State */
@media (min-width: 993px) {
  body.sidebar-collapsed .main-sidebar {
    transform: translateX(-100%);
  }
  
  body.sidebar-collapsed .main-wrapper {
    margin-left: 0;
  }
}


/* Mobile & Tablet Responsive Navigation */
@media (max-width: 992px) {
  .btn-sidebar-close {
    display: flex;
  }

  .main-sidebar {
    width: 280px;
    max-width: 82vw;
    transform: translateX(-100%) !important;
    box-shadow: 10px 0 36px rgba(0, 0, 0, 0.7);
    z-index: 1045;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  body.sidebar-open .main-sidebar {
    transform: translateX(0) !important;
  }
  
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Clean, crisp mobile backdrop (NO blur to eliminate black skin smudge) */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  
  body.sidebar-open .sidebar-backdrop {
    display: block !important;
    opacity: 1 !important;
  }
}

/* Mobile Optimization & Touch Enhancements */
@media (max-width: 768px) {
  /* Prevent iOS & Android browser auto-zoom when focusing inputs */
  .form-control,
  .form-select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea {
    font-size: 16px !important;
  }

  .content-wrapper {
    padding: 14px;
    gap: 16px;
  }

  .main-header {
    padding: 0 12px;
  }

  .header-btn span {
    display: none;
  }

  .header-btn {
    padding: 0 10px;
  }

  .server-quick-status {
    display: none !important;
  }

  .info-box-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Users page stat cards: 2-col compact on mobile (was 4 stacked full-width) */
  .user-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }

  .user-stats-grid .card-body {
    padding: 12px !important;
    gap: 10px !important;
  }

  .user-stats-grid .us-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.05rem !important;
    border-radius: 8px !important;
    flex-shrink: 0;
  }

  .user-stats-grid .us-label {
    font-size: 0.64rem !important;
  }

  .user-stats-grid .us-num {
    font-size: 1.2rem !important;
  }

  /* Slim stat cards on mobile: icons hidden,
     content is just label + value + bar. No more chunky boxes. */
  .info-box {
    padding: 12px;
  }

  .info-box-icon {
    display: none;
  }

  .info-box-content {
    width: 100%;
    min-width: 0;
  }

  .info-box-text {
    font-size: 0.62rem;
    margin-bottom: 2px;
  }

  .info-box-number {
    font-size: 1.1rem;
    white-space: nowrap;
  }

  .info-box-sub {
    font-size: 0.68rem;
    margin-top: 2px;
  }

  .info-box .progress-bar-container {
    margin-top: 6px;
    height: 6px;
  }

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

  .card-body {
    padding: 14px;
  }

  .btn {
    min-height: 40px;
    padding: 8px 14px;
  }

  .login-page {
    padding: 12px;
  }

  .login-box {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .login-header {
    padding: 24px 16px 16px;
  }

  .login-body {
    padding: 20px 16px;
  }

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

/* ==========================================================
   UNIFIED BUTTON DESIGN SYSTEM (AdminLTE + HavenCraft Theme)
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button (HavenCraft Emerald) */
.btn-primary {
  background: var(--primary);
  color: #06110d !important;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 200, 150, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(0, 200, 150, 0.4);
  transform: translateY(-1px);
  color: #06110d !important;
}

/* Secondary Button */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

/* Danger Button */
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--text-main);
  border-color: var(--danger);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Warning Button */
.btn-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: var(--warning);
  color: #0c0e14;
  border-color: var(--warning);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

/* Sizes */
.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* ==========================================================
   HEADER NOTIFICATIONS SYSTEM
   ========================================================== */
.notif-dropdown-wrapper {
  position: relative;
}

.notif-bell-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.notif-bell-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.notif-badge-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-app);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: notifPulse 2.5s infinite;
}

@keyframes notifPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.notif-menu-dropdown {
  position: absolute;
  top: 46px;
  right: 0;
  width: 340px;
  max-width: min(340px, calc(100vw - 24px));
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notif-menu-dropdown.show {
  display: flex;
}

@media (max-width: 768px) {
  .notif-menu-dropdown {
    position: fixed !important;
    top: 60px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 auto !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85) !important;
    z-index: 9999 !important;
  }
}

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

.notif-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.notif-item-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.notif-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-footer {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ==========================================================
   USER PROFILE COMPONENT (AdminLTE Style - Screenshot 1)
   ========================================================== */
.profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

.profile-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary), #008f6b);
  box-shadow: 0 0 20px rgba(0, 200, 150, 0.3);
  margin-bottom: 16px;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0d1117;
  object-fit: cover;
  display: block;
}

.profile-name-main {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profile-role-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.profile-stats-row {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-bottom: 18px;
}

.profile-stat-col {
  flex: 1;
  text-align: center;
}

.profile-stat-col:not(:last-child) {
  border-right: 1px solid var(--border);
}

.profile-stat-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.profile-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.profile-about-box {
  width: 100%;
  text-align: left;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.profile-about-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.profile-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 16px;
  gap: 8px;
}

.profile-tab-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-tab-link:hover {
  color: var(--text-main);
}

.profile-tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-tab-content {
  padding: 24px;
}

/* ==========================================================
   LOCKSCREEN COMPONENT (AdminLTE Style - Screenshot 2)
   ========================================================== */
.lockscreen-wrapper {
  max-width: 440px;
  margin: 80px auto 0;
  text-align: center;
}

.lockscreen-logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.lockscreen-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 24px;
}

.lockscreen-item {
  border-radius: var(--radius-full);
  background: rgba(21, 26, 40, 0.85);
  border: 1px solid var(--border-strong);
  position: relative;
  margin: 10px auto 20px;
  width: 320px;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.lockscreen-image {
  border-radius: 50%;
  position: absolute;
  left: -10px;
  top: -8px;
  background: #0d1117;
  padding: 3px;
  border: 2px solid var(--primary);
  width: 60px;
  height: 60px;
  box-shadow: 0 0 16px rgba(0, 200, 150, 0.4);
}

.lockscreen-image img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lockscreen-credentials {
  margin-left: 64px;
  flex: 1;
  display: flex;
  align-items: center;
}

.lockscreen-credentials input {
  border: 0;
  padding: 12px 14px;
  background: transparent;
  color: #fff;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
}

.lockscreen-credentials .btn-unlock {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 10px 16px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.lockscreen-credentials .btn-unlock:hover {
  transform: translateX(3px);
  color: #fff;
}

.lockscreen-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.lockscreen-footer {
  margin-top: 36px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================
   HEADER NOTIFICATIONS DROPDOWN
   ========================================================== */
.notif-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.notif-bell-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.notif-badge-pill {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  border: 2px solid var(--bg-header);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
  line-height: 1.2;
}

/* ==========================================================
   USER PROFILE LAYOUT (AdminLTE Style - Screenshot 1)
   ========================================================== */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1180px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
  }

  .profile-nav-tabs {
    gap: 2px;
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .profile-nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-tab-link {
    padding: 12px 12px;
    font-size: 0.82rem;
  }

  .profile-tab-content {
    padding: 18px 14px;
  }
}

.profile-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  padding: 3px;
  background: #0d1117;
  box-shadow: 0 4px 20px rgba(0, 200, 150, 0.35);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-name-main {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-role-sub {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.profile-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.profile-about-box {
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.profile-about-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.profile-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  gap: 4px;
  overflow-x: auto;
}

.profile-tab-link {
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.profile-tab-link:hover {
  color: var(--text-main);
}

.profile-tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ==========================================================
   GLASSY CRM DASHBOARD — VIDEO MOCKUP THEME & ANIMATIONS
   ========================================================== */
.dash-hero-glass {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75) 0%, rgba(30, 41, 59, 0.45) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.dash-hero-glass::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 200, 150, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

.dash-hero-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-hero-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 4px;
}

.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.crm-stat-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.crm-stat-card:hover {
  transform: translateY(-5px);
}

.crm-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.crm-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
}

.trend-up {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.trend-neutral {
  background: var(--info-dim);
  color: var(--info);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.trend-amber {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.crm-stat-number {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}

.crm-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

.crm-stat-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.crm-stat-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease-in-out;
}

/* Glass Card Charts */
.crm-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .crm-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.crm-bar-chart-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  height: 190px;
  padding: 20px 10px 0;
  position: relative;
}

.crm-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.crm-bar-track {
  width: 100%;
  max-width: 38px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px 8px 0 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.crm-bar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #00b386 0%, #006b4f 100%);
  box-shadow: 0 0 12px rgba(0, 200, 150, 0.25);
  transition: height 1s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  position: relative;
}

.crm-bar-col:hover .crm-bar-fill {
  filter: brightness(1.25);
  box-shadow: 0 0 20px rgba(0, 200, 150, 0.45);
}

.crm-bar-col.accent .crm-bar-fill {
  background: linear-gradient(180deg, #00e5ab 0%, #008f6b 100%);
  box-shadow: 0 0 12px rgba(0, 200, 150, 0.4);
}

.crm-bar-col.accent:hover .crm-bar-fill {
  box-shadow: 0 0 20px rgba(0, 200, 150, 0.7);
}

.crm-bar-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-weight: 600;
}

.crm-bar-tooltip {
  position: absolute;
  top: -34px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.crm-bar-col:hover .crm-bar-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Telemetry Circular Gauge */
.crm-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 20px;
  position: relative;
}

.crm-gauge-svg {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}

.crm-gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.crm-gauge-val {
  fill: none;
  stroke: url(#emeraldCyanGrad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 20;
  filter: drop-shadow(0 0 8px rgba(0, 200, 150, 0.6));
  transition: stroke-dashoffset 1.5s ease;
}

.crm-gauge-center {
  position: absolute;
  text-align: center;
}

.crm-gauge-tps {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.crm-gauge-sub {
  font-size: 0.74rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Rank Breakdown items */
.rank-dist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}

.rank-dist-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-dist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.rank-dist-title {
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-dist-percent {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.rank-dist-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.rank-dist-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease;
}

/* Quick Actions Grid */
.crm-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.crm-action-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-action-tile:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: #fff;
}

.crm-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ===== Keyboard focus — consistent 2px primary ring (ChaiUI-inspired) ===== */
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/* ==========================================================
   PROFILE — MOBILE HARDENING (overflow fixes)
   Bare `1fr` (= minmax(auto,1fr)) lets a wide item's min-content
   push the track past the viewport; minmax(0,1fr) caps it.
   ========================================================== */
@media (max-width: 1180px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-layout > * {
    min-width: 0;
    max-width: 100%;
  }
  .profile-stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-nav-tabs {
    max-width: 100%;
  }
  .profile-tab-link {
    flex-shrink: 0;
  }
  .profile-about-box {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.25rem;
  }
  /* flex-item safety: content wrapper children must shrink */
  .content-wrapper > * {
    min-width: 0;
  }
}

/* ==========================================================
   SHARED — confirmation modal (window.hvnConfirm)
   ChaiUI: proper dialog — backdrop dismiss, Escape, focus.
   ========================================================== */
.hvn-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(3, 6, 12, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.hvn-modal-backdrop.show {
  opacity: 1;
}

.hvn-modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}

.hvn-modal-backdrop.show .hvn-modal {
  transform: none;
}

.hvn-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hvn-modal-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
}

.hvn-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================
   SHARED — inline form error (replaces native alert())
   ========================================================== */
.form-error {
  display: none;
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 6px;
}

.form-error.show {
  display: block;
}

/* ==========================================================
   SHARED — password strength meter
   ========================================================== */
.pw-meter {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.pw-meter span {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.2s ease;
}

.pw-meter span.on-1 { background: var(--danger); }
.pw-meter span.on-2 { background: var(--warning); }
.pw-meter span.on-3 { background: var(--info); }
.pw-meter span.on-4 { background: var(--primary); }

.pw-strength-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 1em;
}

/* Header server pill — offline state (toggled by layout.js live check) */
.server-quick-status.is-offline {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.server-quick-status.is-offline .pulse-dot {
  background-color: var(--danger);
  box-shadow: none;
  animation: none;
}

/* Shared loading spinner utility (gallery, settings save, etc.) */
.spin {
  display: inline-block;
  animation: hvn-spin 1s linear infinite;
}
@keyframes hvn-spin {
  to { transform: rotate(360deg); }
}

/* Global Staff Role Badges */
.role-owner        { background: rgba(239, 68, 68, 0.15);  color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.35); }
.role-co-owner     { background: rgba(249, 115, 22, 0.15); color: #fb923c;       border: 1px solid rgba(249, 115, 22, 0.35); }
.role-manager      { background: rgba(168, 85, 247, 0.15); color: #c084fc;       border: 1px solid rgba(168, 85, 247, 0.35); }
.role-developer    { background: rgba(99, 102, 241, 0.15); color: #818cf8;       border: 1px solid rgba(99, 102, 241, 0.35); }
.role-admin        { background: var(--primary-dim);       color: var(--primary); border: 1px solid var(--border-primary); }
.role-moderator    { background: rgba(2, 132, 199, 0.15);  color: var(--info);    border: 1px solid rgba(2, 132, 199, 0.35); }
.role-officer      { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.35); }
.role-helper       { background: rgba(234, 179, 8, 0.15);  color: #facc15;       border: 1px solid rgba(234, 179, 8, 0.35); }
.role-builder      { background: rgba(132, 204, 22, 0.15); color: #a3e635;       border: 1px solid rgba(132, 204, 22, 0.35); }
.role-pending      { background: rgba(148, 163, 184, 0.15); color: #cbd5e1;       border: 1px solid rgba(148, 163, 184, 0.35); }

