:root {
  --hh-bg: #10141f;
  --hh-bg-alt: #171b27;
  --hh-panel: #1f2330;
  --hh-panel-soft: #262b3a;
  --hh-border-subtle: rgba(255, 255, 255, 0.06);
  --hh-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
  --hh-yellow: #ffd800;
  --hh-yellow-soft: rgba(255, 216, 0, 0.16);
  --hh-text: #f5f5f5;
  --hh-muted: #9aa0b8;
  --hh-radius-lg: 16px;
  --hh-radius-xl: 20px;
  --hh-radius-pill: 999px;
  --hh-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===== Global reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--hh-font);
  color: var(--hh-text);
  background:
    radial-gradient(circle at top left, #27375a 0, transparent 55%),
    radial-gradient(circle at bottom right, #2d3a4f 0, transparent 55%),
    radial-gradient(circle at top right, #47485a 0, transparent 55%),
    #05070d;
}

/* ===== Login layout (card centred) ===== */
body.hh-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column; /* stack card and intro vertically */
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
}

.hh-card {
  width: 380px;
  max-width: 92vw;
  background: linear-gradient(145deg, var(--hh-panel), var(--hh-bg-alt));
  border-radius: 24px;
  padding: 28px 26px 22px;
  box-shadow: var(--hh-shadow-soft);
  border: 1px solid var(--hh-border-subtle);
}

.hh-logo {
  display: block;
  max-width: 190px;
  margin: 0 auto 16px;
}

.hh-title {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  margin-bottom: 6px;
}

.hh-title-hexit {
  font-weight: 700;
}

.hh-title-hive {
  font-weight: 400;
  opacity: 0.9;
}

.hh-title-portal {
  margin-left: 6px;
  color: var(--hh-muted);
}

.hh-tagline {
  text-align: center;
  font-size: 12px;
  color: var(--hh-muted);
  margin-bottom: 18px;
}

.hh-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hh-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hh-label {
  font-size: 12px;
  color: var(--hh-muted);
}

.hh-input {
  border-radius: 10px;
  border: 1px solid var(--hh-border-subtle);
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  color: var(--hh-text);
  font-size: 13px;
}

.hh-input:focus {
  outline: none;
  border-color: var(--hh-yellow);
  box-shadow: 0 0 0 1px rgba(255, 216, 0, 0.36);
}

.hh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--hh-radius-pill);
  border: none;
  background: linear-gradient(135deg, #ffd800, #ffb400);
  color: #111;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.05s ease-out,
    box-shadow 0.1s ease-out,
    filter 0.1s ease-out;
}

.hh-button:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

.hh-button-secondary {
  background: transparent;
  color: var(--hh-text);
  border: 1px solid var(--hh-border-subtle);
  text-transform: none;
  letter-spacing: 0.06em;
}

.hh-button-ghost {
  background: transparent;
  color: var(--hh-muted);
  border: none;
}

.hh-login-form .hh-button {
  width: 100%;
  margin-top: 6px;
}

.hh-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 0, 76, 0.12);
  border: 1px solid rgba(255, 0, 76, 0.4);
  font-size: 12px;
}

.hh-helper {
  margin-top: 10px;
  font-size: 11px;
  color: var(--hh-muted);
}

/* ===== Admin shell ===== */
body.hh-shell {
  min-height: 100vh;
  display: flex;
}

.hh-shell-root {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

/* Sidebar */
.hh-sidebar {
  width: 210px;
  background: radial-gradient(circle at top, #25283a 0, #151826 55%);
  border-right: 1px solid var(--hh-border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 12px;
}

.hh-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.hh-sidebar-logo img {
  width: 80px; /* was 34px – make logo clearly visible */
  height: auto;
  border-radius: 14px; /* slightly softer corners to match bigger size */
}

.hh-sidebar-brand {
  line-height: 1.15;
}

.hh-sidebar-brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hh-sidebar-brand-product {
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
}

.hh-nav-item,
.hh-nav-item-disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--hh-muted);
  text-decoration: none;
  cursor: pointer;
}

.hh-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--hh-text);
}

.hh-nav-item-icon {
  width: 18px;
  text-align: center;
  opacity: 0.9;
}

.hh-nav-item-label {
  flex: 1;
}

.hh-nav-item-active {
  background: var(--hh-yellow-soft);
  color: var(--hh-text);
  position: relative;
}

.hh-nav-item-active::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 4px;
  background: var(--hh-yellow);
}

.hh-nav-item-disabled {
  opacity: 0.45;
  cursor: default;
}

