/* ===== PORTAL ADMIN - Visual Moderno ===== */

/* Background geral */
.form-body {
  background: #f1f5f9;
}

/* Título da página */
.TituloPagina {
  background: linear-gradient(135deg, #0f2547 0%, #1a3a6e 50%, #2a5dac 100%);
  padding: 28px 20px;
  text-align: center;
  border-bottom: none;
  position: relative;
}

.TituloPagina h1 {
  color: white;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Card de conteúdo (borderedForm) */
.borderedForm {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  padding-top: 28px;
  padding-bottom: 28px;
  margin-bottom: 30px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.borderedForm > center > h5 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.3px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
  display: inline-block;
}

/* Labels dos formulários */
.borderedForm label b,
.borderedForm label {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

/* Inputs e selects */
.borderedForm .form-control,
.borderedForm select.wide,
.borderedForm select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: #334155;
  background-color: #fff;
}

.borderedForm .form-control:focus,
.borderedForm select:focus {
  border-color: #2a5dac;
  box-shadow: 0 0 0 3px rgba(42, 93, 172, 0.1);
  outline: none;
}

/* Botões primários */
.borderedForm .btn-primary {
  background: linear-gradient(135deg, #2a5dac, #1e4a8a);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 20px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(42, 93, 172, 0.2);
}

.borderedForm .btn-primary:hover {
  background: linear-gradient(135deg, #1e4a8a, #163a6e);
  box-shadow: 0 4px 8px rgba(42, 93, 172, 0.3);
  transform: translateY(-1px);
}

/* Botão de sucesso (Novo registro) */
.borderedForm .btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.borderedForm .btn-success:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
  transform: translateY(-1px);
}

/* Botão de perigo */
.borderedForm .btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.borderedForm .btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}

/* Tabelas dentro do admin */
.borderedForm .table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.borderedForm .table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  border-top: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  white-space: nowrap;
}

.borderedForm .table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  border-top: none;
  color: #334155;
}

.borderedForm .table tbody tr:hover {
  background-color: #f8fafc;
}

.borderedForm .table tbody tr:last-child td {
  border-bottom: none;
}

/* DataTables override */
.borderedForm .dataTables_wrapper .dataTables_length select,
.borderedForm .dataTables_wrapper .dataTables_filter input {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

.borderedForm .dataTables_wrapper .dataTables_info {
  font-size: 12px;
  color: #64748b;
}

.borderedForm .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  margin: 0 2px;
  font-size: 12px;
}

.borderedForm .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, #2a5dac, #1e4a8a) !important;
  color: white !important;
  border-color: #2a5dac !important;
}

.borderedForm .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* Switch toggle melhorado */
.switch {
  width: 36px;
  height: 20px;
}

.slider:before {
  height: 16px;
  width: 16px;
}

input:checked + .slider {
  background-color: #2a5dac;
}

input:focus + .slider {
  box-shadow: 0 0 2px #2a5dac;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.slider.round {
  border-radius: 20px;
}

/* ===== HOME ADMIN - Cards ===== */
.admin-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  text-align: left;
  border-left: 4px solid transparent;
  font-size: 14px;
  font-weight: 600;
}

.admin-card:hover {
  border-left-color: #2a5dac;
  box-shadow: 0 4px 12px rgba(42, 93, 172, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: #1e293b;
}

.admin-card:active {
  transform: translateY(0);
}

.admin-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.admin-card-icon.blue {
  background: #eff6ff;
  color: #2a5dac;
}

.admin-card-icon.green {
  background: #f0fdf4;
  color: #16a34a;
}

.admin-card-icon.amber {
  background: #fffbeb;
  color: #d97706;
}

.admin-card-icon.purple {
  background: #faf5ff;
  color: #7c3aed;
}

.admin-card-icon.red {
  background: #fef2f2;
  color: #dc2626;
}

.admin-card-icon.teal {
  background: #f0fdfa;
  color: #0d9488;
}

.admin-card-label {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
}

.admin-card-arrow {
  color: #cbd5e1;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.admin-card:hover .admin-card-arrow {
  color: #2a5dac;
  transform: translateX(3px);
}

/* Modal melhorado */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
}

