/* =====================================================================
   PyDen LicitaBot - Tema InApp adaptado (build-free).
   Reaproveita identidade visual do template InApp (laranja #00429E,
   Poppins, sidebar fixa, icon-shape, avatar) sobre Bootstrap 5.3 (CDN).
   ===================================================================== */

:root {
  --pyden-primary: #00429E;
  --pyden-primary-dark: #002F73;
  --pyden-teal: #0E9C8B;
  --pyden-teal-dark: #0B7E70;
  --bs-primary: #00429E;
  --bs-primary-rgb: 0, 66, 158;
  --bs-success: #00C951;
  --bs-success-rgb: 0, 201, 81;
  --bs-info: #00B8DB;
  --bs-info-rgb: 0, 184, 219;
  --bs-warning: #F0B100;
  --bs-warning-rgb: 240, 177, 0;
  --bs-danger: #FB2C36;
  --bs-danger-rgb: 251, 44, 54;
  --bs-link-color: #404040;
  --bs-link-color-rgb: 64, 64, 64;
  --bs-link-hover-color: #00429E;
  --bs-body-font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  --bs-body-font-size: 0.875rem;
  --bs-body-color: #262626;
  --bs-border-color: #e5e5e5;
}

body {
  font-family: var(--bs-body-font-family);
  font-size: var(--bs-body-font-size);
  background-color: #fafafa;
  color: var(--bs-body-color);
}

/* ---- Botoes (recolore variantes do Bootstrap CDN) ---- */
.btn-primary {
  --bs-btn-bg: #00429E; --bs-btn-border-color: #00429E;
  --bs-btn-hover-bg: #003A8A; --bs-btn-hover-border-color: #002F73;
  --bs-btn-active-bg: #002F73; --bs-btn-active-border-color: #002F73;
  --bs-btn-disabled-bg: #00429E; --bs-btn-disabled-border-color: #00429E;
}
.btn-outline-primary {
  --bs-btn-color: #00429E; --bs-btn-border-color: #00429E;
  --bs-btn-hover-bg: #00429E; --bs-btn-hover-border-color: #00429E;
  --bs-btn-active-bg: #00429E; --bs-btn-active-border-color: #00429E;
}
.text-primary { color: #00429E !important; }
.bg-primary { background-color: #00429E !important; }
.link-primary { color: #00429E !important; }
/* Teal da marca (cor de destaque secundaria) */
.text-teal { color: var(--pyden-teal) !important; }
.bg-teal { background-color: var(--pyden-teal) !important; }
.bg-teal-subtle { background-color: rgba(14,156,139,.12) !important; }
.btn-teal { --bs-btn-bg:#0E9C8B; --bs-btn-border-color:#0E9C8B; --bs-btn-color:#fff; --bs-btn-hover-bg:#0B7E70; --bs-btn-hover-border-color:#0B7E70; --bs-btn-hover-color:#fff; --bs-btn-active-bg:#0B7E70; }
.btn-success { --bs-btn-bg:#00C951; --bs-btn-border-color:#00C951; --bs-btn-hover-bg:#00b349; --bs-btn-hover-border-color:#00b349; }
.form-check-input:checked { background-color:#00429E; border-color:#00429E; }
.form-switch .form-check-input:checked { background-color:#00429E; border-color:#00429E; }
a { text-decoration: none; }
a:hover { color: var(--pyden-primary); }

/* ---- Cards ---- */
.card { border: 1px solid var(--bs-border-color); border-radius: .5rem; }
.card-header { background-color: transparent; }

/* ---- Overlay mobile ---- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(1px); display: none; z-index: 1030; }
.overlay.show { display: block; }

/* ---- Sidebar ---- */
.sidebar {
  width: 240px; background: #fff; transition: width .3s, left .3s;
  border-right: 1px solid var(--bs-border-color); height: 100vh; position: fixed;
  top: 0; left: 0; padding-top: 60px; z-index: 1030; overflow-y: auto;
}
.sidebar .nav-link {
  color: #262626; padding: 8px 10px; display: flex; align-items: center;
  font-size: 14px; font-weight: 400; gap: 12px; white-space: nowrap;
  margin: 1px 12px; border-radius: 8px;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  color: var(--pyden-primary); background-color: rgba(0,66,158,.095);
}
.sidebar .nav-link .ti { font-size: 18px; }
.sidebar .nav-text { transition: opacity .2s; }
.sidebar .nav-section { padding: 16px 24px 8px; color: #a3a3a3; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sidebar .logo-area {
  position: absolute; top: 0; left: 0; height: 60px; width: 100%; background: #fff;
  display: flex; align-items: center; gap: 10px; padding-left: 17px; color: #262626;
  border-bottom: 1px solid var(--bs-border-color); font-weight: 700; font-size: 1.05rem;
}
/* Aberta: so o wordmark. Recolhida: so o icone "P". Nunca os dois juntos. */
.sidebar .logo-area .logo-dot { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; flex-shrink: 0; display: none; }
.sidebar .logo-area .logo-text { height: 26px; width: auto; }
.sidebar.collapsed .logo-area .logo-dot { display: inline-block; }
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .nav-link { margin: 0; background-color: transparent; padding: 8px 18px; }
.sidebar.collapsed .nav-text, .sidebar.collapsed .logo-text, .sidebar.collapsed .nav-section { display: none; }

/* ---- Topbar + content offset ---- */
.topbar { height: 60px; margin-left: 240px; }
.topbar.full { margin-left: 60px; }
.content { margin-left: 240px; min-height: calc(100vh - 60px); padding-top: 60px; }
.content.full { margin-left: 60px; }

@media (max-width: 992px) {
  .sidebar { left: -240px; }
  .sidebar.mobile-show { left: 0; }
  .topbar { margin-left: 0 !important; width: 100% !important; }
  .content { margin-left: 0 !important; }
}

/* ---- Icon shape ---- */
.icon-shape { display: inline-flex; align-items: center; justify-content: center; text-align: center; vertical-align: middle; border-radius: .5rem; }
.icon-xs { width: 1.5rem; height: 1.5rem; }
.icon-sm { width: 2rem; height: 2rem; }
.icon-md { width: 2.5rem; height: 2.5rem; }
.icon-lg { width: 3rem; height: 3rem; }

/* ---- Avatar ---- */
.avatar { position: relative; display: inline-block; width: 3rem; height: 3rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 1.5rem; height: 1.5rem; }
.avatar-sm { width: 2rem; height: 2rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; }
.avatar-initials { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; text-transform: uppercase; font-weight: 600; }
.avatar-primary .avatar-initials { color: #fff; background-color: var(--pyden-primary); }

/* ---- Utilidades especificas ---- */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.btn-sm { width: 2rem; height: 2rem; padding: 0; }
.cursor-pointer { cursor: pointer; }
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.nav-tabs .nav-link.active { color: var(--pyden-primary); border-bottom-color: var(--pyden-primary); }
.fs-7 { font-size: .8rem; }

/* ---- Monitor de disputa ---- */
.timer-display { font-variant-numeric: tabular-nums; font-weight: 700; }
.decision-badge { font-size: .8rem; }
.live-log { background:#0a0a0a; color:#d4d4d4; font-family: ui-monospace, monospace; font-size:.78rem; height: 320px; overflow-y:auto; border-radius:.5rem; padding:.75rem; }
.live-log .log-line { white-space: pre-wrap; }
.position-1 { color:#00C951; font-weight:700; }
.position-2 { color:#F0B100; font-weight:700; }
.position-out { color:#FB2C36; font-weight:700; }
