/* ============================================================
   supplier-theme.css — styling the ported supplier module.

   The supplier views come from master-supplier, whose stylesheet was
   never ported: their button classes (.btn1/.btn2/.btn3/.btn-search)
   and their habit of putting a whole form inside .card-header had no
   rules here. Loaded AFTER the layout's inline theme so it wins.
   ============================================================ */

/* ── card: a form inside .card-header must not get the green title bar ── */
.section.dashboard > .row > [class*="col-"] > .card > .card-header,
.dashboard-section .card > .card-header,
.card-header:has(form),
.card-header:has(table) {
  background: #fff !important;
  color: var(--ag-text, #1e293b) !important;
  font-weight: 400;
  border-bottom: 0;
  border-radius: var(--ag-radius, 10px) !important;
  padding: 22px;
}
.section.dashboard { padding: 0 0 40px; }
.section.dashboard .card,
.dashboard-section .card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--ag-radius, 10px);
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}

/* ── form fields ────────────────────────────────────────────── */
.section.dashboard .form-label,
.dashboard-section .form-label,
.card-header:has(form) .form-label {
  color: var(--ag-text, #1e293b);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}
.section.dashboard .form-group,
.dashboard-section .form-group { margin-bottom: 4px; }
.section.dashboard .form-control,
.section.dashboard .form-select,
.dashboard-section .form-control,
.dashboard-section .form-select {
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid #d7dfe4;
  border-radius: 8px;
  background-color: #fff;
  color: var(--ag-text, #1e293b);
}
.section.dashboard .form-control:focus,
.section.dashboard .form-select:focus,
.dashboard-section .form-control:focus,
.dashboard-section .form-select:focus {
  border-color: var(--ag-primary, #16a34a);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
  outline: 0;
}
.section.dashboard textarea.form-control,
.dashboard-section textarea.form-control { min-height: 96px; }

/* ── buttons: .btn1 primary, .btn2 neutral, .btn3 danger ────── */
.btn.btn1 {
  background: var(--ag-primary, #16a34a);
  border: 1px solid var(--ag-primary, #16a34a);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 20px;
  border-radius: 8px;
}
.btn.btn1:hover  { background: var(--ag-primary-dark, #15803d); border-color: var(--ag-primary-dark, #15803d); color: #fff; }
.btn.btn1:focus  { box-shadow: 0 0 0 3px rgba(22,163,74,.25); color: #fff; }

.btn.btn2 {
  background: #fff;
  border: 1px solid #d7dfe4;
  color: #334155;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 8px;
}
.btn.btn2:hover { background: #f6f8f7; color: #15803d; border-color: #bcd9c6; }

.btn.btn3 {
  background: #fff;
  border: 1px solid #e6b3b3;
  color: #b91c1c;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
}
.btn.btn3:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.btn3.danger, .btn.btn-delete { color: #b91c1c; }
.btn.btn-delete:hover { background: #b91c1c; color: #fff; }

.btn.btn-search i, .btn.btn1 i, .btn.btn2 i, .btn.btn3 i { margin-right: 5px; }

/* the Save row sat flush against the fields */
.section.dashboard .text-end .btn,
.dashboard-section .text-end .btn { margin-top: 8px; }

/* ── tables inside supplier lists ───────────────────────────── */
.section.dashboard .table thead th,
.dashboard-section .table thead th {
  background: #f2f7f4;
  color: #15803d;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid rgba(15,23,42,.08) !important;
}
.section.dashboard .table td,
.dashboard-section .table td { font-size: 13.5px; vertical-align: middle; }

/* ── select2 / multiselect widgets used by these forms ──────── */
.section.dashboard .select2-container--default .select2-selection--single,
.section.dashboard .select2-container--default .select2-selection--multiple {
  border: 1px solid #d7dfe4;
  border-radius: 8px;
  min-height: 40px;
}

@media (max-width: 768px) {
  .section.dashboard > .row > [class*="col-"] > .card > .card-header,
  .dashboard-section .card > .card-header { padding: 14px; }
  .section.dashboard .form-control,
  .section.dashboard .form-select { font-size: 13.5px; }
}

/* ── the submit action: it was rendering as bare text, so give it a
      clear, high-contrast button and its own row separated from the
      fields above ─────────────────────────────────────────────── */
.section.dashboard form .text-end,
.dashboard-section form .text-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.section.dashboard form button[type="submit"],
.section.dashboard form input[type="submit"],
.dashboard-section form button[type="submit"],
.dashboard-section form input[type="submit"] {
  background: linear-gradient(135deg, var(--ag-primary, #16a34a), var(--ag-primary-dark, #15803d));
  border: 0;
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .2px;
  padding: 11px 30px;
  min-width: 140px;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(22,163,74,.30);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.section.dashboard form button[type="submit"]:hover,
.dashboard-section form button[type="submit"]:hover {
  filter: brightness(1.06);
  box-shadow: 0 5px 16px rgba(22,163,74,.38);
  transform: translateY(-1px);
  color: #fff !important;
}
.section.dashboard form button[type="submit"]:active,
.dashboard-section form button[type="submit"]:active { transform: translateY(0); }
.section.dashboard form button[type="submit"]:focus-visible,
.dashboard-section form button[type="submit"]:focus-visible {
  outline: 3px solid rgba(22,163,74,.35);
  outline-offset: 2px;
}
/* bootstrap-icons are not loaded here; keep the label centred regardless */
.section.dashboard form button[type="submit"] i:empty,
.dashboard-section form button[type="submit"] i:empty { display: none; }

@media (max-width: 768px) {
  .section.dashboard form .text-end,
  .dashboard-section form .text-end { justify-content: stretch; }
  .section.dashboard form button[type="submit"],
  .dashboard-section form button[type="submit"] { width: 100%; padding: 13px 20px; }
}
