/* ===========================================================
   Dynamic Forms – Global Layout

   Scope:
   - Shared Power Pages styling for the live Dynamic Forms renderer.
   - Covers layout, accordion sections, fields, validation, subgrid modals,
     document placeholders, dashboard widgets, and action messages.
   - Export/print-only styling lives in DynamicForms_ViewExportForm_Styles.css.

   Keep selector names aligned with DynamicForms_Renderer.js and the Liquid
   templates; most classes are emitted dynamically rather than authored in HTML.
   =========================================================== */

:root {
  --df-tt-red: var(--tt_red, #ed151a);
}


/* Root container for dynamic form content */
#taxFormContainer {
  margin: 20px 0 40px 0;
  padding: 0;
  border: none;
  background: transparent;
  position: relative; /* needed for version badge */
}

/* ===========================================================
   Version info box
   =========================================================== */

/* DEV: DynamicForms_Styles_Core.css version label */
#taxFormContainer::after {
  content: "DynamicForms_Styles_Core.css v1.2";  /* <--- bump this version every time you publish <---------------------------------------------------------------------------------------*/
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  z-index: 10;
  pointer-events: none;
}

.df-version-info {
  margin-top: 10px;
  font-size: 2rem;
  color: #555555;
}

.df-version-info p {
  margin: 2px 0;
}

.df-version-label {
  font-weight: 600;
  margin-right: 4px;
}

.df-version-value {
  font-weight: 500;
}

.df-page-intro {
  margin: 0 0 15px 0;
  font-size: 18px;
}

.df-page-header-text {
  margin: 20px 0;
}

.df-page-header-note {
  margin: 50px 0;
  font-size: 0.95rem;
}

.page-block-container {
  margin: 40px 0 20px 0px;
}

.df-section-progress {
  margin: 15px 0 20px 0;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #d0d0d0;
  background: #f8f8f8;
  font-size: 0.95rem;
}
/* ==========================================
   Progress Bar
   ========================================== */

.df-progressbar-outer {
  width: 100%;
  height: 14px;
  background: #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}

.df-progressbar-value {
  height: 100%;
  width: 0%;
  background: var(--df-tt-red);  /* same red as completed sections */
  transition: width 0.3s ease;
}

.df-progressbar-text {
  font-size: 1.5rem;
}


/* Optional: headings inside the dynamic form block */
#taxFormContainer h2  {
  margin-top: 0;
}

/* Debug / version panel at the bottom */
.df-debug-wrapper {
  margin-top: 100px;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid #d0d0d0;
  background: #fcfcfc;
  font-size: 0.9rem;
}

/* ===========================================================
   Accordion
   =========================================================== */

.df-accordion {
  border: none;
  border-radius: 0;
  background: transparent;
}

/* Individual sections */
.df-root .df-accordion-section {
  margin: 2px 0 10px 0;
}

/* Header: pill-style bar */
.df-root .df-accordion-header {
  background: #5f5f61;
  color: #ffffff;
  padding: 9px 9px 9px 18px;
  border-radius: 20px; /* pill */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  box-shadow: none;
  font-weight: 500;
}

/* When section is open, keep same colour as default */
.df-accordion-section.open .df-accordion-header {
  background: #666666;
  color: #ffffff;
}

/* Completed section: red header + tick */
.df-accordion-section.df-section-complete .df-accordion-header {
  background: var(--df-tt-red);   /* completed = red */
  color: #ffffff;
}



/* The <h2> inside the header */
.df-root .df-accordion-header h2.df-accordion-title {
  margin: 0;
  font-size: 18px;            
  font-weight: 700;
  color: #ffffff !important;  /* beat any generic h2 / PersonalTaxForm.css rules */
}


/* Status icon (flag / tick) in accordion header – piggy-back glyphicons */
.df-root .df-accordion-status-icon {
  float: right;
  font-size: 18px;
  margin-top: 2px;
  margin-right: 4px;

  /* colour will usually inherit from header (white), but you can force it: */
  color: #ffffff;
}

/* Title & “flag”/icon on the right */
.df-accordion-title {
  flex: 1;
}

/* Body: smooth expand/collapse */
.df-accordion-body {
  max-height: 0;
  overflow: hidden;
  padding: 1em 2.2em;
  margin-top: 4px;

  /* start collapsed, no vertical padding */
  padding: 0 2.2em;
  margin-top: 0;

  background: #ffffff;
  border-radius: 4px;
  border: none; /* no border */

  /* Animate height only.
    Padding changes can make the accordion feel like it "wobbles" while opening,
    especially when JS is also recalculating max-height. */
  transition: max-height 0.3s ease;
}