.hh-sidebar-footer {
  border-top: 1px solid var(--hh-border-subtle);
  padding-top: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-sidebar-version {
  white-space: nowrap;
  margin-bottom: 4px;
}

.hh-sidebar-dot {
  padding: 0 4px;
}

.hh-sidebar-link {
  color: var(--hh-muted);
  text-decoration: none;
  font-size: 11px;
}

.hh-sidebar-link:hover {
  color: var(--hh-text);
}

/* =========================================================
 * Sidebar powered-by footer
 * =======================================================*/
.hh-sidebar-powered {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;              /* center text + logo */
}
.hh-sidebar-powered-label {
  font-size: 0.75rem;
  font-weight: 700;          /* stronger bold */
  opacity: 0.9;
  margin-bottom: 0.4rem;
  white-space: nowrap;
}

.hh-sidebar-powered-logo {
  display: flex;
  align-items: center;
  justify-content: center;   /* center horizontally */
  padding-right: 0;          /* no right bias */
}

.hh-sidebar-powered-img {
  max-width: 100%;        /* fit inside sidebar width */
  height: auto;
  display: block;
  opacity: 0.95;
}

.hh-sidebar-powered-link {
  display: inline-block;
  text-decoration: none;
}

/* Top bar */
.hh-shell-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hh-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 22px;
  background: linear-gradient(
    90deg,
    rgba(21, 26, 40, 0.96),
    rgba(11, 13, 20, 0.96)
  );
  border-bottom: 1px solid var(--hh-border-subtle);
}

.hh-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hh-topbar-product-name {
  font-size: 13px;
  font-weight: 600;
}

.hh-topbar-tagline {
  display: block;
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-topbar-middle {
  display: flex;
  justify-content: center;
  flex: 1;
}

.hh-tenant-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--hh-radius-pill);
  border: 1px solid var(--hh-border-subtle);
  background: rgba(0, 0, 0, 0.18);
  color: var(--hh-text);
  font-size: 12px;
  cursor: default;
}

.hh-tenant-label {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hh-tenant-chevron {
  opacity: 0.8;
}

.hh-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hh-bell-alert {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}

.hh-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--hh-yellow);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hh-user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 11px;
}

.hh-user-name {
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hh-user-role {
  color: var(--hh-muted);
}

.hh-link-profile {
  font-size: 11px;
  color: var(--hh-muted);
  text-decoration: none;
}

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

/* Main content */
.hh-main {
  flex: 1;
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.hh-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.hh-page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.hh-page-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--hh-muted);
}

.hh-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== Generic panels / cards ===== */
.hh-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hh-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.hh-stat-card {
  background: var(--hh-panel);
  border-radius: var(--hh-radius-lg);
  padding: 14px 16px;
  border: 1px solid var(--hh-border-subtle);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.hh-stat-label {
  font-size: 12px;
  color: var(--hh-muted);
  margin-bottom: 6px;
}

.hh-stat-value {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.hh-stat-sub {
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .hh-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hh-panel {
  background: var(--hh-panel);
  border-radius: var(--hh-radius-lg);
  padding: 14px 16px 16px;
  border: 1px solid var(--hh-border-subtle);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.hh-panel-header {
  margin-bottom: 8px;
}

.hh-panel-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
}

.hh-panel-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-empty {
  font-size: 12px;
  color: var(--hh-muted);
}

/* ===== Screens list ===== */
.hh-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.hh-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.hh-filter-label {
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-filter-input,
.hh-filter-select {
  border-radius: 8px;
  border: 1px solid var(--hh-border-subtle);
  background: rgba(0, 0, 0, 0.3);
  color: var(--hh-text);
  font-size: 12px;
  padding: 6px 8px;
}

.hh-filter-input:focus,
.hh-filter-select:focus {
  outline: none;
  border-color: var(--hh-yellow);
}

.hh-table-wrapper {
  border-radius: var(--hh-radius-lg);
  background: var(--hh-panel);
  border: 1px solid var(--hh-border-subtle);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* Tables */
.hh-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.hh-table th,
.hh-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hh-table th {
  font-weight: 600;
  color: var(--hh-muted);
  background: rgba(0, 0, 0, 0.2);
}

.hh-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.hh-col-actions {
  width: 80px;
}

/* Pills */
.hh-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.hh-pill-status-online {
  background: rgba(0, 200, 83, 0.16);
  color: #97f7bb;
}

.hh-pill-status-offline {
  background: rgba(255, 0, 76, 0.16);
  color: #ff8aa4;
}

.hh-pill-status-warn {
  background: rgba(255, 216, 0, 0.16);
  color: #ffe57c;
}

.hh-pill-status-never {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
}

.hh-muted {
  opacity: 0.6;
  font-size: 11px;
}

/* ===== Screen detail – shared tab styles ===== */
.hh-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--hh-border-subtle);
}

.hh-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: var(--hh-radius-pill);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--hh-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.15s ease-out,
    color 0.15s ease-out,
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.12s ease-out;
}

.hh-tab:hover {
  color: var(--hh-text);
  background: rgba(139, 160, 23, 0.03);
  border-color: var(--hh-border-subtle);
}

/* Support both active class names used in markup/JS */
.hh-tab-active,
.hh-tab--active {
  color: var(--hh-text);
  background: var(--hh-panel-soft);
  border-color: var(--hh-border-subtle);
  box-shadow: 0 0 0 1px rgb(151, 142, 20), var(--hh-shadow-soft);
}

.hh-tab-disabled {
  cursor: default;
  opacity: 0.4;
}

.hh-tab-panels {
  margin-top: 16px;
}

/* All panels are hidden by default; the active one is shown */
.hh-tab-panel {
  display: none;
  width: 100%;
}

/* Only the active panel is visible */
.hh-tab-panel-active {
  display: block;
}

.hh-screen-view { margin-top: 8px; }

/* ===== Screen view – isolated tab system ===== */
.hh-screen-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--hh-border-subtle);
}

