/**
 * HaloCloud Cloud Console 2.0 - Unified Design System & Layout
 */

:root {
  color-scheme: light;

  /* Color Tokens - Modern Cloud SaaS */
  --hc-primary: #3164db;
  --hc-primary-hover: #2453be;
  --hc-primary-light: #edf3ff;
  --hc-primary-subtle: rgba(49, 100, 219, 0.08);

  --hc-bg-page: #f8fafc;
  --hc-bg-surface: #ffffff;
  --hc-bg-subtle: #f1f5f9;
  --hc-bg-muted: #e2e8f0;

  --hc-border: #e2e8f0;
  --hc-border-hover: #cbd5e1;
  --hc-border-focus: #3164db;

  --hc-text-primary: #0f172a;
  --hc-text-secondary: #475569;
  --hc-text-muted: #94a3b8;
  --hc-text-inverse: #ffffff;

  --hc-success: #10b981;
  --hc-success-bg: #ecfdf5;
  --hc-success-border: #a7f3d0;
  --hc-warning: #f59e0b;
  --hc-warning-bg: #fffbeb;
  --hc-warning-border: #fde68a;
  --hc-danger: #ef4444;
  --hc-danger-bg: #fef2f2;
  --hc-danger-border: #fecaca;
  --hc-info: #3b82f6;
  --hc-info-bg: #eff6ff;

  /* Typography */
  --hc-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Layout Constants */
  --hc-topbar-height: 58px;
  --hc-rail-width: 240px;
  --hc-rail-width-collapsed: 68px;

  /* Elevation Shadows */
  --hc-shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --hc-shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --hc-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --hc-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --hc-shadow-popover: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  /* Animation */
  --hc-transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Body & Reset */
body.hc-console-body {
  margin: 0;
  padding: 0;
  background-color: var(--hc-bg-page);
  color: var(--hc-text-primary);
  font-family: var(--hc-font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.hc-console-body * {
  box-sizing: border-box;
}

/*
 * The inherited WHMCS ID rule otherwise outranks .w-hidden and exposes the
 * full-page loading veil. Keep this non-important so showOverlay() can still
 * reveal it through the inline display value used by WHMCS.
 */
.hc-theme #fullpage-overlay.w-hidden {
  display: none;
}

/* Master Layout */
.hc-console-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========================================================
   TOPBAR
   ======================================================== */
.hc-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--hc-topbar-height);
  padding: 0 20px;
  min-width: 0;
  gap: 12px;
  background: var(--hc-bg-surface);
  border-bottom: 1px solid var(--hc-border);
  box-shadow: var(--hc-shadow-xs);
}

.hc-topbar__start {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hc-topbar__mobile-toggle {
  display: none !important;
}

.hc-topbar__brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  text-decoration: none !important;
}

.hc-topbar__logo {
  height: 26px;
  max-width: 100%;
  width: auto;
  display: block;
}

.hc-topbar__badge {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hc-primary);
  background: var(--hc-primary-light);
  border-radius: 6px;
}

.hc-topbar__divider {
  width: 1px;
  height: 20px;
  background: var(--hc-border);
}

.hc-topbar__workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--hc-text-primary);
  font-size: 13px;
  font-weight: 500;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
}

.hc-topbar__workspace i {
  color: var(--hc-primary);
  font-size: 12px;
}

