/* ============================================================
   NHRD Support Module - Custom Styles
   Matches the institutional government portal aesthetic
   ============================================================ */

:root {
  --nhrd-blue: #1a5fa8;
  --nhrd-blue-light: #2472c8;
  --nhrd-blue-pale: #e8f0fb;
  --nhrd-green: #2e7d32;
  --nhrd-green-light: #e8f5e9;
  --nhrd-amber: #e65100;
  --nhrd-amber-light: #fff3e0;
  --nhrd-red: #c62828;
  --nhrd-red-light: #ffebee;
  --nhrd-purple: #6a1b9a;
  --nhrd-purple-light: #f3e5f5;
  --nhrd-grey: #f5f5f5;
  --nhrd-grey-border: #dee2e6;
  --nhrd-text: #212529;
  --nhrd-text-muted: #6c757d;
  --nhrd-gold: #b8860b;
  --nhrd-header-bg: #ffffff;
  --nhrd-nav-bg: #e9ecef;
  --nhrd-footer-bg: #e9ecef;
}

/* ---- General ---- */
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--nhrd-text);
  background: #f0f2f5;
}

a {
  color: var(--nhrd-blue);
}
a:hover {
  color: var(--nhrd-blue-light);
}

/* ---- Header ---- */
.nhrd-header {
  background: var(--nhrd-header-bg);
  border-bottom: 1px solid var(--nhrd-grey-border);
  padding: 10px 0;
}

.nhrd-header .crest img {
  height: 60px;
}

.nhrd-header .site-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--nhrd-blue);
  line-height: 1.2;
}

.nhrd-header .site-subtitle {
  font-size: 11px;
  color: var(--nhrd-text-muted);
  letter-spacing: 0.5px;
}

.nhrd-header .utility-btns .btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 3px;
}

/* ---- Primary Navigation ---- */
.nhrd-navbar {
  background: var(--nhrd-nav-bg);
  border-bottom: 2px solid var(--nhrd-blue);
  padding: 0;
}

.nhrd-navbar .navbar-nav .nav-link {
  color: var(--nhrd-text) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-right: 1px solid var(--nhrd-grey-border);
  border-radius: 0;
}

.nhrd-navbar .navbar-nav .nav-link:hover {
  background: #d0d7e3;
  color: var(--nhrd-blue) !important;
}

.nhrd-navbar .navbar-nav .nav-link.active {
  background: var(--nhrd-blue);
  color: #fff !important;
}

/* ---- Footer ---- */
.nhrd-footer {
  background: var(--nhrd-footer-bg);
  border-top: 1px solid var(--nhrd-grey-border);
  padding: 15px 0;
  font-size: 11px;
  color: var(--nhrd-text-muted);
  margin-top: 40px;
}

/* ---- Page wrapper ---- */
.nhrd-page {
  background: #fff;
  border: 1px solid var(--nhrd-grey-border);
  border-radius: 3px;
  margin: 20px auto;
  max-width: 1140px;
}

.nhrd-page-header {
  background: var(--nhrd-blue-pale);
  border-bottom: 1px solid var(--nhrd-grey-border);
  padding: 14px 20px;
}

.nhrd-page-header h4 {
  color: var(--nhrd-blue);
  font-weight: 700;
  margin: 0;
  font-size: 16px;
}

.nhrd-page-header .breadcrumb {
  margin: 4px 0 0;
  font-size: 12px;
  background: transparent;
  padding: 0;
}

.nhrd-page-body {
  padding: 22px;
}

/* ---- Section headings ---- */
.nhrd-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--nhrd-blue);
  padding: 6px 12px;
  margin: 0 0 14px;
  border-radius: 2px;
  letter-spacing: 0.3px;
}

