/* ═══════════════════════════════════════════════
   Management BS5 — Styles for BS5 management area
   Loaded instead of bootstrap3/management.css when
   the parish uses site_layout "bs5"
   ═══════════════════════════════════════════════ */

/* Reset root font-size in case BS3 scaffolding.less leaks through */
html { font-size: 16px !important; }

/* ── BS3 → BS5 Compatibility Layer ──
   Maps Bootstrap 3 classes that don't exist in Bootstrap 5
   so existing management views continue to work.            */

.col-xs-1  { flex: 0 0 auto; width: 8.333333%; }
.col-xs-2  { flex: 0 0 auto; width: 16.666667%; }
.col-xs-3  { flex: 0 0 auto; width: 25%; }
.col-xs-4  { flex: 0 0 auto; width: 33.333333%; }
.col-xs-5  { flex: 0 0 auto; width: 41.666667%; }
.col-xs-6  { flex: 0 0 auto; width: 50%; }
.col-xs-7  { flex: 0 0 auto; width: 58.333333%; }
.col-xs-8  { flex: 0 0 auto; width: 66.666667%; }
.col-xs-9  { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

.btn-xs {
  padding: 2px 8px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 4px;
}

.btn-mini {
  padding: 2px 8px;
  font-size: 13px;
}

.pull-right { float: right !important; }
.pull-left  { float: left !important; }

.label {
  display: inline-block;
  padding: .3em .6em;
  font-size: 85%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: .25rem;
  color: #fff;
}
.label-success { background-color: #198754; }
.label-danger  { background-color: #dc3545; }
.label-default { background-color: #6c757d; }
.label-warning { background-color: #ffc107; color: #212529; }
.label-info    { background-color: #0dcaf0; color: #212529; }
.label-primary { background-color: #0d6efd; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-white { color: #fff; }
.icon-off::before { content: ""; }

.navbar-right { margin-left: auto !important; }
.navbar-fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
}
.navbar-inverse {
  background-color: #212529 !important;
  border-color: #16181b;
}

.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.panel {
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 20px;
}
.panel-body { padding: 15px; }
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid #dee2e6;
  border-radius: 5px 5px 0 0;
}

/* ── Base Layout ── */

body {
  margin-top: 56px;
  margin-bottom: 100px;
  background-color: #f8f9fa !important;
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.5;
  color: #212529;
}

body.has-context-bar {
  margin-top: 94px;
}

.container-fluid {
  width: 98%;
}

hr.small {
  margin: 4px 0;
  border-width: 1px;
  border-color: #dee2e6;
  opacity: 0.4;
}

hr {
  margin: 12px 0;
  border-color: #dee2e6;
}

img {
  max-width: 100%;
}

/* ── Impersonation Banner ── */

.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10070;
  background: #d97706;
  color: #fff;
  font-size: 14px;
  padding: 6px 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.impersonation-banner .btn-outline-light {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 4px;
}

.impersonation-banner .btn-outline-light:hover {
  background: #fff;
  color: #d97706;
}

.management-navbar-primary.impersonation-active {
  top: 38px;
}

.management-navbar-context.impersonation-active {
  top: 84px;
}

/* ── Context bar: right-side "Visit Site" pill ── */
.management-navbar-context .context-visit-site {
  color: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  padding: 4px 12px !important;
  font-size: 12px;
  font-weight: 500;
  margin: 3px 0;
  transition: all 0.15s ease;
}

.management-navbar-context .context-visit-site:hover {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

body.has-impersonation-banner {
  margin-top: 94px !important;
}

body.has-impersonation-banner.has-context-bar {
  margin-top: 130px !important;
}

/* ── Primary Navbar ── */

.management-navbar-primary {
  background: #1e1b4b;
  padding: 0 16px;
  min-height: 46px;
  box-shadow: none;
  z-index: 10060 !important;
}

.management-navbar-primary.has-context {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.management-navbar-primary:not(.has-context) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.management-navbar-primary .navbar-brand {
  color: #fff !important;
  font-size: 15px;
  padding: 6px 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.management-navbar-primary .navbar-brand:hover {
  color: #c7d2fe !important;
}

.management-navbar-primary .navbar-brand img {
  width: 22px;
  height: auto;
}

.management-navbar-primary .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 14px;
  padding: 8px 12px !important;
  text-decoration: none;
  transition: color 0.15s;
}

.management-navbar-primary .nav-link:hover {
  color: #fff !important;
}

.management-navbar-primary .nav-link img {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: middle;
}

.management-navbar-primary .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
  padding: 4px 8px;
}

.management-navbar-primary .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── Context Navbar (second tier) ── */

.management-navbar-context {
  position: fixed;
  top: 46px;
  left: 0;
  right: 0;
  z-index: 10050 !important;
  background: linear-gradient(180deg, #252050 0%, #1a1740 100%);
  padding: 0 16px;
  min-height: 38px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.management-navbar-context .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px !important;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  border-radius: 5px;
  margin: 3px 1px;
  letter-spacing: 0.01em;
}

.management-navbar-context .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}

.management-navbar-context .nav-link:active {
  background: rgba(255, 255, 255, 0.15);
}

.management-navbar-context .nav-link .bi {
  font-size: 13px;
  opacity: 0.7;
}

.management-navbar-context .nav-link:hover .bi {
  opacity: 1;
}

.management-navbar-context .nav-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
}

.management-navbar-context .nav-link.active .bi {
  opacity: 1;
}

.context-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 8px;
  list-style: none;
}

/* ── Bootstrap 5 modal stacking fix ──
   The admin navbars use very high z-indexes (primary: 10060, context: 10050,
   impersonation banner: 10070) — a legacy holdover from Bootstrap 3 where
   .modal also sat at 10050. Bootstrap 5's default modal z-indexes are only
   1050 (backdrop) and 1055 (dialog), so without this override every BS5
   modal in the admin (QR code, password, slideshow-height help, etc.) gets
   covered by the navbar. Lift them above the impersonation banner. */
.modal-backdrop {
  z-index: 10080 !important;
}
.modal {
  z-index: 10085 !important;
}

/* ── Toolbar & content offsets (central source of truth) ── */
.dfc-toolbar {
  top: 56px !important;
}

body.has-context-bar .dfc-toolbar {
  top: 84px !important;
}

.dfc-content {
  margin-top: 104px;
}

body.has-context-bar .dfc-content {
  margin-top: 132px !important;
}

body.has-context-bar .brief-content,
body.has-context-bar .board-content,
body.has-context-bar .help-content,
body.has-context-bar .preview-content,
body.has-context-bar .editor-layout,
body.has-context-bar .health-content,
body.has-context-bar .detail-content,
body.has-context-bar .markets-content {
  margin-top: 132px !important;
}

body.has-context-bar .board-content {
  height: calc(100vh - 132px);
}

body.has-context-bar .editor-layout {
  height: calc(100vh - 132px);
}

.nav-btn {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  color: #fff !important;
  text-decoration: none !important;
  margin: 4px 2px;
  transition: opacity 0.15s;
}

.nav-btn:hover {
  opacity: 0.85;
  color: #fff !important;
}

.nav-btn-success { background: #198754; }
.nav-btn-primary { background: #0d6efd; }
.nav-btn-info    { background: #0891b2; }
.nav-btn-warning { background: #d97706; }
.nav-btn-danger  { background: #dc3545; }

.nav-btn img {
  width: 16px;
  height: 16px;
  margin-right: 3px;
  vertical-align: middle;
}

/* ── Buttons ── */

.btn {
  margin: 5px 5px 5px 0;
  border-radius: 6px;
}

a.btn { text-decoration: none; }
.btn a { color: inherit; text-decoration: none; }

/* ── Sections (legacy management cards) ── */

.section, fieldset {
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  background-color: #fff;
  border-radius: 8px;
}

.section h3, fieldset h3 {
  background-color: #334155;
  padding: 8px 14px;
  margin: -8px -8px 8px -8px;
  color: #fff;
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  border-radius: 7px 7px 0 0;
}

.section h3 small.white a, fieldset h3 small.white a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.section-short { min-height: auto; }

div.section div.btn.btn-info {
  margin: 5px !important;
}

.section table {
  max-width: 99.5% !important;
}

/* ── Page Title ── */

div.row div.col-xs-12 h3 {
  text-align: center;
  background-color: #334155;
  color: #fff;
  padding: 8px 14px;
  font-family: 'Roboto Slab', serif;
  font-size: 20px;
  border-radius: 6px;
}

/* ── Tables ── */

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
  background: white;
  border: 1px solid #e9ecef;
}

.table-striped tbody tr:nth-child(2n+1) td,
.table-striped tbody tr:nth-child(2n+1) th {
  background-color: #f8f9fa;
}

/* ── Alerts ── */

div.alert-success h4, div.alert-warning h4, div.alert-danger h4 {
  text-align: center;
}

div#errorExplanation.errorExplanation {
  color: #fff;
  background-color: #dc3545;
  padding: 12px;
  border-radius: 6px;
}

.has-warning .form-control {
  border-color: #dc3545;
}

.alert-error h4 {
  color: #fff;
  background-color: #dc3545;
  padding: 12px;
  text-align: center;
  border-radius: 6px;
}

/* ── Pagination ── */

div.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
}

div#Pagination div.pagination,
div.pagination {
  border: 1px solid #dee2e6;
  background: white;
  padding: 4px;
  border-radius: 6px;
}

.pagination > a,
.pagination > span,
.pagination > em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  line-height: 1.2;
  font-style: normal;
}

.pagination > a {
  color: #4338ca;
  text-decoration: none;
}

.pagination > a:hover,
.pagination > a:focus {
  background: #f3f4f6;
  border-color: #dee2e6;
  color: #312e81;
}

.pagination > .current,
div#Pagination div.pagination span.current {
  background: #4338ca;
  color: white;
  border-color: #4338ca;
}

.pagination > .gap,
div#Pagination div.pagination span.gap {
  color: #6c757d;
  background: transparent;
  border-color: transparent;
}

.pagination > .disabled {
  color: #6c757d;
  background: #f8f9fa;
  border-color: #dee2e6;
  opacity: 0.65;
  pointer-events: none;
}

.pagination > .previous_page,
.pagination > .next_page {
  font-weight: 600;
}

span.disabled.prev_page {
  border-color: #dee2e6;
}

/* ── Forms ── */

div.form-group {
  margin-bottom: 8px;
}

div.form-group.moremargin {
  margin-bottom: 38px;
}

input#imageURLboxSmall {
  width: 100%;
}

.code_editor {
  width: 100%;
  height: 400px;
}

input#email, input#password {
  display: block;
  width: 100%;
  height: 38px;
  padding: 8px 14px;
  font-size: 16px;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

select#directory_id,
select#dfcfile_page_layout,
select#dfcfile_page_layout option,
select#directory_id option {
  color: #212529 !important;
}

/* ── Images ── */

div.imagelist {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background-color: #e9ecef;
  border-radius: 6px;
}

td.recent_images {
  max-width: 50px;
}

input#image_uploaded_data {
  border-radius: 6px;
  font-size: 16px;
  padding: 10px 16px;
  background-color: #0891b2;
  border: none;
  color: #fff;
}

