/* HaloCloud Cloud Studio — shared visual primitives (R2) */

:root {
  color-scheme: light;
}

.hc-theme {
  --hc-surface-page: #ffffff;
  --hc-surface-subtle: #f7f8fa;
  --hc-surface-selected: #edf3ff;
  --hc-text-primary: #20242b;
  --hc-text-secondary: #637083;
  --hc-action-primary: #3164db;
  --hc-action-hover: #2453be;
  --hc-action-on-primary: #ffffff;
  --hc-border-subtle: #e5e7eb;
  --hc-border-control: #7b8799;
  --hc-focus-ring: #2453be;
  --hc-state-success: #136b45;
  --hc-state-success-bg: #eaf7f0;
  --hc-state-warning: #8f4b00;
  --hc-state-warning-bg: #fff5dd;
  --hc-state-danger: #b42318;
  --hc-state-danger-bg: #fff0ee;
  --hc-state-info: #2354b6;
  --hc-state-info-bg: #eff4ff;
  --hc-space-1: 4px;
  --hc-space-2: 8px;
  --hc-space-3: 12px;
  --hc-space-4: 16px;
  --hc-space-5: 24px;
  --hc-space-6: 32px;
  --hc-space-7: 48px;
  --hc-radius-control: 6px;
  --hc-radius-card: 8px;
  --hc-sidebar-width: 216px;
  --hc-header-height: 64px;
  --hc-control-height: 44px;
  --hc-primary-height: 48px;
  --hc-content-max: 1480px;
  --hc-summary-width: 320px;
  --hc-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --hc-font-size-body: 16px;
  --hc-line-body: 24px;
  --hc-font-size-dense: 14px;
  --hc-line-dense: 20px;
  --hc-font-size-page-title: 26px;
  --hc-line-page-title: 34px;
  --hc-font-size-section: 18px;
  --hc-line-section: 26px;
  --hc-font-size-control-label: 16px;
  --hc-line-control-label: 24px;
  --hc-font-size-total: 28px;
  --hc-line-total: 36px;
  --hc-font-size-plan-price: 24px;
  --hc-line-plan-price: 32px;
  --hc-transition: 150ms ease;
  --hc-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --hc-drawer-shadow: 0 8px 24px rgba(29, 41, 57, 0.12);
  --hc-shadow-sm: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
  --hc-shadow-card: 0 1px 3px 0 rgba(16, 24, 40, 0.08), 0 1px 2px -1px rgba(16, 24, 40, 0.04);
  --hc-shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --hc-shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --hc-shadow-float: 0 20px 32px -6px rgba(16, 24, 40, 0.12), 0 8px 12px -4px rgba(16, 24, 40, 0.05);

  box-sizing: border-box;
  color: var(--hc-text-primary);
  font-family: var(--hc-font-body);
  font-size: var(--hc-font-size-body);
  letter-spacing: 0;
  line-height: var(--hc-line-body);
}

.hc-theme *,
.hc-theme *::before,
.hc-theme *::after {
  box-sizing: inherit;
}

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

.hc-theme a:hover {
  color: var(--hc-action-hover);
  text-decoration: underline;
}

.hc-theme a:focus-visible {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-theme a.hc-button {
  color: var(--hc-action-on-primary);
  text-decoration: none;
}

.hc-theme a.hc-button:hover,
.hc-theme a.hc-button:focus-visible {
  color: var(--hc-action-on-primary);
  text-decoration: none;
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-theme a.hc-button--secondary {
  color: var(--hc-text-primary);
}

.hc-theme a.hc-button--secondary:hover,
.hc-theme a.hc-button--secondary:focus-visible {
  color: var(--hc-text-primary);
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-theme a.hc-button--ghost {
  color: var(--hc-action-primary);
}

.hc-theme a.hc-button--ghost:hover,
.hc-theme a.hc-button--ghost:focus-visible {
  color: var(--hc-action-hover);
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-theme a.hc-button--danger {
  color: #ffffff;
}

.hc-theme a.hc-button--danger:hover,
.hc-theme a.hc-button--danger:focus-visible {
  color: #ffffff;
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

/* Shell */

.hc-shell {
  display: flex;
  min-height: 100vh;
  background: var(--hc-surface-page);
}

.hc-sidebar {
  flex: 0 0 var(--hc-sidebar-width);
  width: var(--hc-sidebar-width);
  background: var(--hc-surface-subtle);
  border-right: 1px solid var(--hc-border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hc-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--hc-space-2);
  padding: var(--hc-space-4) var(--hc-space-4) var(--hc-space-3);
  min-height: var(--hc-header-height);
}

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

.hc-sidebar__close {
  display: none;
}

.hc-sidebar__nav {
  flex: 1;
  padding: 0 var(--hc-space-2) var(--hc-space-4);
  overflow-y: auto;
}

.hc-sidebar__footer {
  padding: var(--hc-space-3) var(--hc-space-2) var(--hc-space-4);
  border-top: 1px solid var(--hc-border-subtle);
}

.hc-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--hc-surface-page);
}

.hc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-4);
  min-height: var(--hc-header-height);
  padding: var(--hc-space-3) var(--hc-space-5);
  border-bottom: 1px solid var(--hc-border-subtle);
}

.hc-header__start {
  display: flex;
  align-items: center;
  gap: var(--hc-space-3);
  min-width: 0;
}

.hc-header__end {
  display: flex;
  align-items: center;
  gap: var(--hc-space-3);
  flex-shrink: 0;
}

.hc-header__menu-toggle {
  display: none;
}

.hc-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hc-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-text-secondary);
}

