/* ============================================================
   ObraJa - Override de paleta sobre o tema Bootstrap/Synto
   - Botoes CTA: amarelo ObraJa com texto azul-marinho
   - Acentos: laranja
   - Headings: azul-marinho
   ============================================================ */

:root {
  --bs-primary: #142850;
  --bs-primary-rgb: 20, 40, 80;

  --obraja-amarelo: #FFC72C;
  --obraja-azul: #142850;
  --obraja-azul-2: #1B3F73;
  --obraja-laranja: #FF6B00;
  --obraja-laranja-2: #cc5500;
}

/* ---------- Responsividade mobile (sidebar + tabelas) ---------- */
@media (max-width: 768px) {
  .obraja-content { padding: 12px 10px; }
  .page-header-breadcrumb h3 { font-size: 1.15rem; }
  /* Tabela scroll horizontal limpo */
  .table-responsive { -webkit-overflow-scrolling: touch; }
  /* Modais full-screen no mobile */
  .modal-dialog { margin: 0; max-width: 100% !important; }
  .modal-dialog.modal-lg, .modal-dialog.modal-xl { max-width: 100% !important; }
  .modal-content { min-height: 100vh; border-radius: 0; }
  /* Cards mais compactos */
  .card-body { padding: 12px; }
  .kpi-icon { width: 36px; height: 36px; font-size: 16px; }
  /* Botões de ação inline ficam menores */
  .btn-icon-action { width: 28px; height: 28px; font-size: 12px; }
  .btn-icon-action i { font-size: 13px; }
}

/* ---------- Z-index dos modais (override styles.css herdado) ---------- */
/* Sidebar usa z-index 1030; modal/backdrop precisam ficar acima */
.modal-backdrop { z-index: 1055 !important; opacity: .55 !important; }
.modal          { z-index: 1060 !important; }
.modal-dialog   { z-index: 1061 !important; }

/* ---------- Botões de ação inline em tabelas/cards ---------- */
/* Padrão: btn-icon-action (32x32, só ícone, cor pela variant outline-*) */
.btn-icon-action {
  width: 32px; height: 32px; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px !important; font-size: 14px;
}
.btn-icon-action i { font-size: 16px; }
.btn-group-actions { gap: 4px; display: inline-flex; }
.btn-group-actions .btn-icon-action { border-radius: 6px !important; }

/* ---------- Tipografia Quicksand (mesma do mdz_drive) ---------- */
body, .quicksand {
  font-family: "Quicksand", system-ui, sans-serif !important;
}

/* ---------- Botoes ---------- */
.btn-primary {
  background-color: var(--obraja-amarelo) !important;
  border-color: var(--obraja-amarelo) !important;
  color: var(--obraja-azul) !important;
  font-weight: 700 !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #e0a800 !important;
  border-color: #e0a800 !important;
  color: var(--obraja-azul) !important;
}

.btn-outline-primary {
  background-color: transparent !important;
  color: var(--obraja-azul) !important;
  border-color: var(--obraja-azul) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--obraja-azul) !important;
  border-color: var(--obraja-azul) !important;
  color: #fff !important;
}

.btn-outline-danger {
  background-color: transparent !important;
  color: #dc2626 !important;
  border-color: #dc2626 !important;
}
.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

.btn-outline-secondary {
  background-color: transparent !important;
  color: #4b5563 !important;
  border-color: #d1d5db !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: #4b5563 !important;
  border-color: #4b5563 !important;
  color: #fff !important;
}

.btn-outline-warning {
  background-color: transparent !important;
  color: #b45309 !important;
  border-color: #f59e0b !important;
}
.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
  background-color: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #1f2937 !important;
}

.btn-outline-success {
  background-color: transparent !important;
  color: #047857 !important;
  border-color: #10b981 !important;
}
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
}

.btn-outline-info {
  background-color: transparent !important;
  color: #0e7490 !important;
  border-color: #06b6d4 !important;
}
.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
  background-color: #06b6d4 !important;
  border-color: #06b6d4 !important;
  color: #fff !important;
}

.btn-accent {
  background-color: var(--obraja-laranja);
  border-color: var(--obraja-laranja);
  color: #fff;
  font-weight: 600;
}
.btn-accent:hover {
  background-color: var(--obraja-laranja-2);
  border-color: var(--obraja-laranja-2);
  color: #fff;
}

/* ---------- Backgrounds e textos ---------- */
.bg-primary { background-color: var(--obraja-azul) !important; }
.text-primary { color: var(--obraja-azul) !important; }