/* ── Tabs (general) ── */

.nav > li > a {
  padding: 6px 8px;
  background-color: #f8f9fa;
  font-size: 14px;
  border-radius: 4px;
  color: #212529;
  text-decoration: none;
}

.nav > li > a:hover {
  background-color: #4338ca;
  color: white;
  text-decoration: none;
}

.nav > li > a.active {
  background-color: #334155;
  color: #fff;
}

.nav > li {
  margin: 0 2px;
}

ul#myTab.nav.nav-tabs li a {
  padding: 6px 10px;
  background-color: #475569;
  color: white;
  border-radius: 4px 4px 0 0;
  font-size: 14px;
}

ul#myTab.nav.nav-tabs li:hover a {
  background-color: #64748b;
}

ul#myTab.nav.nav-tabs li.active a {
  background-color: #1e1b4b;
  color: white;
}

/* ── Dfcfile Edit Page ── */

.dfcfile-edit-header {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dfcfile-edit-header h5 {
  font-family: 'Roboto Slab', serif;
  color: #1e1b4b;
  font-size: 17px;
}

.dfcfile-edit-tabs {
  border-bottom: 2px solid #e2e8f0;
  gap: 2px;
  padding: 0;
}

.dfcfile-edit-tabs .nav-link {
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  background: none;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
}

.dfcfile-edit-tabs .nav-link:hover {
  color: #334155;
  border-bottom-color: #cbd5e1;
  background: none;
}

.dfcfile-edit-tabs .nav-link.active {
  color: #1e1b4b;
  border-bottom-color: #4338ca;
  background: none;
  font-weight: 600;
}

.dfcfile-edit-tabs .nav-link .bi {
  font-size: 15px;
}

/* ── Tabs + Quick Settings row ── */

.dfcfile-tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dfcfile-quick-settings {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
  flex-shrink: 0;
}

.dfcfile-qs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.dfcfile-qs-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.dfcfile-qs-btn.dfcfile-qs-btn-danger {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  box-shadow: 0 0 0 1px #fca5a5 inset;
}
.dfcfile-qs-btn.dfcfile-qs-btn-danger:hover {
  background: #fecaca !important;
  color: #b91c1c !important;
}

.dfcfile-qs-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  flex-shrink: 0;
}