.hc-breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: var(--hc-space-2);
  color: var(--hc-border-control);
}

.hc-breadcrumbs a {
  color: var(--hc-text-secondary);
}

.hc-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--hc-space-5);
  max-width: var(--hc-content-max);
  width: 100%;
  margin: 0 auto;
}

.hc-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hc-space-4);
  margin-bottom: var(--hc-space-5);
}

.hc-page-header__title {
  margin: 0;
  font-size: var(--hc-font-size-page-title);
  font-weight: 600;
  line-height: var(--hc-line-page-title);
}

.hc-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hc-space-3);
}

.hc-section-title {
  margin: 0 0 var(--hc-space-4);
  font-size: var(--hc-font-size-section);
  font-weight: 600;
  line-height: var(--hc-line-section);
}

.hc-section {
  margin-bottom: var(--hc-space-6);
}

.hc-divider {
  border: 0;
  border-top: 1px solid var(--hc-border-subtle);
  margin: var(--hc-space-5) 0;
}

/* Navigation */

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

.hc-nav__group-label {
  margin: var(--hc-space-4) var(--hc-space-2) var(--hc-space-2);
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  font-weight: 600;
  color: var(--hc-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0;
}

.hc-nav__item {
  margin: 0 0 var(--hc-space-1);
}

.hc-nav__link {
  display: flex;
  align-items: center;
  gap: var(--hc-space-3);
  min-height: var(--hc-control-height);
  padding: var(--hc-space-2) var(--hc-space-3);
  border-radius: var(--hc-radius-control);
  color: var(--hc-text-primary);
  text-decoration: none;
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
}

.hc-nav__link:hover {
  background: rgba(29, 41, 57, 0.04);
  text-decoration: none;
  color: var(--hc-text-primary);
}

.hc-nav__link[aria-current="page"] {
  background: var(--hc-surface-selected);
  color: var(--hc-action-primary);
  font-weight: 600;
}

.hc-nav__icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: inherit;
}

/* Buttons */

.hc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hc-space-2);
  min-height: var(--hc-control-height);
  padding: 0 var(--hc-space-4);
  border: 1px solid transparent;
  border-radius: var(--hc-radius-control);
  background: var(--hc-action-primary);
  color: var(--hc-action-on-primary);
  font-family: inherit;
  font-size: var(--hc-font-size-dense);
  font-weight: 600;
  line-height: var(--hc-line-dense);
  letter-spacing: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(49, 100, 219, 0.15);
  transition: all 0.18s var(--hc-ease-out);
}

.hc-theme .hc-button.w-hidden {
  display: none;
}

.hc-button:hover {
  background: var(--hc-action-hover);
  color: var(--hc-action-on-primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 100, 219, 0.28);
}

.hc-button:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 1px 2px rgba(49, 100, 219, 0.15);
}

