.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.page-head h1 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: 0.01em;
}

.page-head .page-count {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.btn-navy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--navy-deep);
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-navy:hover,
.btn-navy:focus {
  background: var(--navy-mid);
  color: #fff !important;
}

.page-search {
  position: relative;
  margin-bottom: 10px;
}

.page-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dark);
  font-size: 0.9rem;
}

.page-search input {
  width: 100%;
  min-height: 42px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px 8px 36px;
  background: #fff;
  color: var(--text);
}

.page-search input:focus {
  outline: 0;
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.2);
}

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

.entity-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.entity-card.is-hidden,
.doc-file-card.is-hidden,
tr.js-client.is-hidden,
tr.js-row.is-hidden {
  display: none !important;
}

.entity-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.entity-initials {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--navy-deep);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entity-initials.has-photo {
  padding: 0;
  overflow: hidden;
  background: #e8e4dc;
}

.entity-initials.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-copy {
  min-width: 0;
  flex: 1;
}

.entity-copy strong {
  display: block;
  font-size: 16px;
  color: var(--navy-deep);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-meta {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-meta a {
  color: #0d5ea0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

.entity-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0ebe2;
}

.chip-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fcfbf8;
  color: var(--navy-deep);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none !important;
}

.chip-btn i {
  color: var(--gold-dark);
  font-size: 12px;
}

.chip-btn:hover {
  background: #f6f1e6;
  color: var(--navy-deep);
}

.app-link {
  color: #0d5ea0 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 700;
}

.app-link i {
  font-size: 0.78em;
  margin-right: 4px;
}

.app-link:hover,
.app-link:focus {
  color: #8b6914 !important;
}

.chip-btn.is-call {
  background: #eef6ee;
  border-color: #b7d7b9;
  color: #1b7a3a;
}

.chip-btn.is-call i {
  color: #1b7a3a;
}

.chip-btn.danger {
  color: #9b1c1c;
  margin-left: auto;
  border: 0;
  background: transparent;
}

.chip-btn.danger i {
  color: #9b1c1c;
}

.entity-card-actions form {
  margin-left: auto;
}

.entity-check {
  display: flex;
  align-items: center;
  margin: 0 8px 0 0;
}

.entity-check input {
  width: 18px;
  height: 18px;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dash-line .entity-check {
  margin-right: 10px;
}

.page-empty {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px 16px;
  color: var(--muted);
}

.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.table-card .table {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.table-card thead th {
  background: var(--navy-deep);
  color: #f7f1e3;
  font-weight: 600;
  border: 0;
  padding: 10px 12px;
  white-space: nowrap;
}

.table-card tbody td {
  padding: 9px 12px;
  vertical-align: middle;
  border-top: 1px solid #efe9de;
}

.table-card tbody td a:not(.chip-btn) {
  color: #0d5ea0;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-card tbody td a:hover {
  color: var(--gold-dark);
}

.table-card tbody tr:hover {
  background: #faf7f1;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #eef3f7;
  color: var(--navy-deep);
  white-space: nowrap;
}

.status-pill.is-open {
  background: #e8f4ea;
  color: #1b7a3a;
}

.status-pill.is-closed {
  background: #ececec;
  color: #5d6570;
}

.status-pill.is-hearing {
  background: #f7efd8;
  color: #8b6914;
}

.entity-copy a {
  color: #0d5ea0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entity-copy a:hover {
  color: var(--gold-dark);
}

.detail-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.detail-hero h1 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.3;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.detail-card h2 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.detail-item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #f0ebe2;
  font-size: 15px;
}

.detail-item:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.detail-item span {
  color: var(--muted);
  font-weight: 600;
}

.detail-item strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  max-width: 760px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

a.form-card.admin-tool {
  display: block;
  max-width: none;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.form-card.admin-tool:hover {
  border-color: var(--gold-mid);
  box-shadow: 0 6px 16px rgba(14, 39, 64, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-card .form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-deep);
}

.form-card .form-control,
.form-card select.form-control {
  min-height: 44px;
  font-size: 16px;
  border: 1px solid #d9d2c6;
  border-radius: 10px;
}

.form-card .form-control:focus,
.form-card select.form-control:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.2);
}

.field-split {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field-split .chip-btn {
  flex-shrink: 0;
  white-space: nowrap;
  height: 44px;
}

.field-split .form-control {
  flex: 1;
  min-width: 0;
}

.section-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfbf8;
}

.section-box h2 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-deep);
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy-deep) !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
}

