/* ==========================================================================
   BEJOR LIFT BRASIL - LUXURY INDUSTRIAL THEME
   Paleta oficial extraida da logomarca Bejor
   ========================================================================== */

:root {
  --bejor-green-dark: #142815;
  --bejor-green-mid: #1F3B21;
  --bejor-obsidian: #15191D;
  --bejor-gold: #C59D4B;
  --bejor-gold-light: #E2C275;
  --bejor-gold-dark: #9A7730;

  --bejor-cream: #F7F4EE;
  --bejor-beige: #EAE2D3;
  --bejor-white: #FFFFFF;
  --bejor-text-main: #1E242B;
  --bejor-text-muted: #6C757D;

  --bejor-success: #2E7D32;
  --bejor-warning: #D9822B;
  --bejor-danger: #C62828;
  --bejor-info: #1976D2;

  --sidebar-width: 268px;
  --sidebar-collapsed-width: 78px;
  --topbar-height: 66px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 18px rgba(20, 40, 21, 0.06);
  --shadow-hover: 0 10px 26px rgba(20, 40, 21, 0.11);
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bejor-cream);
  color: var(--bejor-text-main);
  margin: 0;
  min-height: 100vh;
}

.font-brand {
  font-family: 'Cinzel', 'Playfair Display', Georgia, serif;
  letter-spacing: 0.06em;
}

/* ---------- LAYOUT SHELL ---------- */
.bejor-wrapper {
  display: flex;
  min-height: 100vh;
}

.bejor-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bejor-obsidian) 0%, var(--bejor-green-dark) 42%, #0E1F0F 100%);
  color: var(--bejor-cream);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(197, 157, 75, 0.25);
  transition: width 0.22s ease, transform 0.22s ease;
}

.bejor-sidebar .brand-header {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(226, 194, 117, 0.18);
}

.bejor-sidebar .brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bejor-gold);
  box-shadow: 0 0 14px rgba(197, 157, 75, 0.35);
  flex-shrink: 0;
}

.bejor-sidebar .brand-text h6 {
  margin: 0;
  color: var(--bejor-gold-light);
  font-size: 0.96rem;
  font-weight: 700;
}

.bejor-sidebar .brand-text small {
  color: rgba(247, 244, 238, 0.65);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
}

.bejor-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 24px;
}

.bejor-nav::-webkit-scrollbar { width: 5px; }
.bejor-nav::-webkit-scrollbar-thumb { background: rgba(197, 157, 75, 0.35); border-radius: 10px; }

.bejor-nav-group {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(226, 194, 117, 0.62);
  padding: 14px 12px 5px;
  font-weight: 700;
}

.bejor-nav .nav-link {
  color: rgba(247, 244, 238, 0.84);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.16s ease;
  text-decoration: none;
}

.bejor-nav .nav-link i {
  font-size: 1.05rem;
  color: rgba(226, 194, 117, 0.78);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.bejor-nav .nav-link:hover {
  background: var(--bejor-green-mid);
  color: var(--bejor-white);
}

.bejor-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(197, 157, 75, 0.25) 0%, rgba(197, 157, 75, 0.08) 100%);
  color: var(--bejor-gold-light);
  border-left: 3px solid var(--bejor-gold);
  font-weight: 600;
}

.bejor-nav .nav-link.active i {
  color: var(--bejor-gold-light);
}

/* Collapsed desktop sidebar */
body.sidebar-collapsed .bejor-sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .bejor-sidebar .brand-text,
body.sidebar-collapsed .bejor-sidebar .bejor-nav-group,
body.sidebar-collapsed .bejor-sidebar .nav-link span { display: none; }
body.sidebar-collapsed .bejor-sidebar .nav-link { justify-content: center; padding: 10px; }
body.sidebar-collapsed .bejor-main { margin-left: var(--sidebar-collapsed-width); }

.bejor-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.22s ease;
}

/* ---------- TOPBAR ---------- */
.bejor-topbar {
  height: var(--topbar-height);
  background: var(--bejor-white);
  border-bottom: 1px solid var(--bejor-beige);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 2px 10px rgba(21, 25, 29, 0.04);
}

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

/* ---------- CARDS & BUTTONS ---------- */
.card-bejor {
  background: var(--bejor-white);
  border: 1px solid var(--bejor-beige);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-bejor-header {
  background: linear-gradient(90deg, var(--bejor-green-dark), var(--bejor-green-mid));
  color: var(--bejor-cream);
  padding: 14px 18px;
  border-bottom: 2px solid var(--bejor-gold);
  border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card {
  background: var(--bejor-white);
  border: 1px solid var(--bejor-beige);
  border-top: 3px solid var(--bejor-gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  height: 100%;
}

.kpi-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(197, 157, 75, 0.16);
  color: var(--bejor-green-dark);
}

.btn-gold {
  background: linear-gradient(135deg, var(--bejor-gold-light) 0%, var(--bejor-gold) 55%, var(--bejor-gold-dark) 100%);
  color: var(--bejor-obsidian);
  border: none;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(197, 157, 75, 0.35);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--bejor-gold) 0%, var(--bejor-gold-dark) 100%);
  color: var(--bejor-white);
}

.btn-bejor-green {
  background: var(--bejor-green-dark);
  color: var(--bejor-gold-light);
  border: 1px solid var(--bejor-gold);
  font-weight: 600;
}