/* Search Trigger Button */
.hc-topbar__search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 360px;
  max-width: 360px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--hc-border);
  border-radius: 8px;
  background: var(--hc-bg-subtle);
  color: var(--hc-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-topbar__search-btn:hover {
  border-color: var(--hc-border-hover);
  background: #ffffff;
  color: var(--hc-text-secondary);
  box-shadow: var(--hc-shadow-xs);
}

.hc-topbar__search-btn i {
  font-size: 13px;
  flex-shrink: 0;
}

.hc-topbar__search-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  font-family: var(--hc-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--hc-text-secondary);
  background: #ffffff;
  border: 1px solid var(--hc-border);
  border-radius: 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Topbar End Controls */
.hc-topbar__end {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Topbar Auth Buttons (Log In & Register) */
.hc-theme .hc-topbar__auth-btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 16px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 32px !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
  cursor: pointer;
}

.hc-theme .hc-topbar__auth-btn--login {
  background: var(--hc-bg-surface, #ffffff) !important;
  border: 1px solid var(--hc-border, #e2e8f0) !important;
  color: var(--hc-text-primary, #0f172a) !important;
}

.hc-theme .hc-topbar__auth-btn--login:hover {
  background: var(--hc-bg-subtle, #f8fafc) !important;
  border-color: var(--hc-border-hover, #cbd5e1) !important;
  color: var(--hc-primary, #3164db) !important;
}

.hc-theme .hc-topbar__auth-btn--register {
  background: var(--hc-primary, #3164db) !important;
  border: 1px solid var(--hc-primary, #3164db) !important;
  color: #ffffff !important;
}

.hc-theme .hc-topbar__auth-btn--register:hover {
  background: var(--hc-primary-hover, #2453be) !important;
  border-color: var(--hc-primary-hover, #2453be) !important;
  color: #ffffff !important;
}

/* Auth Pages Layout (Centered, No Sidebar, Minimal Topbar) */
.hc-theme.hc-body--auth {
  background: var(--hc-bg-subtle, #f8fafc) !important;
}

.hc-theme.hc-body--auth .hc-console-main {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  min-height: calc(100vh - var(--hc-topbar-height, 58px)) !important;
}

.hc-theme.hc-body--auth .hc-main-viewport {
  width: 100% !important;
  max-width: 100% !important;
  padding: 40px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 auto !important;
  background: transparent !important;
}

.hc-theme.hc-body--auth #main-body {
  flex: 0 0 auto !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.hc-theme.hc-body--auth .hc-console-container {
  max-width: 100% !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 auto !important;
}

/* Status Pill */
.hc-topbar__status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  color: var(--hc-text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition: var(--hc-transition);
}

.hc-topbar__status-pill:hover {
  background: var(--hc-bg-muted);
}

.hc-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hc-success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: hc-pulse 2s infinite;
}

@keyframes hc-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Icon Buttons (Notifications, Cart, Lang) */
.hc-topbar__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--hc-border);
  border-radius: 8px;
  background: var(--hc-bg-surface);
  color: var(--hc-text-secondary);
  font-size: 14px;
  text-decoration: none !important;
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-topbar__icon-btn:hover {
  border-color: var(--hc-border-hover);
  background: var(--hc-bg-subtle);
  color: var(--hc-text-primary);
}

.hc-topbar__badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--hc-danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid #ffffff;
}

/* User Profile Trigger Pill */
.hc-topbar__profile-wrap {
  position: relative;
}

.hc-topbar__profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  height: 44px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--hc-border);
  border-radius: 20px;
  background: var(--hc-bg-surface);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--hc-transition);
}

.hc-topbar__profile-btn:hover {
  border-color: var(--hc-border-hover);
  background: var(--hc-bg-subtle);
  box-shadow: var(--hc-shadow-xs);
}

.hc-topbar__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3164db, #1d4ed8);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.hc-topbar__profile-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  white-space: nowrap;
}

.hc-topbar__profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--hc-text-primary);
  line-height: 1.2;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-topbar__profile-arrow {
  font-size: 10px;
  color: var(--hc-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.hc-topbar__profile-btn[aria-expanded="true"] .hc-topbar__profile-arrow {
  transform: rotate(180deg);
}

/* Locale Picker in TopBar */
.hc-topbar .hc-locale-picker {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hc-topbar .hc-locale-picker__trigger {
  min-height: 44px !important;
  height: 44px !important;
  min-width: 0 !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border: 1px solid var(--hc-border) !important;
  background: var(--hc-bg-surface) !important;
  color: var(--hc-text-secondary) !important;
}

.hc-topbar .hc-locale-picker__trigger:hover {
  border-color: var(--hc-border-hover) !important;
  background: var(--hc-bg-subtle) !important;
  color: var(--hc-text-primary) !important;
}

/* ========================================================
   FLOATING PROFILE POPOVER (Replacing Modal!)
   ======================================================== */
.hc-profile-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  padding: 16px;
  background: var(--hc-bg-surface);
  border: 1px solid var(--hc-border);
  border-radius: 14px;
  box-shadow: var(--hc-shadow-popover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 1050;
}

.hc-profile-popover.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hc-profile-popover__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hc-border);
}

.hc-profile-popover__avatar-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--hc-primary-light);
  color: var(--hc-primary);
  font-size: 18px;
  font-weight: 700;
}

.hc-profile-popover__info {
  flex: 1;
  min-width: 0;
}

.hc-profile-popover__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--hc-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-profile-popover__email {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--hc-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-profile-popover__id-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 6px;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  border-radius: 4px;
  font-family: var(--hc-font-mono);
  font-size: 11px;
  color: var(--hc-text-secondary);
  cursor: pointer;
}

.hc-profile-popover__id-badge:hover {
  color: var(--hc-primary);
  border-color: var(--hc-border-hover);
}

/* Balance Widget inside Popover */
.hc-profile-popover__balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--hc-primary-light);
  border-radius: 8px;
}

.hc-profile-popover__balance-meta {
  display: flex;
  flex-direction: column;
}

.hc-profile-popover__balance-title {
  font-size: 11px;
  color: var(--hc-primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hc-profile-popover__balance-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--hc-text-primary);
  font-variant-numeric: tabular-nums;
}

.hc-profile-popover__topup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--hc-primary);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none !important;
  transition: var(--hc-transition);
}

