/* ==========================================================
   modern-hostyt.css — Ultra-modern hosting panel design system
   ========================================================== */

/* ----------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (Light / Dark)
   ---------------------------------------------------------- */
:root,
[data-theme="light"] {
  /* Brand */
  --mh-accent:        #6366f1;
  --mh-accent-hover:  #4f46e5;
  --mh-accent-subtle: rgba(99,102,241,.08);
  --mh-accent-rgb:    99,102,241;

  /* Surfaces */
  --mh-bg:            #f1f5f9;
  --mh-bg-card:       #ffffff;
  --mh-bg-card-rgb:   255,255,255;
  --mh-bg-sidebar:    #ffffff;
  --mh-bg-topbar:     rgba(255,255,255,.72);
  --mh-bg-input:      #ffffff;
  --mh-bg-hover:      #f8fafc;
  --mh-bg-code:       #f1f5f9;
  --mh-bg-modal:      rgba(15,23,42,.45);

  /* Glass */
  --mh-glass-bg:      rgba(255,255,255,.60);
  --mh-glass-border:  rgba(255,255,255,.35);
  --mh-glass-blur:    20px;

  /* Text — slate-600/slate-500 give stronger contrast on white than slate-500/slate-400 */
  --mh-text:          #0f172a;
  --mh-text-secondary:#475569;
  --mh-text-muted:    #64748b;
  --mh-text-inverse:  #ffffff;

  /* Borders — slate-300 is more visible than slate-200 without feeling heavy */
  --mh-border:        #cbd5e1;
  --mh-border-subtle: #e2e8f0;
  --mh-border-focus:  var(--mh-accent);
  --mh-ring:          0 0 0 3px rgba(99,102,241,.18);

  /* Shadows */
  --mh-shadow-sm:     0 1px 2px rgba(0,0,0,.04);
  --mh-shadow:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --mh-shadow-md:     0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --mh-shadow-lg:     0 10px 15px rgba(0,0,0,.06), 0 4px 6px rgba(0,0,0,.04);
  --mh-shadow-xl:     0 20px 25px rgba(0,0,0,.08), 0 8px 10px rgba(0,0,0,.04);

  /* Status colors */
  --mh-success:       #22c55e;
  --mh-success-bg:    rgba(34,197,94,.1);
  --mh-danger:        #ef4444;
  --mh-danger-bg:     rgba(239,68,68,.1);
  --mh-warning:       #f59e0b;
  --mh-warning-bg:    rgba(245,158,11,.1);
  --mh-info:          #3b82f6;
  --mh-info-bg:       rgba(59,130,246,.1);

  /* Radii */
  --mh-radius-sm:     6px;
  --mh-radius:        10px;
  --mh-radius-lg:     16px;
  --mh-radius-xl:     24px;
  --mh-radius-full:   9999px;

  /* Spacing scale */
  --mh-space-1:       4px;
  --mh-space-2:       8px;
  --mh-space-3:       12px;
  --mh-space-4:       16px;
  --mh-space-5:       20px;
  --mh-space-6:       24px;
  --mh-space-8:       32px;
  --mh-space-10:      40px;
  --mh-space-12:      48px;

  /* Sidebar */
  --mh-sidebar-w:     260px;
  --mh-sidebar-w-collapsed: 72px;
  --mh-topbar-h:      60px;

  /* Transition */
  --mh-transition:    .2s cubic-bezier(.4,0,.2,1);
  --mh-transition-slow: .35s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --mh-accent:        #818cf8;
  --mh-accent-hover:  #a5b4fc;
  --mh-accent-subtle: rgba(129,140,248,.12);
  --mh-accent-rgb:    129,140,248;

  --mh-bg:            #0f172a;
  --mh-bg-card:       #1e293b;
  --mh-bg-card-rgb:   30,41,59;
  --mh-bg-sidebar:    #1e293b;
  --mh-bg-topbar:     rgba(30,41,59,.82);
  --mh-bg-input:      #1e293b;
  --mh-bg-hover:      #334155;
  --mh-bg-code:       #1e293b;
  --mh-bg-modal:      rgba(0,0,0,.6);

  --mh-glass-bg:      rgba(30,41,59,.60);
  --mh-glass-border:  rgba(255,255,255,.08);

  --mh-text:          #f1f5f9;
  --mh-text-secondary:#94a3b8;
  --mh-text-muted:    #64748b;
  --mh-text-inverse:  #0f172a;

  --mh-border:        #334155;
  --mh-ring:          0 0 0 3px rgba(129,140,248,.22);

  --mh-shadow-sm:     0 1px 2px rgba(0,0,0,.2);
  --mh-shadow:        0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --mh-shadow-md:     0 4px 6px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);
  --mh-shadow-lg:     0 10px 15px rgba(0,0,0,.3), 0 4px 6px rgba(0,0,0,.2);
  --mh-shadow-xl:     0 20px 25px rgba(0,0,0,.35), 0 8px 10px rgba(0,0,0,.2);

  --mh-success-bg:    rgba(34,197,94,.15);
  --mh-danger-bg:     rgba(239,68,68,.15);
  --mh-warning-bg:    rgba(245,158,11,.15);
  --mh-info-bg:       rgba(59,130,246,.15);
}

/* ----------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--mh-text);
  background: var(--mh-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--mh-transition), color var(--mh-transition);
}

a {
  color: var(--mh-accent);
  text-decoration: none;
  transition: color var(--mh-transition);
}
a:hover { color: var(--mh-accent-hover); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--mh-text);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

hr {
  border: none;
  border-top: 1px solid var(--mh-border);
  margin: var(--mh-space-6) 0;
}

/* ----------------------------------------------------------
   3. LAYOUT — SIDEBAR + TOPBAR + MAIN
   ---------------------------------------------------------- */
.mh-app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.mh-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--mh-sidebar-w);
  background: var(--mh-bg-sidebar);
  border-right: 1px solid var(--mh-border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--mh-transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--mh-border) transparent;
}

.mh-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--mh-space-3);
  padding: 0 var(--mh-space-5);
  height: var(--mh-topbar-h);
  border-bottom: 1px solid var(--mh-border);
  text-decoration: none;
}
.mh-sidebar__brand img {
  height: 32px;
  width: auto;
}
.mh-sidebar__brand span {
  font-weight: 700;
  font-size: 1rem;
  color: var(--mh-text);
  white-space: nowrap;
}

.sidebar-nav {
  list-style: none;
  padding: var(--mh-space-3) var(--mh-space-3);
  margin: 0;
  flex: 1;
}
.sidebar-nav__label {
  display: block;
  padding: var(--mh-space-4) var(--mh-space-3) var(--mh-space-2);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mh-text-muted);
}
.sidebar-nav__item {}
.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: var(--mh-space-3);
  padding: var(--mh-space-2) var(--mh-space-3);
  border-radius: var(--mh-radius);
  color: var(--mh-text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--mh-transition);
  text-decoration: none;
}
.sidebar-nav__link:hover {
  color: var(--mh-text);
  background: var(--mh-bg-hover);
}
.sidebar-nav__link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .7;
}
.sidebar-nav__item.is-active .sidebar-nav__link {
  color: var(--mh-accent);
  background: var(--mh-accent-subtle);
  font-weight: 600;
}
.sidebar-nav__item.is-active .sidebar-nav__link svg {
  opacity: 1;
}
.sidebar-nav__badge {
  margin-left: auto;
  background: var(--mh-danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--mh-radius-full);
  line-height: 1.4;
}

.mh-sidebar__footer {
  padding: var(--mh-space-4) var(--mh-space-5);
  border-top: 1px solid var(--mh-border);
  font-size: .8rem;
  color: var(--mh-text-muted);
  display: flex;
  align-items: center;
  gap: var(--mh-space-2);
}

/* Sidebar overlay (mobile) */
.mh-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--mh-bg-modal);
  z-index: 1039;
  opacity: 0;
  transition: opacity var(--mh-transition-slow);
}
.mh-sidebar-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* Main content area */
.mh-main {
  flex: 1;
  margin-left: var(--mh-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--mh-transition-slow);
}

/* Topbar */
.mh-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: var(--mh-space-4);
  height: var(--mh-topbar-h);
  padding: 0 var(--mh-space-6);
  background: var(--mh-bg-topbar);
  backdrop-filter: blur(var(--mh-glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--mh-glass-blur)) saturate(1.4);
  border-bottom: 1px solid var(--mh-border);
}
.mh-topbar__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--mh-text);
  cursor: pointer;
  padding: var(--mh-space-2);
  border-radius: var(--mh-radius-sm);
}
.mh-topbar__toggle svg { width: 22px; height: 22px; }

.mh-topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--mh-space-1);
  font-size: .82rem;
  color: var(--mh-text-secondary);
  flex: 1;
  min-width: 0;
}
.mh-topbar__breadcrumb a {
  color: var(--mh-text-muted);
  transition: color .15s;
  padding: 2px 4px; border-radius: 4px;
}
.mh-topbar__breadcrumb a:hover { color: var(--mh-accent); background: var(--mh-bg-hover); }
.mh-topbar__breadcrumb .sep {
  color: var(--mh-border);
  font-size: .7rem;
  margin: 0 2px;
}
.mh-topbar__breadcrumb > :last-child:not(.sep):not(a) {
  color: var(--mh-text);
  font-weight: 600;
}

