:root {
  --bg: #EEF3FB;
  --panel: #FFFFFF;
  --panel-2: #E3ECFB;
  --cream: #1E2A3D;
  --cream-dim: #6E7E94;
  --gold: #3D6FCB;
  --sage: #2FA66B;
  --rust: #E0824A;
  --line: rgba(30,42,61,0.12);
  --radius: 14px;
}

#rehat-portal-wrapper {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  line-height: 1.55;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

#rehat-portal-wrapper h1, 
#rehat-portal-wrapper h2, 
#rehat-portal-wrapper h3, 
#rehat-portal-wrapper h4 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cream);
}

#rehat-portal-wrapper .mono { 
  font-family: 'JetBrains Mono', monospace; 
}

/* ---------- Portal Inner Navigation ---------- */
#rehat-portal-wrapper .portal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

#rehat-portal-wrapper .portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

#rehat-portal-wrapper .brand-logo {
  height: 28px;
  width: auto;
}

#rehat-portal-wrapper .brand-text {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
}

#rehat-portal-wrapper .nav-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

#rehat-portal-wrapper .tab-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream-dim);
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}

#rehat-portal-wrapper .tab-btn.active {
  background: var(--gold);
  color: #FFFFFF;
  font-weight: 600;
}

#rehat-portal-wrapper .user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

#rehat-portal-wrapper .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--line);
}

/* ---------- Layout Components ---------- */
#rehat-portal-wrapper .view-section {
  display: none;
}

#rehat-portal-wrapper .view-section.active {
  display: block;
}

#rehat-portal-wrapper .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

#rehat-portal-wrapper .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

#rehat-portal-wrapper .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

#rehat-portal-wrapper .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  #rehat-portal-wrapper .portal-nav {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    text-align: center;
  }
  #rehat-portal-wrapper .nav-tabs {
    justify-content: center;
  }
  #rehat-portal-wrapper .grid-2, 
  #rehat-portal-wrapper .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Forms & Inputs ---------- */
#rehat-portal-wrapper label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--cream-dim);
  margin-bottom: 6px;
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#rehat-portal-wrapper input, 
#rehat-portal-wrapper select, 
#rehat-portal-wrapper textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

#rehat-portal-wrapper input:focus, 
#rehat-portal-wrapper select:focus, 
#rehat-portal-wrapper textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

#rehat-portal-wrapper .btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--gold);
  color: #FFFFFF;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform .15s ease, background .2s;
  text-align: center;
}

#rehat-portal-wrapper .btn:hover {
  transform: translateY(-1px);
  background: #2b5cb5;
  text-decoration: none;
}

#rehat-portal-wrapper .btn.secondary {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}

#rehat-portal-wrapper .btn.secondary:hover {
  background: var(--bg);
}

#rehat-portal-wrapper .btn.small {
  padding: 6px 12px;
  font-size: 11px;
}

/* ---------- Alerts/Messages ---------- */
#rehat-portal-wrapper .msg {
  margin-top: 14px;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
}

#rehat-portal-wrapper .msg.success {
  background: rgba(143, 175, 150, 0.15);
  color: var(--sage);
  border: 1px solid rgba(143, 175, 150, 0.3);
}

#rehat-portal-wrapper .msg.error {
  background: rgba(192, 122, 87, 0.15);
  color: var(--rust);
  border: 1px solid rgba(192, 122, 87, 0.3);
}

/* ---------- Tables ---------- */
#rehat-portal-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#rehat-portal-wrapper th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cream-dim);
  padding: 12px 10px;
  border-bottom: 2px solid var(--line);
}

#rehat-portal-wrapper td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

#rehat-portal-wrapper tr:last-child td {
  border-bottom: none;
}

#rehat-portal-wrapper .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  font-weight: 600;
}

#rehat-portal-wrapper .pill.pending { background: rgba(224, 130, 74, 0.15); color: var(--rust); }
#rehat-portal-wrapper .pill.approved { background: rgba(47, 166, 107, 0.15); color: var(--sage); }
#rehat-portal-wrapper .pill.reconciled { background: rgba(61, 111, 203, 0.15); color: var(--gold); }
#rehat-portal-wrapper .pill.cancelled { background: rgba(110, 126, 148, 0.15); color: var(--cream-dim); }

#rehat-portal-wrapper .empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--cream-dim);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Dashboard Nested Tabs ---------- */
#rehat-portal-wrapper .dash-subtabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 8px;
  overflow-x: auto;
}

#rehat-portal-wrapper .subtab-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--cream-dim);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all .2s;
  white-space: nowrap;
}

