/* =========================================================
   B&B Logistic — Estilos Premium (Bootstrap 5 + DataTables)
   Archivo: /public_html/assets/css/style.css
   Paleta:
   - Cyan: #00d4ff
   - Azul Rey: #0033cc
   - Fondo: #f4f7f6
   - Texto: #2c3e50
   ========================================================= */

/* Google Font (Poppins) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root{
  --bb-cyan: #00d4ff;
  --bb-royal: #0033cc;
  --bb-bg: #f4f7f6;
  --bb-card: #ffffff;
  --bb-text: #2c3e50;

  --bb-muted: #6c7a89;
  --bb-border: rgba(44, 62, 80, 0.12);

  --bb-shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --bb-shadow-md: 0 10px 24px rgba(0,0,0,0.08);

  --bb-radius: 14px;
  --bb-radius-sm: 10px;

  --bb-gradient: linear-gradient(135deg, var(--bb-cyan) 0%, var(--bb-royal) 100%);
}

*{
  box-sizing: border-box;
}

html, body{
  height: 100%;
}

body{
  margin: 0;
  background: var(--bb-bg);
  color: var(--bb-text);
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links */
a{
  color: var(--bb-royal);
  text-decoration: none;
}
a:hover{
  color: #001f99;
  text-decoration: none;
}

/* Layout helpers (para usar en Fase 2) */
.app-shell{
  display: flex;
  min-height: 100vh;
}

/* =========================
   Sidebar (Fase 2 lo usa)
   ========================= */
.sidebar{
  width: 280px;
  background: var(--bb-gradient);
  color: #fff;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--bb-shadow-md);
}

.sidebar .brand{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  margin-bottom: 14px;
}

.sidebar .brand img{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  padding: 6px;
}

