/**
 * Styling for the Gafoor "see all" list pages:
 * - Controller tables (sales orders, inventory purchases) wrapped in .gafoor-list-page
 * - The stock list (.stock-list-container)
 * - The suppliers / customers view pages (.view-id-suppliers, .view-id-customers)
 *
 * Scoped to these contexts so it does not affect admin or other site tables.
 */

/* Card container. */
.gafoor-list-page,
.stock-list-container,
.view-id-suppliers,
.view-id-customers {
  max-width: 1200px;
  margin: 24px auto;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid rgba(190, 192, 202, 0.35);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(19, 15, 38, 0.05);
}

/* Tables. */
.gafoor-list-page table,
.stock-list-container table,
.view-id-suppliers .views-view-table,
.view-id-customers .views-view-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

/* Header row. */
.gafoor-list-page thead th,
.stock-list-container thead th,
.view-id-suppliers .views-view-table th,
.view-id-customers .views-view-table th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
  color: #6b6c75;
  background: #faf7fd;
  border-bottom: 1px solid rgba(76, 35, 99, 0.12);
}

/* Body cells. */
.gafoor-list-page tbody td,
.stock-list-container tbody td,
.view-id-suppliers .views-view-table td,
.view-id-customers .views-view-table td {
  padding: 12px 14px;
  color: #45464e;
  vertical-align: middle;
  border-bottom: 1px solid rgba(190, 192, 202, 0.3);
}

/* Row hover + last row. */
.gafoor-list-page tbody tr:hover,
.stock-list-container tbody tr:hover,
.view-id-suppliers .views-view-table tbody tr:hover,
.view-id-customers .views-view-table tbody tr:hover {
  background: #faf7fd;
}

.gafoor-list-page tbody tr:last-child td,
.stock-list-container tbody tr:last-child td {
  border-bottom: 0;
}

/* Links inside the tables. */
.gafoor-list-page a,
.stock-list-container a,
.view-id-suppliers .views-view-table a,
.view-id-customers .views-view-table a {
  color: #4c2363;
  text-decoration: none;
}

.gafoor-list-page a:hover,
.stock-list-container a:hover {
  text-decoration: underline;
}

/* The customer/supplier rows use the theme's .inr-order markup, which already
   carries its own divider + padding. So the .views-row wrapper must not add its
   own border/padding, or every row shows a double dividing line. */
.view-id-suppliers .views-row,
.view-id-customers .views-row {
  padding: 0;
  border: 0;
}

.view-id-suppliers .inr-order:last-child,
.view-id-customers .inr-order:last-child {
  border-bottom: 0;
}

/* Rollover highlight per record (full-width within the card). */
.view-id-suppliers .inr-order,
.view-id-customers .inr-order {
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
  transition: background-color 0.15s ease;
}

.view-id-suppliers .inr-order:hover,
.view-id-customers .inr-order:hover {
  background-color: #faf7fd;
}

/* Exposed filters / header inside the view card. */
.view-id-suppliers .views-exposed-form,
.view-id-customers .views-exposed-form {
  margin-bottom: 16px;
}

/* Multi-line cells (amounts / items stacked with <div>). */
.gafoor-list-page td > div {
  line-height: 1.5;
}

/* Preserve right-aligned numeric columns. */
.gafoor-list-page .text-right,
.stock-list-container .text-right,
.stock-list-container td.text-right,
.stock-list-container th.text-right {
  text-align: right;
}

/* Stock list filter row spacing. */
.stock-list-filter {
  margin-bottom: 18px;
}

/* ---- Daily totals dashboard ---- */
.daily-dashboard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 8px;
}

.daily-dashboard__head h2 {
  margin: 0;
  font-size: 22px;
  color: #130f26;
}

.daily-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.daily-filter label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #6b6c75;
}

.daily-filter input[type="date"] {
  padding: 8px 10px;
  font: inherit;
  border: 1px solid rgba(190, 192, 202, 0.6);
  border-radius: 8px;
}

.daily-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.daily-dashboard .daily-presets > a:not(.daily-btn),
.daily-dashboard .daily-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: #4c2363;
  border: 1px solid #4c2363;
  border-radius: 8px;
}

.daily-dashboard .daily-presets > a:not(.daily-btn):hover,
.daily-dashboard .daily-btn:hover {
  color: #fff;
  text-decoration: none;
  background: #3a1a4d;
  border-color: #3a1a4d;
}

.daily-table {
  margin-top: 28px;
}

.daily-table__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.daily-table__head h3 {
  margin: 0;
  font-size: 16px;
  color: #45464e;
}

.daily-dashboard tfoot th {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #130f26;
  background: #faf7fd;
  border-top: 2px solid rgba(76, 35, 99, 0.15);
}

.daily-empty {
  padding: 16px 14px;
  color: #8a8b93;
}

.daily-weekly-sheet {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgba(190, 192, 202, 0.6);
}

.daily-weekly-sheet select {
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  border: 1px solid rgba(190, 192, 202, 0.6);
  border-radius: 8px;
}

/* Empty state. */
.gafoor-list-page .empty,
.stock-list-container p {
  padding: 16px 4px;
  color: #8a8b93;
}

/* Bottom action row (e.g. "Add Stock Item"). */
.stock-list-container + .bottom-recent {
  max-width: 1200px;
  margin: 14px auto 0;
}

.stock-list-container + .bottom-recent .button {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  color: #fff;
  background: #4c2363;
  border-radius: 8px;
  text-decoration: none;
}

/* --- Manage invoice form (payments + line items) ------------------------- */
.invoice-payments .invoice-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: #f6f1fa;
  border: 1px solid #e3d6ee;
  border-radius: 10px;
}
.invoice-payments .invoice-summary p {
  margin: 0;
}
.invoice-payments fieldset {
  margin-bottom: 22px;
  border: 1px solid #e3d6ee;
  border-radius: 10px;
  padding: 8px 16px 16px;
}
.invoice-payments fieldset > legend {
  font-weight: 600;
  color: #4c2363;
  padding: 0 6px;
}
.invoice-payments .payment-row,
.invoice-payments .lineitem-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.invoice-payments .payment-row:last-child,
.invoice-payments .lineitem-row:last-child {
  border-bottom: none;
}
.invoice-payments .lineitem-new {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 2px solid #e3d6ee;
}
.invoice-payments .form-item {
  margin: 0;
}
.invoice-payments .form-actions .button {
  color: #fff;
  background: #4c2363;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
}