.modal-header .modal-title {
  font-weight: 700;
  font-size: 16px;
  color: #1e293b;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 12px 20px;
}

/* Alert de licença */
.alert-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  font-size: 13px;
}

/* Seção de erro */
section[style*="background: #2A5DAC"] {
  background: linear-gradient(135deg, #1a3a6e, #2a5dac) !important;
  border-top: none !important;
}

/* Responsivo */
@media (max-width: 810px) {
  .TituloPagina {
    padding: 20px 16px;
  }
  .TituloPagina h1 {
    font-size: 18px;
  }
  .borderedForm {
    padding: 16px;
    border-radius: 10px;
    margin-left: -5px;
    margin-right: -5px;
  }
}

/* ===== DataTables global override para admin ===== */
.form-body table.dataTable thead th,
.form-body table.dataTable thead td {
  border-bottom: 2px solid #e2e8f0;
}

.form-body table.dataTable.no-footer {
  border-bottom: 1px solid #e2e8f0;
}

.form-body table.dataTable tbody tr {
  transition: background-color 0.15s ease;
}

.form-body table.dataTable tbody tr:hover {
  background-color: #f8fafc !important;
}

.form-body .dataTables_wrapper .dataTables_length,
.form-body .dataTables_wrapper .dataTables_filter,
.form-body .dataTables_wrapper .dataTables_info,
.form-body .dataTables_wrapper .dataTables_paginate {
  font-size: 13px;
  color: #64748b;
  padding: 8px 0;
}

.form-body .dataTables_wrapper .dataTables_filter input {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  margin-left: 8px;
  transition: border-color 0.2s ease;
}

.form-body .dataTables_wrapper .dataTables_filter input:focus {
  border-color: #2a5dac;
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 93, 172, 0.1);
}

.form-body .dataTables_wrapper .dataTables_length select {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
}

/* Scrollbar estilizada para tabelas */
.form-body div[style*="overflow-x: auto"],
.form-body .resultado-limitado {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.form-body div[style*="overflow-x: auto"]::-webkit-scrollbar,
.form-body .resultado-limitado::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.form-body div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb,
.form-body .resultado-limitado::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Botões de ação em tabelas */
.form-body .btn-sm {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
}

/* Nice Select override */
.form-body .nice-select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  height: 38px;
  line-height: 36px;
  transition: border-color 0.2s ease;
}

.form-body .nice-select:hover,
.form-body .nice-select:focus,
.form-body .nice-select.open {
  border-color: #2a5dac;
}

.form-body .nice-select .list {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
}

.form-body .nice-select .option:hover,
.form-body .nice-select .option.focus {
  background-color: #f0f4ff;
}

/* ===== MODAL DETALHA PEDIDO ===== */

/* Override de tamanho e padding para o modal de detalha pedido */
.modal-detalha-pedido .tingle-modal-box {
  width: 80%;
  max-width: 1100px;
}

.modal-detalha-pedido .tingle-modal-box__content {
  padding: 0;
}

.modal-detalha-pedido .tingle-modal-box__content > center:first-child {
  display: none;
}

/* Header do modal */
.detalha-header {
  background: linear-gradient(135deg, #2a5dac 0%, #4a7fd4 100%);
  padding: 20px 28px;
  color: white;
}

.detalha-header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detalha-header-title i {
  font-size: 20px;
  opacity: 0.8;
}

.detalha-header-empresa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.detalha-header-empresa i {
  font-size: 14px;
  opacity: 0.85;
}

.detalha-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
}

.detalha-header-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.9;
}

.detalha-header-meta-item strong {
  opacity: 0.7;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Corpo do modal */
.detalha-body {
  padding: 24px 28px;
}

/* Seções do modal */
.detalha-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.detalha-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detalha-section-title i {
  font-size: 12px;
  color: #64748b;
}

/* Info grid dentro das seções */
.detalha-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 20px;
}

