/*
 * Visitor workspace refresh
 * Visual layer only: existing IDs, tab controls, and data renderers remain intact.
 */
:root {
  --refresh-ink: #172a4b;
  --refresh-ink-soft: #5f6f87;
  --refresh-orange: #f15a24;
  --refresh-orange-dark: #d94716;
  --refresh-orange-soft: #fff3ed;
  --refresh-navy: #13294b;
  --refresh-line: #e2e8f0;
  --refresh-line-soft: #edf1f5;
  --refresh-canvas: #f6f8fb;
  --refresh-surface: #ffffff;
  --refresh-green: #16825a;
  --refresh-radius: 14px;
  --refresh-shadow: 0 12px 34px rgba(23, 42, 75, 0.07);
}

body {
  color: var(--refresh-ink);
  background: var(--refresh-canvas);
  font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.auth-required { background: var(--refresh-canvas); }

/* Institutional web header + app navigation */
.app-shell-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: var(--refresh-surface);
  border: 0;
  box-shadow: 0 1px 0 var(--refresh-line), 0 8px 24px rgba(23, 42, 75, 0.04);
}

.app-shell-header::before,
.app-shell-header::after { display: none; }

.app-header {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 22px;
  width: min(98%, 2560px);
  max-width: 98%;
  min-height: 84px;
  margin: 0 auto;
  padding: 12px 20px;
  text-align: left;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--refresh-orange);
  text-decoration: none;
  white-space: nowrap;
}

.app-brand:hover { color: var(--refresh-orange-dark); }

.app-brand-logo {
  display: block;
  width: auto;
  height: 68px;
  max-width: 250px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.app-brand-divider {
  width: 1.5px;
  height: 40px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 2px;
  flex-shrink: 0;
}

.app-brand-system-logo {
  display: block;
  width: auto;
  height: 68px;
  max-width: 110px;
  object-fit: contain;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.05));
}

.app-brand-logo:hover,
.app-brand-system-logo:hover {
  transform: scale(1.03);
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: var(--refresh-orange);
  box-shadow: 0 8px 18px rgba(241, 90, 36, 0.22);
  font-size: 1.05rem;
}

