:root {
  --ui-bg: #f4f6f8;
  --ui-surface: #ffffff;
  --ui-border: #dfe4ea;
  --ui-text: #1f2d3d;
  --ui-muted: #6b7b8c;
  --ui-primary: #007bff;
  --ui-primary-2: #0069d9;
}

body {
  background: var(--ui-bg);
  color: var(--ui-text);
  overflow-x: hidden;
}

.container,
.container-fluid,
.card,
.modal-content,
.table,
.alert,
.navbar,
.dropdown-menu {
  border-radius: 12px;
}

.card,
.modal-content,
.table,
.dropdown-menu {
  border: 1px solid var(--ui-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.navbar {
  border: 1px solid var(--ui-border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.table thead th {
  border-top: 0;
  color: var(--ui-muted);
  font-weight: 700;
}

.form-control,
.custom-select,
.btn {
  border-radius: 10px;
}

.form-control:focus,
.custom-select:focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
  border-color: var(--ui-primary-2);
}

.alert {
  border: 1px solid var(--ui-border);
}

.ui-table-wrapper {
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.ui-table-controls {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ui-table-search {
  max-width: 340px;
}

.ui-table-pager {
  display: flex;
  gap: 8px;
}

.ui-table-info {
  display: block;
  margin-top: 8px;
  color: var(--ui-muted);
  font-size: 12px;
}

.pedido-card {
  margin-top: 10px;
}

.pedido-card-header {
  background: #f8fbff;
  border-bottom: 1px solid var(--ui-border);
}

.pedido-folio {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e9f3ff;
  color: #1f2d3d;
  font-size: 12px;
}

.pedido-toolbar {
  background: #f8fbff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.pedido-form .form-group {
  margin-bottom: 14px;
}

.pedido-form .table {
  background: #fff;
}

.table-responsive-mobile {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-container {
  width: 100%;
  max-width: 100%;
}

.table-responsive-mobile table {
  min-width: 640px;
}

.card,
.bag,
.modal-content {
  max-width: 100%;
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .container,
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  [class*="col-"] {
    padding-left: 6px;
    padding-right: 6px;
  }

  .card {
    border-radius: 10px;
  }

  .card-body {
    padding: 12px;
  }

  .btn {
    min-height: 38px;
  }

  .form-control,
  .custom-select {
    min-height: 38px;
    font-size: 14px;
  }

  .ui-table-controls {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .ui-table-search {
    max-width: 100%;
    width: 100%;
  }

  .ui-table-pager {
    width: 100%;
    justify-content: flex-end;
  }

  .ui-table-pager .btn {
    flex: 1 1 auto;
  }

  .ui-table-wrapper {
    padding: 8px;
  }

  .table th,
  .table td {
    white-space: nowrap;
    font-size: 13px;
    padding: 0.45rem;
  }

  .table-responsive-mobile table {
    min-width: 560px;
  }

  .partidas,
  .content_partida1,
  .content_partida2 {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .pedido-card-header {
    gap: 8px;
    flex-direction: column;
    align-items: flex-start !important;
  }
}