.dfcfile-qs-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dfcfile-qs-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1;
}

.dfcfile-quick-settings .form-check.form-switch {
  min-height: auto !important;
  margin: 0 !important;
  padding-left: 2.5em !important;
}

.dfcfile-quick-settings .form-check-input {
  width: 34px !important;
  height: 18px !important;
  margin: 0 !important;
  cursor: pointer;
}

.dfcfile-quick-settings .form-check-input:checked {
  background-color: #4338ca !important;
  border-color: #4338ca !important;
}

.dfcfile-quick-settings .form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.25) !important;
  border-color: #4338ca !important;
}

.dfcfile-qs-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Segmented control (e.g. Slideshow | Gallery) */
.dfcfile-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  position: relative;
}
.dfcfile-segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.dfcfile-segmented label {
  margin: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 12px;
  border-radius: 999px;
  line-height: 1;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
  white-space: nowrap;
}
.dfcfile-segmented label:hover {
  color: #334155;
}
.dfcfile-segmented input[type="radio"]:checked + label {
  background: #ffffff;
  color: #4338ca;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.dfcfile-segmented input[type="radio"]:focus-visible + label {
  outline: 2px solid rgba(67, 56, 202, 0.35);
  outline-offset: 1px;
}

.dfcfile-qs-select {
  font-size: 12px;
  padding: 3px 26px 3px 8px;
  border-radius: 6px;
  border-color: #e2e8f0;
  max-width: 160px;
  height: 28px;
  line-height: 1;
  color: #334155;
  background-color: #f8fafc;
}
.dfcfile-qs-select:focus {
  border-color: #4338ca;
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.15);
}