.mh-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--mh-space-3);
  margin-left: auto;
}

/* Page header */
.mh-page-header {
  padding: var(--mh-space-3) var(--mh-space-6) 0;
}
.mh-page-header:empty,
.mh-page-header:has(h1:empty) { display: none; }
.mh-page-header h1 {
  font-size: 1.5rem;
  margin-bottom: var(--mh-space-1);
}
.mh-page-header h1:empty { display: none; }
.mh-page-header p:empty { display: none; }
.mh-page-header p {
  color: var(--mh-text-secondary);
  margin: 0;
  font-size: .9rem;
}

/* Page body */
.mh-page-body {
  flex: 1;
  padding: var(--mh-space-3) var(--mh-space-6) var(--mh-space-6);
}

/* Footer */
.mh-footer {
  padding: var(--mh-space-6);
  text-align: center;
  font-size: .8rem;
  color: var(--mh-text-muted);
  border-top: 1px solid var(--mh-border);
}
.mh-footer a { color: var(--mh-text-secondary); }

/* ----------------------------------------------------------
   4. GRID SYSTEM (simple flex grid)
   ---------------------------------------------------------- */
.mh-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mh-space-6);
}
.mh-col    { flex: 1 1 0; min-width: 0; }
.mh-col-12 { flex: 0 0 100%; max-width: 100%; }
.mh-col-6  { flex: 0 0 calc(50% - var(--mh-space-6)/2); max-width: calc(50% - var(--mh-space-6)/2); }
.mh-col-4  { flex: 0 0 calc(33.333% - var(--mh-space-6)*2/3); max-width: calc(33.333% - var(--mh-space-6)*2/3); }
.mh-col-3  { flex: 0 0 calc(25% - var(--mh-space-6)*3/4); max-width: calc(25% - var(--mh-space-6)*3/4); }
.mh-col-8  { flex: 0 0 calc(66.666% - var(--mh-space-6)/3); max-width: calc(66.666% - var(--mh-space-6)/3); }

/* ----------------------------------------------------------
   5. CARDS — Glassmorphism + solid
   ---------------------------------------------------------- */
.mh-card {
  background: var(--mh-bg-card);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-lg);
  box-shadow: var(--mh-shadow), 0 0 0 1px rgba(255,255,255,.03) inset;
  overflow: hidden;
  transition: box-shadow var(--mh-transition), transform var(--mh-transition);
  position: relative;
}
.mh-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255,255,255,.04) 0%, transparent 40%);
  pointer-events: none; z-index: 0;
}
.mh-card:hover {
  box-shadow: var(--mh-shadow-md), 0 0 0 1px rgba(255,255,255,.05) inset;
}

/* Elevated card (modals, popovers, overlays) */
.mh-card--elevated {
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 0 0 1px rgba(255,255,255,.05) inset;
}

.mh-card--glass {
  background: var(--mh-glass-bg);
  border: 1px solid var(--mh-glass-border);
  backdrop-filter: blur(var(--mh-glass-blur));
  -webkit-backdrop-filter: blur(var(--mh-glass-blur));
}

.mh-card--clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.mh-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--mh-shadow-lg);
  color: inherit;
}

.mh-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mh-space-5) var(--mh-space-5);
  border-bottom: 1px solid var(--mh-border);
}
.mh-card__header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.mh-card__body {
  padding: var(--mh-space-5);
}

.mh-card__footer {
  padding: var(--mh-space-4) var(--mh-space-5);
  border-top: 1px solid var(--mh-border);
  background: var(--mh-bg-hover);
}

/* Stat card */
.mh-stat {
  display: flex;
  align-items: center;
  gap: var(--mh-space-4);
  padding: var(--mh-space-5);
}
.mh-stat__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--mh-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}
.mh-stat__icon svg { width: 24px; height: 24px; }
.mh-stat__icon--success { background: var(--mh-success-bg); color: var(--mh-success); }
.mh-stat__icon--danger  { background: var(--mh-danger-bg);  color: var(--mh-danger); }
.mh-stat__icon--warning { background: var(--mh-warning-bg); color: var(--mh-warning); }
.mh-stat__icon--info    { background: var(--mh-info-bg);    color: var(--mh-info); }
.mh-stat__icon--accent  { background: var(--mh-accent-subtle); color: var(--mh-accent); }

.mh-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.mh-stat__label {
  font-size: .8rem;
  color: var(--mh-text-secondary);
}
.mh-stat__sub {
  font-size: .75rem;
  color: var(--mh-text-muted);
}

/* ----------------------------------------------------------
   6. BUTTONS
   ---------------------------------------------------------- */
.mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mh-space-2);
  padding: var(--mh-space-2) var(--mh-space-4);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--mh-radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--mh-transition);
  text-decoration: none;
  font-family: inherit;
}
.mh-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.mh-btn:disabled, .mh-btn.disabled {
  opacity: .5;
  pointer-events: none;
}

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

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

.mh-btn--ghost {
  background: transparent;
  color: var(--mh-text-secondary);
  border-color: transparent;
}
.mh-btn--ghost:hover {
  background: var(--mh-bg-hover);
  color: var(--mh-text);
}

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

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

.mh-btn--sm {
  padding: var(--mh-space-1) var(--mh-space-3);
  font-size: .8rem;
}
.mh-btn--lg {
  padding: var(--mh-space-3) var(--mh-space-6);
  font-size: 1rem;
}
.mh-btn--block { width: 100%; }
.mh-btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--mh-radius);
}

/* ----------------------------------------------------------
   7. FORMS
   ---------------------------------------------------------- */
.mh-form-group {
  margin-bottom: var(--mh-space-5);
}
.mh-form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--mh-text);
  margin-bottom: var(--mh-space-2);
}
.mh-form-label.required::after {
  content: " *";
  color: var(--mh-danger);
}

.mh-form-control {
  display: block;
  width: 100%;
  padding: var(--mh-space-2) var(--mh-space-3);
  font-size: .875rem;
  font-family: inherit;
  color: var(--mh-text);
  background: var(--mh-bg-input);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  transition: border-color var(--mh-transition), box-shadow var(--mh-transition);
  line-height: 1.6;
}
.mh-form-control:focus {
  outline: none;
  border-color: var(--mh-accent);
  box-shadow: var(--mh-ring);
}
.mh-form-control::placeholder {
  color: var(--mh-text-muted);
}

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

select.mh-form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.mh-form-check {
  display: flex;
  align-items: center;
  gap: var(--mh-space-2);
}
.mh-form-check input[type="checkbox"],
.mh-form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--mh-accent);
  cursor: pointer;
}
.mh-form-check label {
  font-size: .875rem;
  cursor: pointer;
  color: var(--mh-text-secondary);
}

.mh-input-group {
  display: flex;
  align-items: stretch;
}
.mh-input-group .mh-form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.mh-input-group__append {
  display: flex;
  align-items: center;
  padding: 0 var(--mh-space-3);
  background: var(--mh-bg-hover);
  border: 1px solid var(--mh-border);
  border-left: 0;
  border-radius: 0 var(--mh-radius) var(--mh-radius) 0;
  color: var(--mh-text-secondary);
  cursor: pointer;
  transition: background var(--mh-transition);
}
.mh-input-group__append:hover {
  background: var(--mh-border);
}

/* ----------------------------------------------------------
   8. TABLES
   ---------------------------------------------------------- */
.mh-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.mh-table th {
  text-align: left;
  padding: var(--mh-space-3) var(--mh-space-4);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mh-text-muted);
  border-bottom: 1px solid var(--mh-border);
  white-space: nowrap;
}
.mh-table td {
  padding: var(--mh-space-3) var(--mh-space-4);
  border-bottom: 1px solid var(--mh-border);
  vertical-align: middle;
}
.mh-table tr:last-child td {
  border-bottom: none;
}
.mh-table tr:hover td {
  background: var(--mh-bg-hover);
}

.mh-table--clickable tr {
  cursor: pointer;
  transition: background var(--mh-transition);
}
.mh-table--empty {
  text-align: center;
  padding: var(--mh-space-10) var(--mh-space-6);
  color: var(--mh-text-muted);
}

/* ----------------------------------------------------------
   9. BADGES & STATUS
   ---------------------------------------------------------- */
.mh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 600;
  border-radius: var(--mh-radius-full);
  white-space: nowrap;
}
.mh-badge--success { background: var(--mh-success-bg); color: var(--mh-success); }
.mh-badge--danger  { background: var(--mh-danger-bg);  color: var(--mh-danger); }
.mh-badge--warning { background: var(--mh-warning-bg); color: var(--mh-warning); }
.mh-badge--info    { background: var(--mh-info-bg);    color: var(--mh-info); }
.mh-badge--accent  { background: var(--mh-accent-subtle); color: var(--mh-accent); }