.hh-screen-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: var(--hh-radius-pill);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--hh-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.15s ease-out,
    color 0.15s ease-out,
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.12s ease-out;
}

.hh-screen-tab:hover {
  color: var(--hh-text);
  background: rgba(139, 160, 23, 0.03);
  border-color: var(--hh-border-subtle);
}

.hh-screen-tab-active {
  color: var(--hh-text);
  background: var(--hh-panel-soft);
  border-color: var(--hh-border-subtle);
  box-shadow: 0 0 0 1px rgb(151, 142, 20), var(--hh-shadow-soft);
}

.hh-screen-tab-panels {
  margin-top: 16px;
}

/* All screen-view panels are hidden by default; the active one is shown */
.hh-screen-tab-panel {
  display: none;
  width: 100%;
}

.hh-screen-tab-panel-active {
  display: block;
}

.hh-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hh-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hh-form-field {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hh-form-label {
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-form-input,
.hh-form-textarea {
  border-radius: 8px;
  border: 1px solid var(--hh-border-subtle);
  background: rgba(0, 0, 0, 0.3);
  color: var(--hh-text);
  font-size: 12px;
  padding: 6px 8px;
}

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

.hh-form-input:focus,
.hh-form-textarea:focus {
  outline: none;
  border-color: var(--hh-yellow);
}

.hh-form-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.hh-form-success {
  margin-top: 6px;
  font-size: 12px;
  color: #97f7bb;
}

.hh-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.45);
  text-decoration: none;
  margin-left: 4px;
}

.hh-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hh-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.hh-link-logout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;  /* was 28px – ~25% larger */
  height: 40px; /* was 28px – ~25% larger */
  border-radius: 999px;
  margin-left: 6px;
  color: #ffffff;
  text-decoration: none;
  font-size: 16px; /* bump slightly so the icon doesn’t look tiny in a bigger circle */
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.hh-link-logout-icon:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hh-logout-icon {
  width: 24px; /* about half the visual size of circle */
  height: 24px;
  display: block;
}

.hh-logout-form {
  margin: 0;
}

.hh-account-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hh-account-form {
  flex: 2;
  min-width: 260px;
}

.hh-avatar-form {
  flex: 1;
  min-width: 220px;
}

.hh-avatar-profile {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--hh-border-subtle);
  overflow: hidden;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hh-avatar-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hh-avatar-profile-fallback {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

/* Inline action links inside tables */
.hh-inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.hh-inline-form button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0 0 0 8px;
  cursor: pointer;
}

/* Generic small action link */
.hh-action-link {
  font-size: 11px;
  color: var(--hh-yellow);
  text-decoration: none;
}

.hh-action-link:hover {
  text-decoration: underline;
}

/* “Danger” action (delete) */
.hh-action-link-danger {
  color: #ff8a8a;
}

.hh-action-link-danger:hover {
  color: #ffc1cf;
}

/* Override variant with full alert banner */
.hh-form-success {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.4);
  font-size: 12px;
}

.hh-danger-zone {
  margin-top: 10px;
  font-size: 11px;
}