.hc-profile-popover__topup-link:hover {
  background: var(--hc-primary-hover);
}

/* Popover Navigation List */
.hc-profile-popover__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hc-profile-popover__item {
  margin: 2px 0;
}

.hc-profile-popover__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--hc-text-primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  transition: var(--hc-transition);
}

.hc-profile-popover__link i {
  width: 16px;
  text-align: center;
  color: var(--hc-text-secondary);
  font-size: 13px;
}

.hc-profile-popover__link:hover {
  background: var(--hc-bg-subtle);
  color: var(--hc-primary);
}

.hc-profile-popover__link:hover i {
  color: var(--hc-primary);
}

.hc-profile-popover__signout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  border-top: 1px solid var(--hc-border);
  color: var(--hc-danger) !important;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-profile-popover__signout:hover {
  background: var(--hc-danger-bg);
}

/* ========================================================
   COMMAND PALETTE (Cmd+K)
   ======================================================== */
.hc-cmd-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.hc-cmd-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hc-cmd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.hc-cmd-dialog {
  position: relative;
  width: calc(100% - 24px);
  max-width: 580px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--hc-border);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.hc-cmd-modal.is-active .hc-cmd-dialog {
  transform: translateY(0) scale(1);
}

.hc-cmd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hc-border);
}

.hc-cmd-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hc-border);
  border-radius: 8px;
  background: var(--hc-bg-surface);
  color: var(--hc-text-secondary);
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-cmd-close:hover {
  border-color: var(--hc-border-hover);
  background: var(--hc-bg-subtle);
  color: var(--hc-text-primary);
}

.hc-cmd-header i {
  color: var(--hc-text-muted);
  font-size: 16px;
}

.hc-cmd-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--hc-text-primary);
  outline: none;
}

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

.hc-cmd-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.hc-cmd-group {
  margin-bottom: 8px;
}

.hc-cmd-group-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hc-text-muted);
}

.hc-cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--hc-text-primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.1s ease;
}

.hc-cmd-item i {
  width: 18px;
  text-align: center;
  color: var(--hc-text-secondary);
  font-size: 14px;
}

.hc-cmd-item:hover,
.hc-cmd-item.is-selected {
  background: var(--hc-primary-light);
  color: var(--hc-primary);
}

.hc-cmd-item:hover i,
.hc-cmd-item.is-selected i {
  color: var(--hc-primary);
}

.hc-cmd-item-shortcut {
  margin-left: auto;
  font-size: 11px;
  color: var(--hc-text-muted);
}

.hc-cmd-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--hc-text-muted);
  font-size: 13px;
}

/* ========================================================
   SIDEBAR RAIL & MAIN CONTENT
   ======================================================== */
.hc-console-main {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--hc-topbar-height));
}

.hc-rail {
  position: sticky;
  top: var(--hc-topbar-height);
  display: flex;
  flex-direction: column;
  width: var(--hc-rail-width);
  height: calc(100vh - var(--hc-topbar-height));
  background: var(--hc-bg-surface);
  border-right: 1px solid var(--hc-border);
  padding: 16px 10px 12px;
  flex-shrink: 0;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Collapsed rail */
.hc-rail--collapsed {
  width: var(--hc-rail-width-collapsed);
  padding: 16px 8px 12px;
}

.hc-rail--collapsed .hc-rail__section-title,
.hc-rail--collapsed .hc-rail__link span,
.hc-rail--collapsed .hc-rail__link-badge,
.hc-rail--collapsed .hc-rail__deploy-btn span {
  display: none !important;
}

.hc-rail--collapsed .hc-rail__link,
.hc-rail--collapsed .hc-rail__deploy-btn {
  justify-content: center;
  padding: 10px 0;
}

/* Quick Deploy CTA Button in Rail */
.hc-rail__deploy-wrap {
  margin-bottom: 16px;
}

.hc-rail__deploy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--hc-primary);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: none;
  transition: background-color 0.15s ease;
}

