/* ===== HR TOOLS PAGE ===== */

/* ── Search & Filter Bar ── */
.hrt-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hrt-search {
  flex: 1;
  min-width: 220px;
  padding: 10px 16px 10px 40px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.92rem;
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 14px center;
  transition: border-color 0.2s;
  color: var(--text-primary);
}

.hrt-search:focus {
  outline: none;
  border-color: var(--sidebar-active);
}

.hrt-filter-btn {
  padding: 9px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hrt-filter-btn:hover {
  border-color: var(--sidebar-active);
  color: var(--sidebar-active);
}

.hrt-filter-btn.active {
  background: var(--sidebar-active);
  color: #fff;
  border-color: var(--sidebar-active);
}

/* ── Category Sections ── */
.hrt-category {
  margin-bottom: 32px;
}

.hrt-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.hrt-category-icon {
  font-size: 1.4rem;
}

.hrt-category-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hrt-category-count {
  font-size: 0.75rem;
  background: #e2e8f0;
  color: var(--text-secondary);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* ── Tool Cards Grid ── */
.hrt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.hrt-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
}

.hrt-card:hover {
  border-color: var(--sidebar-active);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.hrt-card.expanded {
  grid-column: 1 / -1;
  cursor: default;
}

.hrt-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.hrt-card-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.hrt-card-info {
  flex: 1;
  min-width: 0;
}

.hrt-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hrt-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.hrt-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.hrt-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eff6ff;
  color: #3b82f6;
  font-weight: 600;
}

.hrt-tag--green { background: #dcfce7; color: #166534; }
.hrt-tag--amber { background: #fef9c3; color: #854d0e; }
.hrt-tag--red   { background: #fee2e2; color: #991b1b; }
.hrt-tag--purple { background: #f3e8ff; color: #7c3aed; }

.hrt-card-chevron {
  font-size: 1rem;
  color: var(--text-secondary);
  transition: transform 0.3s;
  padding-right: 4px;
}

.hrt-card.expanded .hrt-card-chevron {
  transform: rotate(180deg);
}

/* ── Expanded Tool Body ── */
.hrt-card-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border-color);
}

.hrt-card.expanded .hrt-card-body {
  display: block;
  animation: hrtFadeIn 0.3s ease;
}

@keyframes hrtFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Calculator Forms ── */
.hrt-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

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

.hrt-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hrt-field input,
.hrt-field select {
  padding: 9px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: #f8fafc;
  transition: border-color 0.2s;
}

.hrt-field input:focus,
.hrt-field select:focus {
  outline: none;
  border-color: var(--sidebar-active);
  background: #fff;
}

.hrt-calc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--sidebar-active);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}

.hrt-calc-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ── Result Display ── */
.hrt-result {
  display: none;
  margin-top: 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px;
}

.hrt-result.show {
  display: block;
  animation: hrtFadeIn 0.3s ease;
}

.hrt-result-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sidebar-active);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.hrt-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.hrt-result-item {
  text-align: center;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.hrt-result-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--sidebar-active);
}

.hrt-result-value.green  { color: #16a34a; }
.hrt-result-value.amber  { color: #d97706; }
.hrt-result-value.red    { color: #dc2626; }
.hrt-result-value.purple { color: #7c3aed; }

.hrt-result-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Chart Container ── */
.hrt-chart-wrap {
  display: none;
  margin-top: 14px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  padding: 16px;
  height: 280px;
}

.hrt-chart-wrap.show {
  display: block;
  animation: hrtFadeIn 0.3s ease;
}

.hrt-chart-wrap canvas {
  max-height: 240px;
}

/* ── Reference Tables ── */
.hrt-ref-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.85rem;
}

.hrt-ref-table th {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hrt-ref-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.hrt-ref-table tr:hover td {
  background: #f8fafc;
}

.hrt-ref-table .highlight {
  font-weight: 700;
  color: var(--sidebar-active);
}

/* ── Info Box ── */
.hrt-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 0.84rem;
  color: #166534;
  line-height: 1.5;
}

.hrt-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.hrt-info--amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #854d0e;
}

.hrt-info--blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* ── State Selector ── */
.hrt-state-select {
  padding: 9px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #f8fafc;
  color: var(--text-primary);
  min-width: 200px;
  margin-top: 12px;
}

.hrt-state-select:focus {
  outline: none;
  border-color: var(--sidebar-active);
}

/* ── Hidden utility ── */
.hrt-hidden {
  display: none !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hrt-grid {
    grid-template-columns: 1fr;
  }
  .hrt-form {
    grid-template-columns: 1fr;
  }
  .hrt-result-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hrt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