.app-modal .modal-header {
  background: var(--navy-deep);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.app-modal .modal-header .close {
  color: #fff;
  opacity: 0.85;
}

.app-modal .modal-content {
  border-radius: 12px;
  border: 0;
}

@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .form-actions {
    position: sticky;
    bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px));
    background: var(--cream);
    padding: 8px 0 4px;
    z-index: 5;
  }

  .form-actions .btn-navy,
  .form-actions .btn-ghost {
    flex: 1;
  }
}

.client-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(14, 39, 64, 0.12);
  max-height: 240px;
  overflow-y: auto;
}

.search-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 9px 12px;
  border-bottom: 1px solid #f0ebe2;
  color: var(--navy-deep);
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result strong {
  display: block;
  font-size: 15px;
}

.search-result small,
.client-chip-copy small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.search-result:hover,
.search-result:focus {
  background: #f6f1e6;
}

.search-result.muted {
  color: var(--muted);
}

.selected-clients {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.client-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.client-chip.is-primary {
  border-color: var(--gold-mid);
  background: #fcf8ef;
}

.client-chip-copy {
  min-width: 0;
  flex: 1;
}

.client-chip-copy a {
  color: #0d5ea0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.client-chip-copy a:hover,
.entity-meta a:hover {
  color: var(--gold-dark);
}

.primary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-deep);
  white-space: nowrap;
}

.chip-remove {
  border: 0;
  background: transparent;
  color: #9b1c1c;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0 4px;
}

.picker-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.picker-error {
  color: #9b1c1c;
}

@media (max-width: 767.98px) {
  .page-head h1 {
    font-size: 1.18rem;
  }

  .clients-table-wrap,
  .list-table-wrap {
    display: none;
  }
}

@media (min-width: 768px) {
  .clients-card-wrap,
  .list-card-wrap {
    display: none;
  }
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.cal-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}

.cal-legend .dot.is-upcoming,
.fc-event.is-upcoming,
.fc-list-event.is-upcoming .fc-list-event-dot {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}

.cal-legend .dot.is-adjourned,
.fc-event.is-adjourned,
.fc-list-event.is-adjourned .fc-list-event-dot {
  background: var(--gold-mid);
  border-color: var(--gold-mid);
}

.cal-legend .dot.is-done,
.fc-event.is-done,
.fc-list-event.is-done .fc-list-event-dot {
  background: #2d7a45;
  border-color: #2d7a45;
}

.cal-views {
  display: flex;
  gap: 6px;
}

.cal-views .chip-btn.is-active {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}

.cal-views .chip-btn.is-active i {
  color: var(--gold);
}

.cal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.cal-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
  overflow: hidden;
}

.cal-hint {
  margin: 8px 2px 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

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

.upcoming-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfbf8;
  padding: 10px 12px;
  color: var(--navy-deep);
}

.upcoming-item strong {
  display: block;
  font-size: 15px;
}

.upcoming-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.upcoming-item:hover,
.upcoming-item:focus {
  background: #f6f1e6;
  border-color: var(--gold-mid);
}

.fc {
  --fc-border-color: #efe9de;
  --fc-page-bg-color: #fff;
  --fc-neutral-bg-color: #f7f4ee;
  --fc-today-bg-color: #f7efd8;
  --fc-event-bg-color: #0e2740;
  --fc-event-border-color: #0e2740;
  --fc-event-text-color: #fff;
  --fc-button-bg-color: #0e2740;
  --fc-button-border-color: #0e2740;
  --fc-button-text-color: #fff;
  --fc-button-hover-bg-color: #173d5c;
  --fc-button-hover-border-color: #173d5c;
  --fc-button-active-bg-color: #8b6914;
  --fc-button-active-border-color: #8b6914;
  --fc-now-indicator-color: #d4b36a;
  --fc-page-text-color: var(--text);
  font-family: inherit;
}

