/* ============================================================
   INVOICES.CSS
   Standalone Invoices page — tabs, card list, line-items modal.
   ============================================================ */


/* ——————————————————————————————————————————————————————————
   TAB STRIP
   —————————————————————————————————————————————————————————— */
.inv-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(231,207,207,0.3);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.inv-tab {
  padding: 9px 18px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.inv-tab:hover {
  color: var(--text-secondary);
  background: rgba(231,207,207,0.1);
}
.inv-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--rose);
  background: rgba(231,207,207,0.12);
}


/* ——————————————————————————————————————————————————————————
   BRAND SELECT IN TOOLBAR
   —————————————————————————————————————————————————————————— */
.invp-brand-select {
  max-width: 180px;
  flex-shrink: 0;
}


/* ——————————————————————————————————————————————————————————
   INVOICE LIST CONTAINER
   —————————————————————————————————————————————————————————— */
.inv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* ——————————————————————————————————————————————————————————
   INVOICE CARD
   —————————————————————————————————————————————————————————— */
.inv-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 20px;
  transition: box-shadow 0.15s ease;
}
.inv-card:hover {
  box-shadow: var(--shadow-hover);
}

.inv-card-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-num-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(231,207,207,0.25);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  align-self: flex-start;
}

.inv-card-brand {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.inv-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-card-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.inv-date-item {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--text-muted);
}

.inv-date-label {
  font-weight: 500;
  color: var(--text-secondary);
}


/* ——————————————————————————————————————————————————————————
   CARD RIGHT — amount, status, actions
   —————————————————————————————————————————————————————————— */
.inv-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.inv-card-amount {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.inv-card-method {
  font-size: 11px;
  color: var(--text-muted);
}

.inv-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}


/* ——————————————————————————————————————————————————————————
   STATUS PILLS
   —————————————————————————————————————————————————————————— */
.inv-status-pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 50px;
}

.inv-st-draft {
  background: rgba(200,200,200,0.2);
  color: #888;
}
.inv-st-sent {
  background: rgba(180,195,230,0.25);
  color: #5568a0;
}
.inv-st-pending {
  background: rgba(237,210,170,0.3);
  color: #9a6a30;
}
.inv-st-paid {
  background: rgba(150,210,160,0.2);
  color: #3a7a40;
}


/* ——————————————————————————————————————————————————————————
   MODAL SIZE
   —————————————————————————————————————————————————————————— */
.inv-modal-lg {
  max-width: 640px;
}


/* ——————————————————————————————————————————————————————————
   LINE ITEMS SECTION
   —————————————————————————————————————————————————————————— */
.inv-line-items-wrap {
  margin-top: 16px;
  border: 1px solid rgba(231,207,207,0.3);
  border-radius: 10px;
  overflow: hidden;
}

.inv-line-header {
  display: grid;
  grid-template-columns: 1fr 72px 100px 90px 32px;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(231,207,207,0.12);
  border-bottom: 1px solid rgba(231,207,207,0.25);
}

.inv-lh-desc,
.inv-lh-qty,
.inv-lh-rate,
.inv-lh-total,
.inv-lh-del {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.inv-lh-qty,
.inv-lh-rate,
.inv-lh-total { text-align: right; }

.inv-line-row {
  display: grid;
  grid-template-columns: 1fr 72px 100px 90px 32px;
  gap: 8px;
  padding: 8px 14px;
  align-items: center;
  border-bottom: 1px solid rgba(231,207,207,0.15);
}
.inv-line-row:last-child { border-bottom: none; }

.inv-line-desc,
.inv-line-qty,
.inv-line-rate {
  padding: 5px 8px !important;
  height: auto !important;
  font-size: 12.5px !important;
}
.inv-line-qty,
.inv-line-rate { text-align: right; }

.inv-line-row-total {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  padding-right: 4px;
}

.inv-line-remove-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.inv-line-remove-btn:hover {
  background: rgba(217,180,180,0.2);
  color: #b06060;
}

.inv-add-line-btn {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--rose);
  background: none;
  border: none;
  border-top: 1px solid rgba(231,207,207,0.2);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.inv-add-line-btn:hover {
  background: rgba(231,207,207,0.1);
}

.inv-line-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(231,207,207,0.1);
  border-top: 1px solid rgba(231,207,207,0.25);
}

.inv-total-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.inv-grand-total {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}


/* ——————————————————————————————————————————————————————————
   RESPONSIVE
   —————————————————————————————————————————————————————————— */
@media (max-width: 600px) {
  .inv-card {
    flex-direction: column;
    gap: 12px;
  }
  .inv-card-right {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .inv-line-header,
  .inv-line-row {
    grid-template-columns: 1fr 56px 80px 72px 28px;
    gap: 4px;
  }
}