.hc-button:focus-visible {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-button:disabled,
.hc-button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.hc-button--primary {
  min-height: var(--hc-primary-height);
  padding: 0 var(--hc-space-5);
}

.hc-button--secondary {
  background: var(--hc-surface-page);
  color: var(--hc-text-primary);
  border-color: var(--hc-border-subtle);
  box-shadow: var(--hc-shadow-sm);
}

.hc-button--secondary:hover {
  background: var(--hc-surface-subtle);
  color: var(--hc-text-primary);
  border-color: #cbd5e1;
  box-shadow: var(--hc-shadow-md);
  transform: translateY(-1px);
}

.hc-button--secondary:active {
  transform: translateY(0) scale(0.985);
}

.hc-button--ghost {
  background: transparent;
  color: var(--hc-action-primary);
  border-color: transparent;
  box-shadow: none;
}

.hc-button--ghost:hover {
  background: var(--hc-surface-selected);
  color: var(--hc-action-hover);
  box-shadow: none;
  transform: none;
}

.hc-button--danger {
  background: var(--hc-state-danger);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(180, 35, 24, 0.2);
}

.hc-button--danger:hover {
  background: #922018;
  box-shadow: 0 4px 12px rgba(180, 35, 24, 0.3);
  transform: translateY(-1px);
}

.hc-button--danger:active {
  transform: translateY(0) scale(0.985);
}

.hc-button--block {
  width: 100%;
}

.hc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hc-control-height);
  min-width: var(--hc-control-height);
  height: var(--hc-control-height);
  padding: 0;
  border: 1px solid var(--hc-border-control);
  border-radius: var(--hc-radius-control);
  background: var(--hc-surface-page);
  color: var(--hc-text-primary);
  font-family: inherit;
  cursor: pointer;
}

.hc-icon-button:hover {
  background: var(--hc-surface-subtle);
}

.hc-icon-button:focus-visible {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

/* Form fields */

.hc-field {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-2);
  margin-bottom: var(--hc-space-4);
}

.hc-field__label {
  font-size: var(--hc-font-size-control-label);
  font-weight: 600;
  line-height: var(--hc-line-control-label);
}

.hc-field__hint {
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-text-secondary);
}

.hc-field__error {
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-state-danger);
}

.hc-field--error .hc-input,
.hc-field--error .hc-select,
.hc-field--error .hc-textarea {
  border-color: var(--hc-state-danger);
}

.hc-input,
.hc-select,
.hc-textarea {
  width: 100%;
  min-height: var(--hc-control-height);
  padding: var(--hc-space-2) var(--hc-space-3);
  border: 1px solid var(--hc-border-control);
  border-radius: var(--hc-radius-control);
  background: var(--hc-surface-page);
  color: var(--hc-text-primary);
  font-family: inherit;
  font-size: var(--hc-font-size-body);
  line-height: var(--hc-line-body);
  letter-spacing: 0;
}

.hc-textarea {
  min-height: 120px;
  resize: vertical;
}

.hc-input:focus-visible,
.hc-select:focus-visible,
.hc-textarea:focus-visible {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 0;
  border-color: var(--hc-focus-ring);
}

.hc-input-group {
  display: flex;
  gap: var(--hc-space-2);
  align-items: stretch;
}

.hc-input-group .hc-input {
  flex: 1 1 auto;
  min-width: 0;
}

.hc-password-field {
  position: relative;
}

.hc-password-field .hc-input {
  padding-right: calc(var(--hc-control-height) + var(--hc-space-2));
}

.hc-password-field .hc-icon-button {
  position: absolute;
  top: 50%;
  right: var(--hc-space-1);
  transform: translateY(-50%);
  border: 0;
  background: transparent;
}

.hc-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-3);
  cursor: pointer;
}

.hc-checkbox__input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--hc-action-primary);
  flex-shrink: 0;
}

.hc-checkbox__label {
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
}

.hc-form-grid {
  display: grid;
  gap: var(--hc-space-4);
}

.hc-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Segmented / radio choice */

.hc-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hc-space-2);
}

.hc-segmented__legend,
.hc-radio-choice__legend {
  width: 100%;
  margin: 0 0 var(--hc-space-3);
  font-size: var(--hc-font-size-control-label);
  font-weight: 600;
  line-height: var(--hc-line-control-label);
}

.hc-radio-choice {
  border: 0;
  margin: 0 0 var(--hc-space-4);
  padding: 0;
}

.hc-radio-choice__options,
.hc-segmented__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hc-space-2);
}

.hc-radio-choice__option,
.hc-segmented__option {
  position: relative;
  display: inline-flex;
}

.hc-radio-choice__option input,
.hc-segmented__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hc-radio-choice__label,
.hc-segmented__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--hc-control-height);
  padding: 0 var(--hc-space-4);
  border: 1px solid var(--hc-border-control);
  border-radius: var(--hc-radius-control);
  background: var(--hc-surface-page);
  color: var(--hc-text-primary);
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  cursor: pointer;
  user-select: none;
}