.mh-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ----------------------------------------------------------
   10. TABS
   ---------------------------------------------------------- */
.mh-tabs {
  display: flex;
  gap: var(--mh-space-1);
  border-bottom: 1px solid var(--mh-border);
  padding: 0 var(--mh-space-5);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}
.mh-tabs::-webkit-scrollbar { display: none; }
.mh-tabs-wrap { position: relative; }
.mh-tabs-wrap .mh-tabs-arrow {
  display: none;
  position: absolute; top: 0; bottom: 1px; width: 32px; z-index: 2;
  align-items: center; justify-content: center;
  background: linear-gradient(to var(--dir), transparent, var(--mh-bg-card) 60%);
  border: none; cursor: pointer; color: var(--mh-text-muted); padding: 0;
}
.mh-tabs-wrap .mh-tabs-arrow--left  { left: 0; --dir: left; }
.mh-tabs-wrap .mh-tabs-arrow--right { right: 0; --dir: right; }
.mh-tabs-wrap .mh-tabs-arrow.is-visible { display: flex; }
.mh-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--mh-space-2);
  padding: var(--mh-space-3) var(--mh-space-4);
  font-size: .875rem;
  font-weight: 500;
  color: var(--mh-text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--mh-transition);
  text-decoration: none;
  font-family: inherit;
}
.mh-tab:hover {
  color: var(--mh-text);
}
.mh-tab.is-active, .mh-tab--active {
  color: var(--mh-accent);
  border-bottom-color: var(--mh-accent);
  font-weight: 600;
}
.mh-tab-panel {
  display: none;
}
.mh-tab-panel.is-active {
  display: block;
}

/* ----------------------------------------------------------
   11. ALERTS / FLASH MESSAGES
   ---------------------------------------------------------- */
.mh-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--mh-space-3);
  padding: var(--mh-space-4) var(--mh-space-5);
  border-radius: var(--mh-radius);
  font-size: .875rem;
  margin-bottom: var(--mh-space-5);
  border: 1px solid transparent;
}
.mh-alert--success { background: var(--mh-success-bg); border-color: var(--mh-success); color: var(--mh-success); }
.mh-alert--danger  { background: var(--mh-danger-bg);  border-color: var(--mh-danger);  color: var(--mh-danger); }
.mh-alert--warning { background: var(--mh-warning-bg); border-color: var(--mh-warning); color: var(--mh-warning); }
.mh-alert--info    { background: var(--mh-info-bg);    border-color: var(--mh-info);    color: var(--mh-info); }

.mh-alert__close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  padding: 0;
  line-height: 1;
}
.mh-alert__close:hover { opacity: 1; }

.flash-message {
  transition: opacity .4s ease, transform .4s ease;
}
.flash-message--hiding {
  opacity: 0;
  transform: translateY(-8px);
}

/* ----------------------------------------------------------
   12. TOAST NOTIFICATIONS
   ---------------------------------------------------------- */
.mh-toast-container {
  position: fixed;
  bottom: var(--mh-space-6);
  right: var(--mh-space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--mh-space-3);
  max-width: 380px;
}
.mh-toast {
  display: flex;
  align-items: center;
  gap: var(--mh-space-3);
  padding: var(--mh-space-3) var(--mh-space-4);
  background: rgba(var(--mh-bg-card-rgb, 255,255,255), .85);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--mh-radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,.15), 0 0 0 1px rgba(255,255,255,.04) inset;
  font-size: .875rem;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s cubic-bezier(.21,1.02,.73,1), opacity .25s ease;
}
.mh-toast--visible {
  transform: translateX(0);
  opacity: 1;
}
[data-theme="dark"] .mh-toast {
  background: rgba(15,23,42,.82);
  border-color: rgba(255,255,255,.06);
}
.mh-toast__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.mh-toast--success .mh-toast__icon { color: var(--mh-success); }
.mh-toast--danger  .mh-toast__icon { color: var(--mh-danger); }
.mh-toast--warning .mh-toast__icon { color: var(--mh-warning); }
.mh-toast__body { flex: 1; min-width: 0; }
.mh-toast__close {
  background: none;
  border: none;
  color: var(--mh-text-muted);
  cursor: pointer;
  font-size: .9rem;
  padding: 0;
}

/* ----------------------------------------------------------
   13. MODAL
   ---------------------------------------------------------- */
.mh-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: var(--mh-space-6);
}
.mh-modal-overlay.is-open {
  display: flex;
}
.mh-modal {
  background: var(--mh-bg-card);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--mh-radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04) inset;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.mh-modal--lg { max-width: 640px; }
.mh-modal--sm { max-width: 380px; }
@media (max-width: 640px) {
  .mh-modal { max-width: calc(100vw - 32px); }
  .mh-modal--lg { max-width: calc(100vw - 32px); }
}
[data-theme="dark"] .mh-modal {
  background: rgba(15,23,42,.85);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-color: rgba(255,255,255,.06);
}
.mh-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mh-space-5);
  border-bottom: 1px solid var(--mh-border);
}
.mh-modal__header h3 { margin: 0; }
.mh-modal__close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--mh-text-muted);
  padding: var(--mh-space-1);
}
.mh-modal__body {
  padding: var(--mh-space-5);
}
.mh-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--mh-space-3);
  padding: var(--mh-space-4) var(--mh-space-5);
  border-top: 1px solid var(--mh-border);
}

/* ----------------------------------------------------------
   14. PAGINATION
   ---------------------------------------------------------- */
.mh-pagination {
  display: flex;
  align-items: center;
  gap: var(--mh-space-1);
}
.mh-pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--mh-space-2);
  border-radius: var(--mh-radius);
  font-size: .85rem;
  font-weight: 500;
  color: var(--mh-text-secondary);
  text-decoration: none;
  transition: all var(--mh-transition);
}
.mh-pagination__item:hover {
  background: var(--mh-bg-hover);
  color: var(--mh-text);
}
.mh-pagination__item.is-active {
  background: var(--mh-accent);
  color: #fff;
}
.mh-pagination__item.is-disabled {
  opacity: .4;
  pointer-events: none;
}

/* ----------------------------------------------------------
   15. AVATAR / USER
   ---------------------------------------------------------- */
.mh-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--mh-radius-full);
  object-fit: cover;
  border: 2px solid var(--mh-border);
}
.mh-avatar--sm { width: 28px; height: 28px; }
.mh-avatar--lg { width: 48px; height: 48px; }

.mh-user {
  display: flex;
  align-items: center;
  gap: var(--mh-space-3);
  text-decoration: none;
  color: var(--mh-text);
}
.mh-user__name {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
}
.mh-user__email {
  font-size: .75rem;
  color: var(--mh-text-muted);
}

/* ----------------------------------------------------------
   16. DROPDOWN
   ---------------------------------------------------------- */
.mh-dropdown {
  position: relative;
}
.mh-dropdown-menu {
  position: fixed;
  min-width: 180px;
  background: var(--mh-bg-card);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04) inset;
  padding: var(--mh-space-2);
  display: none;
  z-index: 9990;
}
.mh-dropdown-menu.is-open { display: block; }
.mh-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--mh-space-2);
  padding: var(--mh-space-2) var(--mh-space-3);
  font-size: .85rem;
  color: var(--mh-text);
  border-radius: var(--mh-radius-sm);
  text-decoration: none;
  transition: background var(--mh-transition);
}
.mh-dropdown-item:hover {
  background: var(--mh-bg-hover);
  color: var(--mh-text);
}
.mh-dropdown-item--danger { color: var(--mh-danger); }
.mh-dropdown-divider {
  height: 1px;
  background: var(--mh-border);
  margin: var(--mh-space-2) 0;
}

/* ----------------------------------------------------------
   17. ANNOUNCEMENT BAR
   ---------------------------------------------------------- */
.mh-announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--mh-space-3);
  padding: var(--mh-space-2) var(--mh-space-4);
  font-size: .8rem;
  font-weight: 500;
  color: #fff;
  text-align: center;
}
.mh-announcement--accent  { background: var(--mh-accent); }
.mh-announcement--success { background: var(--mh-success); }
.mh-announcement--danger  { background: var(--mh-danger); }
.mh-announcement--warning { background: var(--mh-warning); color: #000; }
.mh-announcement--info    { background: var(--mh-info); }
.mh-announcement__close {
  background: none;
  border: none;
  color: inherit;
  opacity: .7;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 var(--mh-space-2);
}
.mh-announcement__close:hover { opacity: 1; }

/* ----------------------------------------------------------
   18. SKELETON LOADER
   ---------------------------------------------------------- */
.skeleton-wrap .skeleton-item {
  background: linear-gradient(90deg, var(--mh-border) 25%, var(--mh-bg-hover) 50%, var(--mh-border) 75%);
  background-size: 200% 100%;
  animation: mh-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--mh-radius-sm);
}
.skeleton-wrap.skeleton-loaded .skeleton-item {
  animation: none;
  background: transparent;
}
@keyframes mh-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------
   19. EMPTY STATE
   ---------------------------------------------------------- */