.hh-danger-zone .hh-muted {
  margin-right: 6px;
}

.hh-danger-zone .hh-action-link-danger {
  font-weight: 600;
}

.hh-auth-intro {
  max-width: 900px;
  margin-top: 36px;
  text-align: center;
  color: var(--hh-text); /* body white */
  font-size: 14px;
  line-height: 1.7;
  font-weight: 500;
  opacity: 0.96;
}

@media (max-width: 600px) {
  .hh-auth-intro {
    font-size: 13px;
    margin-top: 24px;
  }
}

/* Make table links (e.g. screen names) white on the dark background */
.hh-panel table a {
  color: #f8ff9d;
}

/* Optional: keep them white on hover/focus, just add underline for affordance */
.hh-panel table a:hover,
.hh-panel table a:focus {
  color: #acfffb;
  text-decoration: underline;
}

/* Inline links in empty states (e.g. "create a new screen") */
.hh-link-inline {
  color: #ffffff;
}

.hh-link-inline:hover,
.hh-link-inline:focus {
  color: #ffffff;
  text-decoration: underline;
}

/* ===== Screen simulation preview (wall panel) ===== */
.hh-screen-panel {
  margin-top: 16px;
}

.hh-screen-sim-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  /* make it look like a grab handle */
  padding: 6px 0;
  cursor: grab;
  border-radius: var(--hh-radius-lg) var(--hh-radius-lg) 0 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06),
    rgba(15, 23, 42, 0)
  );
}

.hh-screen-sim-header-main {
  flex: 1 1 auto;
}

/* visual + UX state while dragging */
.hh-screen-sim-header--dragging {
  cursor: grabbing;
  user-select: none;
}

.hh-screen-sim-toggle {
  white-space: nowrap;
}

.hh-screen-sim-body {
  margin-top: 8px;
}

.hh-screen-panel.hh-screen-sim-collapsed .hh-screen-sim-body {
  display: none;
}

/* Card layout */
.hh-screen-sim-card {
  margin-top: 4px;
}

.hh-screen-sim-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
}

.hh-screen-sim-left {
  /* take full width of the panel, no fixed column cap */
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center; /* center the viewport + controls block */
}

.hh-screen-sim-right {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Screen bezel */
.hh-screen-sim-viewport-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--hh-radius-lg);
  border: 1px solid var(--hh-border-subtle);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 60%),
    var(--hh-panel-soft);
  padding: 8px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 12px 30px rgba(0, 0, 0, 0.35);
}

.hh-screen-sim-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--hh-radius-lg) - 4px);
  overflow: hidden;
  background: #02030a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hh-screen-sim-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

.hh-screen-sim-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
  background: #000; /* keeps letterboxing clean */
}

.hh-screen-sim-placeholder {
  font-size: 12px;
  color: var(--hh-muted);
  text-align: center;
  padding: 16px;
}

.hh-screen-sim-overlay {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  font-size: 11px;
  pointer-events: none;
}

.hh-screen-sim-overlay-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.hh-screen-sim-overlay-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.hh-screen-sim-label {
  color: #f5f5f5;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

.hh-screen-sim-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0b111f;
  background: #ffd36a;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.hh-screen-sim-badge-live {
  background: #4ade80;
}

.hh-screen-sim-badge-draft {
  background: #fdba74;
}

.hh-screen-sim-inline-controls {
  width: 100%;
  max-width: 100%;
  margin: 6px auto 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Right side summary + inspector */
.hh-screen-sim-summary {
  font-size: 12px;
  color: var(--hh-muted);
}

.hh-screen-sim-meta {
  margin: 0;
  padding: 0;
}

.hh-screen-sim-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 2px 0;
}

.hh-screen-sim-meta-row dt {
  margin: 0;
  color: var(--hh-muted);
}

.hh-screen-sim-meta-row dd {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.hh-screen-sim-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.hh-screen-sim-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
}

.hh-screen-sim-chip-status {
  border-color: rgba(52, 211, 153, 0.7);
}

