/* ============================================================
   BuyCompras — Stylesheet Principal
   Concrefer | 2026
   ============================================================ */

:root {
  --bc-primary:   #1a3a5c;
  --bc-primary-d: #122840;
  --bc-accent:    #e67e22;
  --bc-bg:        #f0f4f8;
  --bc-surface:   #ffffff;
  --bc-border:    #dee2e6;
  --bc-text:      #212529;
  --bc-muted:     #6c757d;
  --sidebar-w:    245px;
  --bottom-nav-h: 62px;
}

/* ── Reset / Base ────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bc-bg);
  color: var(--bc-text);
  margin: 0;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.bc-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bc-primary);
  color: #fff;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .25s ease;
}

.bc-sidebar-logo {
  padding: 16px 16px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.bc-sidebar-logo img {
  width: 150px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.bc-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  text-decoration: none;
}
.bc-sidebar-brand span {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
}
.bc-sidebar-brand span em {
  color: var(--bc-accent);
  font-style: normal;
}

.bc-nav { flex: 1; padding: 8px 0; }

.bc-nav-section {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.4);
  padding: 16px 16px 4px;
}

.bc-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 8px;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.bc-nav-link i { font-size: 1.1rem; min-width: 20px; }
.bc-nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.bc-nav-link.active {
  background: var(--bc-accent);
  color: #fff;
}

.bc-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}
.bc-sidebar-footer .avatar {
  width: 32px; height: 32px;
  background: var(--bc-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff; flex-shrink: 0;
}
.bc-sidebar-footer .info { flex: 1; overflow: hidden; }
.bc-sidebar-footer .info .name {
  color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bc-sidebar-footer .info .role {
  color: rgba(255,255,255,.5); font-size: .7rem;
}
.bc-logout-btn {
  background: none; border: none; color: rgba(255,255,255,.5);
  cursor: pointer; padding: 4px; font-size: 1rem;
  transition: color .15s;
}
.bc-logout-btn:hover { color: #fff; }

/* ── Main Content ────────────────────────────────────────── */
.bc-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bc-topbar {
  background: var(--bc-surface);
  border-bottom: 1px solid var(--bc-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.bc-topbar h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--bc-primary);
}
.bc-topbar .bc-topbar-actions { margin-left: auto; display: flex; gap: 8px; }

.bc-content { padding: 24px; flex: 1; }

/* ── Bottom Nav (Mobile) ─────────────────────────────────── */
.bc-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--bc-surface);
  border-top: 1px solid var(--bc-border);
  display: none;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.bc-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--bc-muted);
  font-size: .65rem;
  font-weight: 600;
  gap: 2px;
  padding: 6px 0;
  position: relative;
  transition: color .15s;
}
.bc-bottom-nav-item i   { font-size: 1.35rem; }
.bc-bottom-nav-item.active { color: var(--bc-primary); }
.bc-bottom-nav-fab {
  color: #fff !important;
  background: var(--bc-accent);
  border-radius: 50%;
  width: 50px; height: 50px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(230,126,34,.4);
  align-self: center;
}
.bc-bottom-nav-fab i { font-size: 1.5rem !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .bc-sidebar  { display: none !important; }
  .bc-main     { margin-left: 0; padding-bottom: var(--bottom-nav-h); }
  .bc-bottom-nav { display: flex !important; }
  .bc-content  { padding: 14px; }
  .bc-topbar   { padding: 10px 14px; }
}