/* Page-edit-fields bar (bottom) — toggle switch overrides */
.dfcfile-page-edit-fields .form-check.form-switch {
  min-height: auto !important;
  margin: 0 !important;
  padding-left: 2.5em !important;
}

.dfcfile-page-edit-fields .form-check-input {
  width: 34px !important;
  height: 18px !important;
  margin: 0 !important;
  cursor: pointer;
}

.dfcfile-page-edit-fields .form-check-input:checked {
  background-color: #4338ca !important;
  border-color: #4338ca !important;
}

.dfcfile-page-edit-fields .form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.25) !important;
  border-color: #4338ca !important;
}

.dfcfile-tab-content {
  padding-top: 20px;
}

.dfcfile-editor-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dfcfile-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.dfcfile-loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.dfcfile-loading-spinner {
  text-align: center;
  font-size: 0.85rem;
}

.dfcfile-asset-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dfcfile-asset-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 16px;
}

.dfcfile-asset-card .card-header h6 {
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.dfcfile-asset-card .card-body {
  padding: 12px 16px;
  max-height: 360px;
  overflow-y: auto;
}

.dfcfile-asset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dfcfile-asset-row {
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.dfcfile-asset-row:last-child {
  border-bottom: none;
}

.dfcfile-asset-thumb {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  flex-grow: 0;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: block;
}

.dfcfile-asset-thumb img {
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.dfcfile-asset-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
  font-size: 16px;
}

.dfcfile-asset-row .form-control-sm {
  font-size: 12px;
  font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
  color: #475569;
  background: #f8fafc;
  cursor: text;
}

.dfcfile-asset-row .form-control-sm:focus {
  background: #fff;
  color: #1e1b4b;
}

/* Feeds accordion */

.dfcfile-feeds-accordion .accordion-item {
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
  border-radius: 8px !important;
  overflow: hidden;
}

.dfcfile-feeds-accordion .accordion-button {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  padding: 12px 18px;
  background: #f8fafc;
}

.dfcfile-feeds-accordion .accordion-button:not(.collapsed) {
  background: #1e1b4b;
  color: #fff;
  box-shadow: none;
}

.dfcfile-feeds-accordion .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}

.dfcfile-feeds-accordion .accordion-body {
  padding: 16px 18px;
}

.dfcfile-feeds-accordion .accordion-body .section {
  border: none;
  padding: 0;
  margin-bottom: 0;
  background: none;
}

.dfcfile-feeds-accordion .accordion-body .section h3 {
  display: none;
}

/* ── Misc ── */

div.row.black {
  background-color: #1e1b4b;
  color: white;
  margin: 0;
  border-radius: 6px;
}

h1.nomargin {
  margin: 0;
  font-size: 2em;
}

div#Headline h2 {
  margin: 0;
}