.btn-bejor-green:hover {
  background: var(--bejor-green-mid);
  color: var(--bejor-white);
}

.badge-gold {
  background: rgba(197, 157, 75, 0.2);
  color: #7D5E1D;
  border: 1px solid rgba(197, 157, 75, 0.5);
  font-weight: 600;
}

.badge-green {
  background: var(--bejor-green-dark);
  color: var(--bejor-gold-light);
}

/* ---------- TABLES ---------- */
.table-bejor thead th {
  background: var(--bejor-cream);
  color: var(--bejor-green-dark);
  border-bottom: 2px solid var(--bejor-gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  white-space: nowrap;
}

.table-bejor tbody td {
  vertical-align: middle;
  border-color: var(--bejor-beige);
  font-size: 0.88rem;
}

/* ---------- LOGIN SPLIT SCREEN ---------- */
.bejor-auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bejor-obsidian);
}

.bejor-auth-left {
  background: radial-gradient(circle at 35% 35%, #203F23 0%, var(--bejor-green-dark) 48%, var(--bejor-obsidian) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px;
  position: relative;
  overflow: hidden;
  border-right: 2px solid rgba(197, 157, 75, 0.35);
}

.bejor-auth-left::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(226, 194, 117, 0.14);
  top: -120px;
  left: -120px;
}

.bejor-auth-left::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(197, 157, 75, 0.18);
  bottom: -140px;
  right: -100px;
}

.bejor-auth-logo {
  width: 230px;
  height: 230px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 16px 38px rgba(0, 0, 0, 0.65));
  position: relative;
  z-index: 2;
}

.bejor-auth-right {
  background: linear-gradient(160deg, var(--bejor-cream) 0%, #EFE9DD 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}

.bejor-auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--bejor-beige);
  border-top: 4px solid var(--bejor-gold);
  border-radius: 18px;
  padding: 36px 34px;
  box-shadow: 0 22px 48px rgba(20, 40, 21, 0.12);
}

/* ---------- KANBAN & TRELLO ---------- */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}

.kanban-col {
  min-width: 290px;
  max-width: 310px;
  background: #EFECE5;
  border: 1px solid var(--bejor-beige);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 75vh;
}

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bejor-beige);
  background: var(--bejor-white);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.kanban-cards {
  padding: 10px;
  overflow-y: auto;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: var(--bejor-white);
  border: 1px solid var(--bejor-beige);
  border-left: 4px solid var(--bejor-gold);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.kanban-card:active { cursor: grabbing; }

/* ---------- OMNICHANNEL INBOX ---------- */
.chat-shell {
  display: grid;
  grid-template-columns: 330px 1fr;
  height: calc(100vh - 155px);
  min-height: 540px;
  background: var(--bejor-white);
  border: 1px solid var(--bejor-beige);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-list {
  border-right: 1px solid var(--bejor-beige);
  overflow-y: auto;
  background: #FAF8F4;
}

.chat-item {
  padding: 13px 15px;
  border-bottom: 1px solid var(--bejor-beige);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

.chat-item:hover, .chat-item.active {
  background: rgba(197, 157, 75, 0.14);
}

.chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: var(--bejor-cream);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.89rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.msg-cliente { align-self: flex-start; background: var(--bejor-white); border: 1px solid var(--bejor-beige); }
.msg-ia { align-self: flex-end; background: #E9F2EA; border: 1px solid #B7D5BA; }
.msg-humano { align-self: flex-end; background: var(--bejor-green-dark); color: var(--bejor-cream); }
.msg-sistema { align-self: center; background: rgba(197, 157, 75, 0.2); color: #6E5116; font-size: 0.78rem; max-width: 90%; }

/* ---------- GLOBAL SEARCH ---------- */
.global-search-box { position: relative; width: 320px; max-width: 100%; }
.global-search-results {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: var(--bejor-white);
  border: 1px solid var(--bejor-beige);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  display: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 991.98px) {
  .bejor-sidebar { transform: translateX(-100%); }
  body.sidebar-mobile-open .bejor-sidebar { transform: translateX(0); }
  .bejor-main { margin-left: 0 !important; }
  .bejor-auth-page { grid-template-columns: 1fr; }
  .bejor-auth-left { padding: 32px 20px; border-right: none; border-bottom: 2px solid var(--bejor-gold); }
  .bejor-auth-logo { width: 150px; height: 150px; }
  .chat-shell { grid-template-columns: 1fr; height: auto; }
}

/* ---------- ANIMAÇÕES V3.4 (PULSING & BLINKING BADGES) ---------- */
@keyframes bejorBlinkRedGold {
  0%, 100% {
    background-color: #dc3545 !important;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    transform: scale(1);
  }
  50% {
    background-color: #C59D4B !important;
    box-shadow: 0 0 12px 3px rgba(197, 157, 75, 0.85);
    transform: scale(1.06);
  }
}

.blink-badge {
  animation: bejorBlinkRedGold 1.4s infinite cubic-bezier(0.4, 0, 0.6, 1) !important;
  display: inline-flex !important;
  align-items: center;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
}

@keyframes bejorPulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 16px 4px rgba(220, 53, 69, 0.25);
  }
}

.animate-pulse-glow {
  animation: bejorPulseGlow 2s infinite ease-in-out;
}