.hh-screen-sim-list-header {
  font-size: 12px;
  color: var(--hh-muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.hh-screen-sim-list {
  flex: 1 1 auto;
  border-radius: 10px;
  background: rgba(6, 11, 26, 0.9);
  /* extra padding on the right so item text isn't under the inner scrollbar */
  padding: 6px 12px 6px 6px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.15);
  max-height: 220px;
}

.hh-screen-sim-list-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.hh-screen-sim-list-item:hover {
  background: rgba(37, 99, 235, 0.18);
}

.hh-screen-sim-list-item.is-active {
  background: rgba(59, 130, 246, 0.28);
}

.hh-screen-sim-list-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hh-screen-sim-list-item-title {
  font-weight: 500;
}

.hh-screen-sim-list-item-meta {
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-screen-sim-list-item-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  text-transform: uppercase;
}

/* Actions + status */
.hh-screen-sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.hh-screen-sim-status {
  font-size: 11px;
  color: var(--hh-muted);
  margin-top: 4px;
}

/* Responsive tweak */
@media (max-width: 900px) {
  .hh-screen-sim-layout {
    flex-direction: column;
  }
}

/* Screen Simulation flyout – desktop / large layout */
.hh-screen-sim-flyout {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  position: fixed;  /* anchored relative to viewport, JS sets top/right */
  width: 440px;
  max-width: 440px;
  box-shadow: var(--hh-shadow-soft);
  z-index: 20;
  max-height: calc(100vh - 5rem);
  overflow: hidden;
  margin-top: 0;
  /* base transform so drag JS can safely update it */
  transform: translate3d(0, 0, 0);
}

.hh-screen-sim-flyout .hh-screen-sim-body {
  flex: 1 1 auto;
  overflow-y: auto;
  /* keep content away from the vertical scrollbar */
  padding-right: 10px;
  scrollbar-gutter: stable; /* browsers that support it reserve a lane for the scrollbar */
}

/* Optional: class-based collapsed state (if you ever toggle via JS) */
.hh-screen-panel.hh-screen-sim-collapsed .hh-screen-sim-body,
.hh-screen-sim-flyout.hh-screen-sim-collapsed .hh-screen-sim-body {
  display: none;
}

@media (max-width: 960px) {
  .hh-screen-sim-flyout {
    position: fixed;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
    top: auto;
    bottom: 1rem;
    max-height: calc(100vh - 4rem);
    transform: translate3d(0, 0, 0);
  }

  .hh-screen-sim-flyout .hh-screen-sim-body {
    max-height: calc(100vh - 5rem);
  }
}

/* ===== Screen simulation – CSS-only collapse/expand with checkbox ===== */
/* Hidden state toggle input */
.hh-screen-sim-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Default label text when open */
.hh-screen-sim-toggle::after {
  content: "Collapse";
}

/* When checkbox is unchecked = collapsed */
#hh-screen-sim-toggle-state:not(:checked)
  + .hh-screen-sim-header
  .hh-screen-sim-toggle::after {
  content: "Expand";
}

/* Collapse the body when unchecked */
#hh-screen-sim-toggle-state:not(:checked)
  ~ .hh-screen-sim-body {
  display: none;
}

/* When checked (expanded), let the body render normally */
#hh-screen-sim-toggle-state:checked
  ~ .hh-screen-sim-body {
  display: block; /* inner layout handles flex/etc */
}

/* === Auth background images & overlay === */
body.hh-auth {
  position: relative;
  min-height: 100vh;
  background-color: #10141f; /* fallback if variable not set */
  background-image: var(
    --hh-bg-image,
    radial-gradient(circle at top left, #171b27, #10141f)
  );
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Darken / grade the background so the login stays readable */
body.hh-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.95)),
    linear-gradient(
      to bottom right,
      rgba(16, 20, 31, 0.5),
      rgba(16, 20, 31, 0.9)
    );
  mix-blend-mode: multiply;
  z-index: 0;
}

/* Make sure card and intro sit above the dark overlay */
.hh-card,
.hh-auth-intro {
  position: relative;
  z-index: 1;
}

/* === 3D tilt styling for login card === */
.hh-card {
  transform-origin: center center;
  will-change: transform;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

.hh-card--tilting {
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.75);
}

/* Media library thumbnails */
.hh-media-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hh-media-thumb img,
.hh-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay play icon for video thumbs */
.hh-media-thumb-video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* === Media Library – preview thumbnails === */
.hh-media-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--hh-border-subtle);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 55%),
    #05070d;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.hh-media-thumb:hover {
  border-color: rgba(255, 216, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 216, 0, 0.28);
}

.hh-media-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hh-media-thumb-video-icon {
  font-size: 22px;
  color: #f5f5f5;
}

.hh-media-thumb-empty {
  cursor: default;
  opacity: 0.4;
}

/* === Media preview modal === */
body.hh-modal-open {
  overflow: hidden;
}

.hh-media-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60; /* above normal panels, below any global overlays */
}

.hh-media-modal-backdrop.is-open {
  display: flex;
}