div.alert-success h4 {
  padding: 12px;
}

.navbar-brand {
  padding: 0;
}

div#edit.tab-pane.fade.active.in form div.col-md-8 {
  padding-top: 5px;
}

div.section h3 a.pull-right.btn.btn-inverse {
  margin-top: 0;
}

h3 a.btn.btn-info.pull-right {
  margin-top: 0;
}

h3 div.btn.btn-info.pull-right {
  margin-top: -5px;
}

div.section h3 {
  padding-right: 4px;
}

div.col-sm-6 div#People.section,
div.col-sm-6 div#Campaigns.section {
  min-height: 140px;
}

form#Search input#query.form-control {
  margin-top: -5px;
}

.well {
  margin-bottom: 0;
}

.section h3 {
  padding: 4px 4px 4px 14px;
}

body#tinymce {
  background-color: white !important;
  background: white !important;
}

/* ── Calendly ── */

.calendly-overlay {
  background-color: rgba(31, 31, 31, 0.9) !important;
}

.calendar-day.is-bookable {
  background-color: #4338ca !important;
  color: white !important;
}

/* ── Navbar Dropdowns ── */

.management-navbar-primary .dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 220px;
  margin-top: 8px;
}

.management-navbar-primary .dropdown-item {
  padding: 8px 16px;
  font-size: 14px;
  color: #334155;
  display: flex;
  align-items: center;
  transition: background-color 0.1s;
}

.management-navbar-primary .dropdown-item:hover {
  background-color: #f1f5f9;
  color: #1e1b4b;
}

.management-navbar-primary .dropdown-item.text-danger:hover {
  background-color: #fef2f2;
}