/* When section is open, we add vertical padding */
.df-accordion-section.open .df-accordion-body {
  padding: 1em 2.2em;
  margin-top: 4px;
}



/* ===========================================================
   Sections & Blocks
   =========================================================== */

/* Section wrapper spacing
   What this does:
   - Increases the default space below each rendered section.

   Why this is needed:
   - The accordion body resizes as content changes.
   - A slightly larger default section bottom margin makes the visual gap between
     the Save draft button and the next accordion title feel stable and intentional.

   Watch out:
   - This affects all sections, so keep the increase modest.
*/
.df-section {
  margin-bottom: 28px;
}

.df-text-block {
  margin-bottom: 10px;
  font-size: 16px;
}

.df-text-line {
  margin: 0 0 5px 0;
  line-height: 1.4;
}

.df-declaration-block {
  margin: 15px 0;
  padding: 10px;
  border-left: 4px solid #0078d4;
  background: #f4f9ff;
}

.df-declaration-text {
  margin: 0;
}

.df-heading {
  margin: 15px 0 10px 0;
  font-weight: 600;
}

.df-page-header-content-container {
  font-size: 18px;
  margin: 15px 0 10px 0;
}

.df-page-header-content-container .df-heading {
  margin-bottom: 5px;
}

.df-heading-text {
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.df-page-header-list {
  margin: 0 0 4px 20px;
  padding-left: 18px;
}

.df-page-header-list li {
  margin-bottom: 2px;
}

.df-heading-1 { 
  font-size: 22px;
  margin-top: 30px;
}
.df-heading-2 { 
  font-size: 20px;
  margin-top: 30px;
}
.df-heading-3 { font-size: 18px; }
.df-heading-4 { font-size: 16px; }
.df-heading-5 { font-size: 14px; }
.df-heading-6 { font-size: 13px; }

/* ===========================================================
   Documents Integration Block
   =========================================================== */

.df-documents-block {
  padding: 20px 0px 70px 0px;
}


/* ===========================================================
   Fields Layout
   =========================================================== */

.df-fields-block {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 15px;
}

.df-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 5px;
}

.df-width-full {
  flex: 1 1 100%;
}

.df-width-half {
  flex: 1 1 48%;
  min-width: 260px;
}

.df-width-third {
  flex: 1 1 30%;
  min-width: 220px;
}

.df-width-quarter {
  flex: 1 1 22%;
  min-width: 180px;
}

.df-field-label {
  font-weight: 600;
  margin-bottom: 3px;
}

.df-field-label-readonly {
  color: #666;
}

.df-field-required {
  color: #d83b01;
}

.df-field-sublabel {
  margin-top: 3px;
  font-size: 14px;
  color: #555;
}

.df-field-sublabel-line {
  margin: 0 0 2px 0;
}

.df-field-sublabel ul {
  margin: 3px 0 0 18px;
  padding-left: 18px;
}

.df-field-sublabel li {
  margin-bottom: 2px;
}

/*
  What this does:
  - Styles the optional read-only reason text shown under locked fields.

  Why this is needed:
  - The Page Definition can explain why a field is read-only.
  - Users need that explanation to be visible but not alarming.
*/
.df-field-readonly-reason {
  margin-top: 5px;
  font-size: 12px;
  color: #666666;
  font-style: italic;
}

/* ===========================================================
   Subgrid Modal Layout
   =========================================================== */

/* Inner wrapper for subgrid modal content */
.df-subgrid-modal-inner {
  font-size: 14px;
  line-height: 1.42857143;
  max-width: 750px;      /* 💡 match live modal body width */
  width: 100%;
  padding: 0 15px;
  margin: 0 auto;        /* center within modal body */
  box-sizing: border-box;
}

#df-subgrid-modal-body {
  padding: 0 28px 20px;
}

@media (max-width: 768px) {
  .df-subgrid-modal-inner {
    max-width: 100%;
    padding: 0 10px;
  }
}


.df-modal-title {
  font-size: 24px;
  margin: 0;
}

.df-modal-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}



.df-modal-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 5px;
}

/* reuse existing df-width-* classes for modal fields */
/* they are already defined and will work in this flex container */

/* reuse existing error styles */
.df-modal-field.df-field-invalid .df-field-error {
  display: block;
}

