/* ============================================================
   JTEL WEB SUITE - MODULE 010 : INVOICE INDEX - STYLES
   ------------------------------------------------------------
   Folder : 010-invoice-index/010-invoice-index.css
   Loaded after 999-common.css, so rules here refine the common
   baseline for this module only. Section notes show the original
   styles.css block each rule came from.

   Build 015 - module-wise split (2026-09-30). No visual change.
   ============================================================ */

/* ---------- from [module-invoice-index] ---------- */

.screen-invoice-index {
  flex-direction: column;
  background: #e7edf1;
}

.invoice-index-workspace {
  background:
    linear-gradient(180deg, #edf2f5, #e5ebef);
}

.invoice-index-workspace-scroll {
  padding: 15px;
}

.invoice-index-filter-panel,
.invoice-index-results-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,248,250,0.99));
  border: 1px solid #cdd8df;
  border-radius: 15px;
  box-shadow:
    inset 0 1px 0 #fff,
    0 7px 20px rgba(24, 47, 64, 0.08);
}

.invoice-index-filter-panel {
  padding: 14px 15px 15px;
}

.invoice-index-filter-heading,
.invoice-index-results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.invoice-index-filter-heading h2,
.invoice-index-results-heading h2 {
  margin: 4px 0 0;
  color: #2b3f4d;
  font-size: 1rem;
}

.invoice-index-filter-heading p {
  margin: 5px 0 0;
  color: #7b8b95;
  font-size: 0.66rem;
  line-height: 1.45;
}

.invoice-index-filter-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 140px 140px minmax(150px, 0.85fr) minmax(210px, 1.3fr) minmax(170px, 0.9fr) minmax(200px, 1.25fr) 138px;
  gap: 8px;
  align-items: end;
}

.index-filter-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.index-filter-field > span {
  color: #61727e;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.index-filter-field input,
.index-filter-field select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 9px;
  color: #314754;
  background: #fff;
  border: 1px solid #c7d3db;
  border-radius: 8px;
  outline: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.69rem;
}

.index-filter-field input:focus,
.index-filter-field select:focus {
  background-color: #fff8c9;
  border-color: #d2a62c;
  box-shadow: 0 0 0 3px rgba(226, 184, 52, 0.30);
}

