/* ===================================================
   Buffet Sales OS — App CSS
   =================================================== */

:root {
  /* Marca (mantida pra bater com LP/login) */
  --bso-primary:    #E76F51;
  --bso-primary-d:  #c85a3e;
  --bso-secondary:  #223A45;   /* teal escuro, mais profundo p/ a sidebar */
  --bso-accent:     #2A9D8F;
  /* Neutros QUENTES — combinam com a terracota (antes eram frios/azulados) */
  --bso-bg:         #F6F3EF;
  --bso-card:       #FFFFFF;
  --bso-text:       #22282C;
  --bso-text-muted: #6E7781;
  --bso-border:     #ECE6DF;
  --bso-hover:      #F3EFE9;
  /* Forma — mais macia e moderna */
  --bso-sidebar-w:  248px;
  --bso-radius:     12px;
  --bso-radius-sm:  9px;
  --bso-shadow:     0 1px 2px rgba(34,40,44,.04), 0 3px 10px rgba(34,40,44,.05);
  --bso-shadow-md:  0 10px 30px rgba(34,40,44,.10);
  /* Status */
  --bso-green:      #2F9E6E;
  --bso-red:        #E5484D;
  --bso-yellow:     #D39A1E;
  --bso-blue:       #3B7DD8;
  /* Mobile / app */
  --bso-bottomnav-h: 62px;
  --bso-safe-b:     env(safe-area-inset-bottom, 0px);
}

/* --- Reset parcial dentro do app --- */
.bso-app *, .bso-app *::before, .bso-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Neutraliza heranças problemáticas de tema dentro da sidebar */
#bso-app .bso-sidebar * {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.bso-app {
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--bso-text);
  background: var(--bso-bg);
}

/* ===== SIDEBAR ===== */
.bso-sidebar {
  width: var(--bso-sidebar-w);
  background: var(--bso-secondary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform .25s ease;
}

.bso-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  min-height: 60px;
  flex-shrink: 0;
}

/* Logo — usa #bso-app para garantir especificidade máxima sobre o tema */
#bso-app .bso-sidebar-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 18px 16px 14px !important;
  border-bottom: 1px solid rgba(255,255,255,.1) !important;
  min-height: 60px !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

#bso-app .bso-logo {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  max-width: 185px !important;
  text-decoration: none !important;
  font-style: normal !important;
  text-transform: none !important;
}

#bso-app .bso-logo-icon {
  display: inline-block !important;
  font-size: 22px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  font-style: normal !important;
  text-transform: none !important;
}

#bso-app .bso-logo-text {
  display: inline-block !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
  letter-spacing: -.2px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-style: normal !important;
  text-transform: none !important;
  text-decoration: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.bso-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.bso-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.bso-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}

.bso-nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.bso-nav-item.active {
  background: rgba(231,111,81,.2);
  border-left-color: var(--bso-primary);
  color: #fff;
  font-weight: 600;
}

.bso-nav-icon { font-size: 16px; }

.bso-sidebar-footer {
  padding: 14px 20px;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ===== MAIN ===== */
.bso-main {
  flex: 1;
  margin-left: var(--bso-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.bso-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: var(--bso-card);
  border-bottom: 1px solid var(--bso-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--bso-shadow);
}

.bso-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  color: var(--bso-text);
}

.bso-topbar-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

.bso-topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ===== CONTENT ===== */
.bso-content {
  flex: 1;
  padding: 24px;
  overflow-x: auto;
}

/* ===== LOADING ===== */
.bso-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--bso-text-muted);
  font-size: 15px;
}

.bso-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bso-border);
  border-top-color: var(--bso-primary);
  border-radius: 50%;
  animation: bso-spin .7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes bso-spin { to { transform: rotate(360deg); } }

/* ===== CARDS ===== */
.bso-card {
  background: var(--bso-card);
  border-radius: var(--bso-radius);
  box-shadow: var(--bso-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.bso-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bso-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--bso-text);
}