.hc-rail__deploy-btn:hover {
  background: var(--hc-primary-hover);
  box-shadow: none;
  transform: none;
}

.hc-rail__deploy-btn:active {
  background: #1d45a8;
  transform: none;
}

/* Rail Navigation Sections */
.hc-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.hc-rail__section-title {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hc-text-muted);
}

.hc-rail__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hc-rail__item {
  margin-bottom: 2px;
}

.hc-rail__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 8px;
  color: var(--hc-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: var(--hc-transition);
}

.hc-rail__link i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--hc-text-secondary);
  transition: var(--hc-transition);
}

.hc-rail__link:hover {
  color: var(--hc-text-primary);
  background: var(--hc-bg-subtle);
}

.hc-rail__link:hover i {
  color: var(--hc-primary);
}

.hc-rail__link.is-active {
  color: var(--hc-primary);
  background: var(--hc-primary-light);
  font-weight: 600;
}

.hc-rail__link.is-active i {
  color: var(--hc-primary);
}

.hc-rail__link-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: var(--hc-border);
  color: var(--hc-text-secondary);
}

.hc-rail__link.is-active .hc-rail__link-badge {
  background: rgba(49, 100, 219, 0.15);
  color: var(--hc-primary);
}

/* Rail Footer */
.hc-rail__footer {
  padding-top: 12px;
  border-top: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hc-rail__toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-height: 44px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--hc-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-rail__toggle-btn:hover {
  color: var(--hc-text-primary);
  background: var(--hc-bg-subtle);
}

.hc-rail__toggle-btn span {
  white-space: nowrap;
}

.hc-rail--collapsed .hc-rail__footer {
  justify-content: center;
}

.hc-rail--collapsed .hc-rail__toggle-btn {
  width: 40px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}

.hc-rail--collapsed .hc-rail__toggle-btn span {
  display: none;
}

.hc-rail--collapsed .hc-rail__toggle-btn i::before {
  content: "\f03c";
}

.hc-rail--collapsed .hc-rail__section {
  padding-top: 8px;
  border-top: 1px solid var(--hc-border);
}

.hc-rail--collapsed .hc-rail__section:first-child {
  padding-top: 0;
  border-top: 0;
}

.hc-rail--collapsed .hc-rail__link,
.hc-rail--collapsed .hc-rail__deploy-btn {
  position: relative;
}

.hc-rail--collapsed .hc-rail__link:hover::after,
.hc-rail--collapsed .hc-rail__deploy-btn:hover::after {
  content: attr(data-hc-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--hc-text-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1200;
  box-shadow: var(--hc-shadow-md);
}

/* Main Viewport Content */
.hc-main-viewport {
  flex: 1;
  min-width: 0;
  background: var(--hc-bg-page);
  display: flex;
  flex-direction: column;
}

#main-body {
  flex: 1;
  padding: 28px 32px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Bootstrap .container kept only as a compatibility hook for module scripts */
#main-body > .hc-console-container.container {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}

/* ========================================================
   LINK COLOR GUARD
   cloud-studio.css paints every anchor with `.hc-theme a { color: primary }`
   (specificity 0,1,1). Component anchors below must win, otherwise Bootstrap
   buttons turn blue-on-blue and navigation links lose their neutral colour.
   ======================================================== */
.hc-theme a.btn.btn-primary,
.hc-theme a.btn.btn-primary:hover,
.hc-theme a.btn.btn-primary:focus,
.hc-theme a.btn.btn-success,
.hc-theme a.btn.btn-success:hover,
.hc-theme a.btn.btn-danger,
.hc-theme a.btn.btn-danger:hover,
.hc-theme a.btn.btn-warning,
.hc-theme a.btn.btn-info {
  color: #ffffff;
  text-decoration: none;
}

.hc-theme a.btn.btn-default,
.hc-theme a.btn.btn-secondary,
.hc-theme a.btn.btn-light,
.hc-theme a.btn.btn-outline-secondary,
.hc-theme a.btn.btn-outline-dark {
  color: var(--hc-text-primary);
  text-decoration: none;
}

.hc-theme a.btn.btn-outline-primary {
  color: var(--hc-primary);
  text-decoration: none;
}

.hc-theme a.btn.btn-outline-primary:hover {
  color: #ffffff;
}

.hc-theme .hc-topbar__brand-wrap,
.hc-theme .hc-topbar__brand-wrap:hover {
  color: var(--hc-text-primary);
  text-decoration: none;
}

.hc-theme .hc-topbar__icon-btn {
  color: var(--hc-text-secondary);
}

.hc-theme .hc-topbar__icon-btn:hover {
  color: var(--hc-text-primary);
}

.hc-theme .hc-topbar__status-pill,
.hc-theme .hc-topbar__status-pill:hover {
  color: var(--hc-text-secondary);
}

.hc-theme .hc-rail__deploy-btn,
.hc-theme .hc-rail__deploy-btn:hover {
  color: #ffffff;
}

.hc-theme .hc-rail__link {
  color: var(--hc-text-secondary);
}

.hc-theme .hc-rail__link:hover {
  color: var(--hc-text-primary);
}

.hc-theme .hc-rail__link.is-active,
.hc-theme .hc-rail__link.is-active:hover {
  color: var(--hc-primary);
}

.hc-theme .hc-profile-popover__link {
  color: var(--hc-text-primary);
}

.hc-theme .hc-profile-popover__link:hover {
  color: var(--hc-primary);
}

.hc-theme .hc-profile-popover__signout,
.hc-theme .hc-profile-popover__signout:hover {
  color: var(--hc-danger);
}

.hc-theme .hc-profile-popover__topup-link,
.hc-theme .hc-profile-popover__topup-link:hover {
  color: #ffffff;
}

.hc-theme .hc-cmd-item {
  color: var(--hc-text-primary);
}

.hc-theme .hc-cmd-item:hover,
.hc-theme .hc-cmd-item.is-selected {
  color: var(--hc-primary);
}

.hc-theme .hc-settings-nav__tab {
  color: var(--hc-text-secondary);
}

.hc-theme .hc-settings-nav__tab:hover {
  color: var(--hc-text-primary);
}

.hc-theme .hc-settings-nav__tab.is-active {
  color: var(--hc-primary);
}

.hc-theme .hc-chip {
  color: var(--hc-text-secondary);
}

.hc-theme .hc-chip:hover {
  color: var(--hc-text-primary);
}

.hc-theme .hc-chip.is-active {
  color: var(--hc-primary);
}

.hc-theme .hc-metric-strip__item,
.hc-theme .hc-metric-strip__item:hover {
  color: var(--hc-text-primary);
  text-decoration: none;
}

.hc-theme .hc-instance-card__title a {
  color: inherit;
  text-decoration: none;
}

.hc-theme .hc-instance-card__title a:hover {
  color: var(--hc-primary);
}

.hc-theme .hc-instance-card__manage-btn,
.hc-theme .hc-instance-card__manage-btn:hover {
  color: #ffffff;
}

.hc-theme .hc-instance-card__action-icon {
  color: var(--hc-text-secondary);
  text-decoration: none;
}

.hc-theme .hc-instance-card__action-icon:hover {
  color: var(--hc-primary);
}

.hc-theme .hc-console-breadcrumb a {
  color: var(--hc-text-secondary);
}

/* Small status dot used inside filter chips */
.hc-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hc-success);
}