/* ── Status Badges ───────────────────────────────────────── */
.bc-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.bc-status-rascunho                  { background:#f0f0f0; color:#6c757d; }
.bc-status-em_aprovacao              { background:#fff3cd; color:#f39c12; border:1px solid #f39c12; }
.bc-status-aprovado                  { background:#f3e6ff; color:#6f2da8; border:1px solid #8e44ad; }
.bc-status-em_cotacao                { background:#cfe2ff; color:#1a5fa6; border:1px solid #1a5fa6; }
.bc-status-aguardando_aprovacao_compra{ background:#fde8d8; color:#c0581a; border:1px solid #e67e22; }
.bc-status-aguardando_pedido         { background:#fde8d8; color:#c0581a; border:1px solid #e67e22; }
.bc-status-pedido_realizado          { background:#d4edda; color:#1a7a3f; border:1px solid #27ae60; }
.bc-status-em_entrega                { background:#d1ecf1; color:#0c5460; border:1px solid #17a2b8; }
.bc-status-concluido                 { background:#d4edda; color:#155724; border:1px solid #27ae60; }
.bc-status-reprovado                 { background:#f8d7da; color:#721c24; border:1px solid #dc3545; }
.bc-status-cancelado                 { background:#e9ecef; color:#495057; }

/* ── Urgência Badges ─────────────────────────────────────── */
.bc-urgencia-normal  { background:#f8f9fa; color:#6c757d; border:1px solid #dee2e6; }
.bc-urgencia-urgente { background:#fff3cd; color:#856404; border:1px solid #ffc107; }
.bc-urgencia-critico { background:#f8d7da; color:#721c24; border:1px solid #dc3545; }

/* ── Cards ───────────────────────────────────────────────── */
.bc-card {
  background: var(--bc-surface);
  border-radius: 10px;
  border: 1px solid var(--bc-border);
  padding: 20px;
  margin-bottom: 16px;
}
.bc-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bc-border);
}
.bc-card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--bc-primary);
}

/* ── Dashboard Stat Cards ────────────────────────────────── */
.bc-stat-card {
  background: var(--bc-surface);
  border-radius: 10px;
  border: 1px solid var(--bc-border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
  color: inherit;
}
.bc-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
.bc-stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.bc-stat-num  { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.bc-stat-lbl  { font-size: .8rem; color: var(--bc-muted); font-weight: 600; margin-top: 2px; }

/* ── Timeline ────────────────────────────────────────────── */
.bc-timeline { position: relative; padding-left: 28px; }
.bc-timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 6px; bottom: 0;
  width: 2px;
  background: var(--bc-border);
}
.bc-timeline-item { position: relative; margin-bottom: 20px; }
.bc-timeline-dot {
  position: absolute;
  left: -22px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bc-accent);
  border: 2px solid var(--bc-surface);
  box-shadow: 0 0 0 2px var(--bc-accent);
}
.bc-timeline-content { background: var(--bc-bg); border-radius: 8px; padding: 10px 14px; }
.bc-timeline-acao { font-weight: 700; font-size: .85rem; color: var(--bc-primary); }
.bc-timeline-desc { font-size: .82rem; color: var(--bc-text); margin: 2px 0; }
.bc-timeline-meta { font-size: .72rem; color: var(--bc-muted); }

/* ── Progress Steps ──────────────────────────────────────── */
.bc-steps { display: flex; align-items: center; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.bc-step  { display: flex; align-items: center; flex-shrink: 0; }
.bc-step-node {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 70px;
}
.bc-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--bc-border);
  background: var(--bc-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--bc-muted);
  transition: all .3s;
}
.bc-step-circle.done   { background: #27ae60; border-color: #27ae60; color: #fff; }
.bc-step-circle.active { background: var(--bc-accent); border-color: var(--bc-accent); color: #fff; }
.bc-step-label { font-size: .6rem; font-weight: 600; color: var(--bc-muted); text-align: center; max-width: 70px; line-height: 1.2; }
.bc-step-label.active { color: var(--bc-accent); }
.bc-step-label.done   { color: #27ae60; }
.bc-step-line {
  height: 2px;
  flex: 1;
  min-width: 20px;
  background: var(--bc-border);
  margin: 0 4px;
  margin-bottom: 16px;
}
.bc-step-line.done { background: #27ae60; }

/* ── Tables ──────────────────────────────────────────────── */
.bc-table-wrap { overflow-x: auto; }
.bc-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.bc-table th {
  background: var(--bc-bg);
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--bc-muted);
  border-bottom: 2px solid var(--bc-border);
  white-space: nowrap;
}
.bc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bc-border);
  vertical-align: middle;
}
.bc-table tr:hover td { background: #fafafa; }
.bc-table tr:last-child td { border-bottom: none; }

/* ── Pedido cards (mobile list) ──────────────────────────── */
.bc-pedido-card {
  background: var(--bc-surface);
  border-radius: 10px;
  border: 1px solid var(--bc-border);
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow .15s;
}
.bc-pedido-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.bc-pedido-card .code {
  font-size: .72rem;
  font-weight: 700;
  color: var(--bc-muted);
  font-family: monospace;
}
.bc-pedido-card .titulo {
  font-weight: 700;
  font-size: .92rem;
  color: var(--bc-primary);
  margin: 3px 0 6px;
}

/* ── Forms ───────────────────────────────────────────────── */
.bc-form-label { font-size: .8rem; font-weight: 600; color: var(--bc-muted); margin-bottom: 4px; }
.bc-required::after { content: ' *'; color: #e74c3c; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-bc-primary {
  background: var(--bc-primary); color: #fff;
  border: none; border-radius: 8px; padding: 8px 16px;
  font-weight: 600; cursor: pointer; font-size: .875rem;
  transition: background .15s;
}
.btn-bc-primary:hover { background: var(--bc-primary-d); }

.btn-bc-accent {
  background: var(--bc-accent); color: #fff;
  border: none; border-radius: 8px; padding: 8px 16px;
  font-weight: 600; cursor: pointer; font-size: .875rem;
  transition: background .15s;
}
.btn-bc-accent:hover { background: #cf6d17; }

/* ── Empty State ─────────────────────────────────────────── */
.bc-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--bc-muted);
}
.bc-empty i { font-size: 3rem; margin-bottom: 12px; display: block; }
.bc-empty p { font-size: .9rem; margin: 0; }

/* ── Loading Spinner ─────────────────────────────────────── */
.bc-spinner {
  display: inline-block;
  width: 36px; height: 36px;
  border: 3px solid var(--bc-border);
  border-top-color: var(--bc-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bc-loading { text-align: center; padding: 48px; }

/* ── Toast ───────────────────────────────────────────────── */
#bc-toast-container {
  position: fixed;
  bottom: 80px; right: 16px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.bc-toast {
  background: #333;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .85rem;
  font-weight: 500;
  max-width: 300px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideIn .3s ease;
}
.bc-toast.success { background: #27ae60; }
.bc-toast.error   { background: #e74c3c; }
.bc-toast.info    { background: var(--bc-primary); }
@keyframes slideIn { from { transform: translateX(120%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ── Modal adjustments ───────────────────────────────────── */
.modal-header { background: var(--bc-primary); color: #fff; }
.modal-header .btn-close { filter: invert(1); }
.modal-title { font-weight: 700; }

/* ── Barra de Ações (solicitacao.html) ───────────────────── */
.bc-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.bc-action-bar .btn {
  white-space: nowrap;
}

/* ================================================================
   MODO IMPRESSÃO — layout padrão sem cards ou paddings decorativos
   ================================================================ */
@media print {
  .bc-sidebar,
  .bc-bottom-nav,
  .bc-topbar,
  .no-print,
  button,
  .btn { display: none !important; }

  body { background: #fff !important; font-family: Arial, sans-serif !important; }
  .bc-main { margin-left: 0 !important; }
  .bc-content { padding: 0 !important; }

  .print-header {
    display: flex !important;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 16px;
  }
  .print-header img { width: 60px; height: 60px; object-fit: contain; }
  .print-header-info h1 { font-size: 14pt; font-weight: bold; margin: 0; }
  .print-header-info p  { font-size: 9pt; margin: 0; color: #555; }

  .print-title {
    font-size: 12pt;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 12px 0;
    border: 1px solid #999;
    padding: 6px;
  }

  .print-section { margin-bottom: 14px; }
  .print-section-title {
    font-size: 9pt;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
    margin-bottom: 8px;
  }

  .print-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
  .print-field { flex: 1; min-width: 120px; }
  .print-field label { font-size: 7.5pt; font-weight: bold; color: #555; display: block; }
  .print-field span  { font-size: 9pt; }

  table.print-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  table.print-table th {
    background: #eee;
    border: 1px solid #999;
    padding: 4px 6px;
    text-align: left;
    font-weight: bold;
  }
  table.print-table td { border: 1px solid #ccc; padding: 4px 6px; }

  .print-signatures {
    display: flex; gap: 40px; margin-top: 32px; flex-wrap: wrap;
  }
  .print-sig {
    flex: 1; min-width: 150px;
    border-top: 1px solid #000;
    padding-top: 6px;
    font-size: 8pt;
  }
  .print-sig-label { font-weight: bold; }

  .bc-card { border: none !important; padding: 0 !important; margin: 0 !important; }
  .bc-status { border: 1px solid #999 !important; background: none !important; color: #000 !important; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