.mh-empty {
  text-align: center;
  padding: var(--mh-space-12) var(--mh-space-6);
  color: var(--mh-text-muted);
}
.mh-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--mh-space-4);
  opacity: .4;
}
.mh-empty__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--mh-text-secondary);
  margin-bottom: var(--mh-space-2);
}

/* ----------------------------------------------------------
   20. DATAGRID (key-value pairs)
   ---------------------------------------------------------- */
.mh-datagrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--mh-space-5);
  padding: var(--mh-space-5);
}
.mh-datagrid__title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mh-text-muted);
  margin-bottom: var(--mh-space-1);
}
.mh-datagrid__value {
  font-size: .9rem;
  font-weight: 500;
  color: var(--mh-text);
}

/* ----------------------------------------------------------
   21. CHAT / MESSAGES (support tickets)
   ---------------------------------------------------------- */
.mh-chat {
  display: flex;
  flex-direction: column;
  gap: var(--mh-space-4);
  padding: var(--mh-space-5);
}
.mh-message {
  max-width: 80%;
  min-width: min(320px, 100%);
  border-radius: var(--mh-radius-lg);
  padding: var(--mh-space-4);
  position: relative;
}
.mh-message--client {
  align-self: flex-start;
  background: var(--mh-accent-subtle);
  border: 1px solid rgba(var(--mh-accent-rgb), .15);
}
.mh-message--staff {
  align-self: flex-end;
  background: var(--mh-bg-hover);
  border: 1px solid var(--mh-border);
}
.mh-message__author {
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: var(--mh-space-2);
}
.mh-message--client .mh-message__author { color: var(--mh-accent); }
.mh-message--staff .mh-message__author  { color: var(--mh-text-secondary); }
.mh-message__body {
  font-size: .875rem;
  line-height: 1.7;
  color: var(--mh-text);
}
.mh-message__body p:last-child { margin-bottom: 0; }
.mh-message__time {
  font-size: .7rem;
  color: var(--mh-text-muted);
  margin-top: var(--mh-space-2);
}
.mh-message__actions {
  position: absolute;
  top: var(--mh-space-3);
  right: var(--mh-space-3);
}

/* ----------------------------------------------------------
   22. AUTH PAGES (login, signup, reset)
   ---------------------------------------------------------- */
/* Animated mesh gradient background */
.mh-mesh-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  --mesh-c1: var(--mh-mesh-color-1, rgba(99,102,241,.12));
  --mesh-c2: var(--mh-mesh-color-2, rgba(139,92,246,.10));
  --mesh-c3: var(--mh-mesh-color-3, rgba(6,182,212,.08));
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, var(--mesh-c1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, var(--mesh-c2) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 60% 85%, var(--mesh-c3) 0%, transparent 60%),
    var(--mh-bg);
  animation: mh-mesh-drift 25s ease-in-out infinite alternate;
}
@keyframes mh-mesh-drift {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(15deg); }
  100% { filter: hue-rotate(-10deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mh-mesh-bg { animation: none; }
}

.mh-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; z-index: 1;
  padding: var(--mh-space-6);
}
.mh-auth__container {
  width: 100%;
  max-width: 420px;
}
.mh-auth__logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--mh-space-8);
}
.mh-auth__logo a {
  display: inline-flex;
}
.mh-auth__logo img {
  height: 40px;
  width: auto;
  display: block;
}
.mh-auth__card {
  background: rgba(var(--mh-bg-card-rgb, 255,255,255), .85);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--mh-radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,.12), 0 0 0 1px rgba(255,255,255,.05) inset;
  padding: var(--mh-space-8);
}
[data-theme="dark"] .mh-auth__card {
  background: rgba(30,41,59,.75);
  border-color: rgba(255,255,255,.06);
  box-shadow: 0 25px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03) inset;
}
.mh-auth__title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--mh-space-6);
}
.mh-auth__footer {
  text-align: center;
  margin-top: var(--mh-space-6);
  font-size: .875rem;
  color: var(--mh-text-secondary);
}

/* ----------------------------------------------------------
   23. THEME TOGGLE
   ---------------------------------------------------------- */
.mh-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--mh-radius);
  border: 1px solid var(--mh-border);
  background: var(--mh-bg-card);
  color: var(--mh-text-secondary);
  cursor: pointer;
  transition: all var(--mh-transition);
}
.mh-theme-toggle:hover {
  background: var(--mh-bg-hover);
  color: var(--mh-text);
}
.mh-theme-toggle .theme-icon { display: flex; }

/* ----------------------------------------------------------
   24. UTILITY CLASSES
   ---------------------------------------------------------- */
.mh-text-muted    { color: var(--mh-text-muted) !important; }
.mh-text-secondary{ color: var(--mh-text-secondary) !important; }
.mh-text-success  { color: var(--mh-success) !important; }
.mh-text-danger   { color: var(--mh-danger) !important; }
.mh-text-warning  { color: var(--mh-warning) !important; }
.mh-text-accent   { color: var(--mh-accent) !important; }
.mh-text-center   { text-align: center; }
.mh-text-right    { text-align: right; }
.mh-text-sm       { font-size: .8rem; }
.mh-text-xs       { font-size: .7rem; }

.mh-mt-0 { margin-top: 0; }
.mh-mt-4 { margin-top: var(--mh-space-4); }
.mh-mt-6 { margin-top: var(--mh-space-6); }
.mh-mb-0 { margin-bottom: 0; }
.mh-mb-4 { margin-bottom: var(--mh-space-4); }
.mh-mb-6 { margin-bottom: var(--mh-space-6); }
.mh-p-0  { padding: 0; }
.mh-p-5  { padding: var(--mh-space-5); }

.mh-flex       { display: flex; }
.mh-flex-col   { flex-direction: column; }
.mh-flex-wrap  { flex-wrap: wrap; }
.mh-items-center { align-items: center; }
.mh-justify-between { justify-content: space-between; }
.mh-gap-3 { gap: var(--mh-space-3); }
.mh-gap-4 { gap: var(--mh-space-4); }
.mh-gap-6 { gap: var(--mh-space-6); }

.mh-hidden     { display: none !important; }
.mh-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.mh-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   25. RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .mh-col-4 { flex: 0 0 calc(50% - var(--mh-space-6)/2); max-width: calc(50% - var(--mh-space-6)/2); }
  .mh-col-3 { flex: 0 0 calc(50% - var(--mh-space-6)/2); max-width: calc(50% - var(--mh-space-6)/2); }
}

@media (max-width: 768px) {
  .mh-sidebar {
    transform: translateX(-100%);
  }
  .mh-sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--mh-shadow-xl);
  }
  .mh-main {
    margin-left: 0;
  }
  .mh-topbar__toggle {
    display: flex;
  }
  .mh-page-body {
    padding: var(--mh-space-4);
  }
  .mh-page-header {
    padding: var(--mh-space-4) var(--mh-space-4) 0;
  }
  .mh-row {
    gap: var(--mh-space-4);
  }
  .mh-col-6, .mh-col-4, .mh-col-3, .mh-col-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .mh-message {
    max-width: 95%;
  }
  .mh-datagrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mh-toast-container {
    left: var(--mh-space-4);
    right: var(--mh-space-4);
    bottom: var(--mh-space-4);
    max-width: none;
  }
  .mh-auth__card {
    padding: var(--mh-space-6);
  }
}

/* Mobile responsive utilities */
.mh-hide-mobile { display: inline-flex; }
.mh-show-mobile { display: none !important; }

@media (max-width: 768px) {
  .mh-hide-mobile { display: none !important; }
  .mh-show-mobile { display: inline-flex !important; }
}

@media (max-width: 480px) {
  .mh-datagrid {
    grid-template-columns: 1fr;
  }
  .mh-topbar {
    padding: 0 var(--mh-space-3);
  }
  .mh-topbar__breadcrumb { display: none; }
  .mh-topbar__actions { gap: var(--mh-space-1); }
  .mh-topbar__actions .mh-btn--sm { padding: var(--mh-space-1) var(--mh-space-2); font-size: .75rem; }
  .mh-dropdown-menu { left: var(--mh-space-3) !important; right: var(--mh-space-3) !important; min-width: 0 !important; max-width: none !important; }
}