.management-navbar-primary .dropdown-item .bi {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.management-navbar-primary .dropdown-divider {
  margin: 4px 0;
  border-color: #e2e8f0;
}

.user-avatar-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

.user-dropdown-header {
  padding: 12px 16px;
  white-space: normal;
}

.user-avatar-dropdown {
  flex-shrink: 0;
}

.user-avatar-dropdown-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

.user-avatar-dropdown-placeholder {
  font-size: 36px;
  color: #94a3b8;
}

.user-info-dropdown {
  min-width: 0;
}

.user-info-dropdown .fw-semibold {
  font-size: 14px;
  color: #1e1b4b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info-dropdown .text-muted {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-menu {
  min-width: 240px;
}

/* ── Parish Edit Page ── */

.tab-content .card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.tab-content .card-header {
  background: #334155;
  color: #fff;
  padding: 10px 16px;
  border-bottom: none;
}

.tab-content .card-header h5 {
  font-family: 'Roboto Slab', serif;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.tab-content .card-header h5 .bi {
  opacity: 0.8;
}

.tab-content .card-body {
  padding: 20px;
}

.tab-content .form-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.tab-content .form-text {
  font-size: 12px;
}

.tab-content .form-select,
.tab-content .form-control {
  border-radius: 6px;
  border-color: #d1d5db;
  font-size: 14px;
}

.tab-content .form-select:focus,
.tab-content .form-control:focus {
  border-color: #4338ca;
  box-shadow: 0 0 0 0.2rem rgba(67, 56, 202, 0.15);
}

/* ── Person Edit / Profile Page ── */

.person-edit-page .page-title {
  font-family: 'Roboto Slab', serif;
  font-size: 22px;
  color: #1e1b4b;
}

.person-edit-page .card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.person-edit-page .card-header {
  background: #334155;
  color: #fff;
  padding: 10px 16px;
  border-bottom: none;
}

.person-edit-page .card-title-icon {
  font-family: 'Roboto Slab', serif;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.person-edit-page .card-title-icon .bi {
  opacity: 0.8;
}

.person-edit-page .card-body {
  padding: 20px;
}

.profile-card {
  border-top: 4px solid #4338ca !important;
}

.profile-header {
  position: relative;
}

.profile-avatar {
  position: relative;
  display: inline-block;
}

.profile-avatar-upload {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  border-radius: 12px;
  border: 3px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: #f8f9fa;
}

.profile-avatar-upload .profile-avatar-img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 130px !important;
  max-height: 130px !important;
  object-fit: cover;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.profile-avatar-overlay-icon {
  font-size: 22px;
  color: #fff;
}

.profile-avatar-overlay-text {
  font-size: 11px;
  color: #fff;
  margin-top: 2px;
  font-weight: 500;
  white-space: nowrap;
}

.profile-avatar-upload:hover .profile-avatar-overlay,
.profile-avatar-upload.dragover .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar-upload:hover .profile-avatar-img,
.profile-avatar-upload.dragover .profile-avatar-img {
  filter: brightness(0.7);
}

.profile-avatar-upload.dragover {
  outline: 3px dashed #4338ca;
  outline-offset: 4px;
}

.profile-avatar-overlay.uploading {
  opacity: 1;
  background: rgba(67, 56, 202, 0.4);
}

.profile-upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

.profile-name {
  font-family: 'Roboto Slab', serif;
  font-size: 26px;
  font-weight: 600;
  color: #1e1b4b;
  margin: 0;
  line-height: 1.3;
}

.profile-honorific {
  font-weight: 400;
  color: #64748b;
}

.profile-nickname {
  font-weight: 400;
  font-style: italic;
  color: #64748b;
  font-size: 20px;
}

.profile-meta {
  margin-top: 4px;
}

.profile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 14px;
  margin-right: 16px;
}

.profile-meta-item .bi {
  font-size: 13px;
}

.profile-status-badge {
  font-size: 12px;
  padding: 3px 10px;
  vertical-align: middle;
  font-weight: 500;
}

.profile-deactivate a {
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}

.profile-deactivate a:hover {
  color: #dc3545 !important;
}

.sub-record-card {
  border-color: #e2e8f0 !important;
  border-radius: 8px !important;
  transition: box-shadow 0.15s;
}

.sub-record-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sub-record-card .card-body {
  padding: 16px;
}

.sub-record-card .border-top {
  border-color: #f1f5f9 !important;
}

.sub-record-card .btn-sm {
  font-size: 13px;
  padding: 4px 10px;
}

.sub-record-card .btn-outline-secondary {
  color: #6c757d;
  background-color: transparent;
  border-color: #6c757d;
}
.sub-record-card .btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}
.sub-record-card .btn-outline-danger {
  color: #dc3545;
  background-color: transparent;
  border-color: #dc3545;
}
.sub-record-card .btn-outline-danger:hover {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.family-member-row:not(:last-child) {
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.bio-textarea {
  min-height: 120px;
  resize: vertical;
}

.person-edit-page .form-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.person-edit-page .form-select,
.person-edit-page .form-control {
  border-radius: 6px;
  border-color: #d1d5db;
  font-size: 14px;
}

.person-edit-page .form-select:focus,
.person-edit-page .form-control:focus {
  border-color: #4338ca;
  box-shadow: 0 0 0 0.2rem rgba(67, 56, 202, 0.15);
}

.person-edit-page .form-check-label {
  font-size: 13px;
  color: #475569;
}

/* ── Offcanvas menu (all screen sizes — rendered outside navbar) ── */

#globalnav.offcanvas {
  background: #1e1b4b;
  max-width: 300px;
}

#globalnav .offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 16px 20px;
}

#globalnav .offcanvas-header .offcanvas-title {
  font-family: 'Roboto Slab', serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

#globalnav .offcanvas-body {
  padding: 12px 16px 24px;
}

