/* ============================================================
   Business Matching – Custom CSS
   Theme: #1466A7 (Primary Blue) + White
   ============================================================ */

:root {
  --bm-primary: #1466a7;
  --bm-primary2: #0d4f84;
  --bm-light: #e8f1f9;
  --bm-text: #212529;
}

/* ---------- Global ---------- */
body {
  font-family: "Noto Sans Thai", "Sarabun", Arial, sans-serif;
  background: #f4f7fb;
}

a {
  text-decoration: none;
}

/* ---------- Navbar ---------- */
.bm-navbar {
  background: var(--bm-primary) !important;
}
.bm-navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* ---------- Login ---------- */
.bm-login-bg {
  background: linear-gradient(135deg, var(--bm-primary) 0%, #0d4f84 100%);
  min-height: 100vh;
}
.bm-logo-circle {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  border-radius: 16px;
  border: none;
}

/* ---------- TCEX Logo images ---------- */
.bm-login-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}
.bm-navbar-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

/* ---------- Hero strip ---------- */
.bm-hero {
  background: linear-gradient(90deg, var(--bm-primary) 0%, #1a7ec4 100%);
  position: relative;
  overflow: hidden;
}

/* ---------- Avatar ---------- */
.bm-avatar-wrap {
  width: 52px;
  height: 52px;
  position: relative;
}
.bm-avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
  border: 1px solid #e0e0e0;
  background: #fff;
}
.bm-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bm-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bm-avatar-lg {
  width: 64px !important;
  height: 64px !important;
  font-size: 1.3rem !important;
}
.bm-avatar-wrap .bm-avatar {
  position: absolute;
  inset: 0;
}

/* ---------- Cards ---------- */
.bm-card {
  border: none;
  border-radius: 12px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.bm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(20, 102, 167, 0.18) !important;
}
.bm-card-top {
  border-bottom: 1px solid #f0f0f0;
}
.bm-desc {
  max-height: 4.5em;
  overflow: hidden;
}

/* info grid cells */
.bm-info-cell {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 5px 8px;
  height: 100%;
}
.bm-info-label {
  font-size: 0.68rem;
  color: #888;
  margin-bottom: 1px;
}
.bm-info-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
}

/* section label (เกี่ยวกับบริษัท ฯลฯ) */
.bm-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bm-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

/* ---------- Detail Modal panels ---------- */
.bm-detail-info {
  border-bottom: 1px solid #e9ecef;
}
.bm-detail-images {
  background: #f8f9fa;
}
@media (min-width: 768px) {
  /* ให้ modal-body เป็น flex column เพื่อให้ row ขยายเต็ม */
  #detailModal .modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #detailModalBody {
    flex: 1;
    overflow: hidden;
  }
  #detailModalBody > .row {
    height: 100%;
  }
  .bm-detail-info {
    border-bottom: none;
    border-right: 1px solid #e9ecef;
    height: 100%;
    overflow-y: auto;
  }
  .bm-detail-images {
    height: 100%;
    overflow-y: auto;
  }
}

/* ---------- Modal ---------- */
.bm-modal-header {
  background: var(--bm-primary);
}
.bm-date-label {
  font-size: 0.85rem;
  border-bottom: 2px solid var(--bm-light);
  padding-bottom: 6px;
}

/* ---------- Slot buttons ---------- */
.slot-btn {
  min-width: 110px;
  font-size: 0.8rem;
}

/* ---------- My matching slot header ---------- */
.bm-slot-header {
  background: var(--bm-primary);
}

/* ---------- Admin Sidebar ---------- */
.bm-sidebar {
  min-height: 100vh;
  background: var(--bm-primary);
  width: 240px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: width 0.2s;
}
.bm-sidebar .sidebar-logo {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
}
.bm-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.75);
  padding: 10px 16px;
  border-radius: 8px;
  margin: 2px 8px;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.bm-sidebar .nav-link:hover,
.bm-sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.bm-sidebar .nav-link i {
  width: 22px;
}

.bm-admin-content {
  margin-left: 240px;
  min-height: 100vh;
}
.bm-admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 900;
}

/* ---------- Stat cards ---------- */
.stat-card {
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--bm-primary), #1a7ec4);
  color: #fff;
}
.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}
.stat-card.green {
  background: linear-gradient(135deg, #198754, #28c76f);
}
.stat-card.orange {
  background: linear-gradient(135deg, #fd7e14, #ffc107);
}
.stat-card.red {
  background: linear-gradient(135deg, #dc3545, #e07b84);
}

/* ---------- Badge status ---------- */
.badge-pending {
  background: #ffc107;
  color: #212529;
}
.badge-confirmed {
  background: #198754;
}
.badge-cancelled {
  background: #6c757d;
}
.badge-rejected {
  background: #dc3545;
}

/* ---------- Responsive admin ---------- */
@media (max-width: 768px) {
  .bm-sidebar {
    width: 100%;
    min-height: unset;
    position: relative;
  }
  .bm-admin-content {
    margin-left: 0;
  }
}
