/* Soda ZW V17 — invoice and quotation management dashboards */
.page-invoices .content,
.page-quotations .content {
  max-width: 1540px;
}

.document-dashboard-v17 {
  --doc-navy: #062b4d;
  --doc-navy-2: #0b3c66;
  --doc-orange: #f58220;
  --doc-ink: #14283b;
  --doc-muted: #67788a;
  --doc-line: #dce5ec;
  --doc-soft: #f4f7f9;
  display: grid;
  gap: 18px;
}

.document-hero-v17 {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 210px;
  padding: 32px 34px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(245,130,32,.28), transparent 28%),
    linear-gradient(130deg, #041f38 0%, var(--doc-navy) 58%, #0b466f 100%);
  box-shadow: 0 18px 40px rgba(6,43,77,.18);
}

.document-hero-v17::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border: 42px solid rgba(255,255,255,.055);
  border-radius: 50%;
  pointer-events: none;
}

.document-hero-copy-v17,
.document-hero-actions-v17 {
  position: relative;
  z-index: 1;
}

.document-eyebrow-v17 {
  display: block;
  margin-bottom: 8px;
  color: #ffb66f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
}

.document-hero-v17 h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.document-hero-v17 p {
  max-width: 690px;
  margin: 10px 0 18px;
  color: rgba(255,255,255,.76);
  font-size: 14px;
  line-height: 1.55;
}

.document-switcher-v17 {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}

.document-switcher-v17 a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.document-switcher-v17 a.active {
  color: var(--doc-navy);
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.13);
}

