/* ==========================================================================
   Reset & base layout
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--hg-font);
  color: var(--hg-gray-900);
  background: var(--hg-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

/* Default icon sizing — every icon from icons.js carries class="ic".
   Contexts that need a different size (e.g. the sidebar logo mark, or the
   modal close button) override this locally. */
.ic { width: 18px; height: 18px; flex-shrink: 0; }

.hg-app {
  display: grid;
  grid-template-columns: var(--hg-sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.hg-sidebar {
  background: var(--hg-navy-950);
  color: #cfd8e8;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.hg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
}
.hg-logo .mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--hg-gold-500), var(--hg-gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hg-navy-950);
  font-weight: 800;
  font-size: 18px;
}
.hg-logo .word {
  line-height: 1.05;
}
.hg-logo .word .top {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.hg-logo .word .bottom {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--hg-gold-500);
  font-weight: 700;
}

.hg-new-appt-btn {
  width: 100%;
  background: #fff;
  color: var(--hg-navy-950);
  border: none;
  border-radius: var(--hg-radius-md);
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.hg-new-appt-btn:hover { background: #f1f1f1; }

.hg-nav-group + .hg-nav-group { margin-top: 18px; }
.hg-nav-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #6a7b9c;
  padding: 0 10px 8px;
}
.hg-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--hg-radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #b9c4da;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  position: relative;
}
.hg-nav-item .ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.hg-nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.hg-nav-item.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.hg-nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--hg-teal-400);
}
.hg-nav-badge {
  margin-left: auto;
  background: var(--hg-amber-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--hg-radius-pill);
  padding: 1px 7px;
}

.hg-sidebar-spacer { flex: 1; }

.hg-help-card {
  background: rgba(255,255,255,0.06);
  border-radius: var(--hg-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.hg-help-card .dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--hg-gold-500);
  color: var(--hg-navy-950);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.hg-help-card .title { font-size: 13px; font-weight: 700; color: #fff; }
.hg-help-card .sub { font-size: 11px; color: #92a0bc; }

.hg-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.hg-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--hg-teal-500);
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.hg-user .name { font-size: 13px; font-weight: 700; color: #fff; }
.hg-user .role { font-size: 11px; color: #92a0bc; }
.hg-user .more { margin-left: auto; color: #92a0bc; }

/* ---------- Main column ---------- */
.hg-main { min-width: 0; display: flex; flex-direction: column; }

.hg-header {
  height: var(--hg-header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: var(--hg-surface);
  border-bottom: 1px solid var(--hg-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.hg-location {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--hg-radius-sm);
  cursor: pointer;
  position: relative;
}
.hg-location:hover { background: var(--hg-gray-50); }
.hg-location .ic {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--hg-teal-50);
  display: flex; align-items: center; justify-content: center;
  color: var(--hg-teal-500);
}
.hg-location .lbl { font-size: 11px; color: var(--hg-gray-500); }
.hg-location .val { font-size: 14px; font-weight: 700; }

.hg-search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hg-gray-50);
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius-md);
  padding: 9px 14px;
  color: var(--hg-gray-500);
  font-size: 14px;
}

.hg-header-spacer { flex: 1; }

.hg-control-centre {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hg-gray-700);
  background: var(--hg-gray-50);
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius-md);
  padding: 9px 14px;
}
.hg-control-centre .ic { width: 16px; height: 16px; color: var(--hg-gold-600); }
.hg-control-centre:hover { background: var(--hg-gray-100); }

/* Header dropdown (location switcher) */
.hg-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--hg-surface);
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius-md);
  box-shadow: var(--hg-shadow-md);
  padding: 6px;
  z-index: 30;
}
.hg-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--hg-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--hg-gray-700);
  border: none;
  background: transparent;
}
.hg-dropdown-item:hover { background: var(--hg-gray-50); }
.hg-dropdown-item.active { color: var(--hg-teal-500); background: var(--hg-teal-50); }

/* Opens upward — used for the sidebar's account menu, anchored near the
   bottom of the viewport where a downward dropdown would get clipped. */
.hg-dropdown-up { top: auto; bottom: calc(100% + 6px); }

/* Control centre header extras */
.hg-super-badge {
  background: var(--hg-navy-950);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: var(--hg-radius-sm);
}
.hg-env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hg-gray-700);
  background: var(--hg-gray-50);
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius-pill);
  padding: 5px 12px;
}
.dot-ok {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--hg-green-500);
  display: inline-block;
}

/* Control centre sidebar extras */
.hg-workspace-card {
  background: rgba(255,255,255,0.06);
  border-radius: var(--hg-radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.hg-workspace-card .lbl { font-size: 11px; color: #92a0bc; margin-bottom: 2px; }
.hg-workspace-card .val { font-size: 14px; font-weight: 700; color: #fff; }
.hg-platform-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--hg-radius-md);
  margin-bottom: 14px;
}
.hg-platform-status .title { font-size: 12px; font-weight: 700; color: #fff; }
.hg-platform-status .sub { font-size: 11px; color: #92a0bc; }

.hg-icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--hg-radius-md);
  border: 1px solid var(--hg-border);
  background: var(--hg-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--hg-gray-600);
}
.hg-icon-btn .count {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--hg-red-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.hg-btn-primary {
  background: var(--hg-navy-950);
  color: #fff;
  border: none;
  border-radius: var(--hg-radius-md);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hg-btn-primary:hover { background: var(--hg-navy-800); }

.hg-content {
  padding: 28px;
  flex: 1;
}

.hg-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hg-gray-500);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hg-page-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}
.hg-page-sub {
  color: var(--hg-gray-500);
  font-size: 14px;
  margin-bottom: 20px;
}
.hg-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 980px) {
  .hg-app { grid-template-columns: 1fr; }
  .hg-sidebar { display: none; }
}