#rehat-portal-wrapper .subtab-btn.active {
  color: var(--gold);
  background: var(--panel-2);
}

/* ---------- Hero Section ---------- */
#rehat-portal-wrapper .hero {
  padding: 48px 0 24px;
}

#rehat-portal-wrapper .hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  margin-bottom: 14px;
}

#rehat-portal-wrapper .hero h1 span.accent {
  color: var(--gold);
  font-style: italic;
}

#rehat-portal-wrapper .hero p {
  max-width: 50ch;
  color: var(--cream-dim);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ---------- Steps ---------- */
#rehat-portal-wrapper .step-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

#rehat-portal-wrapper .step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-weight: 700;
}

#rehat-portal-wrapper .step-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

#rehat-portal-wrapper .step-card p {
  font-size: 13px;
  color: var(--cream-dim);
}

/* ---------- KPI Cards ---------- */
#rehat-portal-wrapper .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  #rehat-portal-wrapper .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  #rehat-portal-wrapper .kpi-grid {
    grid-template-columns: 1fr;
  }
}

#rehat-portal-wrapper .kpi-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

#rehat-portal-wrapper .kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--cream-dim);
  letter-spacing: 0.05em;
}

#rehat-portal-wrapper .kpi-val {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  margin-top: 6px;
}

#rehat-portal-wrapper .kpi-change {
  font-size: 11px;
  color: var(--sage);
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

/* ---------- Ticket ---------- */
#rehat-portal-wrapper .ticket {
  position: relative;
  margin-top: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
}

#rehat-portal-wrapper .ticket-main {
  padding: 20px;
}

#rehat-portal-wrapper .ticket-side {
  padding: 20px;
  border-left: 1px dashed rgba(30,42,61,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  background: var(--panel-2);
}

#rehat-portal-wrapper .ticket::before, 
#rehat-portal-wrapper .ticket::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
  right: 130px;
  z-index: 2;
  border: 1px solid var(--line);
}

#rehat-portal-wrapper .ticket::before { top: -11px; }
#rehat-portal-wrapper .ticket::after { bottom: -11px; }

@media (max-width: 560px) {
  #rehat-portal-wrapper .ticket { grid-template-columns: 1fr; }
  #rehat-portal-wrapper .ticket-side { border-left: none; border-top: 1px dashed rgba(30,42,61,0.18); }
  #rehat-portal-wrapper .ticket::before, 
  #rehat-portal-wrapper .ticket::after { display: none; }
}

/* ---------- FAQ Accordion ---------- */
#rehat-portal-wrapper .accordion-item {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

#rehat-portal-wrapper .accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

#rehat-portal-wrapper .accordion-content {
  display: none;
  padding-top: 8px;
  font-size: 13px;
  color: var(--cream-dim);
}

#rehat-portal-wrapper .accordion-item.active .accordion-content {
  display: block;
}

/* ---------- Asset Card ---------- */
#rehat-portal-wrapper .asset-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

#rehat-portal-wrapper .asset-preview {
  height: 120px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#rehat-portal-wrapper .asset-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--cream);
  color: #FFF;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

#rehat-portal-wrapper .asset-info {
  padding: 14px;
}

#rehat-portal-wrapper .asset-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

#rehat-portal-wrapper .asset-desc {
  font-size: 12px;
  color: var(--cream-dim);
  margin-bottom: 12px;
}

/* ---------- Dashboard Sub-Views Toggle ---------- */
#rehat-portal-wrapper .dash-view {
  display: none;
}
#rehat-portal-wrapper .dash-view.active {
  display: block;
}

/* ---------- Custom Logout Modal ---------- */
#rehat-portal-wrapper .rehat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#rehat-portal-wrapper .rehat-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 42, 61, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}

#rehat-portal-wrapper .rehat-modal-container {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(30, 42, 61, 0.16);
  z-index: 10;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

#rehat-portal-wrapper .rehat-modal.active .rehat-modal-container {
  transform: scale(1);
  opacity: 1;
}

#rehat-portal-wrapper .rehat-modal-header h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-family: 'Fraunces', serif;
  color: var(--cream);
}

#rehat-portal-wrapper .rehat-modal-body p {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--cream-dim);
  line-height: 1.5;
}

#rehat-portal-wrapper .rehat-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

#rehat-portal-wrapper .rehat-modal-footer .btn {
  margin: 0;
  padding: 10px 22px;
  font-size: 13px;
  border-radius: 8px;
}

#rehat-portal-wrapper .rehat-modal-footer #rehat-logout-confirm {
  background: var(--rust);
}

#rehat-portal-wrapper .rehat-modal-footer #rehat-logout-confirm:hover {
  background: #d47035;
}