.invoice-index-find-button {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  color: white;
  background:
    linear-gradient(180deg, #da4650, #ab222b);
  border: 1px solid #931a22;
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    0 6px 13px rgba(170, 31, 40, 0.17);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.invoice-index-results-panel {
  margin-top: 11px;
  padding: 13px 14px 14px;
}

.invoice-index-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

#invoice-index-filter-note {
  color: #7d8d97;
  font-size: 0.63rem;
  font-weight: 700;
}

.invoice-index-grid-scroll {
  position: relative;
  height: calc(100vh - 292px);
  min-height: 325px;
  margin-top: 10px;
  overflow: auto;
  background: white;
  border: 1px solid #ccd8df;
  border-radius: 10px;
}

.invoice-index-grid {
  width: 100%;
  min-width: 1240px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #344a57;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
}

.invoice-index-grid th {
  position: sticky;
  z-index: 3;
  top: 0;
  height: 39px;
  padding: 0 8px;
  color: #edf4f7;
  background:
    linear-gradient(180deg, #536d80, #30495b);
  border-right: 1px solid rgba(255,255,255,0.09);
  border-bottom: 1px solid #243d4f;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.invoice-index-grid td {
  height: 45px;
  padding: 5px 8px;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid #e4eaee;
  border-bottom: 1px solid #dfe7ec;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-index-grid tbody tr {
  cursor: default;
}

.invoice-index-grid tbody tr:nth-child(even) td {
  background: #f7f9fa;
}

.invoice-index-grid tbody tr:hover td {
  background: #eaf2f7;
}

.invoice-index-grid td strong,
.invoice-index-grid td small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-index-grid td small {
  margin-top: 2px;
  color: #8997a0;
  font-size: 10px;
}

.idx-col-no {
  width: 132px;
}

.idx-col-date {
  width: 92px;
  text-align: center;
}

.idx-col-time {
  width: 80px;
  text-align: center;
}

.idx-col-client {
  width: 245px;
}

.idx-col-sale,
.idx-col-refund {
  width: 98px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.idx-col-refund.has-refund {
  color: #9e5d12;
  background: #fff6da !important;
}

.idx-col-remarks {
  width: 250px;
}

.idx-col-user {
  width: 160px;
}

.idx-col-action {
  width: 122px;
  text-align: center;
}

.invoice-index-open-button {
  min-width: 58px;
  height: 29px;
  color: #31566d;
  background: linear-gradient(180deg, #edf4f7, #dbe7ed);
  border: 1px solid #bfd0da;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.invoice-index-open-button:hover {
  color: #fff;
  background: linear-gradient(180deg, #617f93, #36586d);
  border-color: #2d4d61;
}

.invoice-index-empty {
  position: absolute;
  inset: 39px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8696a0;
  background: linear-gradient(180deg, #fff, #f7f9fa);
  text-align: center;
}

.invoice-index-empty.hidden {
  display: none;
}

.invoice-index-empty > span {
  font-size: 2rem;
  color: #8195a3;
}

.invoice-index-empty strong {
  margin-top: 7px;
  color: #506570;
  font-size: 0.82rem;
}

.invoice-index-empty small {
  margin-top: 4px;
  font-size: 0.66rem;
}

.index-count-chip {
  min-width: 82px;
}

.invoice-index-refresh-side {
  color: #d9e7ef;
  background: rgba(95, 128, 150, 0.15);
  border-color: rgba(126, 156, 176, 0.24);
}

@media (max-width: 1250px) {
  .invoice-index-filter-grid {
      grid-template-columns: repeat(4, minmax(150px, 1fr));
    }

  .invoice-index-find-button {
      min-width: 138px;
    }
}

@media (max-width: 760px) {
  .invoice-index-workspace-scroll {
      padding: 9px;
    }

  .invoice-index-filter-grid {
      grid-template-columns: 1fr 1fr;
    }

  .remarks-filter-field,
    .client-filter-field,
    .user-filter-field,
    .invoice-index-find-button {
      grid-column: 1 / -1;
    }

  .invoice-index-grid-scroll {
      height: calc(100vh - 430px);
      min-height: 280px;
    }
}


/* ---------- from [module-invoice-index-polish-011] ---------- */

.index-count-chip {
  display: none !important;
}

.index-filter-field input,
.index-filter-field select {
  height: 40px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13pt;
  font-weight: 600;
}

.index-filter-field > span {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10pt;
}

.compact-index-results {
  margin-top: 10px;
  padding: 8px 10px 9px;
}

.compact-index-results .invoice-index-grid-scroll {
  margin-top: 0;
  height: calc(100vh - 250px);
  min-height: 350px;
}

.invoice-index-grid .idx-col-no {
  width: 122px;
}

.invoice-index-grid td.idx-col-client,
.invoice-index-grid td.idx-col-remarks {
  height: auto;
  min-height: 52px;
  white-space: normal;
  vertical-align: middle;
}

.index-two-line-text {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.invoice-index-grid td.idx-col-client .index-two-line-text {
  font-weight: 700;
}

.invoice-index-grid td.idx-col-remarks .index-two-line-text {
  color: #5d707c;
}

.invoice-index-grid .idx-col-action {
  width: 96px;
}

.invoice-index-action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.invoice-index-icon-button {
  width: 34px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: 130ms ease;
}

.invoice-index-icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.invoice-index-icon-button.edit {
  color: #365c72;
  background: linear-gradient(180deg, #eef5f8, #d9e6ed);
  border: 1px solid #bdced8;
}

.invoice-index-icon-button.pdf {
  color: #aa2932;
  background: linear-gradient(180deg, #fff3f4, #f6dfe1);
  border: 1px solid #e2b8bc;
}

.invoice-index-icon-button.receipt {
  color: #246342;
  background: linear-gradient(180deg, #eef8f2, #d7ebdf);
  border: 1px solid #afd0bb;
}

.receipt-mini-icon {
  font-size: 10px;
  font-weight: 900;
}

.invoice-index-icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.pdf-mini-icon {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.invoice-index-summary-footer {
  min-height: 43px;
  margin-top: 7px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #536875;
  background:
    linear-gradient(180deg, #f7fafb, #e9f0f4);
  border: 1px solid #ccd8df;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 #fff;
  font-family: "Segoe UI", Arial, sans-serif;
}

.invoice-index-summary-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-index-summary-left > span {
  color: #7b8c96;
  font-size: 11px;
}

.invoice-index-summary-left > strong {
  color: #334d5d;
  font-size: 12px;
}

.invoice-index-totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.invoice-index-totals span {
  white-space: nowrap;
}

.invoice-index-totals strong {
  margin-left: 5px;
  color: #2f4e61;
  font-variant-numeric: tabular-nums;
}

.invoice-index-total-separator {
  width: 1px;
  height: 20px;
  background: #c9d5dc;
}

@media (max-width: 900px) {
  .invoice-index-summary-footer {
      align-items: flex-start;
      flex-direction: column;
    }

  .invoice-index-totals {
      width: 100%;
      justify-content: flex-start;
      flex-wrap: wrap;
    }

  .compact-index-results .invoice-index-grid-scroll {
      height: calc(100vh - 405px);
    }
}


/* ---------- from [module-invoice-pdf-viewer] ---------- */

.invoice-pdf-layer {
  z-index: 310;
  padding: 14px;
  background: rgba(7, 16, 23, 0.76);
  backdrop-filter: blur(7px);
}

.invoice-pdf-card {
  width: min(1180px, 96vw);
  height: min(860px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #edf2f5;
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.38);
}

.invoice-pdf-header {
  min-height: 64px;
  padding: 9px 12px 9px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: white;
  background:
    linear-gradient(180deg, #415c70, #253b4b);
  border-bottom: 1px solid #172a38;
}

.invoice-pdf-heading,
.invoice-pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-pdf-heading h2 {
  margin: 3px 0 0;
  font-size: 1rem;
}

.invoice-pdf-heading .section-kicker {
  color: #f18b91;
  font-size: 0.58rem;
}

.invoice-pdf-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #dc4650, #aa222b);
  border: 1px solid #8f1c24;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
  font-size: 0.62rem;
  font-weight: 900;
}

.pdf-viewer-button {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.pdf-viewer-button.secondary {
  color: #e8f1f5;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.17);
}

.pdf-viewer-button.primary {
  color: white;
  background: linear-gradient(180deg, #dc4650, #aa222b);
  border: 1px solid #901b23;
}

.invoice-pdf-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  padding: 8px;
  background: #cfd9df;
}

.invoice-pdf-stage iframe {
  width: 100%;
  height: 100%;
  display: block;
  background: white;
  border: 0;
  border-radius: 7px;
}

.invoice-pdf-placeholder {
  position: absolute;
  inset: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6b7e89;
  background: white;
  border-radius: 7px;
  text-align: center;
}

.invoice-pdf-placeholder > span {
  color: #b32a33;
  font-size: 1.6rem;
  font-weight: 900;
}

.invoice-pdf-placeholder strong {
  margin-top: 8px;
}

.invoice-pdf-placeholder small {
  margin-top: 5px;
}

@media (max-width: 720px) {
  .invoice-pdf-layer {
      padding: 5px;
    }

  .invoice-pdf-card {
      width: 100%;
      height: 98vh;
      border-radius: 11px;
    }

  .invoice-pdf-header {
      min-height: 104px;
      align-items: flex-start;
      flex-direction: column;
    }

  .invoice-pdf-header-actions {
      width: 100%;
    }

  .pdf-viewer-button {
      flex: 1;
    }
}