.hc-radio-choice__option input:checked + .hc-radio-choice__label,
.hc-segmented__option input:checked + .hc-segmented__label {
  border-color: var(--hc-action-primary);
  background: var(--hc-surface-selected);
  color: var(--hc-action-primary);
  font-weight: 600;
}

.hc-radio-choice__option input:focus-visible + .hc-radio-choice__label,
.hc-segmented__option input:focus-visible + .hc-segmented__label {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-radio-choice__option input:disabled + .hc-radio-choice__label,
.hc-segmented__option input:disabled + .hc-segmented__label {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Plan grid */

.hc-layout-split {
  display: grid;
  gap: var(--hc-space-5);
  align-items: start;
}

.hc-layout-split__main {
  min-width: 0;
}

.hc-layout-split__aside {
  min-width: 0;
}

.hc-plan-grid {
  display: grid;
  gap: var(--hc-space-4);
  grid-template-columns: 1fr;
}

.hc-plan {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
  min-width: 0;
  padding: var(--hc-space-4);
  border: 1px solid var(--hc-border-control);
  border-radius: var(--hc-radius-card);
  background: var(--hc-surface-page);
  cursor: pointer;
  transition: border-color var(--hc-transition), background var(--hc-transition);
}

.hc-plan:hover {
  border-color: var(--hc-action-primary);
}

.hc-plan--selected {
  border-color: var(--hc-action-primary);
  background: var(--hc-surface-selected);
}

.hc-plan--unavailable {
  opacity: 0.65;
  cursor: not-allowed;
}

.hc-plan__name {
  margin: 0;
  font-size: var(--hc-font-size-section);
  font-weight: 600;
  line-height: var(--hc-line-section);
}

.hc-plan__price {
  margin: 0;
  font-size: var(--hc-font-size-plan-price);
  font-weight: 600;
  line-height: var(--hc-line-plan-price);
  font-variant-numeric: tabular-nums;
}

.hc-plan__meta {
  margin: 0;
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-text-secondary);
  overflow-wrap: anywhere;
}

.hc-plan__stock {
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-state-success);
}

.hc-plan__stock--out {
  color: var(--hc-state-danger);
}

/* Summary */

.hc-summary {
  padding: var(--hc-space-4) 0;
}

.hc-summary__title {
  margin: 0 0 var(--hc-space-4);
  font-size: var(--hc-font-size-section);
  font-weight: 600;
  line-height: var(--hc-line-section);
}

.hc-summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--hc-space-4);
  padding: var(--hc-space-2) 0;
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  border-bottom: 1px solid var(--hc-border-subtle);
}

.hc-summary__row:last-child {
  border-bottom: 0;
}

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

.hc-summary__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.hc-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--hc-space-4);
  margin-top: var(--hc-space-4);
  padding-top: var(--hc-space-4);
  border-top: 1px solid var(--hc-border-subtle);
  font-size: var(--hc-font-size-total);
  font-weight: 600;
  line-height: var(--hc-line-total);
  font-variant-numeric: tabular-nums;
}

/* Metric strip — Modern Card Grid */

.hc-metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  border: 0;
  margin-bottom: var(--hc-space-5);
}

.hc-metric-strip__item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
  padding: 18px 20px;
  border: 1px solid var(--hc-border-subtle);
  border-radius: var(--hc-radius-card, 10px);
  background: var(--hc-surface-page);
  box-shadow: var(--hc-shadow-sm);
  text-decoration: none !important;
  transition: all 0.2s var(--hc-ease-out);
}

.hc-metric-strip__item:hover {
  border-color: #b0c4de;
  box-shadow: var(--hc-shadow-md);
  transform: translateY(-2px);
}

.hc-metric-strip__label {
  margin: 0 0 var(--hc-space-2);
  font-size: 13px;
  font-weight: 500;
  line-height: var(--hc-line-dense);
  color: var(--hc-text-secondary);
}

.hc-metric-strip__value {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--hc-text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.hc-metric-strip__sub {
  margin: var(--hc-space-1) 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--hc-text-secondary);
}

/* Custom Scrollbar for modern feel */
.hc-theme ::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.hc-theme ::-webkit-scrollbar-track {
  background: transparent;
}

.hc-theme ::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.25);
  border-radius: 9999px;
}

.hc-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.45);
}

/* Table */

.hc-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--hc-space-4);
}

.hc-table-scroll:focus-visible {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
}

