:root {
  --ht-green: #198754;
  --ht-green-dark: #146c43;
  --ht-green-soft: #d8efe3;
  --ht-green-softer: #eef8f2;
  --ht-bg: #e8ecef;
  --ht-card: #ffffff;
  --ht-ink: #1c2430;
  --ht-muted: #6c757d;
  --ht-line: #d9dee3;
  --ht-blue: #0d6efd;
  --ht-blue-soft: #e7f0ff;
  --ht-orange: #e67e22;
  --ht-orange-soft: #fff1e4;
  --ht-red-soft: #f8d7da;
  --ht-red: #842029;
  --ht-amber-soft: #fff3cd;
  --ht-amber: #997404;
  --ht-radius: 10px;
  --ht-shadow: 0 1px 2px rgba(16, 24, 32, 0.06);
  --ht-side: 260px;
  --ht-sans: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body.ht-body, body {
  margin: 0;
  background: var(--ht-bg);
  color: var(--ht-ink);
  font-family: var(--ht-sans);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--ht-green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.ht-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--ht-line);
}

.ht-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ht-ink);
  font-weight: 700;
  text-decoration: none;
}

.ht-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ht-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ht-brand-sep { color: var(--ht-muted); font-weight: 500; }
.ht-brand-sub { color: var(--ht-muted); font-weight: 600; }

.ht-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ht-topbar-right > a {
  color: var(--ht-ink);
  font-weight: 600;
  text-decoration: none;
}

.ht-userchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ht-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #c5cdd4;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.ht-app { min-height: calc(100vh - 54px); }
.ht-shell {
  display: grid;
  grid-template-columns: var(--ht-side) minmax(0, 1fr);
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 18px 40px;
}

.ht-sidebar { display: flex; flex-direction: column; gap: 12px; }

.ht-side-card {
  background: var(--ht-card);
  border: 1px solid var(--ht-line);
  border-radius: var(--ht-radius);
  box-shadow: var(--ht-shadow);
  overflow: hidden;
}

.ht-side-heading {
  margin: 0;
  padding: 10px 14px;
  background: #edf2f6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3b4754;
}

.ht-side-heading .fa { margin-right: 8px; color: #5b6b7a; }

.ht-side-links { display: flex; flex-direction: column; padding: 6px 0; }

.ht-side-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: #4a5560;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.ht-side-links a .fa { width: 1.1em; text-align: center; }

.ht-side-links a:hover { background: #f6f8f9; }

.ht-side-links a.is-active {
  background: var(--ht-green-softer);
  border-left-color: var(--ht-green-dark);
  color: var(--ht-green-dark);
  font-weight: 700;
}

.ht-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.ht-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.ht-page-head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.ht-page-head p { margin: 0; color: var(--ht-muted); max-width: 46rem; }

.ht-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ht-filter-group { display: flex; flex-direction: column; gap: 4px; }
.ht-filter-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ht-muted);
}

.ht-filter-group select,
.ht-form input,
.ht-form select {
  border: 1px solid #cfd6dc;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font: inherit;
  min-width: 150px;
}

.ht-card {
  background: var(--ht-card);
  border: 1px solid var(--ht-line);
  border-radius: var(--ht-radius);
  box-shadow: var(--ht-shadow);
  padding: 18px 20px 20px;
}

.ht-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ht-card h2 { margin: 0; font-size: 20px; }
.ht-card-sub, .ht-help { color: var(--ht-muted); margin: 0 0 14px; }

.ht-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.ht-metric { display: flex; align-items: center; gap: 12px; }

.ht-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.ht-metric.is-used .ht-metric-icon { background: var(--ht-green-soft); color: var(--ht-green-dark); }
.ht-metric.is-used .ht-metric-value { color: var(--ht-green); }
.ht-metric.is-remaining .ht-metric-icon { background: var(--ht-blue-soft); color: var(--ht-blue); }
.ht-metric.is-remaining .ht-metric-value { color: var(--ht-blue); }
.ht-metric.is-entitlement .ht-metric-icon { background: var(--ht-orange-soft); color: var(--ht-orange); }
.ht-metric.is-entitlement .ht-metric-value { color: var(--ht-orange); }