.sidebar .brand .title{
  line-height: 1.2;
}
.sidebar .brand .title strong{
  display: block;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.sidebar .brand .title span{
  font-size: 12px;
  opacity: 0.9;
}

.sidebar .nav{
  margin-top: 10px;
}

.sidebar .nav-link{
  color: rgba(255,255,255,0.92);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sidebar .nav-link:hover{
  background: rgba(255,255,255,0.16);
  color: #fff;
  transform: translateX(2px);
}

.sidebar .nav-link.active{
  background: rgba(255,255,255,0.22);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* =========================
   Main content area (Fase 2)
   ========================= */
.main{
  flex: 1;
  padding: 22px;
}

.page-title{
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
}
.page-subtitle{
  font-size: 13px;
  color: var(--bb-muted);
  margin: 0 0 18px 0;
}

/* =========================
   Cards premium
   ========================= */
.card{
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow-sm);
}

.card .card-header{
  border-bottom: 1px solid var(--bb-border);
  background: #fff;
  border-top-left-radius: var(--bb-radius);
  border-top-right-radius: var(--bb-radius);
  padding: 14px 16px;
  font-weight: 600;
}

.card .card-body{
  padding: 16px;
}

/* Badges */
.badge-soft{
  background: rgba(0, 212, 255, 0.12);
  color: #0b5a78;
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
}

/* =========================
   Buttons premium (Bootstrap overrides)
   ========================= */
.btn{
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 14px;
}

.btn-primary{
  background: var(--bb-gradient);
  border: none;
  box-shadow: 0 10px 18px rgba(0, 51, 204, 0.18);
}

.btn-primary:hover,
.btn-primary:focus{
  background: linear-gradient(135deg, #00c6ef 0%, #002db8 100%);
  border: none;
  box-shadow: 0 12px 24px rgba(0, 51, 204, 0.25);
}

.btn-outline-primary{
  border: 1px solid rgba(0, 51, 204, 0.35);
  color: var(--bb-royal);
}
.btn-outline-primary:hover{
  background: rgba(0, 51, 204, 0.08);
  color: var(--bb-royal);
}

/* Inputs */
.form-control, .form-select{
  border-radius: 12px;
  border: 1px solid var(--bb-border);
  padding: 10px 12px;
}
.form-control:focus, .form-select:focus{
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(0, 212, 255, 0.18);
}

/* =========================
   DataTables Premium Styling
   ========================= */
.table{
  color: var(--bb-text);
}

.table thead th{
  background: var(--bb-gradient);
  color: #fff;
  border: none !important;
  font-weight: 700;
  vertical-align: middle;
}

.table tbody td{
  vertical-align: middle;
  border-color: rgba(44, 62, 80, 0.08);
}

.table-striped > tbody > tr:nth-of-type(odd) > *{
  --bs-table-accent-bg: rgba(0,0,0,0.02);
}

.dataTables_wrapper{
  padding-top: 8px;
}

.dataTables_wrapper .dataTables_filter input{
  border-radius: 12px !important;
  border: 1px solid var(--bb-border) !important;
  padding: 8px 10px !important;
  margin-left: 8px !important;
  outline: none !important;
}

.dataTables_wrapper .dataTables_length select{
  border-radius: 12px !important;
  border: 1px solid var(--bb-border) !important;
  padding: 6px 10px !important;
  outline: none !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate{
  padding-top: 12px !important;
  color: var(--bb-muted) !important;
}

/* Pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button{
  border-radius: 10px !important;
  border: 1px solid rgba(44, 62, 80, 0.12) !important;
  background: #fff !important;
  margin: 0 3px !important;
  padding: 6px 10px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current{
  background: var(--bb-gradient) !important;
  color: #fff !important;
  border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover{
  background: rgba(0, 212, 255, 0.10) !important;
  border: 1px solid rgba(0, 212, 255, 0.35) !important;
  color: var(--bb-text) !important;
}

/* DataTables Buttons (Excel/PDF) */
.dt-buttons{
  margin-bottom: 10px;
}

.dt-buttons .btn{
  border-radius: 12px !important;
  font-weight: 700 !important;
  padding: 8px 12px !important;
  border: none !important;
  background: var(--bb-gradient) !important;
  color: #fff !important;
  box-shadow: 0 10px 18px rgba(0, 51, 204, 0.16);
  margin-right: 6px;
}

.dt-buttons .btn:hover{
  background: linear-gradient(135deg, #00c6ef 0%, #002db8 100%) !important;
  box-shadow: 0 12px 24px rgba(0, 51, 204, 0.25);
}

/* Sorting icons contrast in gradient header */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after{
  color: rgba(255,255,255,0.85) !important;
}

/* Responsive polish */
@media (max-width: 991px){
  .sidebar{
    width: 100%;
    height: auto;
    position: relative;
    border-radius: 0;
  }
  .main{
    padding: 16px;
  }
  .card .card-body{
    padding: 14px;
  }
}
/* =========================================================
   LOGO CONTROL (TOPBAR + SIDEBAR + OFFCANVAS)
   - No depende de src/alt
   - Evita el logo gigante y el desborde
   ========================================================= */

/* TOPBAR: contenedor del ícono (span) */
.navbar-brand .d-inline-flex{
  width: 34px !important;
  height: 34px !important;
  overflow: hidden !important;
  line-height: 0 !important;
}

/* TOPBAR: el logo SIEMPRE pequeño */
.navbar-brand img{
  width: 26px !important;
  height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  object-fit: contain !important;
  display: block !important;
}

/* SIDEBAR: el logo del brand */
.sidebar .brand{
  overflow: hidden !important;
}
.sidebar .brand img{
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
  display: block !important;
}

/* OFFCANVAS (móvil): logo pequeño */
.offcanvas-header .d-inline-flex{
  width: 34px !important;
  height: 34px !important;
  overflow: hidden !important;
  line-height: 0 !important;
}
.offcanvas-header img{
  width: 26px !important;
  height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  object-fit: contain !important;
  display: block !important;
}
/* =========================================================
   HOTFIX NAVBAR: evita que el logo gigante estire el top
   ========================================================= */

/* 1) El navbar NO puede crecer */
nav.navbar{
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  overflow: hidden !important;
  align-items: center !important;
}

/* 2) Su contenedor también fijo */
nav.navbar .container-fluid{
  height: 64px !important;
  align-items: center !important;
}

/* 3) La marca (logo + texto) centrada */
nav.navbar .navbar-brand{
  height: 64px !important;
  display: flex !important;
  align-items: center !important;
  overflow: hidden !important;
}

/* 4) CUALQUIER IMG dentro del navbar queda pequeña (incluye tu logo) */
nav.navbar img{
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
  display: block !important;
}

/* 5) Sidebar sigue con su tamaño correcto */
.sidebar .brand img{
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
  display: block !important;
}

/* =========================
   Fase 2 - Pantallas Auth
   ========================= */
.bb-auth-body{
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0,212,255,0.15), transparent 30%),
    linear-gradient(135deg, #eef5ff 0%, #f8fbff 40%, #edf8ff 100%);
}

.bb-auth-side{
  background: linear-gradient(160deg, #00d4ff 0%, #0033cc 70%, #001f74 100%);
}

.bb-auth-logo-wrap{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.bb-auth-logo-wrap img{
  max-width: 100%;
  max-height: 100%;
}

.bb-auth-list{
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.table td, .table th{
  vertical-align: middle;
}