.bg-obraja-amarelo { background-color: var(--obraja-amarelo) !important; color: var(--obraja-azul); }
.bg-obraja-azul    { background-color: var(--obraja-azul)    !important; color: #fff; }
.bg-obraja-laranja { background-color: var(--obraja-laranja) !important; color: #fff; }
.text-obraja-amarelo { color: var(--obraja-amarelo) !important; }
.text-obraja-azul    { color: var(--obraja-azul)    !important; }
.text-obraja-laranja { color: var(--obraja-laranja) !important; }

/* ---------- Sidebar / logo ObraJa ---------- */
.obraja-logo {
  display: flex; align-items: center; gap: 10px;
}
.obraja-logo img {
  width: 36px; height: 36px; object-fit: contain;
}
.obraja-logo .brand-title {
  font-weight: 800; color: var(--obraja-azul); letter-spacing: -0.3px;
}

/* ---------- Avatares coloridos (parceiros, clientes, entregadores) ---------- */
.avatar-cell { display: flex; align-items: center; gap: 10px; }
.avatar-cell .av {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 12px; flex-shrink: 0;
}

/* ---------- Login page (centralizada) ---------- */
.obraja-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 199, 44, .12), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(255, 107, 0, .12), transparent 40%),
    linear-gradient(135deg, #142850 0%, #1B3F73 100%);
  padding: 24px;
}
.obraja-login-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
  padding: 32px 32px 24px;
}
.obraja-login-header { text-align: center; margin-bottom: 20px; }
.obraja-login-header img { width: 180px; height: 180px; object-fit: contain; margin-bottom: 18px; }
.obraja-login-header h1 { font-size: 22px; font-weight: 800; color: var(--obraja-azul); }
.obraja-login-header h1 em { color: var(--obraja-laranja); font-style: normal; }
.obraja-login-header p { color: #6b7280; font-size: 13px; margin-top: 4px; }

/* ---------- Card customizado ObraJa: cabecalho mais espacado ---------- */
.card-obraja .card-header { background: transparent; border-bottom: 1px solid #e9ecef; padding: 14px 18px; }
.card-obraja .card-header h5,
.card-obraja .card-header .card-title { color: var(--obraja-azul); font-weight: 700; margin: 0; }

/* ---------- Status pulse (live) ---------- */
.pulse-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--obraja-laranja); margin-right: 6px;
  animation: pulse-anim 1.4s ease-in-out infinite;
}
@keyframes pulse-anim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,0,.6); }
  50%      { box-shadow: 0 0 0 8px rgba(255,107,0,0); }
}