.ht-metric-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ht-muted);
}

.ht-metric-value { font-size: 22px; font-weight: 800; }

.ht-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ht-muted);
  margin-bottom: 6px;
}

.ht-progress-track {
  height: 10px;
  background: #e6ebe8;
  border-radius: 999px;
  overflow: hidden;
}

.ht-progress-fill {
  height: 100%;
  background: var(--ht-green);
  border-radius: inherit;
}

.ht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.ht-btn-primary { background: var(--ht-green); color: #fff; }
.ht-btn-primary:hover { background: var(--ht-green-dark); text-decoration: none; color: #fff; }
.ht-btn-dark { background: #343a40; color: #fff; }
.ht-btn-ghost { background: #fff; border-color: #cfd6dc; color: var(--ht-ink); }
.ht-btn-danger { background: #dc3545; color: #fff; }

.ht-table-wrap { overflow-x: auto; }

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

.ht-table th,
.ht-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eef1f4;
  vertical-align: middle;
}

.ht-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c6770;
}

.ht-empty { color: var(--ht-muted); text-align: center !important; padding: 22px 8px !important; }

.ht-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ht-pill.is-complete { background: var(--ht-green-soft); color: #0f5132; }
.ht-pill.is-approved { background: var(--ht-amber-soft); color: var(--ht-amber); }
.ht-pill.is-pending { background: var(--ht-red-soft); color: var(--ht-red); }

.ht-col-action { width: 64px; text-align: center !important; }

.ht-cog {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5dbe0;
  border-radius: 6px;
  color: #4a5560;
  background: #fff;
}

.ht-cog:hover { border-color: var(--ht-green); color: var(--ht-green); text-decoration: none; }

.ht-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ht-field { display: flex; flex-direction: column; gap: 4px; }
.ht-field label { font-size: 13px; font-weight: 700; }
.ht-field-wide { grid-column: 1 / -1; }
.ht-field input, .ht-field select { width: 100%; min-width: 0; }

.ht-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.ht-form-actions-right { display: flex; gap: 8px; margin-left: auto; }

.ht-flash-wrap { margin-bottom: 4px; }
.ht-flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.ht-flash.is-success { background: var(--ht-green-soft); color: #0f5132; }
.ht-flash.is-error { background: var(--ht-red-soft); color: var(--ht-red); }

.ht-simple-list { margin: 0; padding-left: 1.2rem; }
.ht-simple-list li { margin: 8px 0; }

.ht-dl { display: grid; gap: 10px; margin: 0; }
.ht-dl div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; }
.ht-dl dt { color: var(--ht-muted); font-weight: 700; }
.ht-dl dd { margin: 0; }

.ht-cal-dow, .ht-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.ht-cal-dow { margin-bottom: 8px; color: var(--ht-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ht-cal-cell {
  min-height: 78px;
  border: 1px solid #e4e8ec;
  border-radius: 8px;
  padding: 6px;
  background: #fafbfc;
}

.ht-cal-cell.is-pad { background: transparent; border-color: transparent; }
.ht-cal-cell.is-complete { background: var(--ht-green-softer); border-color: #b7dfc8; }
.ht-cal-cell.is-approved { background: #fff8e6; border-color: #f0dfb0; }
.ht-cal-cell.is-pending { background: #fdecee; border-color: #f0c4c8; }
.ht-cal-num { font-weight: 700; display: block; }
.ht-cal-tag { display: block; margin-top: 6px; font-size: 11px; font-weight: 700; color: #3b4754; }

@media (max-width: 900px) {
  .ht-shell { grid-template-columns: 1fr; padding: 12px; }
  .ht-metrics { grid-template-columns: 1fr; }
  .ht-form-grid { grid-template-columns: 1fr; }
  .ht-page-head { flex-direction: column; }
  .ht-dl div { grid-template-columns: 1fr; }
}
