/* =========================================================
   SCHEDMATE — INVOICES STYLES
   Non-breaking, table-only polish
========================================================= */

/* TABLE */
.sm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.sm-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--sm-muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sm-border);
}

.sm-table tbody td {
  padding: 14px;
  font-size: 14px;
  color: var(--sm-text);
  border-bottom: 1px solid var(--sm-surface-2);
  vertical-align: middle;
}

.sm-table tbody tr:hover {
  background: var(--sm-surface);
}

/* INVOICE NO */
.sm-table td:first-child {
  font-weight: 600;
  color: var(--sm-primary);
}

/* STATUS SELECT */
.sm-table select {
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--sm-border);
  background: var(--sm-surface);
  cursor: pointer;
}

.sm-table select[value="paid"],
.sm-table select option[value="paid"] {
  color: var(--sm-success);
  font-weight: 600;
}

.sm-table select[value="draft"],
.sm-table select option[value="draft"] {
  color: var(--sm-warning);
}

.sm-table select[value="sent"],
.sm-table select option[value="sent"] {
  color: var(--sm-primary);
}

.sm-table select[value="void"],
.sm-table select option[value="void"] {
  color: var(--sm-danger);
}

/* AMOUNT */
.sm-table td:nth-child(6) {
  font-weight: 600;
}

/* ACTIONS */
.sm-table td:last-child {
  display: flex;
  gap: 8px;
}

.sm-table td:last-child button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
}

/* EDIT BUTTON */
.sm-table [data-edit] {
  background: var(--sm-surface-2);
  border: 1px solid var(--sm-border);
}

.sm-table [data-edit]:hover {
  background: var(--sm-border);
}

/* ARCHIVE / RESTORE */
.sm-table [data-archive] {
  background: var(--sm-surface);
  border: 1px solid var(--sm-danger);
  color: var(--sm-danger);
}

.sm-table [data-restore] {
  background: var(--sm-surface);
  border: 1px solid var(--sm-success);
  color: var(--sm-success);
}
/* OVERDUE STATUS */
.sm-table select[value="overdue"],
.sm-table select option[value="overdue"] {
  color: var(--sm-danger);
  font-weight: 700;
}
/* ===============================
   STATUS CHIPS (Phase 1)
=============================== */

.sm-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
}

/* Draft */
.sm-status.draft {
  background: var(--sm-warning-bg);
  color: var(--sm-warning);
  border-color: var(--sm-warning-bd);
}

/* Sent */
.sm-status.sent {
  background: var(--sm-surface-2);
  color: var(--sm-primary);
  border-color: var(--sm-border);
}

/* Paid */
.sm-status.paid {
  background: var(--sm-success-bg);
  color: var(--sm-success);
  border-color: var(--sm-success-bd);
}

/* Overdue */
.sm-status.overdue {
  background: var(--sm-danger-bg);
  color: var(--sm-danger);
  border-color: var(--sm-danger-bd);
}

/* Void */
.sm-status.void {
  background: var(--sm-surface-2);
  color: var(--sm-neutral);
  border-color: var(--sm-border);
}

/* Hide native select chrome */
.sm-table select[data-status] {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  font-weight: 600;
}
/* ===============================
   AMOUNT HIERARCHY
=============================== */

.sm-invoice-amount {
  font-weight: 700;
  font-size: 15px;
}

.sm-invoice-sub {
  font-size: 12px;
  color: var(--sm-muted);
  margin-top: 2px;
}

.sm-invoice-balance {
  font-weight: 600;
  color: var(--sm-danger);
}

.sm-invoice-balance.zero {
  color: var(--sm-success);
}
/* ===============================
   INVOICE FILTER BAR
=============================== */

.sm-invoice-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.sm-filter {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--sm-border);
  background: var(--sm-surface);
  cursor: pointer;
  color: var(--sm-neutral);
}

.sm-filter.is-active {
  background: var(--sm-text);
  color: var(--sm-surface);
  border-color: var(--sm-text);
}


/* Mobile safety: allow horizontal scroll for tables */
.sm-table-wrap{ width:100%; overflow:auto; -webkit-overflow-scrolling: touch; }
.sm-table{ min-width: 860px; }
@media (max-width: 900px){ .sm-table{ min-width: 720px; } }
/* ===========================
   Invoice Paid / Balance colors
=========================== */
.sm-inv-sub{
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  opacity: .95;
}

.sm-dot{ opacity: .5; }

.sm-inv-paid,
.sm-inv-bal{
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.75);
  line-height: 1.4;
}

/* Paid */
.sm-inv-paid.is-paid{
  color: var(--sm-success);              /* teal-green */
  border-color: rgba(15,118,110,.25);
  background: rgba(15,118,110,.08);
}
.sm-inv-paid.is-zero{
  color: rgba(0,0,0,.45);
}

/* Balance */
.sm-inv-bal.is-due{
  color: var(--sm-danger);              /* red */
  border-color: rgba(180,35,24,.25);
  background: rgba(180,35,24,.07);
}
.sm-inv-bal.is-zero{
  color: var(--sm-success);              /* green */
  border-color: rgba(22,101,52,.20);
  background: rgba(22,101,52,.07);
}
/* Better alignment for Amount column */
.sm-amount-cell{
  min-width: 170px;
}
.sm-amount-top{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 6px;
}

/* Paid/Balance pills: consistent height + centered */
.sm-inv-sub{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap; /* para hindi sumabog pag maliit screen */
}

.sm-inv-paid,
.sm-inv-bal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

/* Actions column: keep everything aligned right */
.sm-table td:last-child{
  justify-content: flex-end;  /* instead of left */
  align-items: center;
}
.sm-table td:last-child button{
  min-height: 30px;
}
.sm-amount-cell { min-width: 180px; }
.sm-amount-top { font-weight: 700; margin-bottom: 6px; }

.sm-inv-sub{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

.sm-table td:last-child{
  text-align:right;
  white-space:nowrap;
}
/* Invoices table polish */
.sm-panel { overflow: hidden; }

.sm-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.sm-table thead th{
  font-size: 12px;
  text-transform: none;
  letter-spacing: .2px;
  padding: 12px 14px;
}

.sm-table tbody td{
  padding: 14px;
  vertical-align: middle;
}

.sm-table tbody tr{
  border-radius: 14px;
}

.sm-amount-cell{ min-width: 190px; }
.sm-amount-top{ font-weight: 800; margin-bottom: 6px; }

/* Keep action buttons aligned */
.sm-actions{
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}
.sm-filter-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--sm-border);
  border-radius: 12px;
  background: var(--sm-surface-2);
  color: var(--sm-text);
}

.sm-filter-context[hidden] {
  display: none;
}