.hc-status-dot--pulse {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: hc-pulse 2s infinite;
}

.hc-status-dot--paid { background: var(--hc-success); }
.hc-status-dot--unpaid,
.hc-status-dot--collections { background: var(--hc-danger); }
.hc-status-dot--paymentpending,
.hc-status-dot--payment-pending { background: var(--hc-warning); }
.hc-status-dot--refunded { background: var(--hc-info); }
.hc-status-dot--draft,
.hc-status-dot--cancelled { background: var(--hc-text-muted); }

/* Flat Modern buttons rendered inside the console (Clean, Flat, No Gradient, No Inset Bevel) */
.hc-console-body .btn.btn-primary,
.hc-btn-primary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  background: var(--hc-primary, #3164db) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease;
  letter-spacing: normal;
  text-decoration: none !important;
}

.hc-console-body .btn.btn-primary:hover,
.hc-btn-primary:hover {
  background: var(--hc-primary-hover, #2453be) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}

.hc-console-body .btn.btn-primary:active,
.hc-btn-primary:active {
  background: #1d45a8 !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.hc-console-body .btn.btn-outline-secondary,
.hc-console-body .btn.btn-default,
.hc-btn-secondary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  background: var(--hc-bg-surface, #ffffff) !important;
  border: 1px solid var(--hc-border, #e2e8f0) !important;
  color: var(--hc-text-primary, #0f172a) !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  letter-spacing: normal;
  text-decoration: none !important;
}

.hc-console-body .btn.btn-outline-secondary:hover,
.hc-console-body .btn.btn-default:hover,
.hc-btn-secondary:hover {
  background: var(--hc-bg-subtle, #f8fafc) !important;
  border-color: var(--hc-border-hover, #cbd5e1) !important;
  color: var(--hc-text-primary, #0f172a) !important;
  box-shadow: none !important;
  transform: none !important;
}

.hc-console-body .btn.btn-outline-secondary:active,
.hc-console-body .btn.btn-default:active,
.hc-btn-secondary:active {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

.hc-console-body .btn.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  line-height: 20px;
}

.hc-page-header__actions .btn.btn-sm,
.hc-btn-primary--header {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  line-height: 34px !important;
  border-radius: 6px !important;
  border: none !important;
  box-shadow: none !important;
}

.hc-page-header__actions .btn.btn-sm i,
.hc-btn-primary--header i {
  font-size: 12px;
  margin-right: 6px;
}

/* Breadcrumb in header */
.hc-console-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--hc-text-muted);
}

.hc-console-breadcrumb a {
  color: var(--hc-text-secondary);
  text-decoration: none;
}

.hc-console-breadcrumb a:hover {
  color: var(--hc-primary);
}

.hc-console-breadcrumb .separator {
  color: var(--hc-border-hover);
}

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */
.hc-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.hc-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--hc-text-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.hc-toast.hc-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hc-toast--success i { color: #34d399; }
.hc-toast--error i { color: #f87171; }

/* ========================================================
   INSTANCE CARDS & COMPUTING GRID
   ======================================================== */
.hc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.hc-page-header__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--hc-text-primary);
  letter-spacing: -0.02em;
}

.hc-page-header__subtitle {
  margin: 4px 0 0;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 20px;
  color: var(--hc-text-secondary);
}

.hc-page-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Control Bar (Filters + View Switcher / Search) */
.hc-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hc-border);
}

.hc-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--hc-bg-subtle, #f1f5f9);
  border: 1px solid var(--hc-border, #e2e8f0);
  flex-wrap: wrap;
}

.hc-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hc-text-secondary);
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  text-decoration: none !important;
  cursor: pointer;
  transition: var(--hc-transition);
  line-height: 1.5;
  box-shadow: none !important;
}

.hc-chip:hover {
  background: #ffffff;
  color: var(--hc-text-primary);
  border-color: var(--hc-border-hover);
}

.hc-chip.is-active {
  background: var(--hc-primary-light);
  color: var(--hc-primary);
  border-color: rgba(49, 100, 219, 0.3);
  font-weight: 600;
}

.hc-view-switcher {
  display: inline-flex;
  padding: 3px;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  border-radius: 8px;
}

.hc-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hc-text-muted);
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-view-btn.is-active {
  background: #ffffff;
  color: var(--hc-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Instances Grid */
.hc-instances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.hc-instance-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--hc-bg-surface);
  border: 1px solid var(--hc-border);
  border-radius: 12px;
  box-shadow: var(--hc-shadow-sm);
  transition: var(--hc-transition);
}

.hc-instance-card:hover {
  border-color: #b0c4de;
  box-shadow: none;
  transform: none;
}

.hc-instance-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hc-instance-card__region {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hc-text-secondary);
}