.hh-media-modal {
  background: var(--hh-panel);
  border-radius: 18px;
  border: 1px solid var(--hh-border-subtle);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
  max-width: 900px;
  width: min(900px, 94vw);
  max-height: 80vh;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hh-media-modal-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.hh-media-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hh-media-modal-media-wrapper {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.hh-media-modal-media {
  width: 100%;
  max-height: 60vh;
  display: block;
  background: #000;
}

.hh-media-modal-meta {
  font-size: 11px;
  color: var(--hh-muted);
}

.hh-media-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--hh-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
}

.hh-media-modal-close:hover {
  color: #ffffff;
}

/* --- Media Library: force Duration column visible --- */
#hh-media-table th:nth-child(4),
#hh-media-table td:nth-child(4) {
  display: table-cell !important;
  visibility: visible !important;
}

/* ---------------------------------------------------------
 * Media upload 3D progress bar
 * ------------------------------------------------------ */
.hh-upload-progress {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 216, 0, 0.1),
    rgba(10, 15, 30, 0.95)
  );
  border: 1px solid var(--hh-border-subtle);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.hh-upload-progress-header,
.hh-upload-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.hh-upload-progress-header span:first-child {
  font-weight: 500;
  color: var(--hh-text);
}

.hh-upload-progress-size {
  font-variant-numeric: tabular-nums;
  color: var(--hh-muted);
}

.hh-upload-progress-bar-outer {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 0% 0%,
    rgba(255, 255, 255, 0.18),
    rgba(0, 0, 0, 0.7)
  );
  overflow: hidden;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 12px 30px rgba(0, 0, 0, 0.75);
}

.hh-upload-progress-bar-inner {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #facc15, #f97316, #22c55e);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.8);
  transform-origin: left center;
  transition: width 0.15s ease-out;
}

@keyframes hh-upload-stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 40px 0;
  }
}

.hh-upload-progress-bar-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.45) 80%
  );
  background-size: 40px 100%;
  mix-blend-mode: screen;
  opacity: 0.75;
  animation: hh-upload-stripes 1s linear infinite;
}

.hh-upload-progress-percent {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--hh-text);
}

.hh-upload-progress-status {
  font-size: 0.8rem;
  color: var(--hh-muted);
  text-align: right;
}

/* AJAX upload message styling */
.hh-form-ajax-message {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.hh-form-ajax-message-success {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: var(--hh-text);
}

.hh-form-ajax-message-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

/* Button "busy" state */
.hh-button.hh-button-disabled {
  cursor: wait;
  opacity: 0.65;
}

/* Stacked form variant – used for sidebar / secondary cards like New playlist */
.hh-form--stacked .hh-form-row {
  flex-direction: column;
  align-items: stretch;
}

.hh-form--stacked .hh-form-field {
  width: 100%;
}

.hh-form--stacked .hh-form-input,
.hh-form--stacked .hh-form-textarea {
  width: 100%;
}

.hh-form--stacked .hh-form-actions {
  margin-top: 10px;
}

.hh-form--stacked .hh-form-actions .hh-button {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------
 * Company / panel tabs
 * (now share the same .hh-tabs/.hh-tab styles as screen view;
 *  no extra duplicate rules here)
 * ----------------------------------------------------- */

/* --------------------------------------------------
 * Screens table action buttons
 * -------------------------------------------------- */
.hh-col-actions {
  white-space: nowrap;
}

.hh-action-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
}

.hh-action-buttons .hh-inline-form {
  display: inline;
  margin: 0;
}

.hh-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  color: #f5f5f5;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.hh-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

/* View = neutral soft pill */
.hh-action-btn--view {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Edit = yellow accent to match brand */
.hh-action-btn--edit {
  background: rgba(255, 216, 0, 0.14);
  border-color: rgba(255, 216, 0, 0.45);
  color: #ffd800;
}

.hh-action-btn--edit:hover {
  background: rgba(255, 216, 0, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 216, 0, 0.55);
}

/* Delete = danger red */
.hh-action-btn--delete {
  background: rgba(255, 85, 85, 0.14);
  border-color: rgba(255, 85, 85, 0.5);
  color: #ff6b6b;
}

.hh-action-btn--delete:hover {
  background: rgba(255, 85, 85, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 85, 85, 0.55);
}

/* =========================================
 * Alert banners (success / error messages)
 * Used in admin pages (e.g. Screens, Playlists)
 * ========================================= */
.hh-alert {
  display: block;
  margin: 12px 0 16px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Success (green) */
.hh-alert-success {
  background: rgba(46, 204, 113, 0.14); /* soft green on dark bg */
  border: 1px solid rgba(46, 204, 113, 0.7);
  color: #e8ffef;
}

/* Error (red) */
.hh-alert-error {
  background: rgba(231, 76, 60, 0.16); /* soft red on dark bg */
  border: 1px solid rgba(231, 76, 60, 0.75);
  color: #ffeaea;
}

/* Info (blue) */
.hh-alert-info {
  background: rgba(52, 152, 219, 0.14); /* soft blue on dark bg */
  border: 1px solid rgba(52, 152, 219, 0.7);
  color: #e8f4ff;
}

/* Company tree: keep tenant links white, even when visited */
.hh-company-tree a,
.hh-company-tree a:visited {
  color: var(--hh-text);
}

/* Screen view: keep panels in normal flow; let the screen-specific tab rules + JS handle visibility. */
.hh-screen-view .hh-screen-tab-panels {
  position: static;
  display: block;
  margin-top: 16px;
  min-height: 0;
}

.hh-screen-view .hh-screen-tab-panel {
  position: static;
  inset: auto;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  min-height: 0;
  /* No display rule here – .hh-screen-tab-panel / .hh-screen-tab-panel-active + JS handle it */
}

/* Dashboard: "Manage screens" button */
.hh-dash-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: var(--hh-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    gap: 0.4rem;
}

.hh-dash-link-btn:hover,
.hh-dash-link-btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

/* ================================
   Screen Simulation: scrollable body
   ================================ */

#hh-screen-sim-panel {
    /* Keep the flyout inside the viewport */
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

/* Everything below the header lives in here */
#hh-screen-sim-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain; /* don't fling the whole page */

    /* Dark + blue scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: #1b6fff rgba(4, 9, 18, 0.9);
}

/* WebKit scrollbars (Chrome, Edge, etc.) */
#hh-screen-sim-body::-webkit-scrollbar {
    width: 8px;
}

#hh-screen-sim-body::-webkit-scrollbar-track {
    background: rgba(4, 9, 18, 0.85);   /* dark track */
    border-radius: 999px;
}

#hh-screen-sim-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1b6fff, #00c2ff); /* blue thumb */
    border-radius: 999px;
}