/* Prevent iOS zoom on input focus — inputs must be >= 16px */
@media (max-width: 768px) {
  .mh-modal-overlay input[type="text"],
  .mh-modal-overlay input[type="search"],
  .mh-modal-overlay input[type="email"],
  .mh-modal-overlay input[type="tel"],
  .mh-modal-overlay select,
  .mh-form-control,
  .form-control,
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Fix mobile overflow */
html, body { overflow-x: clip; max-width: 100vw; }
.mh-app { overflow-x: clip; }
.mh-main { min-width: 0; }
.mh-page-body { overflow-x: clip; }
.mh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Print styles moved to end of file (section: ENHANCED PRINT STYLES) */

/* ----------------------------------------------------------
   26b. TOM SELECT + INTL-TEL-INPUT overrides
   ---------------------------------------------------------- */
.ts-wrapper { border: none !important; padding: 0 !important; }
.ts-wrapper .ts-control { background: var(--mh-bg-input) !important; border: 1px solid var(--mh-border) !important; border-radius: var(--mh-radius) !important; padding: var(--mh-space-2) var(--mh-space-3) !important; font-size: .875rem !important; min-height: 38px !important; box-shadow: none !important; color: var(--mh-text) !important; }
.ts-wrapper .ts-control input { color: var(--mh-text) !important; }
.ts-wrapper .ts-control .item { color: var(--mh-text) !important; }
.ts-wrapper .ts-control:focus, .ts-wrapper.focus .ts-control { border-color: var(--mh-accent) !important; box-shadow: var(--mh-ring) !important; }
.ts-wrapper .ts-dropdown { border: 1px solid var(--mh-border) !important; border-radius: var(--mh-radius) !important; box-shadow: var(--mh-shadow-lg) !important; background: var(--mh-bg-card) !important; color: var(--mh-text) !important; max-height: 250px !important; overflow-y: auto !important; }
.ts-wrapper .ts-dropdown .option { padding: var(--mh-space-2) var(--mh-space-3) !important; font-size: .875rem !important; color: var(--mh-text) !important; }
.ts-wrapper .ts-dropdown .option:hover { background: var(--mh-bg-hover) !important; }
.ts-wrapper .ts-dropdown .option.active { background: var(--mh-accent-subtle) !important; color: var(--mh-accent) !important; }
.ts-wrapper .ts-dropdown .no-results { color: var(--mh-text-muted) !important; }

.iti { width: 100% !important; display: block !important; }
.iti input { width: 100% !important; }
.iti .iti__flag-container { left: 0 !important; }
.iti--separate-dial-code .iti__selected-flag {
  background: transparent !important;
  border-right: 1px solid var(--mh-border) !important;
  border-radius: var(--mh-radius) 0 0 var(--mh-radius) !important;
  padding: 0 8px 0 12px !important;
}
.iti--separate-dial-code input[type="tel"] { padding-left: 90px !important; }
.iti__country-list {
  background: var(--mh-bg-card) !important; border: 1px solid var(--mh-border) !important;
  border-radius: var(--mh-radius) !important; box-shadow: var(--mh-shadow-lg) !important;
  color: var(--mh-text) !important; max-height: 220px !important;
}
.iti__country-list .iti__country { color: var(--mh-text) !important; }
.iti__country-list .iti__country:hover { background: var(--mh-bg-hover) !important; }
.iti__country-list .iti__country.iti__highlight { background: var(--mh-accent-subtle, rgba(99,102,241,.08)) !important; }
.iti__dial-code { color: var(--mh-text-muted) !important; }
.iti__country-list .iti__country-name { color: var(--mh-text) !important; }
.iti__selected-dial-code { color: var(--mh-text) !important; }

/* Period pill buttons (billing period, registration years) */
.period-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--mh-space-3) var(--mh-space-5); min-width: 130px; flex: 1;
  border: 2px solid var(--mh-border); border-radius: var(--mh-radius);
  background: var(--mh-bg-card); cursor: pointer; transition: all var(--mh-transition);
  font-family: inherit; color: var(--mh-text);
  -webkit-appearance: none; appearance: none;
}
.period-pill:hover { border-color: var(--mh-accent); }
.period-pill.is-active {
  background: var(--mh-accent) !important; border-color: var(--mh-accent) !important;
  color: #fff !important; box-shadow: 0 0 0 3px rgba(var(--mh-accent-rgb), .2);
}
.period-pill__name { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.period-pill__price { font-size: .8rem; opacity: .8; }
.period-pill.is-active .period-pill__price { opacity: 1; }
.period-pill__save { font-size: .65rem; font-weight: 700; color: var(--mh-success); margin-top: 2px; line-height: 1.2; }
.period-pill.is-active .period-pill__save { color: rgba(255,255,255,.85); }
.period-pill--best { position: relative; }
.period-pill--best::before { content: 'Best value'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--mh-success); color: #fff; font-size: .6rem; font-weight: 700; padding: 1px 8px; border-radius: var(--mh-radius-full); white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }

/* ----------------------------------------------------------
   27. BOOTSTRAP COMPAT (for module JS that creates .btn)
   ---------------------------------------------------------- */
button.btn, a.btn, .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--mh-space-2) var(--mh-space-4);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--mh-transition);
  text-decoration: none;
  font-family: inherit;
  background: var(--mh-bg-card);
  color: var(--mh-text);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.btn:hover { background: var(--mh-bg-hover); }