.hc-instance-card__region i {
  color: var(--hc-primary);
}

/* Card Primitive */
.hc-card {
  background: var(--hc-bg-surface);
  border: 1px solid var(--hc-border);
  border-radius: 12px;
  box-shadow: var(--hc-shadow-sm);
  transition: var(--hc-transition);
}

.hc-card:hover {
  border-color: var(--hc-border-hover);
}

.hc-card.p-0 {
  padding: 0 !important;
}

.hc-card.overflow-hidden {
  overflow: hidden !important;
}

.hc-card .hc-table {
  width: 100%;
  border-collapse: collapse;
}

.hc-card .hc-table thead th {
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hc-text-secondary);
  background: var(--hc-bg-subtle);
  border-bottom: 1px solid var(--hc-border);
}

.hc-card .hc-table tbody td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid var(--hc-border);
  font-size: 13.5px;
}

.hc-card .hc-table tbody tr {
  transition: background 0.15s ease;
  cursor: pointer;
}

.hc-card .hc-table tbody tr:hover {
  background: #f8fafc;
}

.hc-card .hc-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Status Pill */
.hc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.hc-status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hc-status-pill--active,
.hc-status-pill--paid,
.hc-status-pill--open {
  background: var(--hc-success-bg, #ecfdf5);
  color: var(--hc-success, #10b981);
}

.hc-status-pill--unpaid,
.hc-status-pill--suspended,
.hc-status-pill--terminated,
.hc-status-pill--collections,
.hc-status-pill--overdue {
  background: var(--hc-danger-bg, #fef2f2);
  color: var(--hc-danger, #ef4444);
}

.hc-status-pill--paymentpending,
.hc-status-pill--payment-pending {
  background: var(--hc-warning-bg, #fffbeb);
  color: var(--hc-warning, #f59e0b);
}

.hc-status-pill--refunded {
  background: var(--hc-info-bg, #eff6ff);
  color: var(--hc-info, #3b82f6);
}

.hc-status-pill--pending,
.hc-status-pill--customer-reply,
.hc-status-pill--customerreply,
.hc-status-pill--inprogress,
.hc-status-pill--in-progress {
  background: var(--hc-warning-bg, #fffbeb);
  color: var(--hc-warning, #f59e0b);
}

.hc-status-pill--answered {
  background: var(--hc-primary-light, #edf3ff);
  color: var(--hc-primary, #3164db);
}

.hc-status-pill--cancelled,
.hc-status-pill--closed,
.hc-status-pill--draft {
  background: var(--hc-bg-subtle, #f1f5f9);
  color: var(--hc-text-muted, #64748b);
}

.hc-instance-card__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--hc-text-primary);
  line-height: 1.3;
}

.hc-instance-card__title a {
  color: inherit;
  text-decoration: none;
}

.hc-instance-card__title a:hover {
  color: var(--hc-primary);
}

.hc-instance-card__ip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.hc-ip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  font-family: var(--hc-font-mono);
  font-size: 12px;
  color: var(--hc-text-primary);
  cursor: pointer;
  transition: var(--hc-transition);
}

.hc-ip-badge:hover {
  border-color: var(--hc-primary);
  color: var(--hc-primary);
  background: var(--hc-primary-light);
}

.hc-instance-card__specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: var(--hc-bg-subtle);
  margin-bottom: 16px;
  font-size: 12.5px;
}

.hc-instance-card__spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--hc-text-secondary);
}

.hc-instance-card__spec-val {
  font-weight: 600;
  color: var(--hc-text-primary);
  font-variant-numeric: tabular-nums;
}

.hc-instance-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--hc-border);
}

.hc-instance-card__manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  background: var(--hc-primary);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: var(--hc-transition);
}

.hc-instance-card__manage-btn:hover {
  background: var(--hc-primary-hover);
  box-shadow: 0 2px 6px rgba(49, 100, 219, 0.3);
}

.hc-instance-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hc-instance-card__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  color: var(--hc-text-secondary);
  font-size: 13px;
  text-decoration: none !important;
  transition: var(--hc-transition);
}

.hc-instance-card__action-icon:hover {
  background: #ffffff;
  border-color: var(--hc-primary);
  color: var(--hc-primary);
  box-shadow: var(--hc-shadow-xs);
}

/* Empty State Card */
.hc-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: var(--hc-bg-surface);
  border: 1px dashed var(--hc-border);
  border-radius: 14px;
  text-align: center;
}

.hc-empty-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--hc-primary-light);
  color: var(--hc-primary);
  font-size: 26px;
  margin-bottom: 16px;
}

.hc-empty-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--hc-text-primary);
}