#hh-screen-sim-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2f84ff, #11d1ff);
}

/* ===== Screen Simulation playlist scroll behaviour ===== */

.hh-screen-sim-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Keep summary/meta/chips static; only the list area scrolls */
.hh-screen-sim-list-header {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--hh-muted);
}

.hh-screen-sim-list-scroll {
    margin-top: 4px;
    max-height: 260px;              /* limit height so flyout stops growing */
    overflow-y: auto;
    padding-right: 4px;             /* space for scrollbar */
}

/* Optional: tighten list styling a bit when scrollable */
.hh-screen-sim-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Dark + blue scrollbar just for the playlist list */
.hh-screen-sim-list-scroll {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #2f6dff rgba(10, 14, 28, 0.9);
}

.hh-screen-sim-list-scroll::-webkit-scrollbar {
    width: 8px;
}

.hh-screen-sim-list-scroll::-webkit-scrollbar-track {
    background: rgba(5, 8, 18, 0.9);
    border-radius: 999px;
}

.hh-screen-sim-list-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2f6dff, #55b0ff);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.hh-screen-sim-list-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3f7dff, #66c0ff);
}

/* Pending devices – action pills (match primary pill buttons) */
.hh-pending-actions-cell {
    white-space: nowrap;
}

.hh-pending-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hh-pending-form {
    margin: 0;
}

/* Base pill */
.hh-pending-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border-radius: var(--hh-radius-pill);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.14), transparent 55%)
                , linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.55));
    color: var(--hh-text);
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.08s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.hh-pending-btn:hover {
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.22), transparent 55%)
                , linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.7));
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Attach = same yellow primary pill language */
.hh-pending-btn--attach {
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.26), transparent 60%)
                , linear-gradient(135deg, #ffd800, #ffb900);
    border-color: rgba(0, 0, 0, 0.2);
    color: #111318;
}

.hh-pending-btn--attach:hover {
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.3), transparent 60%)
                , linear-gradient(135deg, #ffe54f, #ffc933);
}

/* Decline = red outline pill, still glossy */
.hh-pending-btn--decline {
    background: radial-gradient(circle at 0 0, rgba(255, 80, 80, 0.18), transparent 60%)
                , linear-gradient(135deg, rgba(40, 0, 0, 0.9), rgba(0, 0, 0, 0.9));
    border-color: rgba(255, 80, 80, 0.75);
    color: #ffb3b3;
}