#globalnav .offcanvas-body .navbar-nav {
  gap: 2px;
}

.offcanvas-section-label {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 12px 6px;
  margin: 0;
}

#globalnav .offcanvas-body .nav-link {
  color: rgba(255,255,255,0.85) !important;
  padding: 10px 12px !important;
  border-radius: 6px;
  font-size: 15px !important;
  transition: background-color 0.15s;
}

#globalnav .offcanvas-body .nav-link:hover,
#globalnav .offcanvas-body .nav-link:focus {
  background: rgba(255,255,255,0.08);
  color: #fff !important;
}

#globalnav .offcanvas-body .nav-link.text-danger {
  color: #fca5a5 !important;
}

#globalnav .offcanvas-body .nav-link.text-danger:hover {
  background: rgba(239,68,68,0.15);
  color: #fecaca !important;
}

/* ── Management Navbar: Desktop (lg+) ── */

@media (min-width: 992px) {
  .management-navbar-primary > .container-fluid {
    flex-wrap: nowrap;
  }
}

/* ── Management Navbar: Mobile (< lg) ── */

@media (max-width: 991.98px) {
  .management-navbar-primary > .container-fluid {
    flex-wrap: nowrap;
  }

  .management-navbar-primary .navbar-brand + .navbar-brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 0 1 auto;
  }

  .management-navbar-primary .navbar-toggler {
    flex-shrink: 0;
    margin-left: auto;
  }
}

/* ── Responsive: Mobile ── */

@media (max-width: 767px) {
  body {
    margin-bottom: 100px;
    margin-top: 56px;
  }

  body.has-context-bar {
    margin-top: 56px;
  }

  ul#myTab.nav.nav-tabs li a {
    font-size: 11px;
    padding: 4px;
  }

  #myTab {
    margin-left: 10px;
  }

  .dfcfile-edit-tabs .nav-link {
    font-size: 12px;
    padding: 8px 10px;
  }

  .dfcfile-edit-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }

  .dfcfile-edit-header .d-flex:last-child {
    flex-wrap: wrap;
  }

  .dfcfile-tabs-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dfcfile-quick-settings {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0 4px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
  }

  .dfcfile-qs-select {
    max-width: 130px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  body {
    margin-bottom: 120px;
    margin-top: 80px;
  }

  ul#myTab.nav.nav-tabs li a {
    font-size: 11px;
    padding: 4px;
  }

  #myTab {
    margin-left: 16px;
  }

  div.form-group.moremargin {
    margin-bottom: 80px;
  }

  .dfcfile-edit-tabs .nav-link {
    font-size: 13px;
    padding: 8px 14px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  body {
    margin-bottom: 120px;
    margin-top: 70px;
  }

  #myTab {
    margin-left: 15px;
  }

  div.form-group.moremargin {
    margin-bottom: 80px;
  }
}

@media (min-width: 1200px) {
  body {
    margin-bottom: 100px;
    margin-top: 64px;
  }

  #myTab {
    margin-left: 15px;
  }

  div.form-group.moremargin {
    margin-bottom: 70px;
  }
}

/* ═══════════════════════════════════════════════════════
   AI Editor Tab — Chat + Preview Split Panel
   ═══════════════════════════════════════════════════════ */