.hc-table caption {
  text-align: left;
  font-weight: 600;
  padding-bottom: var(--hc-space-3);
}

.hc-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hc-text-secondary);
  background: var(--hc-surface-subtle);
  border-bottom: 1px solid var(--hc-border-subtle);
}

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

.hc-table tbody tr:hover {
  background: rgba(49, 100, 219, 0.025);
}

.hc-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hc-border-subtle);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.hc-table__amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hc-table tbody tr:hover {
  background: rgba(246, 248, 251, 0.6);
}

/* Status */

.hc-status {
  display: inline-flex;
  align-items: center;
  gap: var(--hc-space-2);
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
}

.hc-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--hc-text-secondary);
}

.hc-status--success .hc-status__dot {
  background: var(--hc-state-success);
}

.hc-status--warning .hc-status__dot {
  background: var(--hc-state-warning);
}

.hc-status--danger .hc-status__dot {
  background: var(--hc-state-danger);
}

.hc-status--info .hc-status__dot {
  background: var(--hc-state-info);
}

/* Alert */

.hc-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-3);
  padding: var(--hc-space-3) var(--hc-space-4);
  margin-bottom: var(--hc-space-4);
  border-radius: var(--hc-radius-control);
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
}

.hc-alert--warning {
  background: var(--hc-state-warning-bg);
  color: var(--hc-state-warning);
}

.hc-alert--danger {
  background: var(--hc-state-danger-bg);
  color: var(--hc-state-danger);
}

.hc-alert--info {
  background: var(--hc-state-info-bg);
  color: var(--hc-state-info);
}

.hc-alert--success {
  background: var(--hc-state-success-bg);
  color: var(--hc-state-success);
}

.hc-alert__action {
  margin-left: auto;
  flex-shrink: 0;
  font-weight: 600;
}

/* Empty / skeleton */

.hc-empty {
  padding: var(--hc-space-6) var(--hc-space-4);
  text-align: center;
  color: var(--hc-text-secondary);
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
}

.hc-empty__title {
  margin: 0 0 var(--hc-space-2);
  font-size: var(--hc-font-size-body);
  font-weight: 600;
  color: var(--hc-text-primary);
}

.hc-skeleton {
  background: linear-gradient(90deg, var(--hc-surface-subtle) 25%, #eceff4 50%, var(--hc-surface-subtle) 75%);
  background-size: 200% 100%;
  border-radius: var(--hc-radius-control);
  animation: hc-skeleton-pulse 1.2s ease-in-out infinite;
}

.hc-skeleton--line {
  height: var(--hc-line-dense);
  margin-bottom: var(--hc-space-2);
}

.hc-skeleton--block {
  height: 120px;
}

@keyframes hc-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pagination */

.hc-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hc-space-2);
  margin-top: var(--hc-space-4);
}

.hc-pagination__info {
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-text-secondary);
  margin-right: auto;
}

.hc-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--hc-control-height);
  min-height: var(--hc-control-height);
  padding: 0 var(--hc-space-3);
  border: 1px solid var(--hc-border-control);
  border-radius: var(--hc-radius-control);
  color: var(--hc-text-primary);
  text-decoration: none;
  font-size: var(--hc-font-size-dense);
}

.hc-pagination__link[aria-current="page"] {
  border-color: var(--hc-action-primary);
  background: var(--hc-surface-selected);
  color: var(--hc-action-primary);
  font-weight: 600;
}

/* Tabs */

.hc-tabs {
  margin-bottom: var(--hc-space-5);
}

.hc-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hc-space-1);
  margin: 0 0 var(--hc-space-4);
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--hc-border-subtle);
}

.hc-tabs__tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--hc-control-height);
  padding: var(--hc-space-2) var(--hc-space-4);
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--hc-text-secondary);
  font-family: inherit;
  font-size: var(--hc-font-size-dense);
  font-weight: 600;
  cursor: pointer;
}

.hc-tabs__tab[aria-selected="true"] {
  color: var(--hc-action-primary);
  border-bottom-color: var(--hc-action-primary);
}

.hc-tabs__tab:focus-visible {
  outline: 2px solid var(--hc-focus-ring);
  outline-offset: 2px;
}

.hc-tabs__panel {
  min-width: 0;
}

/* Ticket thread */

.hc-ticket-thread {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-4);
}

.hc-ticket-thread__message {
  padding: var(--hc-space-4);
  border-bottom: 1px solid var(--hc-border-subtle);
}

