/* Dashboard layout. Load after style.css and before subscription.css.
   Shared branding and typography remain in style.css. */

.dashboard-body .app-header {
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.dashboard-body .app-logo {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.dashboard-body .app-logo-image {
  flex-shrink: 0;
}

.dashboard-body .app-logo span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-body .header-actions {
  display: flex;
  flex: 1 1 420px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-body #headerBusinessName {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dashboard-body .header-actions button {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}

.dashboard-body .dashboard-welcome {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px 30px;
  margin-bottom: 32px;
}

.dashboard-body .dashboard-welcome > div:first-child {
  flex: 1 1 420px;
  min-width: 0;
}

.dashboard-body .dashboard-welcome h1 {
  font-size: 42px;
  letter-spacing: -1.8px;
  overflow-wrap: anywhere;
}

.dashboard-body .dashboard-welcome p {
  margin-top: 10px;
  color: var(--muted);
}

.dashboard-body .business-badge {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dashboard-body .status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-bottom: 38px;
}

.dashboard-body .status-card > div,
.dashboard-body .help-card-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-body .dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.75fr);
  align-items: start;
  gap: 28px;
}

.dashboard-body .dashboard-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.dashboard-body .dashboard-profile,
.dashboard-body .dashboard-responsibilities {
  grid-column: auto;
}

.dashboard-body .dashboard-subscription > .subscription-card {
  max-width: 520px;
}

.dashboard-body .record-export-controls,
.dashboard-body #exportCustomDates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.dashboard-body #exportCustomDates[hidden] {
  display: none;
}

.dashboard-body .record-export-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.dashboard-body .record-export-controls :is(input, select) {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
}

.dashboard-body .record-export-controls .export-transactions-button {
  width: auto;
  margin: 0;
}

.dashboard-body #exportDatasetStatus,
.dashboard-body #exportDatasetError {
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.dashboard-body #exportDatasetError {
  color: #a32626;
}

.dashboard-body .dashboard-main-grid > *,
.dashboard-body .dashboard-column,
.dashboard-body .dashboard-sidebar,
.dashboard-body .recent-checks-card,
.dashboard-body .recent-transactions {
  min-width: 0;
  max-width: 100%;
}

.dashboard-body .dashboard-sidebar {
  container-type: inline-size;
  container-name: dashboard-sidebar;
}

.dashboard-body .primary-action-button,
.dashboard-body .export-transactions-button {
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-body .saved-transaction-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  gap: 8px;
  padding: 12px;
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-body .saved-transaction-card:hover {
  border-color: #b7cbc1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.dashboard-body .saved-transaction-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.dashboard-body .saved-transaction-main > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-body .saved-transaction-main strong {
  color: #17201b;
  font-size: 14px;
}

.dashboard-body .saved-transaction-main small {
  color: #68756f;
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-body .saved-transaction-category {
  display: block;
  margin: 2px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #557066;
}

.dashboard-body .saved-transaction-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #173f34;
  background: #dcece4;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 800;
}

.dashboard-body .saved-transaction-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  min-width: 0;
}

.dashboard-body .saved-transaction-side > strong {
  min-width: 0;
  color: #17201b;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.dashboard-body .saved-transaction-actions {
  display: flex;
  flex-wrap: wrap;
  flex: 0 1 auto;
  min-width: 0;
  gap: 8px;
}

.dashboard-body .view-transaction,
.dashboard-body .delete-transaction {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid #177554;
  border-radius: 9px;
  color: #177554;
  cursor: pointer;
}

.dashboard-body .delete-transaction {
  color: #9f3030;
  background: transparent;
  border-color: #e7caca;
  border-radius: 8px;
}

.dashboard-body .view-transaction:hover {
  color: #ffffff;
  background: #177554;
}

.dashboard-body .delete-transaction:hover {
  color: #ffffff;
  background: #a53a3a;
  border-color: #a53a3a;
}

.dashboard-body #profileSummary .profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px 15px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1ef;
}

.dashboard-body #profileSummary .profile-row:last-child {
  border-bottom: 0;
}

.dashboard-body #profileSummary .profile-row > span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.dashboard-body #profileSummary .profile-field-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.dashboard-body #profileSummary strong {
  min-width: 0;
  font-size: 11px;
  text-align: left;
  overflow-wrap: anywhere;
}

.dashboard-body #profileSummary .profile-field-edit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.dashboard-body :is(button, a):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

@container dashboard-sidebar (min-width: 400px) {
  .dashboard-body #profileSummary .profile-row {
    grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr);
  }
}