/* ===== STAT CARDS ===== */
.bso-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bso-stat-card {
  background: var(--bso-card);
  border-radius: var(--bso-radius);
  box-shadow: var(--bso-shadow);
  padding: 18px 20px;
  border-left: 4px solid var(--bso-primary);
}

.bso-stat-card.green  { border-left-color: var(--bso-green); }
.bso-stat-card.blue   { border-left-color: var(--bso-blue); }
.bso-stat-card.yellow { border-left-color: var(--bso-yellow); }
.bso-stat-card.red    { border-left-color: var(--bso-red); }

.bso-stat-label {
  font-size: 12px;
  color: var(--bso-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.bso-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--bso-text);
  line-height: 1;
}

.bso-stat-sub {
  font-size: 11px;
  color: var(--bso-text-muted);
  margin-top: 4px;
}

/* ===== BUTTONS ===== */
.bso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--bso-radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s, box-shadow .15s;
  line-height: 1.4;
  white-space: nowrap;
}
.bso-btn:active { transform: translateY(1px); }

.bso-btn-primary   { background: var(--bso-primary); color: #fff; box-shadow: 0 2px 10px rgba(231,111,81,.30); }
.bso-btn-primary:hover { background: var(--bso-primary-d); color: #fff; }
.bso-btn-secondary { background: var(--bso-border); color: var(--bso-text); }
.bso-btn-secondary:hover { background: #CBD5E0; }
.bso-btn-success   { background: var(--bso-green); color: #fff; }
.bso-btn-success:hover { opacity: .9; }
.bso-btn-danger    { background: var(--bso-red); color: #fff; }
.bso-btn-danger:hover { opacity: .9; }
.bso-btn-ghost     { background: transparent; color: var(--bso-text-muted); border: 1px solid var(--bso-border); }
.bso-btn-ghost:hover { background: var(--bso-bg); }
.bso-btn-sm        { padding: 5px 10px; font-size: 12px; }
.bso-btn-icon      { padding: 6px 8px; }
.bso-btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ===== BADGES / STATUS ===== */
.bso-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.bso-badge-new             { background: #EBF8FF; color: #2B6CB0; }
.bso-badge-qualified       { background: #E9D8FD; color: #553C9A; }
.bso-badge-quote_requested { background: #FEFCBF; color: #744210; }
.bso-badge-proposal_sent   { background: #FED7D7; color: #822727; }
.bso-badge-followup        { background: #FEEBC8; color: #7B341E; }
.bso-badge-visit_scheduled { background: #BEE3F8; color: #2C5282; }
.bso-badge-negotiation     { background: #C6F6D5; color: #276749; }
.bso-badge-closed          { background: #C6F6D5; color: #22543D; }
.bso-badge-lost            { background: #FED7D7; color: #63171B; }
.bso-badge-pending         { background: #FEFCBF; color: #744210; }
.bso-badge-done            { background: #C6F6D5; color: #276749; }
.bso-badge-draft           { background: #EDF2F7; color: #4A5568; }
.bso-badge-sent            { background: #BEE3F8; color: #2C5282; }
.bso-badge-viewed          { background: #E9D8FD; color: #553C9A; }
.bso-badge-expired         { background: #FED7D7; color: #822727; }

/* ===== TABLES ===== */
.bso-table-wrap { overflow-x: auto; }

.bso-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bso-table th, .bso-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--bso-border);
}

.bso-table th {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--bso-text-muted);
  background: var(--bso-bg);
}

.bso-table tr:hover td { background: #fafafa; }
.bso-table .actions { white-space: nowrap; }

/* ===== FORMS ===== */
.bso-form { display: flex; flex-direction: column; gap: 16px; }

.bso-field { display: flex; flex-direction: column; gap: 4px; }

.bso-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--bso-text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.bso-input, .bso-select, .bso-textarea,
.bso-field input:not([type=checkbox]):not([type=radio]), .bso-field select, .bso-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--bso-border);
  border-radius: var(--bso-radius-sm);
  font-size: 14px;
  color: var(--bso-text);
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.bso-input:focus, .bso-select:focus, .bso-textarea:focus,
.bso-field input:focus, .bso-field select:focus, .bso-field textarea:focus {
  outline: none;
  border-color: var(--bso-primary);
  box-shadow: 0 0 0 3px rgba(231,111,81,.15);
}

.bso-textarea { resize: vertical; min-height: 80px; }

.bso-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bso-form-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  flex-wrap: wrap;
}

/* ===== FILTERS ===== */
.bso-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: flex-end;
}

.bso-filters .bso-input,
.bso-filters .bso-select {
  width: auto;
  min-width: 140px;
}

/* ===== PIPELINE / KANBAN ===== */
.bso-kanban-wrap {
  overflow-x: auto;
  margin: -4px;
  padding: 4px;
}

.bso-kanban {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  min-height: calc(100vh - 140px);
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
}

.bso-kanban-col {
  width: 240px;
  min-width: 240px;
  background: var(--bso-card);           /* branco — sem contraste cinza/branco */
  border: 1px solid var(--bso-border);
  border-radius: var(--bso-radius);
  padding: 10px;
  flex-shrink: 0;
  box-shadow: var(--bso-shadow);
}

.bso-kanban-col-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--bso-text-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bso-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bso-kanban-count {
  background: var(--bso-bg);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bso-text-muted);
}

.bso-kanban-cards {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bso-lead-card {
  background: var(--bso-bg);             /* cinza bem claro para contraste com a coluna branca */
  border-radius: calc(var(--bso-radius) - 2px);
  padding: 12px;
  cursor: grab;
  border-left: 3px solid var(--bso-primary);
  transition: box-shadow .15s, transform .1s;
  border: 1px solid var(--bso-border);
  border-left: 3px solid var(--bso-primary);
}

.bso-lead-card:hover { box-shadow: var(--bso-shadow); transform: translateY(-1px); }
.bso-lead-card:active { cursor: grabbing; box-shadow: var(--bso-shadow-md); transform: none; }
.bso-lead-card.sortable-ghost { opacity: .4; }
.bso-lead-card.sortable-drag  { box-shadow: var(--bso-shadow-md); }

.bso-lead-card-name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bso-lead-card-info {
  font-size: 11px;
  color: var(--bso-text-muted);
  line-height: 1.6;
}

.bso-lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* ===== LEAD DETAIL ===== */
.bso-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.bso-detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.bso-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--bso-text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 2px;
}

.bso-detail-value {
  font-size: 14px;
  color: var(--bso-text);
}

.bso-timeline { display: flex; flex-direction: column; gap: 12px; }

.bso-timeline-item {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.bso-timeline-dot {
  width: 8px; height: 8px;
  background: var(--bso-primary);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.bso-timeline-content { flex: 1; }
.bso-timeline-time { font-size: 11px; color: var(--bso-text-muted); }

/* ===== NOTES ===== */
.bso-note {
  background: var(--bso-bg);
  border-radius: var(--bso-radius);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}

.bso-note-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--bso-text-muted);
  margin-bottom: 4px;
}

/* ===== PROPOSAL ITEMS TABLE ===== */
.bso-items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bso-items-table th, .bso-items-table td { padding: 8px 10px; border-bottom: 1px solid var(--bso-border); }
.bso-items-table th { font-size: 11px; text-transform: uppercase; color: var(--bso-text-muted); }
.bso-items-table tfoot td { font-weight: 700; }
.bso-items-table .num { text-align: right; }

/* ===== CALENDAR ===== */
.bso-calendar { width: 100%; }
.bso-calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bso-calendar-title  { font-size: 18px; font-weight: 700; }
.bso-cal-grid        { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--bso-border); border-radius: var(--bso-radius); overflow: hidden; }
.bso-cal-day-name    { background: var(--bso-bg); text-align: center; padding: 8px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--bso-text-muted); }
.bso-cal-cell        { background: var(--bso-card); min-height: 80px; padding: 6px 8px; vertical-align: top; transition: background .1s; }
.bso-cal-cell.other  { background: var(--bso-bg); }
.bso-cal-cell.today  { background: #FFF5F0; }
.bso-cal-num         { font-size: 13px; font-weight: 700; color: var(--bso-text-muted); margin-bottom: 4px; }
.bso-cal-num.today   { color: var(--bso-primary); }
.bso-cal-event       { font-size: 11px; background: var(--bso-primary); color: #fff; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: opacity .15s; }
.bso-cal-event:hover { opacity: .85; }

/* ===== GOOGLE CALENDAR / ICS ===== */
.bso-gcal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #4285F4;
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--bso-radius);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.bso-gcal-btn:hover { opacity: .9; color: #fff; }

.bso-cal-connect-card {
  background: linear-gradient(135deg, #F0F4FF 0%, #E8F0FE 100%);
  border: 1px solid #C5D5FA;
  border-radius: var(--bso-radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* ===== UTILITY GRID ===== */
.bso-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bso-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== VAR CHIP (WhatsApp template) ===== */
.bso-var-chip {
  cursor: pointer;
  background: var(--bso-bg);
  border: 1px solid var(--bso-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  user-select: none;
  transition: background .1s, border-color .1s;
  color: var(--bso-secondary);
}
.bso-var-chip:hover { background: var(--bso-border); border-color: #CBD5E0; }

/* ===== REPORTS ===== */
.bso-report-section { margin-bottom: 32px; }
.bso-report-title   { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.bso-bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bso-bar-row   { display: flex; align-items: center; gap: 10px; }
.bso-bar-label { width: 140px; font-size: 13px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bso-bar-track { flex: 1; background: var(--bso-bg); border-radius: 4px; height: 18px; overflow: hidden; }
.bso-bar-fill  { height: 100%; background: var(--bso-primary); border-radius: 4px; transition: width .4s ease; display: flex; align-items: center; padding-left: 6px; }
.bso-bar-val   { font-size: 11px; font-weight: 700; color: var(--bso-text-muted); min-width: 40px; text-align: right; }

/* ===== FUNNEL ===== */
.bso-funnel { display: flex; flex-direction: column; gap: 4px; }
.bso-funnel-row { display: flex; align-items: center; gap: 12px; }
.bso-funnel-label { width: 170px; font-size: 13px; }
.bso-funnel-bar   { flex: 1; background: var(--bso-bg); border-radius: 4px; height: 22px; overflow: hidden; }
.bso-funnel-fill  { height: 100%; background: linear-gradient(90deg, var(--bso-secondary), var(--bso-accent)); border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.bso-funnel-fill span { font-size: 11px; font-weight: 700; color: #fff; }
.bso-funnel-num   { width: 36px; text-align: right; font-size: 13px; font-weight: 700; color: var(--bso-text-muted); }

/* ===== MODAL ===== */
.bso-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bso-modal {
  background: var(--bso-card);
  border-radius: var(--bso-radius);
  box-shadow: var(--bso-shadow-md);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.bso-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--bso-border);
}

.bso-modal-title { font-size: 16px; font-weight: 700; }
.bso-modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--bso-text-muted); line-height: 1; }
.bso-modal-body  { padding: 20px; }
.bso-modal-footer { padding: 16px 20px; border-top: 1px solid var(--bso-border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== TABS ===== */
.bso-tabs { display: flex; border-bottom: 2px solid var(--bso-border); margin-bottom: 20px; gap: 0; overflow-x: auto; }
.bso-tab  { padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--bso-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; background: none; border-top: none; border-left: none; border-right: none; white-space: nowrap; font-family: inherit; transition: color .15s, border-color .15s; }
.bso-tab:hover  { color: var(--bso-text); }
.bso-tab.active { color: var(--bso-primary); border-bottom-color: var(--bso-primary); }
.bso-tab-panel  { display: none; }
.bso-tab-panel.active { display: block; }

/* ===== WHATSAPP BUTTON ===== */
.bso-wa-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #25D366; color: #fff;
  padding: 8px 16px; border-radius: var(--bso-radius);
  font-size: 13px; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
}
.bso-wa-btn:hover { background: #1ebe59; color: #fff; }

/* ===== ALERTS ===== */
.bso-alert { border-radius: var(--bso-radius); padding: 12px 16px; font-size: 13px; margin-bottom: 16px; }
.bso-alert-info    { background: #EBF8FF; color: #2B6CB0; border: 1px solid #BEE3F8; }
.bso-alert-success { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }
.bso-alert-warning { background: #FFFBEB; color: #744210; border: 1px solid #F6E05E; }
.bso-alert-error   { background: #FFF5F5; color: #742A2A; border: 1px solid #FEB2B2; }

/* ===== LOGIN NOTICE ===== */
.bso-login-notice { padding: 40px 20px; text-align: center; color: var(--bso-text-muted); font-size: 15px; }

/* ===== EMPTY STATE ===== */
.bso-empty { text-align: center; padding: 48px 20px; color: var(--bso-text-muted); }
.bso-empty-icon { font-size: 48px; margin-bottom: 12px; }
.bso-empty-text { font-size: 15px; }

/* ===== STALE INDICATOR ===== */
.bso-stale { border-left-color: var(--bso-yellow) !important; }

/* ===== TABS (Settings) — alinhado ao sistema .bso-tab ===== */
.bso-tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--bso-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  font-family: inherit;
  white-space: nowrap;
}

.bso-tab-btn.active {
  color: var(--bso-primary);
  border-bottom-color: var(--bso-primary);
}

.bso-tab-btn:hover { color: var(--bso-text); }

/* ===== TEMPERATURA / SCORE ===== */
.bso-temp-hot  { color: #E53E3E; font-weight: 700; }
.bso-temp-warm { color: #D69E2E; font-weight: 700; }
.bso-temp-cold { color: #3182CE; font-weight: 700; }

/* ===== COUNTDOWN WHATSAPP ===== */
.bsq-success-countdown {
  font-size: 14px;
  color: #4A5568;
  margin-bottom: 16px;
  padding: 10px 20px;
  background: #F0FFF4;
  border: 1px solid #C6F6D5;
  border-radius: 8px;
}

/* ===== RESPONSIVE / MOBILE APP ===== */
@media (max-width: 900px) {
  .bso-sidebar { transform: translateX(-100%); box-shadow: var(--bso-shadow-md); }
  .bso-sidebar.open { transform: translateX(0); }
  .bso-sidebar-toggle { display: block; }
  .bso-main { margin-left: 0; }
  .bso-menu-btn { display: none; }               /* no mobile o menu é a bottom-nav */
  .bso-detail-grid { grid-template-columns: 1fr; }
  .bso-form-row { grid-template-columns: 1fr; }
  .bso-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bso-content { padding: 16px; padding-bottom: calc(var(--bso-bottomnav-h) + var(--bso-safe-b) + 20px); }
  .bso-bottomnav { display: flex; }              /* barra de app aparece */
  .bso-topbar { padding: 0 16px; }
  .bso-topbar-title { font-size: 17px; }
}

@media (max-width: 480px) {
  .bso-stats-grid { grid-template-columns: 1fr; }
  .bso-kanban-col { min-width: 200px; }
  .bso-content { padding: 12px; padding-bottom: calc(var(--bso-bottomnav-h) + var(--bso-safe-b) + 16px); }
  .bso-card { padding: 16px; }
}

/* ===== WORDPRESS ADMIN BAR COMPATIBILITY ===== */
/* Quando a admin bar do WP está visível (32px no desktop, 46px no mobile) */
.admin-bar .bso-sidebar {
  top: 32px !important;
  height: calc(100vh - 32px) !important;
}
.admin-bar .bso-topbar {
  top: 32px !important;
}
@media screen and (max-width: 782px) {
  .admin-bar .bso-sidebar {
    top: 46px !important;
    height: calc(100vh - 46px) !important;
  }
  .admin-bar .bso-topbar {
    top: 46px !important;
  }
}

/* ===== SIDEBAR FOOTER — logout ===== */
.bso-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bso-sidebar-user {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bso-sidebar-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color .15s;
}
.bso-sidebar-logout:hover { color: rgba(255,255,255,.8); }

/* ===================================================
   ELEVAÇÃO DE DESIGN — polish + mobile app (v1.11)
   =================================================== */

/* Sidebar mais rica */
.bso-sidebar { background: linear-gradient(180deg, #294853 0%, var(--bso-secondary) 100%); }
.bso-nav-item { border-radius: 0 9px 9px 0; margin-right: 8px; }
.bso-nav-item.active { background: rgba(231,111,81,.18); }

/* Topbar */
.bso-topbar { height: 60px; }

/* Cards com borda + profundidade no hover das métricas */
.bso-card { border: 1px solid var(--bso-border); }
.bso-stat-card { border: 1px solid var(--bso-border); transition: box-shadow .18s, transform .18s; }
.bso-stat-card:hover { box-shadow: var(--bso-shadow-md); transform: translateY(-2px); }

/* Tabela mais leve */
.bso-table th { background: transparent; border-bottom: 1.5px solid var(--bso-border); }
.bso-table tr:hover td { background: var(--bso-hover); }

/* ===== BOTTOM NAV (mobile app) ===== */
.bso-bottomnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: rgba(255,255,255,.97);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--bso-border);
  box-shadow: 0 -2px 20px rgba(34,40,44,.07);
  padding-bottom: var(--bso-safe-b);
  height: calc(var(--bso-bottomnav-h) + var(--bso-safe-b));
}
.bso-bottomnav a, .bso-bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding-top: 8px; background: none; border: none; cursor: pointer;
  text-decoration: none; color: var(--bso-text-muted); font-size: 10.5px; font-weight: 600;
  font-family: inherit; -webkit-tap-highlight-color: transparent; transition: color .15s;
}
.bso-bottomnav .bn-ic { font-size: 22px; line-height: 1; }
.bso-bottomnav a.active { color: var(--bso-primary); }
.bso-bottomnav a.active .bn-ic { transform: translateY(-1px); }

/* ===== WHATSAPP (chat) — layout responsivo ===== */
.bso-wa {
  display: grid;
  grid-template-columns: 320px 1fr;
  border: 1px solid var(--bso-border);
  border-radius: var(--bso-radius);
  overflow: hidden;
  background: var(--bso-card);
  height: calc(100vh - 178px);
  height: calc(100dvh - 178px); /* dvh acompanha o teclado no mobile (fallback vh acima) */
  min-height: 420px;
}
.bso-wa-list  { border-right: 1px solid var(--bso-border); overflow-y: auto; background: var(--bso-card); }
.bso-wa-panel { display: flex; flex-direction: column; background: #ECE6DE; min-width: 0; }
.bso-wa-empty { margin: auto; color: var(--bso-text-muted); font-size: 14px; }
.bso-wa-back  { display: none; background: none; border: none; font-size: 28px; line-height: 1; color: var(--bso-primary); cursor: pointer; padding: 0 4px; }

@media (max-width: 900px) {
  .bso-wa { grid-template-columns: 1fr; height: calc(100vh - var(--bso-bottomnav-h) - 150px); height: calc(100dvh - var(--bso-bottomnav-h) - 150px); }
  .bso-wa-list { border-right: none; }
  .bso-wa-panel { display: none; }
  .bso-wa.chat-open .bso-wa-list { display: none; }
  .bso-wa.chat-open .bso-wa-panel { display: flex; }
  .bso-wa-back { display: inline-block; }
}

/* ===== MODAL vira bottom-sheet no celular ===== */
@media (max-width: 600px) {
  .bso-modal-overlay { align-items: flex-end; padding: 0; }
  .bso-modal { width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; max-height: 90vh; animation: bso-sheet-up .22s ease; }
}
@keyframes bso-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