.fc .fc-toolbar-title {
  font-size: 1.12rem;
  color: var(--navy-deep);
  font-weight: 700;
}

.fc .fc-button {
  border-radius: 8px !important;
  font-weight: 700;
  text-transform: none;
  box-shadow: none !important;
  padding: 6px 10px;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.fc .fc-col-header-cell-cushion {
  color: var(--navy-deep);
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 4px;
}

.fc .fc-daygrid-day-number {
  color: var(--navy-deep);
  font-weight: 700;
  padding: 6px;
}

.fc .fc-daygrid-day-frame {
  min-height: 88px;
}

.fc-event {
  border: 0 !important;
  border-radius: 6px !important;
  padding: 1px 5px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.fc .fc-list-sticky .fc-list-day > * {
  background: #f7f4ee;
}

.fc .fc-list-event:hover td {
  background: #f6f1e6;
}

.fc .fc-list-event td {
  padding: 10px 12px;
}

.fc .fc-list-day-cushion {
  font-weight: 700;
  color: var(--navy-deep);
}

.fc .fc-daygrid-more-link {
  color: #0d5ea0;
  font-weight: 700;
  text-decoration: underline;
}

.fc .fc-timegrid-slot {
  height: 2.4em;
}

.hearing-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.hearing-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 39, 64, 0.45);
}

.hearing-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgba(14, 39, 64, 0.2);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hearing-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--navy-deep);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.hearing-sheet-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.hearing-sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.hearing-sheet-body {
  padding: 4px 14px 8px;
}

.hearing-sheet-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
}

.hearing-sheet-actions .btn-navy,
.hearing-sheet-actions form {
  flex: 1;
}

.hearing-sheet-actions .danger {
  margin-left: 0;
  width: 100%;
  justify-content: center;
  background: #f8eeee;
  border: 1px solid #e4c7c7;
}

body.sheet-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .cal-views {
    width: 100%;
  }

  .cal-views .chip-btn {
    flex: 1;
    justify-content: center;
  }

  .fc .fc-header-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
  }

  .fc .fc-toolbar-chunk:nth-child(2) {
    grid-column: 1 / -1;
    order: -1;
    justify-content: center;
  }

  .fc .fc-toolbar-title {
    font-size: 1rem;
  }

  .fc .fc-button {
    min-height: 36px;
    padding: 4px 8px;
    font-size: 13px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 64px;
  }

  .fc-scrollgrid,
  .fc-theme-standard td,
  .fc-theme-standard th {
    font-size: 13px;
  }
}

@media (min-width: 992px) {
  .cal-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .cal-upcoming {
    position: sticky;
    top: calc(var(--nav-h) + 12px);
  }

  .hearing-sheet-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(520px, calc(100vw - 40px));
    transform: translate(-50%, -50%);
    border-radius: 14px;
    max-height: min(80vh, 640px);
  }
}

.doc-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.doc-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy-deep) !important;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none !important;
}

.doc-step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef3f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.doc-step.is-active {
  background: var(--navy-deep);
  color: #fff !important;
  border-color: var(--navy-deep);
}

.doc-step.is-active span {
  background: var(--gold);
  color: var(--navy-deep);
}

.doc-steps-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.doc-type-card .doc-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.doc-type-card .doc-type-head h2 {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.05rem;
}

.detail-card > .doc-type-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-card > .doc-type-head h2 {
  margin: 0 auto 0 0;
}

.doc-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.doc-type-row .form-control {
  flex: 1;
  min-width: 0;
  min-height: 42px;
}

.doc-file-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfbf8;
  margin-bottom: 8px;
}

.doc-file-card i.file-ico {
  color: var(--gold-dark);
  font-size: 1.15rem;
  margin-top: 3px;
}

