/* ==========================================================================
   AbhiHealth Unified Clinical OS & Workstation Design Tokens (clinic-ui.css)
   Phase: UI Token Normalization & Architectural Consistency
   ========================================================================== */

:root {
  --hub-primary: #2563eb;
  --hub-primary-hover: #1d4ed8;
  --hub-emergency: #dc2626;
  --hub-emergency-hover: #b91c1c;
  --hub-border-light: #e2e8f0;
  --hub-border-dark: #334155;
  --hub-card-radius: 1.25rem; /* 20px / rounded-2xl */
  --hub-btn-radius: 0.75rem;  /* 12px / rounded-xl */
  --hub-btn-height: 40px;
}

/* --------------------------------------------------------------------------
   1. HEADER SHELLS
   -------------------------------------------------------------------------- */

/* Standard Light Header Shell for Clinical / Admin Desks */
.hub-header-card-light {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--hub-card-radius);
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

@media (min-width: 640px) {
  .hub-header-card-light {
    border-radius: 1.5rem;
    padding: 1.25rem 1.5rem;
  }
}

/* Command Suites Dark Header Shell (CSSD, Biomedical, Dietetics, Infection Control, Mortuary, OT) */
.hub-header-card-dark {
  border-radius: var(--hub-card-radius);
  padding: 1.25rem 1.5rem;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
  transition: all 0.2s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .hub-header-card-dark {
    border-radius: 1.5rem;
    padding: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   2. ACTION BUTTONS (Exact 40px Height Enforced)
   -------------------------------------------------------------------------- */

.hub-btn-primary,
.hub-btn-emergency {
  height: var(--hub-btn-height) !important;
  min-height: var(--hub-btn-height) !important;
  max-height: var(--hub-btn-height) !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0 1rem !important;
  border-radius: var(--hub-btn-radius) !important;
  font-size: 0.75rem !important; /* 12px */
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease !important;
  outline: none !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}

.hub-btn-primary:active,
.hub-btn-emergency:active {
  transform: scale(0.98) !important;
}

/* Primary CTA variant */
.hub-btn-primary {
  background-color: var(--hub-primary) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.hub-btn-primary:hover {
  background-color: var(--hub-primary-hover) !important;
}

/* High-contrast inverted primary on dark header shells */
.hub-header-card-dark .hub-btn-primary.hub-btn-inverted {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.hub-header-card-dark .hub-btn-primary.hub-btn-inverted:hover {
  background-color: #f8fafc !important;
}

/* Emergency variant (Code Blue, Code Red, Immediate Triage) */
.hub-btn-emergency {
  background-color: var(--hub-emergency) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25), 0 1px 3px 0 rgba(220, 38, 38, 0.3) !important;
}

.hub-btn-emergency:hover {
  background-color: var(--hub-emergency-hover) !important;
}

/* --------------------------------------------------------------------------
   3. UNIFIED 4-COLUMN RESPONSIVE KPI GRID (.hub-kpi-grid)
   -------------------------------------------------------------------------- */

.hub-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.625rem !important;
  width: 100% !important;
}

@media (min-width: 640px) {
  .hub-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }
}

@media (min-width: 1024px) {
  .hub-kpi-grid {
    gap: 0.875rem !important;
  }
}

/* --------------------------------------------------------------------------
   4. TAB SWITCHERS (Segmented Container Track & Items)
   -------------------------------------------------------------------------- */

.hub-tab-track {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.25rem !important;
  background-color: #f1f5f9 !important; /* slate-100 */
  border: 1px solid #e2e8f0 !important; /* slate-200 */
  border-radius: var(--hub-btn-radius) !important;
  gap: 0.25rem !important;
  box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
}

.hub-tab-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  padding: 0.4375rem 0.875rem !important;
  font-size: 0.75rem !important; /* text-xs */
  font-weight: 700 !important;
  border-radius: 0.5rem !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
  border: none !important;
  white-space: nowrap !important;
  user-select: none !important;
  color: #334155 !important; /* slate-700 */
  background: transparent !important;
}

.hub-tab-item:hover {
  color: #0f172a !important; /* slate-900 */
  background-color: rgba(226, 232, 240, 0.7) !important;
}

/* Active tab state */
.hub-tab-item.active,
.hub-tab-item[aria-selected="true"],
.hub-tab-item.hub-tab-active {
  background-color: #2563eb !important; /* blue-600 */
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 2px 0 rgba(37, 99, 235, 0.2) !important;
}

.hub-tab-item.active-light {
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
}