/* ---------- Mapa mockup ---------- */
.map-mock {
  position: relative; height: 540px;
  background: linear-gradient(180deg, #dde4ec 0%, #c8d2dc 100%);
  border-radius: 12px; overflow: hidden;
}
.map-mock .map-grid {
  position: absolute; inset: 0; opacity: .4;
  background-image:
    linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 36px 36px;
}
.map-mock .map-streets {
  position: absolute; inset: 0; opacity: .35;
  background:
    linear-gradient(45deg, transparent 48%, #c5cfdc 48%, #c5cfdc 51%, transparent 51%),
    linear-gradient(-45deg, transparent 48%, #c5cfdc 48%, #c5cfdc 51%, transparent 51%);
}
.map-pin {
  position: absolute; transform: translate(-50%, -100%);
  font-size: 24px; cursor: pointer; z-index: 2;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.3));
  transition: transform .15s;
}
.map-pin:hover { transform: translate(-50%, -100%) scale(1.18); }
.map-legend {
  position: absolute; bottom: 14px; left: 14px;
  background: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  display: flex; flex-direction: column; gap: 5px; z-index: 3;
}

/* ---------- Tema escuro: ajustes especificos ObraJa ---------- */
[data-theme-mode="dark"] .map-mock {
  background: linear-gradient(180deg, #1a2030 0%, #0f1525 100%);
}
[data-theme-mode="dark"] .map-mock .map-grid {
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
}
[data-theme-mode="dark"] .map-mock .map-streets {
  background:
    linear-gradient(45deg, transparent 48%, #2a3650 48%, #2a3650 51%, transparent 51%),
    linear-gradient(-45deg, transparent 48%, #2a3650 48%, #2a3650 51%, transparent 51%);
}
[data-theme-mode="dark"] .map-legend {
  background: #1a2030; color: #cbd5e1;
}

/* ---------- KPI cards minimal ---------- */
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.kpi-icon.amarelo  { background: rgba(255,199,44,.15);  color: #c89500; }
.kpi-icon.azul     { background: rgba(20,40,80,.10);    color: var(--obraja-azul); }
.kpi-icon.laranja  { background: rgba(255,107,0,.15);   color: var(--obraja-laranja); }
.kpi-icon.verde    { background: rgba(16,185,129,.15);  color: #10b981; }
.kpi-icon.roxo     { background: rgba(139,92,246,.15);  color: #8b5cf6; }
.kpi-icon.escuro   { background: rgba(20,40,80,.10);    color: var(--obraja-azul); }

/* ---------- Botões btn-light mais visíveis (override Bootstrap) ---------- */
.btn-light {
  background-color: #f3f4f6 !important;
  border-color: #e5e7eb !important;
  color: #374151 !important;
}
.btn-light:hover {
  background-color: #FFC72C !important;
  border-color: #FFC72C !important;
  color: var(--obraja-azul) !important;
}
.btn-light.active {
  background-color: var(--obraja-azul) !important;
  border-color: var(--obraja-azul) !important;
  color: #fff !important;
}

/* ---------- Sidebar - destaque item ativo ---------- */
.side-menu__item.active {
  background-color: rgba(255, 199, 44, .15) !important;
  color: var(--obraja-azul) !important;
}
.side-menu__item.active .side-menu__icon {
  color: var(--obraja-laranja) !important;
}

/* ---------- Tabela: cabecalho mais leve ---------- */
.table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: #6b7280; font-weight: 700;
}
.table tbody td { vertical-align: middle; }

/* ---------- Thumbnails de produto ---------- */
.product-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: #f3f4f6; flex-shrink: 0;
}
.product-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 22px;
}

/* ---------- Upload de imagem (form de produto) ---------- */
.image-upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed #d1d5db; border-radius: 12px;
  padding: 24px; cursor: pointer; min-height: 220px;
  background: #f9fafb; transition: all .2s;
  position: relative; overflow: hidden;
}
.image-upload:hover { border-color: var(--obraja-laranja); background: #fff7ed; }
.image-upload img { width: 100%; height: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
.image-upload input[type="file"] { display: none; }
.image-upload .iu-ic { font-size: 36px; color: var(--obraja-azul); margin-bottom: 8px; }
.image-upload .iu-title { font-weight: 600; color: var(--obraja-azul); }
.image-upload .iu-hint { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ---------- Driver / depot card ---------- */
.partner-card .partner-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--obraja-azul), var(--obraja-azul-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}

/* ---------- Timeline rica (detalhe pedido / entregador) ---------- */
.tr-list { position: relative; padding-left: 28px; }
.tr-list::before {
  content: ''; position: absolute; left: 12px; top: 4px; bottom: 4px;
  width: 2px; background: #e5e7eb;
}
.tr-item { position: relative; padding-bottom: 18px; }
.tr-item .tr-dot {
  position: absolute; left: -28px; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: #e5e7eb; color: #6b7280;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  border: 3px solid #fff;
}
.tr-item.done .tr-dot { background: #10b981; color: #fff; }
.tr-item.active .tr-dot { background: var(--obraja-laranja); color: #fff; }
.tr-item strong { font-size: 13px; color: #111827; display: block; }
.tr-item small { font-size: 11px; color: #6b7280; }
.tr-item .tr-photo { margin-top: 8px; max-width: 240px; }
.tr-item .tr-photo img { width: 100%; border-radius: 8px; }
[data-theme-mode="dark"] .tr-list::before { background: #2d3748; }
[data-theme-mode="dark"] .tr-item .tr-dot { background: #2d3748; color: #cbd5e1; border-color: #1a2030; }
[data-theme-mode="dark"] .tr-item strong { color: #e5e7eb; }

/* ---------- Ranking de depositos ---------- */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f5; }
.rank-item:last-child { border-bottom: none; }
.rank-pos {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  background: #f3f4f6; color: #6b7280;
}
.rank-pos.gold   { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-pos.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }
.rank-pos.bronze { background: linear-gradient(135deg, #b45309, #92400e); color: #fff; }
.rank-item .rk-body { flex: 1; }
.rank-item .rk-body strong { display: block; font-size: 13px; color: #111827; }
.rank-item .rk-body small  { color: #6b7280; font-size: 11px; }
.rank-item .rk-val { font-weight: 700; color: var(--obraja-laranja); font-family: "Quicksand", system-ui, sans-serif; }
[data-theme-mode="dark"] .rank-item { border-bottom-color: #2d3748; }
[data-theme-mode="dark"] .rank-item .rk-body strong { color: #e5e7eb; }

/* Guarda: classes começando com "ri-" (que NÃO são ícones RemixIcon) devem manter Quicksand */
.rank-item .rk-body, .rank-item .rk-body strong, .rank-item .rk-body small,
.rank-item .rk-val { font-family: "Quicksand", system-ui, sans-serif !important; }