/* ---- Summary Tiles ---- */
.nhrd-tile {
  border: 1px solid var(--nhrd-grey-border);
  border-radius: 3px;
  padding: 14px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.nhrd-tile:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.nhrd-tile .tile-count {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.nhrd-tile .tile-label {
  font-size: 11px;
  color: var(--nhrd-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.nhrd-tile.draft       { border-top: 3px solid #9e9e9e; }
.nhrd-tile.submitted   { border-top: 3px solid var(--nhrd-blue); }
.nhrd-tile.review      { border-top: 3px solid var(--nhrd-amber); }
.nhrd-tile.approved    { border-top: 3px solid var(--nhrd-green); }
.nhrd-tile.rejected    { border-top: 3px solid var(--nhrd-red); }
.nhrd-tile.draft .tile-count     { color: #9e9e9e; }
.nhrd-tile.submitted .tile-count { color: var(--nhrd-blue); }
.nhrd-tile.review .tile-count    { color: var(--nhrd-amber); }
.nhrd-tile.approved .tile-count  { color: var(--nhrd-green); }
.nhrd-tile.rejected .tile-count  { color: var(--nhrd-red); }

/* ---- Status Badges ---- */
.badge-draft      { background: #9e9e9e; color: #fff; }
.badge-submitted  { background: var(--nhrd-blue); color: #fff; }
.badge-review     { background: var(--nhrd-amber); color: #fff; }
.badge-approval   { background: var(--nhrd-purple); color: #fff; }
.badge-approved   { background: var(--nhrd-green); color: #fff; }
.badge-rejected   { background: var(--nhrd-red); color: #fff; }
.badge-info       { background: #0288d1; color: #fff; }

.status-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Priority badges */
.priority-critical { background: var(--nhrd-red); color: #fff; }
.priority-high     { background: var(--nhrd-amber); color: #fff; }
.priority-medium   { background: var(--nhrd-gold); color: #fff; }
.priority-low      { background: var(--nhrd-green); color: #fff; }

/* ---- Buttons ---- */
.btn-nhrd-primary {
  background: var(--nhrd-blue);
  border: 1px solid var(--nhrd-blue);
  color: #fff;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 3px;
}
.btn-nhrd-primary:hover {
  background: var(--nhrd-blue-light);
  border-color: var(--nhrd-blue-light);
  color: #fff;
}
.btn-nhrd-secondary {
  background: #fff;
  border: 1px solid var(--nhrd-grey-border);
  color: var(--nhrd-text);
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 3px;
}
.btn-nhrd-secondary:hover {
  background: var(--nhrd-grey);
}
.btn-nhrd-success {
  background: var(--nhrd-green);
  border: 1px solid var(--nhrd-green);
  color: #fff;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 3px;
}
.btn-nhrd-danger {
  background: var(--nhrd-red);
  border: 1px solid var(--nhrd-red);
  color: #fff;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 3px;
}

/* ---- Progress Steps ---- */
.nhrd-steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--nhrd-grey-border);
}

.nhrd-step {
  display: flex;
  align-items: center;
  flex: 1;
}

.nhrd-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ccc;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.nhrd-step.active .nhrd-step-circle {
  background: var(--nhrd-blue);
}

.nhrd-step.completed .nhrd-step-circle {
  background: var(--nhrd-green);
}

.nhrd-step-label {
  font-size: 11px;
  margin-left: 8px;
  color: var(--nhrd-text-muted);
  white-space: nowrap;
}

.nhrd-step.active .nhrd-step-label {
  color: var(--nhrd-blue);
  font-weight: 600;
}

.nhrd-step.completed .nhrd-step-label {
  color: var(--nhrd-green);
}

.nhrd-step-line {
  flex: 1;
  height: 2px;
  background: #ccc;
  margin: 0 8px;
}

.nhrd-step-line.done {
  background: var(--nhrd-green);
}

/* ---- Form elements ---- */
.nhrd-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--nhrd-text);
  margin-bottom: 3px;
}

.nhrd-form .form-control, .nhrd-form .form-select {
  font-size: 13px;
  border-radius: 2px;
  border-color: #ccc;
}

.nhrd-form .form-control:focus, .nhrd-form .form-select:focus {
  border-color: var(--nhrd-blue);
  box-shadow: 0 0 0 0.15rem rgba(26,95,168,0.15);
}

.nhrd-form .required-star {
  color: var(--nhrd-red);
  margin-left: 2px;
}

.nhrd-form .field-hint {
  font-size: 11px;
  color: var(--nhrd-text-muted);
  margin-top: 2px;
}

.nhrd-form .form-check-label {
  font-size: 13px;
  font-weight: normal;
}

/* ---- AI Panel ---- */
.ai-panel {
  background: linear-gradient(135deg, #e8f0fb 0%, #f0f4ff 100%);
  border: 1px solid #b3c9f0;
  border-radius: 4px;
  padding: 14px;
}

.ai-panel .ai-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--nhrd-blue);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-panel .ai-item {
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.ai-panel .ai-item:last-child {
  border-bottom: none;
}

.ai-score-bar {
  height: 8px;
  background: #c8d8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.ai-score-fill {
  height: 100%;
  background: var(--nhrd-blue);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.ai-warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px;
  color: #5d4037;
  margin: 4px 0;
  display: flex;
  gap: 6px;
}

.ai-success-item {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px;
  color: #1b5e20;
  margin: 4px 0;
  display: flex;
  gap: 6px;
}

/* ---- Timeline ---- */
.nhrd-timeline {
  position: relative;
  padding-left: 24px;
}

.nhrd-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.nhrd-timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.nhrd-timeline-item .tl-dot {
  position: absolute;
  left: -20px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9e9e9e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #9e9e9e;
}

.nhrd-timeline-item.completed .tl-dot { background: var(--nhrd-green); box-shadow: 0 0 0 1px var(--nhrd-green); }
.nhrd-timeline-item.active .tl-dot { background: var(--nhrd-blue); box-shadow: 0 0 0 1px var(--nhrd-blue); }
.nhrd-timeline-item.warning .tl-dot { background: var(--nhrd-amber); box-shadow: 0 0 0 1px var(--nhrd-amber); }

.tl-content {
  background: #fff;
  border: 1px solid var(--nhrd-grey-border);
  border-radius: 3px;
  padding: 10px 14px;
}

.tl-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
}

.tl-meta {
  font-size: 11px;
  color: var(--nhrd-text-muted);
}

.tl-body {
  font-size: 12px;
  margin-top: 6px;
  color: #444;
}

/* ---- Table ---- */
.nhrd-table {
  font-size: 13px;
  border-collapse: collapse;
  width: 100%;
}

.nhrd-table th {
  background: var(--nhrd-nav-bg);
  border: 1px solid var(--nhrd-grey-border);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nhrd-text);
}

.nhrd-table td {
  border: 1px solid var(--nhrd-grey-border);
  padding: 8px 10px;
  vertical-align: middle;
}

.nhrd-table tbody tr:hover {
  background: var(--nhrd-blue-pale);
  cursor: pointer;
}

/* ---- Detail panel ---- */
.detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--nhrd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.detail-value {
  font-size: 13px;
  color: var(--nhrd-text);
  margin-bottom: 14px;
}

/* ---- Workflow panel ---- */
.workflow-panel {
  background: #fafafa;
  border: 1px solid var(--nhrd-grey-border);
  border-radius: 3px;
  padding: 14px;
}

.workflow-stage {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--nhrd-grey-border);
  font-size: 13px;
}

.workflow-stage:last-child {
  border-bottom: none;
}

.workflow-stage .wf-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ccc;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-right: 10px;
}
.workflow-stage.done .wf-icon { background: var(--nhrd-green); }
.workflow-stage.current .wf-icon { background: var(--nhrd-blue); }
.workflow-stage.pending .wf-icon { background: #bbb; }

/* ---- Ticket detail tabs ---- */
.nhrd-tabs {
  border-bottom: 2px solid var(--nhrd-blue);
  margin-bottom: 16px;
}

.nhrd-tabs .nav-link {
  font-size: 12px;
  color: var(--nhrd-text);
  padding: 7px 16px;
  border-radius: 0;
  border: 1px solid transparent;
}

.nhrd-tabs .nav-link.active {
  background: var(--nhrd-blue);
  color: #fff;
  border-color: var(--nhrd-blue);
}

.nhrd-tabs .nav-link:hover:not(.active) {
  background: var(--nhrd-blue-pale);
}

/* ---- Checker items ---- */
.impact-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--nhrd-grey-border);
  border-radius: 3px;
  margin-bottom: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.impact-check:hover {
  background: var(--nhrd-blue-pale);
}

.impact-check input[type="checkbox"] {
  accent-color: var(--nhrd-blue);
}

/* ---- Success screen ---- */
.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--nhrd-green-light);
  border: 3px solid var(--nhrd-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
  color: var(--nhrd-green);
}

.ticket-ref-box {
  background: var(--nhrd-blue-pale);
  border: 2px dashed var(--nhrd-blue);
  border-radius: 6px;
  padding: 14px 24px;
  text-align: center;
  margin: 14px 0;
}

.ticket-ref-box .ticket-no {
  font-size: 24px;
  font-weight: 700;
  color: var(--nhrd-blue);
  letter-spacing: 1px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nhrd-step-label { display: none; }
  .nhrd-steps { overflow-x: auto; }
  .nhrd-header .site-title { font-size: 14px; }
}