.hc-ticket-thread__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hc-space-3);
  margin-bottom: var(--hc-space-2);
  font-size: var(--hc-font-size-dense);
  line-height: var(--hc-line-dense);
  color: var(--hc-text-secondary);
}

.hc-ticket-thread__body {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Module slot */

.hc-module-slot {
  padding: var(--hc-space-4);
  border: 1px dashed var(--hc-border-control);
  border-radius: var(--hc-radius-control);
  background: var(--hc-surface-subtle);
  min-width: 0;
}

.hc-module-slot__label {
  margin: 0 0 var(--hc-space-3);
  font-size: var(--hc-font-size-dense);
  font-weight: 600;
  color: var(--hc-text-secondary);
}

.hc-preview-badge {
  display: inline-block;
  margin-bottom: var(--hc-space-4);
  padding: var(--hc-space-1) var(--hc-space-3);
  border-radius: var(--hc-radius-control);
  background: var(--hc-state-info-bg);
  color: var(--hc-state-info);
  font-size: var(--hc-font-size-dense);
  font-weight: 600;
}

.hc-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(29, 41, 57, 0.4);
  z-index: 90;
}

.hc-drawer-backdrop.is-open {
  display: block;
}

.hc-account-menu summary {
  list-style: none;
  cursor: pointer;
}

.hc-account-menu summary::-webkit-details-marker {
  display: none;
}

.hc-account-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--hc-space-2);
  min-height: var(--hc-control-height);
  padding: 0 var(--hc-space-3);
  border: 1px solid var(--hc-border-subtle);
  border-radius: var(--hc-radius-control);
  background: var(--hc-surface-page);
  font-size: var(--hc-font-size-dense);
}

.hc-account-menu__panel {
  position: absolute;
  right: var(--hc-space-5);
  margin-top: var(--hc-space-2);
  min-width: 180px;
  padding: var(--hc-space-2);
  border: 1px solid var(--hc-border-subtle);
  border-radius: var(--hc-radius-control);
  background: var(--hc-surface-page);
  box-shadow: var(--hc-drawer-shadow);
  z-index: 50;
}

.hc-account-menu__link {
  display: block;
  padding: var(--hc-space-2) var(--hc-space-3);
  border-radius: var(--hc-radius-control);
  color: var(--hc-text-primary);
  text-decoration: none;
}

.hc-account-menu__link:hover {
  background: var(--hc-surface-subtle);
  text-decoration: none;
}

/* Responsive */

@media (min-width: 768px) {
  .hc-plan-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .hc-form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hc-metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .hc-header__menu-toggle {
    display: none;
  }

  .hc-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    transform: none;
    z-index: auto;
    visibility: visible;
    pointer-events: auto;
  }

  .hc-sidebar__close {
    display: none;
  }

  .hc-drawer-backdrop {
    display: none;
  }

  .hc-layout-split {
    grid-template-columns: minmax(0, 1fr) var(--hc-summary-width);
  }
}

@media (min-width: 1200px) {
  .hc-plan-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (max-width: 991px) {
  .hc-shell {
    flex-direction: column;
  }

  .hc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, calc(100vw - var(--hc-space-5)));
    max-width: 320px;
    z-index: 100;
    transform: translateX(-110%);
    transition: transform var(--hc-transition);
    box-shadow: var(--hc-drawer-shadow);
    visibility: hidden;
    pointer-events: none;
  }

  .hc-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .hc-sidebar__close {
    display: inline-flex;
    position: absolute;
    top: var(--hc-space-3);
    right: var(--hc-space-3);
  }

  .hc-header__menu-toggle {
    display: inline-flex;
  }

  .hc-content {
    padding: var(--hc-space-4);
  }

  .hc-layout-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .hc-theme {
    --hc-font-size-page-title: 24px;
    --hc-line-page-title: 32px;
  }

  .hc-plan-grid {
    grid-template-columns: 1fr;
  }

  .hc-form-grid--2 {
    grid-template-columns: 1fr;
  }

  .hc-metric-strip {
    grid-template-columns: 1fr;
  }

  .hc-metric-strip__item {
    border-right: 0;
    border-bottom: 1px solid var(--hc-border-subtle);
  }

  .hc-metric-strip__item:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hc-theme *,
  .hc-theme *::before,
  .hc-theme *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    transition-property: background-color, border-color, color, opacity, box-shadow, transform, filter;
  }

  .hc-sidebar {
    transition: none;
  }
}