.form-close {
  font-size: 40px;
  font-weight: 500;
  position: absolute;
  top: 1%;
}

.form-close .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.df-calculated-wrapper {
  position: relative;
}

.df-calculated-dash {
  position: absolute;
  top: 4px;
  left: 8px;          /* tweak to align with your input */
  pointer-events: none;
}


/* ===========================================================
   Field-level errors (used in modal and main form)
   =========================================================== */

.df-field-error {
  margin-top: 3px;
  font-size: 13px;
  color: var(--df-tt-red); /* same red as section complete */
}

.modal-footer {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding-left: 10%;
}

/* ===========================================================
   Modal error summary
   =========================================================== */

.df-modal-error-summary {
  margin-bottom: 15px;
  padding: 12px 16px;
  background: var(--df-tt-red);
  color: #fff;
  border-radius: 4px;
}

.df-modal-error-summary-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.df-modal-error-summary-list {
  margin: 0;
  padding-left: 20px;
}

.df-modal-error-summary-list li {
  margin: 2px 0;
}

.validation-header {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.validation-header .fa-info-circle {
  font-size: 18px;
}

/* ===========================================================
   Submit Form confirmation modals
   =========================================================== */

/*
  What this does:
  - Adds light spacing and alignment for the two-stage Submit Form modals.

  Why this is needed:
  - These modals use simple confirmation content rather than the subgrid form
    layout, so they benefit from dedicated spacing rules.

  Future watch-out:
  - Keep these styles scoped to the Submit Form flow so they do not affect
    existing subgrid or delete-confirmation modals.
*/
.df-confirmation-modal .modal-body p {
  margin-bottom: 16px;
  line-height: 1.5;
}

.df-submit-form-confirm-row {
  margin-top: 18px;
}

.df-submit-form-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: normal;
}

.df-submit-form-confirm-label input[type="checkbox"] {
  margin-top: 3px;
}

/* ===========================================================
   Inputs
   =========================================================== */

.df-input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-sizing: border-box;
}

.df-input-text,
.df-input-textarea {
  width: 100%;
}

.df-input-textarea {
  min-height: 60px;
  resize: vertical;
}

.df-input-number,
.df-input-currency {
  width: 100%;
}

.df-input-date {
  width: 180px;
}

.df-input-select {
  width: 100%;
}