.hh-pending-btn--decline:hover {
    background: radial-gradient(circle at 0 0, rgba(255, 100, 100, 0.26), transparent 60%)
                , linear-gradient(135deg, rgba(60, 0, 0, 0.95), rgba(0, 0, 0, 0.95));
    border-color: rgba(255, 120, 120, 0.95);
}

/* Lightweight styling that respects existing hh-* look without touching other pages */

.hh-settings-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.hh-settings-tab {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 14, 24, 0.85);
    color: #e5e7ff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hh-settings-tab.is-active {
    border-color: #00c8ff;
    background: rgba(0, 200, 255, 0.12);
    color: #ffffff;
}

.hh-settings-panels {
    margin-top: 8px;
}

.hh-settings-panel {
    margin-top: 8px;
}

.hh-settings-panel-title {
    font-size: 16px;
    margin-bottom: 4px;
}

.hh-settings-panel-intro {
    font-size: 13px;
    color: #9aa0b8;
    margin-bottom: 16px;
}

.hh-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.hh-settings-item {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 12px;
    background: rgba(15, 20, 32, 0.9);
}

.hh-settings-item-label {
    font-size: 14px;
    margin-bottom: 4px;
}

.hh-settings-item-desc {
    font-size: 12px;
    color: #9aa0b8;
    margin-bottom: 6px;
}

.hh-settings-item-meta {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #6f7692;
}

.hh-settings-item-placeholder {
    font-size: 12px;
    color: #cfd3ea;
}

/* New: Maintenance PIN form + flash messages */

.hh-settings-form {
    margin-top: 8px;
}

.hh-settings-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.hh-settings-form-label {
    font-size: 12px;
    color: #cfd3ea;
}

.hh-settings-input {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(3, 7, 18, 0.9);
    color: #f5f5ff;
    padding: 6px 12px;
    font-size: 13px;
    outline: none;
}

.hh-settings-input:focus {
    border-color: #00c8ff;
    box-shadow: 0 0 0 1px rgba(0, 200, 255, 0.45);
}

.hh-settings-form-help {
    font-size: 11px;
    color: #9aa0b8;
}

.hh-settings-form-row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.hh-settings-current-pin {
    font-size: 11px;
    color: #9aa0b8;
}

/* Flash messages inside settings items */
.hh-settings-flash {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.hh-settings-flash-success {
    background: rgba(0, 200, 120, 0.14);
    border: 1px solid rgba(0, 200, 120, 0.4);
    color: #c8ffdf;
}

.hh-settings-flash-error {
    background: rgba(200, 40, 60, 0.14);
    border: 1px solid rgba(200, 40, 60, 0.4);
    color: #ffd6db;
}

.hh-settings-flash-list {
    margin: 0;
    padding-left: 18px;
}

/* =========================================================
 * Media upload drag & drop block
 * Used by: /admin/media/upload.php
 * =======================================================*/

.hh-upload-dropzone-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hh-upload-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background:
    radial-gradient(circle at top left, rgba(58, 160, 255, 0.08), rgba(2, 6, 17, 0.98));
  border-radius: 0.75rem;
  padding: 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.hh-upload-dropzone:hover,
.hh-upload-dropzone:focus-within {
  border-color: var(--hh-accent, #3aa0ff);
  box-shadow: 0 0 0 1px rgba(58, 160, 255, 0.25);
  transform: translateY(-1px);
}

.hh-upload-dropzone.is-dragover {
  border-color: var(--hh-accent, #3aa0ff);
  box-shadow:
    0 0 0 1px rgba(58, 160, 255, 0.35),
    0 10px 25px rgba(0, 0, 0, 0.7);
}

.hh-upload-dropzone-icon {
  font-size: 1.75rem;
  line-height: 1;
  opacity: 0.9;
}

.hh-upload-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hh-upload-dropzone-title {
  font-weight: 600;
}

.hh-upload-dropzone-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}

.hh-upload-dropzone-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hh-upload-dropzone-hint {
  font-size: 0.8rem;
  opacity: 0.75;
}

.hh-upload-file-summary {
  font-size: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  background: rgba(5, 11, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hh-upload-file-summary-label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.hh-upload-file-summary-name {
  font-weight: 500;
  word-break: break-all;
  margin-bottom: 0.15rem;
}

.hh-upload-file-summary-meta {
  opacity: 0.85;
}

.hh-upload-file-meta-separator {
  padding: 0 0.4rem;
}

/* Visually hide the real file input but keep it accessible */
.hh-upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