.doc-file-copy {
  flex: 1;
  min-width: 0;
}

.doc-file-copy strong {
  display: block;
  color: var(--navy-deep);
  font-size: 15px;
}

.doc-file-copy small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.doc-file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #d9d2c6;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 8px;
}

.upload-row .chip-btn.danger {
  margin-left: 0;
  justify-content: center;
}

.upload-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-deep);
  word-break: break-word;
}

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

.drop-zone {
  border: 1.5px dashed #d9d2c6;
  border-radius: 12px;
  background: #fcfbf8;
  padding: 16px 12px;
  text-align: center;
  margin-bottom: 10px;
}

.drop-zone.is-over {
  border-color: var(--gold-mid);
  background: #f7efd8;
}

.drop-zone p {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--navy-deep);
}

.drop-zone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.drop-zone-actions .chip-btn {
  position: relative;
  cursor: pointer;
  margin-left: 0;
}

@media (min-width: 768px) {
  .drop-camera {
    display: none;
  }
}

.selected-client-box {
  margin-top: 8px;
}

@media (min-width: 768px) {
  .upload-row {
    grid-template-columns: minmax(140px, 0.9fr) minmax(0, 1.4fr) auto;
    align-items: center;
  }
}

@media (max-width: 767.98px) {
  .doc-file-card {
    flex-wrap: wrap;
  }

  .doc-file-actions {
    width: 100%;
  }

  .doc-file-actions .chip-btn {
    flex: 1;
    justify-content: center;
  }

  .doc-file-actions .danger {
    margin-left: 0;
  }
}

.file-preview {
  background: #0e2740;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.file-preview iframe,
.file-preview img {
  display: block;
  width: 100%;
  height: min(78vh, 920px);
  border: 0;
  background: #0e2740;
}

.file-preview img {
  object-fit: contain;
  padding: 12px;
}

.file-preview-html iframe {
  background: #fff;
}

.maker-optional {
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.maker-tools {
  margin-bottom: 10px;
}

.maker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.maker-lang {
  max-width: 140px;
  min-height: 34px;
  font-size: 14px;
}

.maker-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.maker-paper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.maker-paper #toolbar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #fcfbf8;
}

.maker-paper .ql-toolbar.ql-snow,
.maker-paper .ql-container.ql-snow {
  border: 0;
}

.maker-paper .ql-editor {
  min-height: min(70vh, 920px);
  font-size: 16px;
  font-family: "Times New Roman", Georgia, serif;
  color: var(--text);
}

.ql-font-times-new-roman { font-family: "Times New Roman", serif; }
.ql-font-georgia { font-family: Georgia, serif; }
.ql-font-courier-new { font-family: "Courier New", monospace; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="times-new-roman"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="times-new-roman"]::before {
  content: "Times New Roman";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="georgia"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="georgia"]::before {
  content: "Georgia";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="courier-new"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="courier-new"]::before {
  content: "Courier New";
}

.maker-paper .ql-snow .ql-picker.ql-size .ql-picker-label::before,
.maker-paper .ql-snow .ql-picker.ql-size .ql-picker-item::before {
  content: attr(data-value);
}

@media (min-width: 768px) {
  .maker-sticky {
    display: none;
  }
}

@media print {
  .app-navbar,
  .sidebar,
  #sidebar-wrapper,
  .sidebar-overlay,
  .mobile-bottom-nav,
  .app-tabbar,
  .page-head,
  .maker-tools,
  .maker-sticky,
  .maker-paper #toolbar,
  .ql-toolbar,
  #draftSheet,
  .flash {
    display: none !important;
  }

  body.app-body {
    padding: 0;
    background: #fff;
  }

  .app-main,
  .ml-sidebar {
    margin: 0 !important;
    padding: 0 !important;
  }

  .maker-paper,
  .ql-container,
  .ql-editor {
    border: 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
  }
}

.status-pill.is-overdue {
  background: #fdecec;
  color: #9b1c1c;
}

.chip-btn.is-on {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: #fff;
}

.chip-btn.is-on i {
  color: var(--gold);
}

.finance-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.finance-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 10px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.finance-stat span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.finance-stat strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 1.25rem;
  color: var(--navy-deep);
}