@media (max-width: 1000px) {
  .dashboard-body .dashboard-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .dashboard-body .header-actions {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .dashboard-body .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .dashboard-body .app-logo {
    gap: 10px;
  }

  .dashboard-body .app-logo span {
    font-size: 15px;
  }

  .dashboard-body .header-actions {
    flex: 0 1 auto;
    gap: 8px;
  }

  .dashboard-body #headerBusinessName {
    display: none;
  }

  .dashboard-body .dashboard-welcome h1 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-body .saved-transaction-card {
    transition: none;
    transform: none;
  }
}

/* Local PDF controls and preview; existing Dashboard layouts remain unchanged. */
.dashboard-body .pdf-branding { margin-top: 16px; }
.dashboard-body .pdf-branding summary { cursor: pointer; padding: 12px 0; }
.dashboard-body .pdf-branding label { display: block; margin-top: 12px; }
.dashboard-body .pdf-branding input { display: block; width: 100%; max-width: 480px; min-width: 0; margin-top: 6px; }
.dashboard-body .pdf-branding p { margin-top: 8px; overflow-wrap: anywhere; }
.dashboard-body #pdfPreviewDialog { width: min(1100px, 94vw); max-width: 94vw; max-height: 92vh; margin: auto; padding: 20px; border: 1px solid #b7cbc1; border-radius: 16px; background: #fbfaf7; color: var(--text); }
.dashboard-body #pdfPreviewDialog::backdrop { background: rgba(15, 23, 42, 0.6); }
.dashboard-body .pdf-preview-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.dashboard-body #pdfPreviewPeriod { overflow-wrap: anywhere; }
.dashboard-body #pdfPreviewFrame { display: block; width: 100%; height: 60vh; margin: 16px 0; border: 1px solid #e4ebe7; }
.dashboard-body :is(#previewRecordsPdf, #downloadRecordsPdf, #downloadPreviewPdf, #closePdfPreview) { min-height: 44px; }
.dashboard-body .pdf-branding summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* Local sharing and Account & Data controls. */
.dashboard-body .pdf-preview-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dashboard-body :is(#shareRecordsPdf, #sharePreviewPdf, #clearAllData) { min-height: 44px; }
.dashboard-body .pdf-share-help { margin-top: 12px; }
.dashboard-body .pdf-share-help summary { cursor: pointer; padding: 12px 0; }
.dashboard-body .pdf-share-help summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.dashboard-body .pdf-share-help ol { padding-left: 24px; }
.dashboard-body .pdf-share-help li { margin-top: 8px; }
.dashboard-body :is(#pdfShareStatus, .account-data p) { overflow-wrap: anywhere; margin-top: 12px; }
.dashboard-body .account-data .profile-data-actions { margin-top: 16px; }
@media (max-width: 430px) {
  .dashboard-body #pdfPreviewDialog { padding: 12px; }
  .dashboard-body .pdf-preview-heading > div { min-width: 0; }
  .dashboard-body #pdfPreviewFrame { height: 45vh; }
}

/* Keep everyday tools separate from account and destructive actions. */
.dashboard-body .header-actions { flex-basis: 100%; justify-content: space-between; align-items: flex-start; }
.dashboard-primary-nav { display:flex; flex-wrap:wrap; gap:8px; }
.dashboard-account-menu { position:relative; min-width:180px; }
.dashboard-account-menu summary { cursor:pointer; padding:12px 16px; border:1px solid var(--border, #d8ded5); border-radius:12px; color:var(--text, #173c31); background:white; min-height:44px; }
.dashboard-account-actions { display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:12px; border:1px solid #d8ded5; border-radius:12px; background:white; margin-top:8px; }
.dashboard-account-actions #headerBusinessName { padding:8px; font-weight:600; }
.dashboard-account-actions #addBusiness { order:3; }
.dashboard-account-actions #deleteBusiness { order:4; }
.dashboard-account-actions #signOutButton { order:5; }
.dashboard-primary-nav .small-button { min-height:44px; text-decoration:none; }
@media(min-width:800px) { .dashboard-account-actions { position:absolute; right:0; width:290px; z-index:20; box-shadow:0 10px 30px #173c3120; } }
@media(max-width:600px) { .dashboard-primary-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; } .dashboard-primary-nav .small-button { text-align:center; } .dashboard-account-menu { width:100%; } }

.dashboard-body .dashboard-responsibilities {
  grid-column: 1 / -1;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #729582;
  border-inline-start: 6px solid #237454;
  border-radius: 16px;
  background-color: #e7f3eb;
  color: #173c31;
}

.dashboard-responsibilities h2 { margin: 0; }
.dashboard-responsibilities p { margin: 8px 0 16px; }
.dashboard-responsibilities a {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 8px;
  background: #173c31;
  color: white;
  font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
  .dashboard-body .dashboard-responsibilities {
    animation: responsibilities-highlight 4s ease-in-out 1;
  }
}

@keyframes responsibilities-highlight {
  50% { background-color: #fff0c5; border-inline-start-color: #966421; }
}