/* Dynamic Forms - searchable choice fields */
.df-searchable-choice {
  position: relative;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.df-searchable-choice-input {
  width: 100%;
}

.df-searchable-choice-list {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.df-searchable-choice.df-searchable-choice-open .df-searchable-choice-list {
  display: block;
}

.df-searchable-choice-option,
.df-searchable-choice-empty {
  padding: 7px 9px;
  font: inherit;
}

.df-searchable-choice-option {
  cursor: pointer;
}

.df-searchable-choice-option:hover,
.df-searchable-choice-option-active {
  background: #eef4ff;
}

.df-searchable-choice-empty {
  color: #666;
}

.df-searchable-choice.df-readonly .df-searchable-choice-list {
  display: none;
}

/* Dynamic Forms - checkbox fields */
.df-field.df-field-checkbox {
  gap: 12px;
}

.df-field.df-field-checkbox-horizontal {
  flex-direction: row;
  align-items: center;
}

.df-field.df-field-checkbox-vertical {
  flex-direction: column;
  align-items: flex-start;
}

.df-field.df-field-checkbox .df-field-label {
  margin-bottom: 0;
}

.df-checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.df-checkbox-horizontal {
  flex-direction: row;
  flex-wrap: wrap;
}

.df-checkbox-container:not(.df-checkbox-horizontal) {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.df-checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

.df-checkbox-container:not(.df-checkbox-horizontal) .df-checkbox-option {
  flex-direction: row;
}

.df-checkbox-option input[type="checkbox"] {
  margin: 0;
}

/* Dynamic Forms - radio fields */

.df-input-radio-group {
  display: flex;
  flex-direction: column;
  gap: 3px;

  /* override generic .df-input border/padding for radios */
  border: none;
  padding: 0;
  background: transparent;
}

.df-radio-horizontal {
  flex-direction: row;
  flex-wrap: wrap;
}

.df-radio-option {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  font-weight: normal;
}

.df-radio-option input[type="radio"] {
  margin-right: 5px;
}

/* Remove borders from readOnly and calculated fields */
.df-input:disabled,
.df-input[readonly],
.df-input.df-readonly,
input:disabled,
input[readonly],
input.df-readonly,
select:disabled,
select[readonly],
textarea:disabled,
textarea[readonly],
textarea.df-readonly {
    border: none !important;
    background-color: transparent !important;
    padding-left: 0 !important;
    cursor: text !important; /* Allow text cursor */
    -webkit-user-select: text !important; /* Allow text selection */
    user-select: text !important;
}

/* Remove the not-allowed cursor */
.df-readonly {
    cursor: text !important;
    pointer-events: auto !important;
}



/* ===========================================================
   Subgrid
   =========================================================== */

.df-subgrid-block {
  margin: 70px 0 20px;
  border-bottom: solid;
  padding-bottom: 50px;
}

.df-subgrid-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

/* Toolbar with Add button aligned to the right */
.df-subgrid-toolbar {
  margin-bottom: 8px;
  text-align: right;
}

.df-subgrid-add-btn {
  /* let .btn.btn-primary handle colour etc. */
  font-weight: 600;
  font-size: 14px;
  border-radius: 9999px;
  padding: 6px 18px;
}


/* Table styling */
.df-subgrid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.df-subgrid-table thead tr {
  background: transparent;
}

/* Header cells */
.df-subgrid-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #d0d0d0;
  font-weight: 600;
  font-size: 14px; /* headings 14px */
}

/* Subgrid label + sortable header text */
.df-subgrid-header-label, 
.df-subgrid-sort-indicator{
  color: var(--df-tt-red);
  font-size: 14px; /* column heading size */
}

.df-subgrid-header-sortable {
  cursor: pointer;
  text-decoration: none;
}

.df-subgrid-header-sortable:hover {
  text-decoration: underline;
}

/* Actions column + icons */
.df-subgrid-actions-header {
  width: 40px;
}

.df-subgrid-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px; /* rows 15px */
}

.df-subgrid-actions-cell {
  text-align: right;
  white-space: nowrap;
}

/* Icon-only edit/delete buttons */
.df-subgrid-icon-btn {
  padding: 0 2px;
  margin-left: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* base icon colour + size */
.df-subgrid-edit-btn .fa,
.df-subgrid-delete-btn .fa {
  font-size: 18px;
  color: #5f5f61;
}

/* hover effect for BOTH edit and delete */
.df-subgrid-edit-btn:hover .fa,
.df-subgrid-delete-btn:hover .fa {
  color: var(--df-tt-red);
}

/* Empty-state message */
.df-subgrid-empty {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 3px;
  border: 1px solid #f5e0a3;
  background: #fff8d1;
  font-size: 14px;
  color: #444444;
}

/* Subgrid table zebra striping
   What this does:
   - Applies alternating row background colours to subgrid table rows.
   - Odd rows get a very light grey, even rows stay white.

   Why this is needed:
   - Makes dense subgrid rows easier to scan visually.
   - Improves readability without changing renderer behaviour.

   Watch out:
   - Applied only to tbody rows, so header styling is unaffected.
   - Keep colours subtle so the table still feels clean and not too heavy.
*/
.df-subgrid-table tbody tr:nth-child(odd) {
  background-color: #f7f7f7;
}

.df-subgrid-table tbody tr:nth-child(even) {
  background-color: #ffffff;
}

/* ===========================================================
   Save button + status
   =========================================================== */

.df-action-message {
  margin: 20px 0 12px 0;
  padding: 12px 14px;
  border-radius: 4px;
  border-left: 4px solid var(--df-tt-red);
  background: #fff4f4;
  color: #333;
}

.df-action-message-warning {
  border-left-color: #8a6d3b;
  background: #fff8e6;
}

.df-action-message-title {
  margin-bottom: 4px;
  color: var(--df-tt-red);
  font-weight: 600;
}

.df-action-message-warning .df-action-message-title {
  color: #8a6d3b;
}

.df-action-message-body {
  margin: 0;
}

.df-form-actions {
  margin: 20px 0 0 0;
  display: flex;
  gap: 10px;
}

/* Framework footer note shown at the bottom of Dynamic Forms pages. */
.df-framework-footer {
  color: var(--dark_grey, var(--tt_grey, #666666));
  font-size: 12px;
  margin-top: 28px;
  text-align: right;
}



/* Section-level action row
   What this does:
   - Adds deliberate breathing room above and below the per-section Save draft button.
   - Makes the gap below the button consistent from first render.

   Why this is needed:
   - Open accordion sections use dynamic height based on scrollHeight.
   - Small DOM/layout changes inside an open section can make the next accordion
     title move slightly lower.
   - By giving the action row a stable bottom margin, we make that spacing
     intentional and always visible.

   Watch out:
   - This affects every section that renders a per-section Save draft button.
   - The renderer currently appends that button for each section.
*/
.df-section-actions {
  margin: 20px 0 12px 0;
  text-align: left;
}

/* Keep button spacing simple.
   The wrapper above now controls the main vertical spacing. */
.df-section-save-btn {
  margin-top: 0;
}

/* ===========================================================
   Misc
   =========================================================== */

.df-debug {
  font-size: 0.85rem;
  color: #555;
}

/* ===========================================================
   Column headings inside fields blocks


   border-top: 1px solid #ddd;

   =========================================================== */

.df-column-heading {
  flex: 1 1 100%;
  margin: 10px 0 5px 0;
  padding-top: 5px;
}

.df-column-heading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ===========================================================
   Main wrapper around dynamic form
   =========================================================== */

.df-main-wrapper {
  margin: 0 auto;
  padding: 0;
  border: none;
  background: transparent;
}

/* ===========================================================
   Section load/debug panels
   =========================================================== */

.df-sections-error {
  border: 3px solid red;
  padding: 15px;
  margin-top: 10px;
  background: #ffe6e6;
}

.df-sections-error-title {
  margin-top: 0;
  color: var(--df-tt-red);
}

.df-sections-loaded {
  border: 2px solid green;
  padding: 10px;
  margin-top: 10px;
  background: #d4edda;
}

.df-sections-loaded-title {
  margin-top: 0;
  color: green;
}

/* ===========================================================
   "No Tax Form Found" panel
   =========================================================== */

.df-no-df-record {
  border: 3px solid orange;
  padding: 20px;
  margin: 20px;
  background: #fff3cd;
}

.df-no-df-record-title {
  margin-top: 0;
}

/* ===========================================================
   Dynamic Forms Dashboard

   This dashboard deliberately reuses Personal Tax Portal theme variables
   first, then falls back to Dynamic Forms defaults if a client portal has not
   defined those variables.
   =========================================================== */

/* Layout: match the Provide Information page width.
   The selector includes both classes so it beats Bootstrap's .container width
   rules even if Bootstrap is loaded later on the page. */
.container.df-dashboard-container {
  width: 80vw;
}

/* Layout: keep the left filter column tall like the Provide Information page. */
.df-dashboard-container #pageSidebar {
  height: 60vh;
}

/* Sidebar title: mirrors the bold left-hand heading style. */
.df-dashboard-sidebar h1 {
  font-weight: bold;
}

/* Sidebar helper text: mirrors the Provide Information intro copy size. */
.df-dashboard-sidebar h3 {
  font-size: 20px;
}

/* Filter list wrapper: hides the old scrollbar gutter beside the red buttons. */
.df-dashboard-filter-list-wrapper {
  height: 90%;
  overflow: hidden;
}

/* Filter list: keeps filter buttons centred and prevents horizontal scroll. */
.df-dashboard-filter-list {
  height: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  text-align: -webkit-center;
}

/* Filter list width: keeps the buttons aligned with the left column copy. */
#dfDashboardFormTypeFilters {
  width: 90%;
}

/* Theme bridge: dashboard-specific aliases mapped to portal theme variables.
   Personal Tax Portal CSS commonly defines --tt_red, --tt_white, --text_black,
   --tt_orange_1, --tt_grey and --pri_silver_tint_40. */
.df-dashboard-container {
  --df-dashboard-accent: var(--tt_red, var(--df-tt-red, #ed151a));
  --df-dashboard-accent-hover: var(--tt_orange_1, var(--df-dashboard-accent));
  --df-dashboard-border: var(--pri_silver_tint_40, #dddddd);
  --df-dashboard-empty-bg: var(--pri_silver_tint_40, #fff4f4);
  --df-dashboard-muted: var(--dark_grey, var(--tt_grey, #666666));
  --df-dashboard-text: var(--text_black, #222222);
  --df-dashboard-white: var(--tt_white, #ffffff);
  color: var(--df-dashboard-text);
}

/* Filter buttons: use the client portal accent colour rather than a hardcoded red. */
#dfDashboardFormTypeFilters > li > a {
  background: var(--df-dashboard-accent) !important;
  border-radius: 18px;
  color: var(--df-dashboard-white) !important;
  cursor: pointer;
  margin: 0 0 12px 0;
  padding: 9px 18px;
  text-align: center;
}

/* Filter buttons active/hover: keep active and hover states visually stable. */
#dfDashboardFormTypeFilters > li > a:hover,
#dfDashboardFormTypeFilters > li.active > a,
#dfDashboardFormTypeFilters > li.active > a:hover,
#dfDashboardFormTypeFilters > li.active > a:focus {
  background: var(--df-dashboard-accent) !important;
  color: var(--df-dashboard-white) !important;
}

/* Header row above the grouped status tables. */
.df-dashboard-heading {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Main dashboard heading: removes Bootstrap's default top gap in this position. */
.df-dashboard-heading h1 {
  margin-top: 0;
}

/* Small result count/summary text under the dashboard heading. */
.df-dashboard-summary {
  color: var(--df-dashboard-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Status group block: each status gets its own section and table. */
.df-dashboard-status-group {
  margin-bottom: 30px;
}

/* Status group title, for example Draft or Submitted. */
.df-dashboard-status-title {
  font-size: 22px;
  margin: 0 0 10px 0;
}

/* Count shown beside the status title. */
.df-dashboard-count {
  color: var(--df-dashboard-muted);
  font-size: 14px;
  font-weight: normal;
}

/* Forms table: fixed layout keeps dates/status columns stable. */
.df-dashboard-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

/* Forms table headings: use the client portal accent colour. */
.df-dashboard-table th {
  border-bottom: 1px solid var(--df-dashboard-border);
  color: var(--df-dashboard-accent);
  font-size: 12px;
  font-weight: bold;
  padding: 8px 6px;
  text-align: left;
}

/* Sortable table heading buttons for Name, Created On and Modified On. */
.df-dashboard-sort-header {
  background: transparent;
  border: 0;
  color: var(--df-dashboard-accent);
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  padding: 0;
  text-align: left;
}

/* Sortable table heading hover state. */
.df-dashboard-sort-header:hover {
  color: var(--df-dashboard-accent-hover);
  text-decoration: underline;
}

/* Small arrow indicator beside the active sort column. */
.df-dashboard-sort-indicator {
  display: inline-block;
  margin-left: 4px;
}

/* Forms table cells. */
.df-dashboard-table td {
  border-bottom: 1px solid var(--df-dashboard-border);
  font-size: 13px;
  padding: 9px 6px;
  vertical-align: top;
  word-wrap: break-word;
}

/* Form links: scoped strongly enough to beat the portal's generic a rules. */
.df-dashboard .df-dashboard-form-link {
  color: var(--df-dashboard-text) !important;
  font-weight: normal;
  text-decoration: none;
}

/* Form links hover: use the portal hover/accent colour. */
.df-dashboard .df-dashboard-form-link:hover {
  color: var(--df-dashboard-accent-hover) !important;
  text-decoration: underline;
}

/* Empty state panel shown when no forms match the selected filter. */
.df-dashboard-empty {
  background: var(--df-dashboard-empty-bg);
  border-left: 4px solid var(--df-dashboard-accent);
  padding: 14px 16px;
}

/* Small framework note at the bottom right of the dashboard. */
.df-dashboard-framework-footer {
  color: var(--df-dashboard-muted);
  font-size: 12px;
  margin-top: 28px;
  text-align: right;
}

/* Tablet and smaller: copy the Provide Information layout behaviour. */
@media (max-width: 1200px) {
  .container.df-dashboard-container {
    width: 100vw;
  }

  .df-dashboard-container #pageSidebar {
    height: 30vh;
  }

  .df-dashboard-container .col-sm-8,
  .df-dashboard-container .col-lg-9 {
    padding: 0;
  }
}

/* Phone layout: convert each table row into stacked label/value lines. */
@media (max-width: 767px) {
  .df-dashboard-heading {
    align-items: flex-start;
    display: block;
  }

  .df-dashboard-table,
  .df-dashboard-table thead,
  .df-dashboard-table tbody,
  .df-dashboard-table th,
  .df-dashboard-table td,
  .df-dashboard-table tr {
    display: block;
  }

  .df-dashboard-table thead {
    display: none;
  }

  .df-dashboard-table tr {
    border-bottom: 1px solid var(--df-dashboard-border);
    padding: 8px 0;
  }

  .df-dashboard-table td {
    border-bottom: 0;
    padding: 4px 6px;
  }

  .df-dashboard-table td::before {
    color: var(--df-dashboard-accent);
    content: attr(data-label) ": ";
    font-weight: bold;
  }
}