.finance-stat small {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.finance-stat.is-paid strong { color: #1b7a3a; }
.finance-stat.is-due strong { color: #8b6914; }
.finance-stat.is-overdue strong { color: #9b1c1c; }

.finance-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.insight-periods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.insight-table th.is-num,
.insight-table td.is-num {
  text-align: right;
  white-space: nowrap;
}

.insight-table td.is-paid { color: #1b7a3a; font-weight: 700; }
.insight-table td.is-overdue { color: #9b1c1c; font-weight: 700; }

.recharge-top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.recharge-circle-wrap,
.recharge-rates,
.recharge-card {
  background: #fff;
}

.recharge-circle-wrap,
.recharge-rates {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.recharge-circle-wrap h2,
.recharge-rates h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--navy-deep);
}

.recharge-circle {
  width: 110px;
  height: 110px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: inset 0 0 0 3px var(--gold);
}

.recharge-circle-wrap {
  text-align: center;
}

.recharge-warn {
  display: block;
  margin-top: 6px;
  color: #9b1c1c;
  font-weight: 700;
  font-size: 13px;
}

.recharge-pay {
  display: inline-flex;
}

.recharge-pay.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.recharge-rate-banner {
  background: #f7f3ea;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.recharge-rate-banner p {
  margin: 0 0 4px;
  color: var(--navy-deep);
}

.recharge-rate-banner strong {
  font-size: 1.05rem;
}

@media (max-width: 700px) {
  .recharge-top {
    grid-template-columns: 1fr;
  }
}

.msg-view {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(14, 39, 64, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.msg-view[hidden] {
  display: none;
}

.msg-view-card {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(14, 39, 64, 0.22);
}

.msg-view-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px 10px;
  background: var(--navy-deep);
  color: #fff;
}

.msg-view-card header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.msg-view-card header .maker-hint {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.msg-view-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.msg-view-body {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
  color: var(--navy-deep);
  background: #f7f3ea;
}

.law-doc {
  background: #fff;
  color: #1c2430;
  max-width: 820px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(14, 39, 64, 0.08);
}

.law-doc-head {
  background: var(--navy-deep);
  color: #fff;
}

.law-doc-head-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px 18px;
  align-items: flex-start;
}

.law-doc-brand {
  display: flex;
  gap: 14px;
  min-width: 0;
}

.law-doc-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  flex-shrink: 0;
}

.law-doc-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.law-doc-firm {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.law-doc-addr {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.law-doc-meta {
  text-align: right;
  flex-shrink: 0;
}

.law-doc-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.law-doc-no {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 4px 0 8px;
}

.law-doc-meta .status-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #f3e2b0;
  border: 1px solid rgba(212, 179, 106, 0.45);
}

.law-doc-gold {
  height: 3px;
  background: linear-gradient(90deg, #8b6914, var(--gold), #f3e2b0, var(--gold), #8b6914);
}

.law-doc-body {
  padding: 20px 26px 8px;
}

.law-doc-parties {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  margin-bottom: 18px;
}

.law-doc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 4px;
}

.law-doc-client {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy-deep);
  margin-bottom: 4px;
}

.law-doc-parties p,
.law-doc-notes {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.law-doc-dates {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.law-doc-dates div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}

.law-doc-dates span {
  color: var(--muted);
  font-weight: 700;
}

.law-doc-dates strong {
  color: var(--navy-deep);
  text-align: right;
}

.law-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 12px;
}

.law-doc-table th {
  background: var(--navy-deep);
  color: #f3e2b0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 10px;
}

.law-doc-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.law-doc-table tbody tr:nth-child(even) td {
  background: #faf7f1;
}

.law-doc-table .is-num,
.law-doc-totals .is-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.law-doc-totals-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 16px;
}

.law-doc-totals {
  width: min(340px, 100%);
  border-collapse: collapse;
}

.law-doc-totals td {
  padding: 7px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.law-doc-totals tr.is-strong td {
  color: var(--navy-deep);
  font-size: 1.02rem;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.law-doc-totals tr.is-due td {
  background: var(--navy-deep);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 10px 12px;
}

.law-doc-totals tr.is-due td:first-child {
  border-radius: 8px 0 0 8px;
}

.law-doc-totals tr.is-due td:last-child {
  border-radius: 0 8px 8px 0;
  color: var(--gold);
}

.law-doc-hero {
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 6px 0 16px;
}

.law-doc-hero span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.law-doc-hero strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
  color: var(--navy-deep);
  letter-spacing: -0.02em;
}

.law-doc-pay {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px dashed #d4b36a;
  border-radius: 12px;
  background: #fbf8f1;
  margin: 8px 0 14px;
}

.law-doc-pay img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}

.law-doc-pay p {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.law-doc-notes {
  margin-top: 8px;
}

.law-doc-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 26px;
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
}

.law-doc-foot span:last-child {
  color: var(--gold);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .law-doc-head-row,
  .law-doc-parties,
  .law-doc-foot {
    display: block;
  }

  .law-doc-meta,
  .law-doc-dates {
    text-align: left;
    margin-top: 12px;
  }

  .law-doc-hero strong {
    font-size: 1.6rem;
  }

  .law-doc-foot span:last-child {
    display: block;
    margin-top: 4px;
  }
}

.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.print-letterhead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.print-letterhead h2 {
  margin: 0 0 4px;
  color: var(--navy-deep);
  font-size: 1.2rem;
}

.print-letterhead p,
.print-billto p,
.print-notes {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.print-meta {
  text-align: right;
}

.print-meta h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: var(--navy-deep);
}

.print-billto {
  margin-bottom: 14px;
}

.print-billto span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.print-billto strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
}

.print-table th,
.print-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.print-table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.print-table td:last-child,
.print-table th:last-child {
  text-align: right;
  font-weight: 700;
}

.print-table tr.is-total td {
  color: var(--navy-deep);
  font-size: 1.05rem;
  border-bottom: 0;
}

.print-only {
  display: none;
}

.print-notes {
  margin-top: 10px;
}

@media (min-width: 768px) {
  .finance-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .finance-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.item-table-wrap {
  overflow-x: auto;
  margin-bottom: 8px;
}

.item-table {
  width: 100%;
  border-collapse: collapse;
}

.item-table th {
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  padding: 4px 6px;
}

.item-table td {
  padding: 4px 4px;
  vertical-align: middle;
}

.item-table td:nth-child(2),
.item-table td:nth-child(3) {
  width: 88px;
}

.item-table .js-amt {
  font-weight: 700;
  white-space: nowrap;
}

.maker-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-weight: 600;
  color: var(--text);
}

.pay-qr {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.pay-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
}

.pay-qr strong {
  display: block;
  color: var(--navy-deep);
}

.writeoff-form {
  margin-top: 10px;
}

@media print {
  .no-print,
  .app-navbar,
  .sidebar,
  #sidebar-wrapper,
  .sidebar-overlay,
  .mobile-bottom-nav,
  .app-tabbar,
  .flash,
  .page-head {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .insight-print-head h1 {
    margin: 0 0 4px;
    font-size: 1.4rem;
  }

  .print-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .law-doc {
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .law-doc-head,
  .law-doc-table th,
  .law-doc-totals tr.is-due td,
  .law-doc-foot,
  .law-doc-gold {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.app-body {
    background: #fff;
    padding: 0;
  }

  @page {
    size: A4;
    margin: 10mm;
  }

  .app-main,
  .ml-sidebar {
    margin: 0 !important;
    padding: 0 !important;
  }
}

.kanban-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.kanban-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 220px;
  box-shadow: 0 4px 12px rgba(14, 39, 64, 0.05);
}

.kanban-col header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f0ebe2;
}

.kanban-col h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-deep);
}

.kanban-col header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.kanban-drop {
  min-height: 180px;
  padding: 8px;
}

.kanban-card {
  background: #fcfbf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: grab;
}

.kanban-card strong {
  display: block;
  color: var(--navy-deep);
  font-size: 15px;
  margin-bottom: 4px;
}

.kanban-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.kanban-card-actions form {
  margin-left: auto;
}

@media (min-width: 900px) {
  .kanban-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.report-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

a.report-tile {
  display: block;
  text-decoration: none !important;
  color: inherit;
  margin-bottom: 0;
}

a.report-tile h2 {
  margin: 0 0 6px;
}

a.report-tile strong {
  display: block;
  font-size: 1.35rem;
  color: var(--navy-deep);
}

a.report-tile p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

@media (min-width: 768px) {
  .report-tiles {
    grid-template-columns: 1fr 1fr;
  }
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  background: var(--navy-deep);
  color: #f7f1e3;
  border-radius: 16px;
  padding: 18px 16px 16px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(14, 39, 64, 0.18);
}

.dash-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.dash-hero h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}

.dash-sub {
  margin: 4px 0 0;
  color: rgba(247, 241, 227, 0.72);
  font-weight: 600;
  font-size: 14px;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-hero .chip-btn {
  background: transparent;
  border-color: rgba(212, 179, 106, 0.55);
  color: #f7f1e3;
}

.dash-hero .chip-btn i {
  color: var(--gold);
}

.dash-hero .chip-btn:hover {
  background: rgba(212, 179, 106, 0.16);
  color: #fff;
}

.dash-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.dash-alert {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy-deep);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}

.dash-alert.is-gold {
  background: #f7efd8;
  border-color: #e4d3a4;
  color: #8b6914;
}

.dash-alert.is-red {
  background: #fdecec;
  border-color: #f0c8c8;
  color: #9b1c1c;
}

a.finance-stat {
  text-decoration: none !important;
  color: inherit;
}

a.finance-stat:hover {
  border-color: var(--gold-mid);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.dash-grid > .detail-card {
  margin-bottom: 0;
}

.dash-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0ebe2;
}

.dash-line:last-child {
  border-bottom: 0;
}

.dash-time {
  flex: 0 0 7.2rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dark);
  line-height: 1.35;
}

.dash-time.is-muted {
  color: var(--muted);
}

.dash-line-copy {
  min-width: 0;
  flex: 1;
}

.dash-line-copy strong {
  display: block;
  color: var(--navy-deep);
  font-size: 15px;
}

.dash-money-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.dash-track {
  height: 8px;
  border-radius: 99px;
  background: #efe8da;
  overflow: hidden;
}

.dash-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1b7a3a, var(--gold));
  border-radius: 99px;
}

@media (max-width: 640px) {
  .dash-time {
    flex-basis: 100%;
  }
}

@media (min-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-hero {
    padding: 22px 20px 18px;
  }

  .dash-hero h1 {
    font-size: 1.85rem;
  }
}

.form-card h2 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pref-wrap {
  overflow-x: auto;
}

.pref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pref-table th,
.pref-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f0ebe2;
  vertical-align: middle;
}

.pref-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pref-table td:first-child {
  font-weight: 700;
  color: var(--navy-deep);
  white-space: nowrap;
}

.pref-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.pref-check input {
  width: 18px;
  height: 18px;
}

.tpl-card {
  margin: 10px 0 0;
  padding: 10px 0 2px;
  border-top: 1px solid #f0ebe2;
}

.tpl-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.tpl-body {
  margin: 8px 0 6px;
  padding: 12px;
  background: #f7f3ea;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy-deep);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.tpl-actions {
  margin: 0 0 6px;
}

@media (max-width: 700px) {
  .pref-table thead {
    display: none;
  }

  .pref-table tr {
    display: block;
    padding: 8px 0 10px;
    border-bottom: 1px solid var(--line);
  }

  .pref-table td {
    display: block;
    border: 0;
    padding: 4px 0;
  }
}
