/* =============================================================================
   Bitácora Electrónica — Sistema de estilos
   Paleta: #0B2545 | #FF6B35 | #17BEBB | #F5F7FA
   ============================================================================= */
:root {
  --bd-primary: #0B2545;
  --bd-primary-hover: #17BEBB;
  --bd-secondary: #FF6B35;
  --bd-secondary-hover: #E55A2A;
  --bd-accent2: #17BEBB;
  --bd-bg: #F0F4F8;
  --bd-text: #0C2838;
  --bd-focus: rgba(11, 37, 69, 0.12);
  --bd-radius: 10px;
  --bd-shadow: 0 12px 40px rgba(11, 37, 69, 0.1);
  --bd-auth-max: 920px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  color: var(--bd-text);
  background: var(--bd-bg);
  -webkit-font-smoothing: antialiased;
}

/* --- Botones --- */
.btn {
  border-radius: var(--bd-radius);
  font-weight: 600;
  padding: 0.55rem 1rem;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--bd-primary) !important;
  border-color: var(--bd-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--bd-primary-hover) !important;
  border-color: var(--bd-primary-hover) !important;
  color: #fff !important;
}

.btn-outline-secondary {
  background: var(--bd-secondary) !important;
  border-color: var(--bd-secondary) !important;
  color: #fff !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: #fff !important;
  color: var(--bd-secondary) !important;
  border-color: var(--bd-secondary) !important;
}

.btn-secondary {
  background: var(--bd-secondary) !important;
  border-color: var(--bd-secondary) !important;
  color: #fff !important;
}

/* --- Formularios --- */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #d8e2ea;
  padding: 0.6rem 0.85rem;
  min-height: 42px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bd-primary);
  box-shadow: 0 0 0 3px var(--bd-focus);
}

.form-label {
  font-weight: 600;
  color: var(--bd-text);
  margin-bottom: 0.35rem;
}

.form-check-input:checked {
  background-color: var(--bd-primary);
  border-color: var(--bd-primary);
}

/* --- Cards generales --- */
.card {
  border-radius: 12px;
  border: 1px solid rgba(12, 40, 56, 0.06);
  box-shadow: 0 2px 12px rgba(11, 37, 69, 0.04);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(12, 40, 56, 0.06);
  padding: 1rem 1.25rem;
}

.text-primary { color: var(--bd-primary) !important; }
font[color="navy"] { color: var(--bd-primary) !important; }

/* =============================================================================
   PÁGINAS DE ACCESO: Login, Seleccionar empresa
   ============================================================================= */
body.bd-auth-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #dce8f2 0%, var(--bd-bg) 45%, #e8eef5 100%);
}

body.bd-auth-page .main#top {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.bd-auth-wrap {
  width: 100%;
  max-width: var(--bd-auth-max);
  margin: 0 auto;
  position: relative;
}

.bd-auth-wrap .bg-auth-circle-shape,
.bd-auth-wrap .bg-auth-circle-shape-2 {
  position: absolute;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.bd-auth-wrap .bg-auth-circle-shape { top: -40px; left: -30px; }
.bd-auth-wrap .bg-auth-circle-shape-2 { bottom: -30px; right: -20px; }

.bd-auth-card {
  position: relative;
  z-index: 1;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--bd-shadow);
  width: 100%;
}

.bd-auth-card .card-body { padding: 0; }

.bd-auth-brand {
  background: linear-gradient(180deg, #0B2545 0%, #07213b 100%);
  color: #fff;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
}

.bd-auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #fff;
}

.bd-auth-brand p {
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
  font-size: 0.9rem;
}

.bd-auth-panel {
  padding: 2rem 2rem 1.75rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bd-auth-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.bd-auth-head img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.bd-auth-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bd-primary);
  letter-spacing: 0.02em;
}

.bd-auth-panel .btn { width: 100%; }

.bd-auth-panel .row.g-2 .btn { width: 100%; }

@media (max-width: 767.98px) {
  .bd-auth-brand {
    min-height: auto;
    padding: 1.5rem 1.25rem;
  }
  .bd-auth-panel {
    padding: 1.5rem 1.25rem;
  }
}

/* =============================================================================
   APLICACIÓN INTERNA: menú, bitácora, reportes, etc.
   ============================================================================= */
body.bd-app {
  overflow-x: hidden;
}

body.bd-app .main#top {
  min-height: 100vh;
}

body.bd-app [data-layout="container"] {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

body.bd-app .content {
  padding: 1rem 1.25rem 2rem;
  min-height: calc(100vh - 4rem);
  width: 100%;
  max-width: 100%;
}

body.bd-app .content > .card {
  width: 100%;
}

body.bd-app .card-body {
  padding: 1.25rem;
}

body.bd-app .card-header h1,
body.bd-app .card-header .fs-0,
body.bd-app .card-header h2 {
  font-size: clamp(1rem, 2.5vw, 1.25rem) !important;
  margin-bottom: 0;
}

/* Header superior */
.navbar-top {
  flex-wrap: nowrap !important;
  align-items: center !important;
  padding: 0.5rem 1rem !important;
  background: #fff !important;
  box-shadow: 0 1px 8px rgba(11, 37, 69, 0.06);
}

.navbar-top .navbar-toggler,
.navbar-top .navbar-toggler-humburger-icon {
  flex: 0 0 auto !important;
  width: 2.5rem !important;
  min-width: 2.5rem !important;
  max-width: 2.5rem !important;
  height: 2.5rem !important;
  padding: 0.35rem !important;
}

.navbar-top .navbar-brand {
  flex: 0 1 auto;
  min-width: 0;
}

.navbar-top .navbar-brand img {
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.navbar-top .navbar-nav-icons {
  flex-shrink: 0;
  margin-left: auto !important;
}

/* Formularios internos: columnas en móvil/tablet */
@media (max-width: 991.98px) {
  body.bd-app .card-body > .row > [class*="col-md-"],
  body.bd-app .card-body > .row > [class*="col-lg-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 1199.98px) {
  body.bd-app .content {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* Tablas y mapas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#mapaPuestos,
#mapaGuardias,
.leaflet-container {
  width: 100% !important;
  min-height: 300px;
}

/* jAlert móvil */
@media (max-width: 576px) {
  #popup_container {
    max-width: calc(100vw - 2rem) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
  }
}

.bd-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 40, 56, 0.45);
  z-index: 1035;
}

body.bd-nav-open { overflow: hidden; }

.alert { border-radius: 8px; }
