/* Enterprise Data Tables - High Density Compact Typography */

.data-table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.785rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.45rem 0.65rem;
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.42rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: #f8fafc;
}

.data-table .cell-sku {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

.data-table .cell-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.8rem;
  line-height: 1.25;
}

.data-table .cell-mapped-name {
  color: #475569;
  font-size: 0.775rem;
  line-height: 1.25;
}

.data-table .cell-qty {
  font-weight: 700;
  font-size: 0.825rem;
  color: #064e3b;
}

.data-table .cell-price {
  font-weight: 600;
  font-size: 0.785rem;
  color: #0f172a;
}

.data-table .cell-total-price {
  font-weight: 800;
  font-size: 0.825rem;
  color: #059669;
}

.data-table .actions-cell {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-end;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.725rem;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-surface-alt);
  border-color: var(--border-dark);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Raw Material Image Thumbnail - Modern Rounded */
.rm-img-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.rm-img-thumb:hover:not(.placeholder) {
  transform: scale(1.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  border-color: #059669;
}

.rm-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.rm-img-thumb.placeholder {
  cursor: default;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.rm-img-placeholder {
  font-size: 1.15rem;
  line-height: 1;
}

/* Spin animation for loading state */
.spin-animation {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================================================================
   Modern Table Container, Toolbar & Pills matching User Mockup
   ========================================================================= */

.rm-table-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.rm-toolbar-wrap {
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.rm-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.rm-search-box input {
  width: 100%;
  height: 38px;
  border-radius: 20px;
  padding-left: 2.3rem;
  padding-right: 1rem;
  border: 1px solid #e2e8f0;
  font-size: 0.825rem;
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.rm-search-box input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.rm-search-box svg {
  position: absolute;
  left: 0.85rem;
  top: 11px;
  color: #94a3b8;
  pointer-events: none;
}

.rm-select-pill {
  height: 38px;
  border-radius: 20px;
  padding: 0 1rem;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.rm-select-pill:focus {
  outline: none;
  border-color: #059669;
}

.btn-pill-primary {
  height: 38px;
  border-radius: 20px;
  padding: 0 1.25rem;
  background: #059669;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.825rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.28);
  transition: all 0.15s ease;
}

.btn-pill-primary:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

/* Unit Badges matching Mockup */
.unit-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.unit-badge.unit-pieces {
  background: #dcfce7;
  color: #15803d;
}

.unit-badge.unit-set {
  background: #ccfbf1;
  color: #0f766e;
}

.unit-badge.unit-meter {
  background: #e0f2fe;
  color: #0369a1;
}

.unit-badge.unit-quintal {
  background: #e0f2fe;
  color: #0369a1;
}

.unit-badge.unit-bag {
  background: #fef3c7;
  color: #b45309;
}

.unit-badge.unit-kg {
  background: #f3e8ff;
  color: #7e22ce;
}

.unit-badge.unit-sub {
  background: #ede9fe;
  color: #6d28d9;
}

.unit-badge.unit-default {
  background: #f1f5f9;
  color: #475569;
}

/* Action Buttons */
.btn-action-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-action-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-action-success-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-action-success-outline:hover {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
}

.btn-action-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.48rem;
  border-radius: 6px;
  border: 1px solid #fee2e2;
  background: #ffffff;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-action-danger-outline:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Pagination Footer matching Mockup */
.pagination-page-pill {
  background: #059669;
  color: #ffffff;
  font-weight: 700;
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.75rem;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.pagination-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