.detalha-info-item {
  display: flex;
  flex-direction: column;
}

.detalha-info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.detalha-info-value {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
}

/* Badge de status no modal */
.detalha-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detalha-status-badge.status-aberto {
  background: #f1f5f9;
  color: #475569;
}

.detalha-status-badge.status-gerado {
  background: #fff7ed;
  color: #c2410c;
}

.detalha-status-badge.status-aprovacao-parcial,
.detalha-status-badge.status-aprovado {
  background: #f0fdf4;
  color: #15803d;
}

.detalha-status-badge.status-cancelado {
  background: #fef2f2;
  color: #b91c1c;
}

.detalha-status-badge.status-reservado {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Botões de download */
.detalha-downloads {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.detalha-downloads .btn {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.detalha-downloads .btn:hover {
  transform: translateY(-1px);
}

/* Tabela de itens do pedido */
.detalha-itens-wrapper {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.detalha-itens-wrapper .table-responsive {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.detalha-itens-wrapper .table-responsive::-webkit-scrollbar {
  width: 5px;
}

.detalha-itens-wrapper .table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.detalha-itens-wrapper .table {
  margin-bottom: 0;
  font-size: 12px;
}

.detalha-itens-wrapper .table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  border-top: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 8px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.detalha-itens-wrapper .table tbody td {
  padding: 8px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  border-top: none;
  color: #334155;
}

.detalha-itens-wrapper .table tbody tr:hover {
  background-color: #f8fafc;
}

.detalha-itens-wrapper .table tbody td img {
  border-radius: 6px;
  border: 1px solid #e2e8f0 !important;
  width: 60px !important;
  height: auto;
  object-fit: cover;
}

.detalha-itens-wrapper .table .form-control {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 6px;
  width: 90px;
  height: auto;
  transition: border-color 0.2s ease;
}

.detalha-itens-wrapper .table .form-control:focus {
  border-color: #2a5dac;
  box-shadow: 0 0 0 2px rgba(42, 93, 172, 0.1);
}

/* Totais */
.detalha-totais {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.detalha-totais .table {
  margin-bottom: 0;
  font-size: 13px;
}

.detalha-totais .table td {
  padding: 10px 16px;
  border-top: none;
  border-bottom: 1px solid #e2e8f0;
}

.detalha-totais .table tr:last-child td {
  border-bottom: none;
}

/* Desconto e total final */
.detalha-desconto-area {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.detalha-desconto-area label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detalha-desconto-area .form-control {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.detalha-desconto-area .form-control:focus {
  border-color: #2a5dac;
  box-shadow: 0 0 0 3px rgba(42, 93, 172, 0.1);
}

/* Observação */
.detalha-obs textarea {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  resize: vertical;
}

/* Seção de adição de produto */
.detalha-add-produto {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.detalha-add-produto h6 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #92400e;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detalha-add-produto .form-control {
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.detalha-add-produto .form-control:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Botões de ação do pedido */
.detalha-acoes {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
}

.detalha-acoes .btn {
  min-width: 140px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  transition: all 0.2s ease;
}

.detalha-acoes .btn:hover {
  transform: translateY(-1px);
}

.detalha-acoes .btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: none;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.detalha-acoes .btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.2);
}

.detalha-acoes .btn-primary {
  background: linear-gradient(135deg, #2a5dac, #1e4a8a);
  border: none;
  box-shadow: 0 2px 6px rgba(42, 93, 172, 0.2);
}

/* Responsivo modal detalha pedido */
@media (max-width: 810px) {
  .detalha-header {
    padding: 16px 18px;
  }

  .detalha-body {
    padding: 16px 18px;
  }

  .detalha-header-meta {
    flex-direction: column;
    gap: 6px;
  }

  .detalha-info-grid {
    grid-template-columns: 1fr;
  }

  .detalha-acoes {
    flex-direction: column;
  }

  .detalha-acoes .btn {
    width: 100%;
  }
}