.dfc-ai-editor {
  display: flex;
  height: 600px;
  border: 1px solid #2d2d44;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a2e;
}

.dfc-ai-chat {
  width: 360px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  border-right: 1px solid #2d2d44;
}

.dfc-ai-chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid #2d2d44;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.dfc-ai-chat-header h6 {
  margin: 0;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.dfc-ai-chat-header h6 i { color: #a78bfa; }

.dfc-ai-tone-select {
  background: #2d2d44;
  border: 1px solid #3d3d5c;
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.dfc-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dfc-ai-msg {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 90%;
  word-wrap: break-word;
}

.dfc-ai-msg-system {
  background: #2d2d44;
  color: #94a3b8;
  align-self: center;
  text-align: center;
  font-size: 12px;
  border-radius: 8px;
  max-width: 100%;
}

.dfc-ai-msg-user {
  background: #3b82f6;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.dfc-ai-msg-ai {
  background: #2d2d44;
  color: #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.dfc-ai-msg-status {
  background: transparent;
  color: #64748b;
  font-size: 11px;
  align-self: flex-start;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.dfc-ai-msg-status.step-active { color: #a78bfa; }
.dfc-ai-msg-status.step-complete { color: #4ade80; }

.dfc-ai-status-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dfc-ai-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  align-self: flex-start;
}

.dfc-ai-typing.active { display: flex; }

.dfc-ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  animation: dfc-ai-bounce 1.4s infinite ease-in-out;
}

.dfc-ai-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.dfc-ai-typing-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dfc-ai-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.dfc-ai-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid #2d2d44;
  background: #12121f;
  flex-shrink: 0;
}

.dfc-ai-input-row {
  display: flex;
  gap: 8px;
}

.dfc-ai-textarea {
  flex: 1;
  background: #2d2d44;
  border: 1px solid #3d3d5c;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  font-family: inherit;
  line-height: 1.4;
}

.dfc-ai-textarea::placeholder { color: #64748b; }
.dfc-ai-textarea:focus { outline: none; border-color: #3b82f6; }

.dfc-ai-send {
  background: #3b82f6;
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.dfc-ai-send:hover { background: #2563eb; }
.dfc-ai-send:disabled { opacity: 0.5; cursor: not-allowed; }

.dfc-ai-hint {
  font-size: 10px;
  color: #4a5568;
  margin-top: 4px;
}

.dfc-ai-preview {
  flex: 1;
  background: #fff;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.dfc-ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
  flex-shrink: 0;
}

.dfc-ai-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dfc-ai-toolbar .btn { font-size: 12px; }

.dfc-ai-preview-iframe {
  width: 100%;
  flex: 1;
  border: none;
}

#aiPreviewPanel .mce-tinymce {
  border: none !important;
  box-shadow: none !important;
}

#aiPreviewPanel .mce-edit-area {
  border-top: 1px solid #e2e8f0 !important;
}

#aiPreviewPanel iframe {
  min-height: 400px;
}

.dfc-ai-preview-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.dfc-ai-preview-empty i { font-size: 48px; display: block; margin-bottom: 12px; color: #cbd5e1; }

.dfc-ai-streaming-bar {
  height: 3px;
  background: #e2e8f0;
  overflow: hidden;
  flex-shrink: 0;
}

.dfc-ai-streaming-bar.hidden { display: none; }

.dfc-ai-streaming-bar .bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #3b82f6, #a78bfa);
  animation: dfc-ai-stream 1.2s ease-in-out infinite;
}

@keyframes dfc-ai-stream {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.dfc-ai-banner {
  padding: 6px 12px;
  font-size: 12px;
  text-align: center;
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  flex-shrink: 0;
}

.dfc-ai-banner.hidden { display: none; }

@media (max-width: 768px) {
  .dfc-ai-editor {
    flex-direction: column;
    height: auto;
  }
  .dfc-ai-chat {
    width: 100%;
    min-width: auto;
    border-right: none;
    border-bottom: 1px solid #2d2d44;
    max-height: 400px;
  }
  .dfc-ai-preview {
    min-height: 400px;
  }
}