.app-brand-wordmark {
  color: var(--refresh-orange);
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.app-header-copy { min-width: 0; }

.app-title {
  margin: 0 0 3px;
  color: var(--refresh-ink);
  font-size: clamp(1rem, 1.8vw, 1.36rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  filter: none;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
}

.app-subtitle {
  margin: 0;
  color: var(--refresh-ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.app-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.app-header-actions button {
  min-height: 38px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

#headerFormButton,
.header-form-button {
  display: none !important;
}

.header-utility-button,
.header-online-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
}

.header-utility-button {
  padding: 0 9px;
  color: var(--refresh-ink);
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.header-utility-button:hover {
  color: var(--refresh-orange);
  background: var(--refresh-orange-soft);
}

.header-logout-button { border-left-color: var(--refresh-line); border-radius: 0 9px 9px 0; padding-left: 14px; }
.header-online-button {
  padding: 0 10px;
  color: var(--refresh-ink-soft);
  background: #f8fafc;
  border: 1px solid var(--refresh-line);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1cad73;
  box-shadow: 0 0 0 3px rgba(28, 173, 115, 0.12);
}

.app-shell-header > .d-flex.justify-content-center {
  background: var(--refresh-navy);
}

.nav-pills-custom {
  display: flex;
  align-items: stretch;
  width: min(98%, 2560px);
  max-width: 98%;
  margin: 0 auto;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-pills-custom .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  box-shadow: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-pills-custom .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-pills-custom .nav-link.active {
  color: #ffffff !important;
  background: transparent;
  border-bottom: 3px solid #ff753a !important;
  box-shadow: none;
  animation: none;
  font-weight: 700;
}

.nav-pills-custom .nav-link.active::before { display: none; }

/* Main workspace — Expansive and full-width */
.main-container {
  width: min(98%, 2560px);
  max-width: 98%;
  margin: 0 auto;
  padding: 24px 12px 64px;
}

.card-custom {
  padding: 34px;
  margin-bottom: 28px;
  overflow: visible;
  border: 1px solid var(--refresh-line);
  border-radius: var(--refresh-radius);
  background: var(--refresh-surface);
  box-shadow: var(--refresh-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card-custom::before,
.card-custom::after { display: none; }
.card-custom:hover { transform: none; background: var(--refresh-surface); box-shadow: var(--refresh-shadow); }

.history-page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.history-page-title {
  margin: 0;
  color: var(--refresh-ink);
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.history-page-subtitle {
  margin: 9px 0 0;
  color: var(--refresh-ink-soft);
  font-size: 0.96rem;
}

.history-page-actions {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.history-result-summary {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
  border-left: 1px solid var(--refresh-line);
  color: var(--refresh-ink-soft);
  white-space: nowrap;
}

.history-result-label { font-size: 0.72rem; }
.history-result-summary strong { color: #c23c0f !important; font-family: 'Inter', sans-serif; font-size: 1.14rem; font-weight: 800; }

.history-refresh-button,
.history-clear-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 9px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.history-refresh-button {
  color: var(--refresh-ink);
  background: #fff;
  border: 1px solid var(--refresh-line);
}

.history-refresh-button:hover {
  color: var(--refresh-orange);
  border-color: rgba(241, 90, 36, 0.45);
  background: var(--refresh-orange-soft);
}

.history-toolbar-row {
  display: flex;
  justify-content: flex-end;
  min-height: 38px;
  margin-bottom: 10px;
}

.history-header-actions { display: flex; align-items: center; gap: 10px; }

.history-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--refresh-line);
  border-radius: 9px;
  background: #f8fafc;
  box-shadow: none;
}

.history-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--refresh-ink-soft);
  background: transparent;
  font-family: 'Prompt', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
}

.history-view-button:hover { color: var(--refresh-orange); background: #fff; }
.history-view-button.is-active { color: var(--refresh-ink); background: #fff; box-shadow: 0 2px 7px rgba(23, 42, 75, 0.08); }

.history-filter-panel {
  margin-bottom: 23px;
  padding: 18px;
  border: 1px solid var(--refresh-line);
  border-radius: 12px;
  background: #f8fafc;
}

.history-filter-panel .form-label {
  margin-bottom: 7px;
  color: var(--refresh-ink);
  font-size: 0.76rem;
  font-weight: 600;
}

.history-filter-panel .form-control,
.history-filter-panel .form-select,
.history-filter-panel .input-group-text {
  min-height: 44px;
  border-color: #d9e1ea;
  background: #fff;
  color: var(--refresh-ink);
  font-size: 0.82rem;
  box-shadow: none;
}

.history-filter-panel .input-group-text { color: var(--refresh-ink-soft); border-right: 0; }
.history-filter-panel .input-group .form-control { border-left: 0; }
.history-filter-panel .form-control:focus,
.history-filter-panel .form-select:focus { border-color: var(--refresh-orange); box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.12); }
.history-filter-panel .input-group:focus-within .input-group-text { border-color: var(--refresh-orange); color: var(--refresh-orange); }
.history-filter-panel .form-control::placeholder { color: #9aa6b6; }

.history-clear-button {
  color: #c23c0f !important;
  background: #fff;
  border: 1px solid rgba(194, 60, 15, 0.45) !important;
  font-weight: 600;
}

.history-clear-button:hover { color: #fff !important; background: var(--refresh-orange); border-color: var(--refresh-orange); transform: translateY(-1px); }

.history-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.history-table-heading-title { color: var(--refresh-ink); font-size: 0.91rem; font-weight: 700; }
.history-table-heading-count { margin-left: 8px; color: var(--refresh-ink-soft); font-size: 0.78rem; }
.history-table-heading-note { color: #525d69 !important; font-size: 0.72rem; }
.history-table-heading-note i { margin-right: 4px; color: #c23c0f !important; }

.table-container {
  overflow-x: auto;
  border: 1px solid var(--refresh-line);
  border-radius: 10px;
  background: #fff;
}

.table-custom {
  min-width: 860px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table-custom thead th {
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--refresh-line);
  background: #f8fafc;
  color: var(--refresh-ink);
  font-family: 'Prompt', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.table-custom tbody tr {
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.table-custom tbody tr:hover {
  transform: none;
  background: #fff8f4;
  box-shadow: none;
}

.table-custom tbody tr td:first-child::before { display: none; }
.table-custom td {
  padding: 15px 14px;
  border: 0;
  border-bottom: 1px solid var(--refresh-line-soft);
  color: var(--refresh-ink);
  font-size: 0.8rem;
  vertical-align: middle;
}

.table-custom tbody tr:last-child td { border-bottom: 0; }
.history-cell-date { color: var(--refresh-ink-soft) !important; white-space: nowrap; }
.history-cell-org .fw-bold { color: var(--refresh-ink) !important; font-weight: 700 !important; }
.history-cell-follow { color: var(--refresh-ink-soft) !important; }
.history-cell-visitors .badge,
.history-card-stats .badge {
  color: #b83407 !important;
  background: var(--refresh-orange-soft) !important;
  border: 1px solid rgba(184, 52, 7, 0.25) !important;
  font-weight: 700;
}
.badge-secondary { color: var(--refresh-ink-soft) !important; background: #f1f4f7 !important; border-color: transparent !important; }
.table-custom .img-thumbnail { border-color: var(--refresh-line); border-radius: 7px !important; }
.history-follow-text { color: var(--refresh-ink-soft); }

.visit-status-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.visit-status-active { color: var(--refresh-green); background: #eaf8f1; }
.visit-status-upcoming { color: var(--refresh-orange); background: var(--refresh-orange-soft); }

.history-actions {
  display: flex;
  align-items: center;
  gap: 12px !important;
}

.history-actions .btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 1px solid var(--refresh-line) !important;
  color: var(--refresh-ink) !important;
  background: #fff !important;
  box-shadow: none !important;
  font-size: 1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.history-actions .btn:hover { color: var(--refresh-orange) !important; border-color: rgba(241, 90, 36, 0.45) !important; background: var(--refresh-orange-soft) !important; }

#paginationControls { padding-top: 16px; border-top: 1px solid var(--refresh-line-soft); }
#paginationControls .page-link { color: var(--refresh-ink); background: #fff; font-family: 'Prompt', sans-serif; font-size: 0.76rem; }
#paginationControls .page-link:hover { color: var(--refresh-orange); background: var(--refresh-orange-soft); }

/* Keep form and dashboard in the same visual system */
.form-container-limit {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto;
  margin-right: auto;
}

#pills-form .card-custom {
  width: 100%;
  max-width: 100%;
  padding: clamp(28px, 3.5vw, 48px);
  box-shadow: var(--refresh-shadow);
}

/* Modals & Popups — Wide, full, and spacious */
.modal-xl {
  max-width: min(1560px, 95vw) !important;
  width: 95vw;
}

.modal-lg {
  max-width: min(1200px, 92vw) !important;
}

.modal-content {
  border-radius: var(--refresh-radius);
  box-shadow: 0 24px 70px rgba(23, 42, 75, 0.18);
}
.section-title { color: var(--refresh-ink); border-bottom-color: var(--refresh-line); font-size: 0.98rem; }
.section-title i { color: var(--refresh-orange); background: var(--refresh-orange-soft); border-color: rgba(241, 90, 36, 0.18); }
.form-label { color: var(--refresh-ink); font-size: 0.83rem; }
.form-control, .form-select { border-color: #d9e1ea; border-radius: 9px; background: #fff; color: var(--refresh-ink); font-size: 0.84rem; box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: var(--refresh-orange); box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.12); }
.upload-area { border-color: rgba(241, 90, 36, 0.35); border-radius: 12px; background: #fff8f4; }
.upload-area:hover, .upload-area.dragover { border-color: var(--refresh-orange); background: var(--refresh-orange-soft); }
.btn-primary, .btn-submit { background: var(--refresh-orange); border-color: var(--refresh-orange); box-shadow: 0 7px 16px rgba(241, 90, 36, 0.2); }
.btn-primary:hover, .btn-submit:hover { background: var(--refresh-orange-dark); border-color: var(--refresh-orange-dark); }

.db-hero-title, .db-chart-title, .db-trophy-name { color: var(--refresh-ink) !important; }
.db-hero-sub, .db-chart-sub, .db-kpi-lbl, .db-mini-lbl { color: var(--refresh-ink-soft) !important; }
.db-kpi-card, .db-chart-card { border-color: var(--refresh-line) !important; background: #fff !important; box-shadow: var(--refresh-shadow) !important; }
.db-kpi-val, .db-mini-val { color: var(--refresh-ink) !important; }
.db-trophy-banner { border-color: rgba(241, 90, 36, 0.22) !important; background: var(--refresh-orange-soft) !important; }

.site-contact-footer { background: var(--refresh-navy); border-top-color: var(--refresh-orange); }

/* Auth is intentionally quiet and uses the same institutional palette. */
.auth-gate { background: var(--refresh-canvas); }
.auth-gate-title, .auth-gate-card-title { color: var(--refresh-ink) !important; }
.auth-gate-primary { background: var(--refresh-orange) !important; box-shadow: 0 10px 24px rgba(241, 90, 36, 0.22) !important; }
.auth-gate-brand-header { display: none !important; }


@media (max-width: 1100px) {
  .app-header { grid-template-columns: auto minmax(180px, 1fr); }
  .app-header-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 2px; }
}

@media (max-width: 768px) {
  /* MOBILE HEADER v29 — compact three-row institutional header */
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "copy"
      "actions";
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 10px 16px 12px;
  }
  .app-brand {
    grid-area: brand;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px 48px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }
  .app-brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .app-brand-wordmark { font-size: 0.95rem; }
  .app-brand-logo {
    width: 100%;
    height: auto;
    max-width: 236px;
    max-height: 50px;
    object-fit: contain;
    object-position: left center;
  }
  .app-brand-divider {
    width: 1px;
    height: 32px;
    justify-self: center;
  }
  .app-brand-system-logo {
    width: 48px;
    height: 48px;
    max-width: 48px;
    justify-self: end;
  }
  .app-header-copy {
    grid-area: copy;
    width: 100%;
    min-width: 0;
    padding-top: 1px;
  }
  .app-title {
    margin-bottom: 2px;
    font-size: 1.02rem;
    line-height: 1.35;
  }
  .app-subtitle { font-size: 0.72rem; line-height: 1.4; }
  .app-header-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: 42px 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow: visible;
    padding-top: 2px;
    padding-bottom: 0;
  }
  .app-header-actions button { min-height: 42px; }
  .header-utility-button,
  .header-online-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex: none;
  }
  .header-utility-button {
    padding: 0;
    border: 1px solid var(--refresh-line);
    border-radius: 11px;
    background: #fff;
    font-size: 0.9rem;
  }
  .header-logout-button {
    padding-left: 0;
    border-left-color: var(--refresh-line);
    border-radius: 11px;
  }
  .header-utility-button span { display: none; }
  .header-online-button {
    width: 100%;
    min-width: 0;
    height: 42px;
    justify-content: flex-start;
    padding: 0 12px;
    overflow: hidden;
    border-radius: 12px;
    font-size: 0.76rem;
  }
  #pageViewCountContainer {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-pills-custom { overflow-x: auto; padding: 0 12px; }
  .nav-pills-custom::-webkit-scrollbar { display: none; }
  .nav-pills-custom .nav-link { min-height: 52px; padding: 0 15px; font-size: 0.76rem; }
  .main-container { padding: 28px 16px 56px; }
  .card-custom, #pills-form .card-custom { padding: 22px 16px; border-radius: 12px; }
  .history-page-intro { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 20px; }
  .history-page-title { font-size: 1.78rem; }
  .history-page-subtitle { margin-top: 7px; font-size: 0.83rem; }
  .history-page-actions { width: 100%; justify-content: space-between; align-items: center; }
  .history-toolbar-row { justify-content: flex-start; }
  .history-filter-panel { padding: 14px; }
  .history-table-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .history-table-heading-note { font-size: 0.7rem; }
  .table-container { overflow: visible; border: 0; }
  .history-table { display: block; min-width: 0; }
  .history-table thead, .history-table colgroup { display: none; }
  .history-table tbody, .history-table tr, .history-table td { display: block; width: 100%; }
  .history-table tbody tr { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--refresh-line); border-radius: 12px; box-shadow: 0 5px 16px rgba(23, 42, 75, 0.05); }
  .history-table tbody tr:hover { box-shadow: 0 5px 16px rgba(23, 42, 75, 0.05); }
  .history-table td { min-height: 34px; padding: 6px 0 6px 94px; border-bottom: 0; text-align: left !important; overflow: visible; }
  .history-table td::before { left: 0; top: 6px; width: 80px; color: #8b98aa; font-size: 0.68rem; }
  .history-cell-actions { padding: 12px 0 0 !important; border-top: 1px solid var(--refresh-line-soft) !important; }
  .history-actions { justify-content: flex-end; }
  #paginationControls { align-items: stretch !important; gap: 10px; }
}

@media (max-width: 480px) {
  .app-header { gap: 7px; padding: 9px 12px 11px; }
  .app-brand { grid-template-columns: minmax(0, 1fr) 1px 44px; gap: 8px; }
  .app-brand-logo { max-width: 220px; max-height: 44px; }
  .app-brand-divider { height: 28px; }
  .app-brand-system-logo { width: 44px; height: 44px; max-width: 44px; }
  .app-title { font-size: 1rem; }
  .app-header-actions { gap: 8px; }
  .header-utility-button { padding: 0; }
  .header-utility-button span { display: none; }
  .header-online-button { padding: 0 10px; }
  .nav-pills-custom .nav-link { padding: 0 12px; }
  .nav-pills-custom .nav-link span { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
  .history-page-actions { gap: 10px; }
  .history-result-summary { padding-left: 10px; }
  .history-refresh-button { min-width: 42px; padding: 0 10px; }
  .history-refresh-button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .header-form-button, .history-refresh-button, .history-clear-button, .history-actions .btn { transition: none; }
}

/* ================================================================
   REDESIGNED USER MANUAL MODAL (SweetAlert2 Custom Styling)
================================================================ */
.swal-manual-popup {
  border-radius: 24px !important;
  padding: 24px 28px !important;
  box-shadow: 0 28px 85px rgba(19, 41, 75, 0.22) !important;
  background: #ffffff !important;
  font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  border: 1px solid var(--refresh-line) !important;
}

.swal-manual-popup .swal2-title {
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
}

.swal-manual-popup .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  overflow: visible !important;
}

.swal-manual-popup .swal2-close {
  top: 16px !important;
  right: 18px !important;
  border-radius: 50% !important;
  color: #8b98aa !important;
  transition: all 0.2s ease !important;
}

.swal-manual-popup .swal2-close:hover {
  color: var(--refresh-orange) !important;
  background: var(--refresh-orange-soft) !important;
}

.swal-manual-confirm {
  padding: 10px 28px !important;
  border-radius: 12px !important;
  font-family: 'Prompt', sans-serif !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: var(--refresh-orange) !important;
  border: 1px solid var(--refresh-orange) !important;
  box-shadow: 0 8px 20px rgba(241, 90, 36, 0.25) !important;
  transition: all 0.2s ease !important;
}

.swal-manual-confirm:hover {
  background: var(--refresh-orange-dark) !important;
  transform: translateY(-1px) !important;
}

/* Header Hero */
.manual-hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf5 0%, #fff1e6 100%);
  border: 1px solid rgba(241, 90, 36, 0.18);
}

.manual-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--refresh-orange);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 8px 18px rgba(241, 90, 36, 0.24);
}

.manual-hero-info {
  flex: 1;
  min-width: 0;
}

.manual-hero-title {
  margin: 0 0 3px;
  color: var(--refresh-ink);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.3;
}

.manual-hero-sub {
  margin: 0;
  color: var(--refresh-ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Nav Pills inside Manual */
.manual-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--refresh-line);
}

.manual-nav-bar::-webkit-scrollbar {
  height: 4px;
}

.manual-nav-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.manual-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--refresh-line);
  background: #f8fafc;
  color: var(--refresh-ink-soft);
  font-family: 'Prompt', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.manual-nav-btn:hover {
  color: var(--refresh-orange);
  background: var(--refresh-orange-soft);
  border-color: rgba(241, 90, 36, 0.3);
}

.manual-nav-btn.active {
  color: #ffffff;
  background: var(--refresh-orange);
  border-color: var(--refresh-orange);
  box-shadow: 0 4px 12px rgba(241, 90, 36, 0.22);
}

/* Panes Container */
.manual-content-box {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 6px;
}

.manual-content-box::-webkit-scrollbar {
  width: 6px;
}

.manual-content-box::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.manual-content-box::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.manual-pane {
  display: none;
  animation: manualPaneFade 0.25s ease;
}

.manual-pane.active {
  display: block;
}

@keyframes manualPaneFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Grids */
.manual-card-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.manual-card-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.manual-role-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--refresh-line);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 42, 75, 0.04);
  transition: all 0.2s ease;
}

.manual-role-card:hover {
  border-color: rgba(241, 90, 36, 0.35);
  box-shadow: 0 6px 18px rgba(241, 90, 36, 0.08);
}

.manual-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.manual-role-badge.viewer {
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.manual-role-badge.admin {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.manual-role-title {
  margin: 0 0 8px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--refresh-ink);
}

.manual-role-list {
  margin: 0;
  padding-left: 18px;
  color: var(--refresh-ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.manual-role-list li {
  margin-bottom: 4px;
}

/* Steps Timeline */
.manual-step-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.manual-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--refresh-line);
  background: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.manual-step-item:hover {
  background: #fffbf9;
  border-color: rgba(241, 90, 36, 0.25);
}

.manual-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--refresh-orange-soft);
  color: var(--refresh-orange);
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid rgba(241, 90, 36, 0.2);
}

.manual-step-details {
  flex: 1;
  min-width: 0;
}

.manual-step-head {
  margin: 0 0 3px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--refresh-ink);
}

.manual-step-desc {
  margin: 0;
  color: var(--refresh-ink-soft);
  font-size: 0.81rem;
  line-height: 1.5;
}

/* Feature Item Card */
.manual-feature-card {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--refresh-line);
  background: #ffffff;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.manual-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 0.95rem;
}

.manual-feature-icon.blue { background: #eff6ff; color: #2563eb; }
.manual-feature-icon.orange { background: var(--refresh-orange-soft); color: var(--refresh-orange); }
.manual-feature-icon.green { background: #f0fdf4; color: #16a34a; }
.manual-feature-icon.purple { background: #faf5ff; color: #9333ea; }
.manual-feature-icon.amber { background: #fffbeb; color: #d97706; }
.manual-feature-icon.red { background: #fef2f2; color: #dc2626; }

.manual-feature-body {
  flex: 1;
  min-width: 0;
}

.manual-feature-name {
  margin: 0 0 3px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--refresh-ink);
}

.manual-feature-text {
  margin: 0;
  font-size: 0.77rem;
  color: var(--refresh-ink-soft);
  line-height: 1.45;
}

/* Action button items */
.manual-btn-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--refresh-line);
  background: #ffffff;
}

.manual-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.manual-btn-pill.edit { background: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.manual-btn-pill.info { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.manual-btn-pill.restore { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }
.manual-btn-pill.delete { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }

.manual-btn-content {
  flex: 1;
}

.manual-btn-title {
  margin: 0 0 2px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--refresh-ink);
}

.manual-btn-desc {
  margin: 0;
  font-size: 0.76rem;
  color: var(--refresh-ink-soft);
}

/* Alert Note */
.manual-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.81rem;
  line-height: 1.5;
  margin-top: 12px;
}

.manual-callout.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.manual-callout.info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.manual-callout.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.manual-callout i {
  font-size: 0.95rem;
  margin-top: 2px;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .swal-manual-popup { padding: 18px 14px !important; }
  .manual-card-grid-2 { grid-template-columns: 1fr; }
  .manual-hero-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .manual-hero-icon { width: 40px; height: 40px; font-size: 1.1rem; }
}
