/* =========================================================
   SAP-Inspired UI Styles (Consolidated)
   Reuse across list, show, products, suppliers pages
   ========================================================= */

/* ---------- Base ---------- */
.sap-container {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 15px;
  font-family: '72', '72full', Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.sap-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  border-left: 4px solid #0a6ed1; /* SAP blue */
}

.sap-card-header {
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 20px;
}

.sap-card-body {
  padding: 20px;
}

.sap-page-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

/* ---------- Buttons & Links ---------- */
.sap-btn {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-weight: 500;
}

.sap-btn-primary {
  background-color: #0a6ed1;
  color: #fff;
  border-color: #0a6ed1;
}

.sap-btn-primary:hover {
  background-color: #085caf;
  border-color: #085caf;
}

.sap-btn-link {
  background: transparent;
  border: none;
  color: #0a6ed1;
  padding: 0;
  text-decoration: underline;
}

.sap-btn-link:hover {
  color: #085caf;
}

.sap-link {
  color: #0a6ed1;
  text-decoration: underline;
}

.sap-link:hover {
  color: #085caf;
}

/* ---------- Search / Forms ---------- */
.sap-search-section { margin-bottom: 20px; }

.sap-search-form {
  display: flex;
  gap: 10px;
}

.sap-search-group {
  display: flex;
  gap: 10px;
  flex: 1;
}

.sap-form-control {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  font-family: '72', '72full', Arial, Helvetica, sans-serif;
}

.sap-form-control:focus {
  outline: none;
  border-color: #0a6ed1;
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.1);
}

/* ---------- Layout Utilities ---------- */
.sap-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sap-breadcrumb { margin-bottom: 10px; }

/* ---------- Typography Utilities ---------- */
.sap-monospace {
  font-family: monospace;
  font-size: 12px;
  color: #333;
}

.sap-timestamp {
  color: #687a7e;
  font-family: monospace;
  font-size: 12px;
}

.sap-text-muted { color: #6f7d84; }
.sap-text-danger { color: #b00020; }

/* ---------- Table Containers ---------- */
.sap-table-container {
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.sap-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sap-data-table th {
  background-color: #f7f7f7;
  padding: 12px 15px;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
  color: #555;
  white-space: nowrap;
}

.sap-data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.sap-data-table tr:hover td { background-color: #f9f9f9; }

.sap-actions { white-space: nowrap; }

.sap-divider {
  color: #a3b1b8;
  margin: 0 6px;
}

/* Limit text width with ellipsis in tight cells */
.sap-ellipsis {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Product Show: Grid / Media ---------- */
.sap-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

.sap-col-left, .sap-col-right { min-width: 0; }

/* Hero image */
.sap-hero {
  border: 1px solid #eaeaea;
  border-radius: 4px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.sap-hero-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Gallery */
.sap-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.sap-thumb {
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
  padding: 4px;
}

.sap-thumb-img {
  max-width: 160px;
  height: auto;
  display: block;
}

/* ---------- Meta (Definition List) ---------- */
.sap-meta { margin: 0; padding: 0; }

.sap-meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid #f3f3f3;
}

.sap-meta-row:last-child { border-bottom: none; }

.sap-meta dt {
  font-weight: 600;
  color: #555;
}

.sap-meta dd {
  margin: 0;
  color: #2e2e2e;
}

/* ---------- Pills / Badges ---------- */
.sap-badges { display: flex; flex-wrap: wrap; gap: 8px; }

.sap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe7f6;
  background: #eef5fd;
  color: #0a6ed1;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.sap-pill-success {
  background: #e9f7ef;
  border-color: #c9eedb;
  color: #107e3e;
}

.sap-pill-muted {
  background: #f5f6f7;
  border-color: #e6e9ec;
  color: #5c6b73;
}

/* Semantic status chips (Suppliers Active/Inactive) */
.sap-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #e6e9ec;
  color: #5c6b73;
  background: #f5f6f7;
}

.sap-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

.sap-status-success {
  background: #e9f7ef;
  border-color: #c9eedb;
  color: #107e3e;
}

.sap-status-muted {
  background: #f5f6f7;
  border-color: #e6e9ec;
  color: #5c6b73;
}

/* ---------- Sections (Headed content blocks) ---------- */
.sap-section { margin-top: 24px; }

.sap-section-header {
  border-bottom: 1px solid #eaeaea;
  margin-bottom: 8px;
}

.sap-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
}

.sap-section-body {
  color: #2d3a40;
  line-height: 1.5;
}

.sap-list {
  padding-left: 18px;
  margin: 0;
}

.sap-list li { margin: 4px 0; }

/* ---------- Key/Value Table (Documents & Media) ---------- */
.sap-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sap-kv-table th {
  width: 200px;
  background: #f7f7f7;
  padding: 10px 12px;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
  color: #555;
  vertical-align: top;
}

.sap-kv-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.sap-kv-table tr:hover td { background: #f9f9f9; }

/* ---------- Responsive ---------- */
/* Global table + paddings */
@media (max-width: 768px) {
  .sap-card-body { padding: 14px; }
  .sap-data-table th, .sap-data-table td { padding: 8px 10px; }
  .sap-ellipsis { max-width: 240px; }
  .sap-table-container { border: none; }
  .sap-search-form { flex-direction: column; }
  .sap-search-group { flex-direction: column; }
}

/* Product show grid + meta columns */
@media (max-width: 992px) {
  .sap-grid { grid-template-columns: 1fr; }
  .sap-meta-row { grid-template-columns: 120px 1fr; }
  .sap-thumb-img { max-width: 140px; }
}

@media (max-width: 560px) {
  .sap-meta-row { grid-template-columns: 1fr; }
  .sap-kv-table th { width: auto; }
}