.btn.btn-sm, .btn-sm.btn { padding: var(--mh-space-1) var(--mh-space-3); font-size: .8rem; }
.btn.btn-lg, .btn-lg.btn { padding: var(--mh-space-3) var(--mh-space-6); font-size: 1rem; }
.btn.btn-primary, button.btn-primary, a.btn-primary { background: var(--mh-accent) !important; color: #fff !important; border-color: var(--mh-accent) !important; }
.btn.btn-primary:hover { background: var(--mh-accent-hover) !important; border-color: var(--mh-accent-hover) !important; }
.btn.btn-secondary, button.btn-secondary { background: var(--mh-bg-card); color: var(--mh-text); border-color: var(--mh-border); }
.btn.btn-secondary:hover { background: var(--mh-bg-hover); }
.btn.btn-success, button.btn-success { background: var(--mh-success) !important; color: #fff !important; border-color: var(--mh-success) !important; }
.btn.btn-success:hover { opacity: .9; }
.btn.btn-danger, button.btn-danger { background: var(--mh-danger) !important; color: #fff !important; border-color: var(--mh-danger) !important; }
.btn.btn-danger:hover { opacity: .9; }
.btn.btn-info, button.btn-info { background: var(--mh-info) !important; color: #fff !important; border-color: var(--mh-info) !important; }
.btn.btn-info:hover { opacity: .9; }
.btn.btn-warning, button.btn-warning { background: var(--mh-warning); color: #000; border-color: var(--mh-warning); }
.btn-outline-primary { background: transparent; color: var(--mh-accent); border-color: var(--mh-accent); }
.btn-outline-primary:hover { background: var(--mh-accent); color: #fff; }
.btn-outline-secondary { background: transparent; color: var(--mh-text-secondary); border-color: var(--mh-border); }
.btn-outline-secondary:hover { background: var(--mh-bg-hover); color: var(--mh-text); }
.btn-outline-danger { background: transparent; color: var(--mh-danger); border-color: var(--mh-danger); }
.btn-outline-danger:hover { background: var(--mh-danger); color: #fff; }
.btn-outline-dark { background: transparent; color: var(--mh-text); border-color: var(--mh-text); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }
.btn-ghost-danger { background: transparent; color: var(--mh-danger); border: none; }
.btn-ghost-danger:hover { background: var(--mh-danger-bg); }

/* Bootstrap spacing compat */
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.d-flex { display: flex; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--mh-text-muted); }
.text-secondary { color: var(--mh-text-secondary); }
.text-danger { color: var(--mh-danger); }
.text-white { color: #fff; }
.font-monospace { font-family: ui-monospace, SFMono-Regular, monospace; }
.small { font-size: .8rem; }
.w-100 { width: 100%; }

/* Bootstrap form compat */
.form-control {
  display: block;
  width: 100%;
  padding: var(--mh-space-2) var(--mh-space-3);
  font-size: .875rem;
  font-family: inherit;
  color: var(--mh-text);
  background: var(--mh-bg-input);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  transition: border-color var(--mh-transition), box-shadow var(--mh-transition);
}
.form-control:focus { outline: none; border-color: var(--mh-accent); box-shadow: var(--mh-ring); }
.form-control-sm { padding: var(--mh-space-1) var(--mh-space-2); font-size: .8rem; }
.form-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: var(--mh-space-2); }
.form-select { appearance: none; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Bootstrap table compat */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: var(--mh-space-3) var(--mh-space-4); border-bottom: 1px solid var(--mh-border); vertical-align: middle; }
.table th { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mh-text-muted); }
.table-hover tr:hover td { background: var(--mh-bg-hover); }
.table-sm th, .table-sm td { padding: var(--mh-space-2) var(--mh-space-3); }

/* Bootstrap badge compat */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; font-size: .75rem; font-weight: 600; border-radius: var(--mh-radius-full); }
.bg-blue, .bg-primary { background: var(--mh-accent); color: #fff; }
.bg-green, .bg-success { background: var(--mh-success); color: #fff; }
.bg-danger, .bg-red { background: var(--mh-danger); color: #fff; }
.bg-warning, .bg-yellow { background: var(--mh-warning); color: #000; }
.bg-info { background: var(--mh-info); color: #fff; }
.bg-purple { background: #8b5cf6; color: #fff; }
.bg-light { background: var(--mh-bg-hover); }
.bg-azure-lt { background: rgba(59,130,246,.1); color: var(--mh-info); }
.bg-green-lt { background: var(--mh-success-bg); color: var(--mh-success); }
.bg-yellow-lt { background: var(--mh-warning-bg); color: var(--mh-warning); }
.bg-orange-lt { background: rgba(249,115,22,.1); color: #f97316; }
.bg-blue-lt { background: rgba(59,130,246,.1); color: var(--mh-info); }

/* Bootstrap alert compat */
.alert { display: flex; align-items: flex-start; gap: var(--mh-space-3); padding: var(--mh-space-4) var(--mh-space-5); border-radius: var(--mh-radius); font-size: .875rem; margin-bottom: var(--mh-space-5); border: 1px solid transparent; }
.alert-info { background: var(--mh-info-bg); border-color: var(--mh-info); color: var(--mh-info); }
.alert-warning { background: var(--mh-warning-bg); border-color: var(--mh-warning); color: var(--mh-warning); }
.alert-danger { background: var(--mh-danger-bg); border-color: var(--mh-danger); color: var(--mh-danger); }
.alert-success { background: var(--mh-success-bg); border-color: var(--mh-success); color: var(--mh-success); }

/* Bootstrap card compat (for module templates) */
.card { background: var(--mh-bg-card); border: 1px solid var(--mh-border); border-radius: var(--mh-radius-lg); box-shadow: var(--mh-shadow); overflow: hidden; margin-bottom: var(--mh-space-5); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: var(--mh-space-4) var(--mh-space-5); border-bottom: 1px solid var(--mh-border); flex-wrap: wrap; gap: var(--mh-space-3); }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: var(--mh-space-5); }
.card-actions { display: flex; gap: var(--mh-space-2); flex-wrap: wrap; }
.card-sm { }

/* Bootstrap misc compat */
.rounded-circle { border-radius: 50%; }
.border { border: 1px solid var(--mh-border); }
.shadow-lg { box-shadow: var(--mh-shadow-lg); }
.fs-6 { font-size: 1rem; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.p-3 { padding: 12px; }
.spinner-border { display: inline-block; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: mh-spin .75s linear infinite; }
.spinner-border-sm { width: .75rem; height: .75rem; }
@keyframes mh-spin { to { transform: rotate(360deg); } }

/* Row/col compat */
.row { display: flex; flex-wrap: wrap; gap: var(--mh-space-4); }
.col, .col-6, .col-md-3, .col-md-6, .col-md-12, .col-sm-6, .col-12 { min-width: 0; }
.col { flex: 1 1 0; }
.col-6 { flex: 0 0 calc(50% - 8px); }
.col-12 { flex: 0 0 100%; }
.col-md-3 { flex: 0 0 calc(25% - 12px); }
.col-md-6 { flex: 0 0 calc(50% - 8px); }
.col-md-12 { flex: 0 0 100%; }
.col-sm-6 { flex: 0 0 calc(50% - 8px); }
@media (max-width: 768px) { .col-md-3, .col-md-6, .col-sm-6 { flex: 0 0 100%; } }
.g-3 { gap: 12px; }

/* Nav tabs compat (for VirtFusion) */
.nav { display: flex; list-style: none; padding: 0; margin: 0; }
.nav-tabs { border-bottom: 1px solid var(--mh-border); gap: 0; }
.nav-item { }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: var(--mh-space-3) var(--mh-space-4); font-size: .875rem; color: var(--mh-text-secondary); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--mh-transition); text-decoration: none; }
.nav-link:hover { color: var(--mh-text); }
.nav-link.active { color: var(--mh-accent); border-bottom-color: var(--mh-accent); font-weight: 600; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.show.active, .tab-content > .tab-pane.fade.show.active { display: block; }
.fade { opacity: 1; }

/* ----------------------------------------------------------
   COMMAND PALETTE (Cmd+K)
   ---------------------------------------------------------- */
.cmd-palette-backdrop {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.cmd-palette-backdrop.is-open { opacity: 1; pointer-events: auto; }

.cmd-palette {
  position: fixed; z-index: 9999;
  top: max(12vh, 80px); left: 50%;
  transform: translateX(-50%) scale(.96);
  width: min(580px, calc(100vw - 32px));
  background: rgba(var(--mh-bg-card-rgb), .88);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.04) inset;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.cmd-palette.is-open { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }

.cmd-palette__input {
  width: 100%; padding: 16px 20px;
  background: transparent; border: none; border-bottom: 1px solid var(--mh-border);
  color: var(--mh-text); font-size: 1rem; outline: none;
  font-family: inherit;
}
.cmd-palette__input::placeholder { color: var(--mh-text-muted); }

.cmd-palette__results {
  list-style: none; margin: 0; padding: 8px;
  max-height: 340px; overflow-y: auto;
  scrollbar-width: thin;
}
.cmd-palette__item {
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  font-size: .9rem; color: var(--mh-text-secondary);
  transition: background .1s, color .1s;
}
.cmd-palette__item[aria-selected="true"],
.cmd-palette__item:hover {
  background: var(--mh-bg-hover); color: var(--mh-text);
}
.cmd-palette__item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--mh-bg-hover);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--mh-text-muted);
}
.cmd-palette__item[aria-selected="true"] .cmd-palette__item-icon,
.cmd-palette__item:hover .cmd-palette__item-icon {
  background: var(--mh-accent); color: #fff;
}
.cmd-palette__item-text { flex: 1; min-width: 0; }
.cmd-palette__item-title { font-weight: 600; font-size: .85rem; }
.cmd-palette__item-desc { font-size: .72rem; color: var(--mh-text-muted); }
.cmd-palette__kbd {
  margin-left: auto; font-size: .65rem; padding: 2px 6px;
  background: var(--mh-bg-hover); border-radius: 4px; font-family: monospace;
  color: var(--mh-text-muted); white-space: nowrap;
}
.cmd-palette__empty {
  padding: 32px 16px; text-align: center; color: var(--mh-text-muted); font-size: .85rem;
}
.cmd-palette__section {
  padding: 8px 16px 4px; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--mh-text-muted);
}

/* ----------------------------------------------------------
   MICRO-INTERACTIONS
   ---------------------------------------------------------- */
/* Card hover lift */
.mh-card {
  transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s;
}
.mh-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mh-shadow-lg);
}
/* Disable lift for cards inside tables, forms etc */
.mh-table-wrap .mh-card:hover,
.mh-card:has(.mh-table):hover,
.mh-card:has(form):hover,
.mh-card:has(.mh-tabs):hover,
.mh-card:has(.mh-chat):hover,
#addons-section .mh-card:hover {
  transform: none;
}

/* Button press */
.mh-btn { transition: all .15s cubic-bezier(.4,0,.2,1); }
.mh-btn:active { transform: scale(.97); }

/* Success morph button */
.mh-btn--morphing { position: relative; overflow: hidden; transition: all .3s; }
.mh-btn--morphing.is-loading {
  pointer-events: none; color: transparent !important;
}
.mh-btn--morphing.is-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: mh-spin .6s linear infinite;
}
.mh-btn--morphing.is-success {
  background: var(--mh-success) !important; border-color: var(--mh-success) !important;
  color: transparent !important; pointer-events: none;
}
.mh-btn--morphing.is-success::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; font-weight: 700;
  animation: mh-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mh-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Form error shake */
@keyframes mh-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-4px); }
  40%,80% { transform: translateX(4px); }
}
.mh-shake { animation: mh-shake .4s ease; }

/* Status pulse dot */
.mh-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mh-success);
  position: relative; display: inline-block;
}
.mh-pulse-dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: var(--mh-success); opacity: .4;
  animation: mh-pulse 2s ease-in-out infinite;
}
@keyframes mh-pulse {
  0%,100% { transform: scale(1); opacity: .4; }
  50% { transform: scale(1.8); opacity: 0; }
}

/* ----------------------------------------------------------
   SCROLL-DRIVEN ANIMATIONS (progressive enhancement)
   ---------------------------------------------------------- */
@supports (animation-timeline: view()) {
  .mh-reveal {
    animation: mh-reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
  @keyframes mh-reveal-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* Fallback for browsers without scroll-driven animations */
.mh-fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s, transform .5s cubic-bezier(.4,0,.2,1);
}
.mh-fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* Stagger delays for card grids */
.mh-stagger > *:nth-child(1) { transition-delay: 0ms; }
.mh-stagger > *:nth-child(2) { transition-delay: 60ms; }
.mh-stagger > *:nth-child(3) { transition-delay: 120ms; }
.mh-stagger > *:nth-child(4) { transition-delay: 180ms; }
.mh-stagger > *:nth-child(5) { transition-delay: 240ms; }
.mh-stagger > *:nth-child(6) { transition-delay: 300ms; }
.mh-stagger > *:nth-child(7) { transition-delay: 360ms; }
.mh-stagger > *:nth-child(8) { transition-delay: 420ms; }

/* ----------------------------------------------------------
   VIEW TRANSITIONS (progressive enhancement)
   ---------------------------------------------------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .15s ease-out fade-out; }
::view-transition-new(root) { animation: .15s ease-in fade-in; }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }

/* ----------------------------------------------------------
   ACCESSIBILITY
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
:focus-visible {
  outline: 2px solid var(--mh-accent);
  outline-offset: 2px;
}
h1, h2, h3 { text-wrap: balance; }

/* ----------------------------------------------------------
   NOTIFICATION BADGE
   ---------------------------------------------------------- */
.mh-notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--mh-danger); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  animation: mh-notif-pop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mh-notif-pop { from { transform: scale(0); } to { transform: scale(1); } }
.mh-dropdown-menu--wide { min-width: 300px; }

