/* =========================================================
   SPLASH ADMIN — Employee Panel harmonization layer
   Loaded AFTER bootstrap(4).min.css, DataTables(bs4) css and splash.css
   to bridge the Splash (Bootstrap 5) markup with the existing
   Bootstrap 4 + jQuery + DataTables + modal stack.
   ========================================================= */

/* ---- Bootstrap 5 flex/spacing utilities used by Splash markup ---- */
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.ms-2 { margin-left: .5rem !important; }
.me-2 { margin-right: .5rem !important; }
.row.g-3 > [class*="col-"],
.row.g-4 > [class*="col-"] { margin-bottom: 1.5rem; }
.flex-column { flex-direction: column !important; }

/* ---- Page rhythm ---- */
.scard + .scard { margin-top: 1.5rem; }

/* ---- Filter form fields inside cards ---- */
.filter-form .form-control-splash { height: 46px; }
.filter-form label { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 13px; margin-bottom: 6px; display: block; }

/* =========================================================
   DataTables — theme the generated controls to match Splash
   ========================================================= */
.dataTables_wrapper { padding: 4px 2px 2px; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: 16px; font-family: var(--font-body); color: var(--text); }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 8px 14px;
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  margin-left: 8px;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22,72,221,.1);
}
.dataTables_wrapper .dt-buttons { margin-bottom: 16px; display: inline-flex; flex-wrap: wrap; gap: 8px; }
.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .dt-button {
  background: var(--cream) !important;
  color: var(--navy) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 11px !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  box-shadow: none !important;
  transition: var(--t);
}
.dataTables_wrapper .dt-buttons .btn:hover,
.dataTables_wrapper .dt-button:hover {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.dataTables_wrapper .dataTables_info { color: var(--muted); font-size: 13.5px; padding-top: 14px; }
.dataTables_wrapper .dataTables_paginate { padding-top: 12px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  min-width: 36px; height: 36px; line-height: 1;
  padding: 0 10px !important;
  margin: 0 3px !important;
  border-radius: 10px !important;
  border: none !important;
  background: var(--cream) !important;
  color: var(--navy) !important;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--blue) !important; color: #fff !important; border: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--blue) !important; color: #fff !important; border: none !important;
  box-shadow: 0 8px 16px rgba(22,72,221,.3);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: transparent !important; color: var(--muted) !important; opacity: .5;
}
/* DataTables sort markers shouldn't fight the uppercase head */
table.dataTable thead th { position: relative; }
table.dataTable.table-splash { border-collapse: separate !important; }

/* =========================================================
   MODALS — Splash look on Bootstrap 4 modals
   ========================================================= */
.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-body);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  align-items: center;
}
.modal-header .modal-title { font-family: var(--font-display); color: var(--ink); font-weight: 600; font-size: 18px; }
.modal-header .close { color: var(--muted); opacity: 1; text-shadow: none; font-size: 26px; font-weight: 400; }
.modal-header .close:hover { color: var(--pink-hot); }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }
.modal-body label { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 14px; margin-bottom: 8px; display: block; }
/* Sit above the fixed sidebar (z-index 1040) */
.modal { z-index: 1060; }
.modal-backdrop { z-index: 1055; }

/* =========================================================
   SALE BUILDER (create / edit)
   ========================================================= */
.sale-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.sale-table thead th {
  background: var(--cream); color: var(--navy);
  font-weight: 800; font-size: 12.5px; letter-spacing: .5px; text-transform: uppercase;
  padding: 13px 18px; border: none; white-space: nowrap;
}
.sale-table td { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 14.5px; color: var(--text); vertical-align: middle; }
.sale-table tbody tr:hover { background: #fafbff; }
.sale-table .sum-row td { font-family: var(--font-display); color: var(--ink); font-weight: 600; background: #fff; }
.sale-table .sum-row td.text-right { color: var(--muted); font-family: var(--font-body); font-weight: 700; }
.sale-table .grand td { font-size: 16px; color: var(--blue); }
.sale-type-options { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.sale-type-options label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 11px; background: var(--cream);
  border: 1.5px solid var(--border); font-weight: 600; cursor: pointer; margin: 0;
}
.sale-type-options input { accent-color: var(--blue); }
.inline-amount { width: 140px !important; display: inline-block; }
.btn-row-del {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  display: inline-grid; place-items: center;
  background: var(--pink-bg); color: var(--pink-hot);
  font-size: 15px; cursor: pointer; transition: var(--t); text-decoration: none;
}
.btn-row-del:hover { background: var(--pink); color: #fff; }

/* Small helper text colors used inline */
.text-error { color: var(--pink-hot); font-weight: 600; }
.text-ok { color: var(--mint); font-weight: 600; }

/* =========================================================
   PRODUCT PICKER MODAL (image-based add to sale)
   ========================================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px;
}
.product-tile {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--t);
  background: #fff;
  text-align: center;
}
.product-tile:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.product-tile.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,72,221,.15); background: #fafbff; }
.product-tile .pt-img {
  width: 100%; height: 84px; border-radius: 10px; overflow: hidden;
  background: var(--cream); display: grid; place-items: center; margin-bottom: 8px;
}
.product-tile .pt-img img { width: 100%; height: 100%; object-fit: cover; }
.product-tile .pt-noimg { font-size: 32px; color: var(--muted); }
.product-tile .pt-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 13.5px; line-height: 1.25; }
.product-tile .pt-meta { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.product-tile .pt-price { font-weight: 800; color: var(--blue); font-size: 13px; }
.product-tile .pt-code { font-size: 11px; color: var(--muted); background: var(--cream); padding: 1px 7px; border-radius: 20px; }
.product-picker-foot { align-items: center; gap: 12px; flex-wrap: wrap; }
.product-picker-foot .pp-selected { font-weight: 700; color: var(--text); }
/* category-first navigation */
.category-tile .pt-img { background: linear-gradient(150deg, var(--mint-soft), var(--pink-bg)); }
.category-tile .pt-noimg { color: var(--blue); }
.btn-pp-back {
  border: none; background: var(--cream); color: var(--navy);
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-grid; place-items: center; margin-right: 8px;
  cursor: pointer; vertical-align: middle; transition: var(--t);
}
.btn-pp-back:hover { background: var(--blue); color: #fff; }
.modal-title .btn-pp-back i { font-size: 16px; }

/* Make plain bootstrap badges fall back to pills when present */
.badge { font-family: var(--font-body); font-weight: 700; border-radius: 30px; padding: 5px 12px; }