.document-switcher-v17 svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.document-hero-actions-v17 {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.document-hero-actions-v17 .button {
  min-height: 44px;
  border-color: rgba(255,255,255,.25);
  box-shadow: none;
}

.document-hero-actions-v17 .button.primary {
  border-color: var(--doc-orange);
  background: var(--doc-orange);
}

.document-hero-actions-v17 .command-payment {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.document-hero-actions-v17 svg {
  width: 17px;
  height: 17px;
}

.document-metrics-v17 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin: 0 !important;
}

.document-metrics-v17 article {
  position: relative;
  min-height: 124px;
  padding: 20px 22px 18px 25px !important;
  border: 1px solid var(--doc-line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(27,54,79,.055) !important;
}

.document-metrics-v17 article::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 0;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: #7e91a2;
}

.document-metrics-v17 .metric-overdue-v17::before { background: #dc4c4c; }
.document-metrics-v17 .metric-upcoming-v17::before,
.document-metrics-v17 .metric-pipeline-v17::before { background: var(--doc-orange); }
.document-metrics-v17 .metric-speed-v17::before,
.document-metrics-v17 .metric-rate-v17::before { background: #2b7bb9; }
.document-metrics-v17 .metric-won-v17::before { background: #21a179; }

.document-metrics-v17 span {
  display: block;
  color: var(--doc-muted) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.document-metrics-v17 strong {
  display: block;
  overflow: hidden;
  margin: 9px 0 5px;
  color: var(--doc-ink) !important;
  font-size: clamp(21px, 2vw, 29px) !important;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-metrics-v17 small {
  color: var(--doc-muted) !important;
  font-size: 12px !important;
}

.document-workspace-v17 {
  overflow: hidden;
  border: 1px solid var(--doc-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(27,54,79,.07);
}

.document-workspace-head-v17 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 24px 14px;
}

.document-workspace-head-v17 h3 {
  margin: 3px 0 0;
  color: var(--doc-ink);
  font-size: 19px;
}

.document-result-count-v17 {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--doc-navy);
  background: #edf4f8;
  font-size: 11px;
  font-weight: 800;
}

.document-tabs-v17 {
  display: flex !important;
  gap: 5px !important;
  overflow-x: auto;
  margin: 0 !important;
  padding: 0 24px 14px !important;
  border: 0 !important;
  background: #fff !important;
  scrollbar-width: thin;
}

.document-tabs-v17 a {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px !important;
  border: 1px solid var(--doc-line) !important;
  border-radius: 10px !important;
  color: #536778 !important;
  background: #fff !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  text-decoration: none;
}

.document-tabs-v17 a b {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #718393;
  background: var(--doc-soft);
  font-size: 10px;
  text-align: center;
}

.document-tabs-v17 a.active {
  border-color: var(--doc-navy) !important;
  color: #fff !important;
  background: var(--doc-navy) !important;
  box-shadow: 0 5px 13px rgba(6,43,77,.18);
}

.document-tabs-v17 a.active b {
  color: var(--doc-navy);
  background: #fff;
}

.document-filter-drawer-v17 {
  margin: 0 24px 16px;
  border: 1px solid var(--doc-line);
  border-radius: 12px;
  background: var(--doc-soft);
}

.document-filter-drawer-v17 > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  color: var(--doc-navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.document-filter-drawer-v17 > summary::before {
  content: "⌕";
  font-size: 17px;
}

.document-filter-drawer-v17 > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 17px;
}

.document-filter-drawer-v17[open] > summary::after { content: "−"; }
.document-filter-drawer-v17 > summary::-webkit-details-marker { display: none; }
.document-filter-drawer-v17 > summary b {
  padding: 3px 7px;
  border-radius: 999px;
  color: #8e4407;
  background: #ffead8;
  font-size: 9px;
  text-transform: uppercase;
}

.document-filters-v17 {
  display: grid !important;
  grid-template-columns: 1.15fr 1fr .8fr .8fr 1.35fr auto auto !important;
  gap: 10px !important;
  align-items: end !important;
  margin: 0 !important;
  padding: 0 14px 14px !important;
  border: 0 !important;
  background: transparent !important;
}

.document-filters-v17 label,
.document-quote-search-v17 label {
  color: #5c6e7d;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .025em;
}

.document-filters-v17 select,
.document-filters-v17 input,
.document-quote-search-v17 input {
  min-height: 39px !important;
  margin-top: 4px !important;
  border: 1px solid #cad7e1 !important;
  border-radius: 9px !important;
  background: #fff !important;
  font-size: 12px !important;
}

.document-quote-search-v17 {
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px !important;
  align-items: end;
  margin: 0 24px 16px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--doc-line) !important;
  border-radius: 12px !important;
  background: var(--doc-soft) !important;
}

.document-register-v17 {
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--doc-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.document-register-v17 .table-wrap {
  overflow-x: auto;
}

.document-register-v17 table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.document-register-v17 thead th {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--doc-line) !important;
  color: #6a7c8c !important;
  background: #f8fafb !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}

.document-register-v17 tbody td {
  padding: 15px 14px !important;
  border-bottom: 1px solid #edf1f4 !important;
  color: #334b5e;
  font-size: 12px;
  vertical-align: middle !important;
}

.document-register-v17 tbody tr {
  transition: background .16s ease, transform .16s ease;
}

.document-register-v17 tbody tr:hover {
  background: #fbfcfd;
}

.document-register-v17 tbody tr:last-child td {
  border-bottom: 0 !important;
}

.document-register-v17 td a:not(.button) {
  color: var(--doc-navy);
  text-decoration: none;
}

.document-register-v17 .money-cell {
  color: var(--doc-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.document-register-v17 .due-late {
  color: #b93838 !important;
  font-weight: 750;
}

.document-register-v17 .actions .button,
.document-register-v17 .document-row-actions .button {
  min-height: 34px;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  white-space: nowrap;
}

.document-register-v17 .document-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.document-register-v17 .document-row-actions form {
  margin: 0;
}

.document-empty-row-v17 .empty {
  padding: 42px 20px !important;
  color: var(--doc-muted);
  text-align: center;
}

.document-empty-row-v17 .empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--doc-ink);
  font-size: 16px;
}

.invoice-dashboard-v17 + .import-panel {
  margin-top: 18px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  box-shadow: none;
}

@media (max-width: 1100px) {
  .document-filters-v17 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .document-search-field-v17 {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .document-dashboard-v17 {
    gap: 13px;
  }
  .document-hero-v17 {
    display: block;
    min-height: 0;
    padding: 23px 19px;
    border-radius: 16px;
  }
  .document-hero-v17 h2 {
    font-size: 26px;
  }
  .document-hero-v17 p {
    margin-bottom: 15px;
    font-size: 13px;
  }
  .document-hero-actions-v17 {
    justify-content: stretch;
    margin-top: 18px;
  }
  .document-hero-actions-v17 .button {
    flex: 1 1 145px;
    justify-content: center;
  }
  .document-metrics-v17 {
    grid-template-columns: repeat(3, minmax(138px, 1fr)) !important;
    overflow-x: auto;
    padding: 1px 1px 8px;
    scroll-snap-type: x proximity;
  }
  .document-metrics-v17 article {
    min-height: 112px;
    padding: 17px 17px 15px 20px !important;
    scroll-snap-align: start;
  }
  .document-metrics-v17 strong {
    font-size: 19px !important;
  }
  .document-workspace-v17 {
    border-radius: 15px;
  }
  .document-workspace-head-v17 {
    padding: 18px 16px 12px;
  }
  .document-workspace-head-v17 h3 {
    font-size: 16px;
  }
  .document-tabs-v17 {
    padding: 0 16px 13px !important;
  }
  .document-filter-drawer-v17,
  .document-quote-search-v17 {
    margin-right: 16px !important;
    margin-left: 16px !important;
  }
  .document-filters-v17 {
    grid-template-columns: 1fr 1fr !important;
  }
  .document-search-field-v17 {
    grid-column: 1 / -1;
  }
  .document-quote-search-v17 {
    grid-template-columns: 1fr auto;
  }
  .document-quote-search-v17 label {
    grid-column: 1 / -1;
  }
  .document-register-v17 {
    padding: 12px !important;
    border-top: 1px solid var(--doc-line) !important;
    background: #f4f7f9 !important;
  }
  .document-register-v17 .table-wrap {
    overflow: visible;
  }
  .document-register-v17 table,
  .document-register-v17 tbody {
    display: block;
  }
  .document-register-v17 thead {
    display: none;
  }
  .document-register-v17 tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px 14px;
    margin-bottom: 11px;
    padding: 15px;
    border: 1px solid var(--doc-line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(27,54,79,.055);
  }
  .document-register-v17 tbody tr:last-child {
    margin-bottom: 0;
  }
  .document-register-v17 tbody td {
    display: block;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
  }
  .document-register-v17 tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #7a8b99;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  .document-register-v17 tbody td.actions {
    grid-column: 1 / -1;
    padding-top: 10px !important;
    border-top: 1px solid #edf1f4 !important;
  }
  .document-register-v17 tbody td.actions > .button {
    width: 100%;
    justify-content: center;
  }
  .document-register-v17 .document-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .document-register-v17 .document-row-actions .button,
  .document-register-v17 .document-row-actions form,
  .document-register-v17 .document-row-actions form .button {
    width: 100%;
    justify-content: center;
  }
  .document-register-v17 .document-empty-row-v17 {
    display: block;
  }
  .document-register-v17 .document-empty-row-v17 td {
    padding: 30px 12px !important;
  }
  .document-register-v17 .document-empty-row-v17 td::before {
    content: none;
  }
}

@media (max-width: 460px) {
  .document-switcher-v17 {
    display: flex;
  }
  .document-switcher-v17 a {
    flex: 1;
    justify-content: center;
  }
  .document-filters-v17 {
    grid-template-columns: 1fr !important;
  }
  .document-search-field-v17 {
    grid-column: auto;
  }
  .document-filters-v17 .button {
    width: 100%;
    justify-content: center;
  }
  .document-result-count-v17 {
    display: none;
  }
}