.hc-empty-card__desc {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--hc-text-secondary);
  max-width: 360px;
}

.hc-empty-card__actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-top: 4px !important;
}

.hc-empty-card__actions .btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 18px !important;
  border-radius: 6px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 36px !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.hc-empty-card__actions .btn i {
  font-size: 12px;
  margin-right: 6px;
}

/* Settings Tabs Navigation */
.hc-settings-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  border-radius: 10px;
}

.hc-settings-nav__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hc-text-secondary);
  text-decoration: none !important;
  white-space: nowrap;
  transition: var(--hc-transition);
}

.hc-settings-nav__tab:hover {
  color: var(--hc-text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.hc-settings-nav__tab.is-active {
  color: var(--hc-primary);
  background: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .hc-topbar__status-pill {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .hc-rail {
    position: fixed;
    top: var(--hc-topbar-height);
    left: 0;
    bottom: 0;
    z-index: 999;
    transform: translateX(-100%);
    box-shadow: var(--hc-shadow-lg);
  }
  .hc-rail.hc-rail--mobile-open {
    transform: translateX(0);
  }
  .hc-rail-backdrop {
    position: fixed;
    inset: 0;
    top: var(--hc-topbar-height);
    background: rgba(15, 23, 42, 0.4);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .hc-rail-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  #main-body {
    padding: 20px 16px;
  }
}

@media (max-width: 880px) {
  .hc-topbar__workspace {
    display: none !important;
  }
  .hc-topbar__search-text,
  .hc-topbar__search-btn .hc-kbd {
    display: none !important;
  }
  .hc-topbar__search-btn {
    flex: 0 0 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    width: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}

@media (max-width: 640px) {
  .hc-topbar__profile-meta {
    display: none !important;
  }
  .hc-topbar__profile-btn {
    padding: 0 4px !important;
  }
}

/* Mobile drawer keeps the saved desktop preference without hiding labels. */
@media (max-width: 1024px) {
  .hc-topbar__mobile-toggle {
    display: inline-flex !important;
  }

  .hc-rail--collapsed {
    width: var(--hc-rail-width);
    padding: 16px 10px 12px;
  }

  .hc-rail--collapsed .hc-rail__section-title,
  .hc-rail--collapsed .hc-rail__link span,
  .hc-rail--collapsed .hc-rail__link-badge,
  .hc-rail--collapsed .hc-rail__deploy-btn span {
    display: inline !important;
  }

  .hc-rail--collapsed .hc-rail__section-title {
    display: block !important;
  }

  .hc-rail--collapsed .hc-rail__link-badge {
    display: inline-flex !important;
  }

  .hc-rail--collapsed .hc-rail__link,
  .hc-rail--collapsed .hc-rail__deploy-btn {
    justify-content: flex-start;
    padding: 8px 12px;
  }

  .hc-rail--collapsed .hc-rail__link:hover::after,
  .hc-rail--collapsed .hc-rail__deploy-btn:hover::after {
    content: none;
  }
}

@media (max-width: 880px) {
  .hc-topbar__search-btn {
    flex: 0 0 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}

@media (max-width: 640px) {
  :root {
    --hc-topbar-height: 116px;
  }

  .hc-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: 44px 44px;
    grid-template-areas:
      "start search"
      "end end";
    align-items: center;
    height: var(--hc-topbar-height);
    padding: 8px 12px;
    gap: 8px;
  }

  .hc-topbar__start {
    grid-area: start;
    gap: 8px;
    min-width: 0;
  }

  .hc-topbar__brand-wrap {
    gap: 6px;
    overflow: hidden;
  }

  .hc-topbar__logo {
    max-width: 130px;
    max-height: 28px;
  }

  .hc-topbar__brand-wrap > .font-weight-bold {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hc-topbar__badge {
    display: none;
  }

  .hc-topbar__search-btn {
    grid-area: search;
  }

  .hc-topbar__end {
    grid-area: end;
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .hc-topbar__status-pill {
    display: none !important;
  }

  .hc-topbar .hc-language-select {
    min-width: 64px;
    min-height: 44px;
    height: 44px;
  }

  .hc-topbar .hc-locale-picker__trigger {
    min-width: 64px !important;
  }

  .hc-topbar__profile-btn {
    min-width: 44px;
    height: 44px;
  }

  .hc-profile-popover {
    width: calc(100vw - 24px);
    max-width: 320px;
  }
}