/* ----------------------------------------------------------
   MODAL ANIMATIONS
   ---------------------------------------------------------- */
.mh-modal-overlay {
  transition: opacity .2s;
}
.mh-modal-overlay .mh-modal {
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s;
}
.mh-modal-overlay.is-open .mh-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ----------------------------------------------------------
   READING PROGRESS BAR (KB articles, long pages)
   ---------------------------------------------------------- */
.mh-reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9990;
  background: transparent; pointer-events: none;
}
.mh-reading-progress__bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--mh-accent), #8b5cf6);
  border-radius: 0 2px 2px 0;
  transition: width .1s;
}
@supports (animation-timeline: scroll()) {
  .mh-reading-progress__bar {
    width: 100%; transform-origin: left;
    animation: mh-progress-grow linear;
    animation-timeline: scroll(root);
    transition: none;
  }
  @keyframes mh-progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ----------------------------------------------------------
   PASSWORD STRENGTH METER
   ---------------------------------------------------------- */
.mh-password-strength {
  height: 4px; border-radius: 2px; margin-top: 6px;
  background: var(--mh-bg-hover);
  overflow: hidden;
}
.mh-password-strength__bar {
  height: 100%; border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0%;
}
.mh-password-strength--weak   .mh-password-strength__bar { width: 25%;  background: var(--mh-danger); }
.mh-password-strength--fair   .mh-password-strength__bar { width: 50%;  background: var(--mh-warning); }
.mh-password-strength--good   .mh-password-strength__bar { width: 75%;  background: var(--mh-info); }
.mh-password-strength--strong .mh-password-strength__bar { width: 100%; background: var(--mh-success); }
.mh-password-strength__label {
  font-size: .7rem; margin-top: 2px; font-weight: 600;
}

/* ----------------------------------------------------------
   EMPTY STATES
   ---------------------------------------------------------- */
.mh-empty-state {
  text-align: center; padding: var(--mh-space-10) var(--mh-space-6);
}
.mh-empty-state__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--mh-bg-hover);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--mh-space-4);
  color: var(--mh-text-muted);
}
.mh-empty-state__title {
  font-size: 1.1rem; font-weight: 700; margin-bottom: var(--mh-space-2);
}
.mh-empty-state__desc {
  font-size: .85rem; color: var(--mh-text-muted); margin-bottom: var(--mh-space-5);
  max-width: 320px; margin-left: auto; margin-right: auto;
}

/* ----------------------------------------------------------
   TOPBAR SHRINK ON SCROLL
   ---------------------------------------------------------- */
.mh-topbar { transition: height .25s, padding .25s, box-shadow .25s; }
.mh-topbar.is-scrolled {
  height: 48px;
  box-shadow: 0 1px 8px rgba(0,0,0,.1);
}

/* ----------------------------------------------------------
   SCROLL TO TOP BUTTON
   ---------------------------------------------------------- */
.mh-scroll-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--mh-bg-card); border: 1px solid var(--mh-border);
  box-shadow: var(--mh-shadow-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--mh-text-muted);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.mh-scroll-top:hover { color: var(--mh-accent); border-color: var(--mh-accent); }
.mh-scroll-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Sidebar collapse removed — was causing text clipping issues */

/* ----------------------------------------------------------
   COPY BUTTON
   ---------------------------------------------------------- */
.mh-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: var(--mh-bg-hover); color: var(--mh-text-muted);
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.mh-copy-btn:hover { color: var(--mh-accent); background: var(--mh-accent-subtle, rgba(99,102,241,.08)); }

/* ----------------------------------------------------------
   FLOATING SUPPORT FAB (expandable menu)
   ---------------------------------------------------------- */
.mh-help-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 950;
  display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px;
}
.mh-help-fab__btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--mh-accent); color: #fff; border: none;
  box-shadow: 0 4px 20px rgba(99,102,241,.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative; z-index: 2;
}
.mh-help-fab__btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(99,102,241,.5); }
.mh-help-fab__btn:active { transform: scale(.95); }
.mh-help-fab__icon-close { display: none; }
.mh-help-fab.is-open .mh-help-fab__icon-default { display: none; }
.mh-help-fab.is-open .mh-help-fab__icon-close { display: block; }
.mh-help-fab.is-open .mh-help-fab__btn { background: var(--mh-text-muted); }

.mh-help-fab__menu {
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0; transform: translateY(8px) scale(.95);
  pointer-events: none;
  transition: opacity .2s, transform .2s cubic-bezier(.4,0,.2,1);
}
.mh-help-fab.is-open .mh-help-fab__menu {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mh-help-fab__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 14px;
  background: var(--mh-bg-card);
  border: 1px solid var(--mh-border);
  border-radius: 28px;
  color: var(--mh-text);
  font-size: .875rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.mh-help-fab__item:hover {
  background: var(--mh-bg-hover);
  transform: translateX(-4px);
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.mh-help-fab__item svg { flex-shrink: 0; color: var(--mh-accent); }

.mh-ticket-panel {
  position: fixed; z-index: 9996;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  width: min(520px, calc(100vw - 32px));
  background: var(--mh-bg-card);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--mh-radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04) inset;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.4,0,.2,1);
  max-height: 85vh; overflow-y: auto;
}
[data-theme="dark"] .mh-ticket-panel {
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
}
.mh-ticket-panel.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.mh-ticket-panel__header {
  display: flex; align-items: center; gap: var(--mh-space-3);
  padding: var(--mh-space-4) var(--mh-space-5);
  border-bottom: 1px solid var(--mh-border);
}
.mh-ticket-panel__header h3 { flex: 1; margin: 0; font-size: 1rem; text-align: center; }
.mh-ticket-panel__back, .mh-ticket-panel__close {
  background: none; border: none; cursor: pointer;
  color: var(--mh-text-muted); font-size: 1.2rem;
  padding: var(--mh-space-1); border-radius: 8px;
  transition: color .15s, background .15s;
}
.mh-ticket-panel__back:hover, .mh-ticket-panel__close:hover {
  color: var(--mh-text); background: var(--mh-bg-hover);
}
.mh-ticket-panel__body {
  padding: var(--mh-space-5);
}
.mh-ticket-panel__backdrop {
  position: fixed; inset: 0; z-index: 9995;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.mh-ticket-panel__backdrop.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
  .mh-help-fab { bottom: 16px; right: 16px; }
  .mh-scroll-top { bottom: 76px; right: 16px; }
}

/* ----------------------------------------------------------
   TOOLTIPS
   ---------------------------------------------------------- */
.mh-tooltip {
  position: fixed; z-index: 99999;
  background: var(--mh-text); color: var(--mh-bg);
  font-size: .72rem; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
  pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -100%);
  opacity: 0; transition: opacity .15s;
}
.mh-tooltip.is-visible { opacity: 1; }
.mh-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--mh-text);
}

/* ----------------------------------------------------------
   TABLE SORTING
   ---------------------------------------------------------- */
.mh-sortable { position: relative; }
.mh-sortable:hover { color: var(--mh-accent); }
.mh-sort-indicator { transition: opacity .15s; }

/* ----------------------------------------------------------
   TAB PANEL TRANSITIONS
   ---------------------------------------------------------- */
.mh-tab-panel {
  transition: opacity .2s, transform .2s;
}

/* ----------------------------------------------------------
   LAZY-LOAD IMAGES (blur-up)
   ---------------------------------------------------------- */
.mh-img-lazy {
  filter: blur(8px); transform: scale(1.02);
  transition: filter .4s, transform .4s;
}
.mh-img-lazy.mh-img-loaded {
  filter: blur(0); transform: scale(1);
}

/* ----------------------------------------------------------
   DOMAIN EXPIRY BADGES
   ---------------------------------------------------------- */
.mh-expiry-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 600; padding: 2px 8px;
  border-radius: var(--mh-radius-full);
}
.mh-expiry-badge--urgent {
  background: rgba(239,68,68,.12); color: var(--mh-danger);
}
.mh-expiry-badge--soon {
  background: rgba(245,158,11,.12); color: var(--mh-warning);
}
.mh-expiry-badge--ok {
  background: rgba(16,185,129,.08); color: var(--mh-success);
}

/* ----------------------------------------------------------
   ENHANCED PRINT STYLES
   ---------------------------------------------------------- */
/* ----------------------------------------------------------
   PREMIUM POLISH (customer flow refinement)
   Cart, dashboard, lists, auth, invoices.
   All values use existing CSS variables; no theme drift.
   ---------------------------------------------------------- */

/* Stronger card hover lift on clickable cards */
.mh-card--clickable {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
}
.mh-card--clickable:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08), 0 4px 8px rgba(var(--mh-accent-rgb), .06) !important;
  border-color: var(--mh-accent) !important;
}
[data-theme="dark"] .mh-card--clickable:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35), 0 4px 8px rgba(var(--mh-accent-rgb), .12) !important;
}

/* Invoice table — first column expands, others hug content */
.mh-table--invoices th:first-child,
.mh-table--invoices td:first-child {
  width: 100%;
}
.mh-table--invoices th,
.mh-table--invoices td {
  white-space: nowrap;
}
.mh-table--invoices td:last-child {
  text-align: right;
}
/* Fix: .mh-hide-mobile sets display:inline-flex globally, which breaks
   table cells. Force table-cell inside tables on desktop. */
.mh-table th.mh-hide-mobile,
.mh-table td.mh-hide-mobile {
  display: table-cell;
}
@media (max-width: 768px) {
  .mh-table th.mh-hide-mobile,
  .mh-table td.mh-hide-mobile {
    display: none !important;
  }
}

/* Premium table headers — heavier, slightly tinted background */
.mh-table thead th {
  background: var(--mh-bg-hover) !important;
  color: var(--mh-text-secondary) !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
}
.mh-table thead th:first-child { border-top-left-radius: var(--mh-radius); }
.mh-table thead th:last-child  { border-top-right-radius: var(--mh-radius); }

/* Smooth row hover with indigo tint */
.mh-table tbody tr {
  transition: background .15s ease;
}
.mh-table tbody tr:hover td {
  background: color-mix(in srgb, var(--mh-accent) 4%, var(--mh-bg-card)) !important;
}
/* Don't tint empty-state rows */
.mh-table tbody tr:hover td:has(.mh-empty-state),
.mh-table tbody tr td.mh-table--empty:hover,
.mh-table tbody tr:has(.mh-empty-state):hover td {
  background: transparent !important;
}

/* Indigo focus ring on form controls */
.mh-form-control:focus {
  border-color: var(--mh-accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--mh-accent-rgb), .15) !important;
}

/* Premium primary button — subtle gradient + shadow + lift on hover */
.mh-btn--primary {
  background: linear-gradient(135deg, var(--mh-accent) 0%, var(--mh-accent-hover) 100%) !important;
  border-color: var(--mh-accent) !important;
  box-shadow: 0 4px 12px rgba(var(--mh-accent-rgb), .22) !important;
}
.mh-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(var(--mh-accent-rgb), .32) !important;
}
.mh-btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(var(--mh-accent-rgb), .22) !important;
}
.mh-btn--lg {
  padding: var(--mh-space-3) var(--mh-space-8) !important;
  font-weight: 700 !important;
  border-radius: var(--mh-radius) !important;
}

/* Cart layout — items as cards, summary sticky on the side */
.mh-cart-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--mh-space-6);
  align-items: start;
}
@media (max-width: 960px) {
  .mh-cart-grid { grid-template-columns: 1fr; }
}

.mh-cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--mh-space-3);
}

.mh-cart-item {
  display: flex;
  align-items: center;
  gap: var(--mh-space-4);
  padding: var(--mh-space-5);
  background: var(--mh-bg-card) !important;
  border: 1px solid var(--mh-border) !important;
  border-radius: var(--mh-radius-lg) !important;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.mh-cart-item:hover {
  border-color: var(--mh-accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
}
.mh-cart-item__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--mh-radius);
  background: var(--mh-accent-subtle);
  color: var(--mh-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mh-cart-item__body { flex: 1; min-width: 0; }
.mh-cart-item__title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--mh-text);
  margin-bottom: 2px;
}
.mh-cart-item__meta {
  font-size: .78rem;
  color: var(--mh-text-muted);
  display: flex;
  gap: var(--mh-space-3);
  flex-wrap: wrap;
}
.mh-cart-item__price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--mh-text);
  text-align: right;
  white-space: nowrap;
}
.mh-cart-item__price del {
  display: block;
  font-weight: 500;
  font-size: .78rem;
  color: var(--mh-text-muted);
}
.mh-cart-item__price .mh-text-success {
  color: var(--mh-success);
}
.mh-cart-item__remove {
  width: 32px;
  height: 32px;
  border-radius: var(--mh-radius);
  background: transparent;
  border: 1px solid var(--mh-border);
  color: var(--mh-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mh-cart-item__remove:hover {
  background: var(--mh-danger-bg);
  border-color: var(--mh-danger);
  color: var(--mh-danger);
}

/* Cart summary — sticky on the right */
.mh-cart-summary {
  position: sticky;
  top: calc(var(--mh-topbar-h, 60px) + var(--mh-space-6));
  background: var(--mh-bg-card) !important;
  border: 1px solid var(--mh-border) !important;
  border-radius: var(--mh-radius-lg) !important;
  padding: var(--mh-space-6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
}
.mh-cart-summary__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mh-text-muted);
  margin-bottom: var(--mh-space-3);
}
.mh-cart-summary__row {
  display: flex;
  justify-content: space-between;
  padding: var(--mh-space-2) 0;
  font-size: .875rem;
  color: var(--mh-text-secondary);
}
.mh-cart-summary__row strong { color: var(--mh-text); }
.mh-cart-summary__divider {
  height: 1px;
  background: var(--mh-border);
  margin: var(--mh-space-3) 0;
}
.mh-cart-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--mh-text);
  margin-top: var(--mh-space-2);
}
.mh-cart-summary__total small {
  font-size: .72rem;
  font-weight: 600;
  color: var(--mh-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Payment method radio cards */
.mh-pay-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--mh-space-2);
}
.mh-pay-method {
  display: flex !important;
  align-items: center;
  gap: var(--mh-space-2);
  padding: var(--mh-space-3) var(--mh-space-4) !important;
  border: 2px solid var(--mh-border) !important;
  border-radius: var(--mh-radius) !important;
  cursor: pointer;
  background: var(--mh-bg-card);
  transition: all .15s ease;
}
.mh-pay-method:hover {
  border-color: var(--mh-accent) !important;
  background: color-mix(in srgb, var(--mh-accent) 4%, transparent) !important;
}
.mh-pay-method:has(input:checked) {
  border-color: var(--mh-accent) !important;
  background: var(--mh-accent-subtle) !important;
  box-shadow: 0 2px 8px rgba(var(--mh-accent-rgb), .12);
}
.mh-pay-method input { accent-color: var(--mh-accent); }
.mh-pay-method span { font-weight: 600; color: var(--mh-text); }

/* Pill badge enhancement (subtle ring for status badges) */
.mh-badge--success { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-success) 25%, transparent); }
.mh-badge--danger  { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-danger)  25%, transparent); }
.mh-badge--warning { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-warning) 25%, transparent); }
.mh-badge--info    { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-info)    25%, transparent); }
.mh-badge--accent  { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-accent)  25%, transparent); }

/* Auth card — bigger shadow, premium feel */
.mh-auth__card {
  border-radius: var(--mh-radius-lg) !important;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .12), 0 8px 16px rgba(15, 23, 42, .06) !important;
}
[data-theme="dark"] .mh-auth__card {
  box-shadow: 0 24px 48px rgba(0, 0, 0, .5), 0 8px 16px rgba(0, 0, 0, .35) !important;
}
.mh-auth__title {
  font-weight: 800 !important;
  letter-spacing: -.01em;
}

/* Empty state polish */
.mh-empty-state {
  padding: var(--mh-space-10) var(--mh-space-6);
  text-align: center;
}
.mh-empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--mh-space-4);
  border-radius: var(--mh-radius-full);
  background: var(--mh-accent-subtle);
  color: var(--mh-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mh-empty-state__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mh-text);
  margin-bottom: var(--mh-space-2);
}
.mh-empty-state__desc {
  color: var(--mh-text-muted);
  font-size: .875rem;
  margin-bottom: var(--mh-space-5);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

@media print {
  .mh-sidebar,
  .mh-topbar,
  .mh-sidebar-overlay,
  .mh-toast-container,
  .mh-announcement,
  .mh-footer,
  .mh-help-fab,
  .mh-scroll-top,
  .cmd-palette,
  .cmd-palette-backdrop,
  .mh-btn,
  .mh-theme-toggle,
  .mh-reading-progress { display: none !important; }

  .mh-main { margin-left: 0 !important; }
  .mh-page-body { padding: 0 !important; }
  .mh-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  a { color: #000 !important; text-decoration: underline; }
  .mh-card::before { display: none; }
  .mh-table th { background: #f5f5f5 !important; }
  .mh-badge { border: 1px solid #999; }

  /* Invoice-specific: clean layout for printing */
  .mh-card__header { background: #f8f8f8 !important; }
  h1, h2, h3 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
}
