/* ══════════════════════════════════════════
   BASY SANEAMENTO — Sistema Interno
   Tokens herdados do site institucional
══════════════════════════════════════════ */

/* ── Busca ── */
.search-input {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--gray2); font-family: 'Barlow', sans-serif;
  font-size: 13px; color: var(--text); background: var(--white);
  outline: none; min-width: 220px; transition: border .2s;
}
.search-input:focus { border-color: var(--blue); }

/* ── Tag de segmento ── */
.tag-segmento {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: rgba(58,159,214,.1); color: var(--navy2);
  border: 1px solid rgba(58,159,214,.2);
}

/* ── Valores monetários ── */
.valor-text { font-variant-numeric: tabular-nums; font-weight: 600; }
.valor-ganho { color: #166534; }
.muted-text  { color: var(--muted); font-size: 12px; }

/* ── Rodapé da tabela ── */
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--gray2);
  font-size: 13px; color: var(--muted); flex-wrap: wrap; gap: 8px;
}
.totais { display: flex; gap: 24px; }
.totais strong { color: var(--text); }

/* ── Modal largo ── */
.modal-lg { max-width: 780px; }

/* ── Metadados de edição ── */
.meta-info {
  display: flex; gap: 24px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 8px;
  background: var(--gray); font-size: 12px; color: var(--muted);
  margin-top: 4px;
}

:root {
  --navy:      #0d1f3c;
  --navy2:     #162d52;
  --navy3:     #1e3a6a;
  --blue:      #3a9fd6;
  --blue2:     #5bbfed;
  --white:     #ffffff;
  --gray:      #f4f7fb;
  --gray2:     #e8edf5;
  --text:      #1a1a2e;
  --muted:     #5a6a80;
  --radius:    10px;
  --shadow:    0 4px 20px rgba(13,31,60,.10);
  --sidebar-w: 240px;
  --topbar-h:  60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Barlow', sans-serif;
  color: var(--text);
  background: var(--gray);
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ══════════════════════════════════════════
   LOGO (herdado do site)
══════════════════════════════════════════ */
.logo-basy { display: flex; align-items: center; gap: 10px; }
.logo-basy svg { height: 38px; width: auto; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 22px;
  letter-spacing: 2px; color: var(--white);
}
.brand-sub {
  font-weight: 300; font-size: 10px;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--blue2);
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-group-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 4px 10px;
  display: block;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  font-size: 14px; font-weight: 600;
  transition: all .2s;
  cursor: pointer;
}
.nav-item svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 2;
  flex-shrink: 0;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--white);
}
.nav-item.active {
  background: rgba(58,159,214,.18);
  color: var(--blue2);
}
.nav-item.disabled {
  opacity: .35; cursor: not-allowed; pointer-events: none;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--white);
  flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  display: block; font-size: 11px; color: rgba(255,255,255,.4);
}
.logout-btn {
  color: rgba(255,255,255,.35);
  transition: color .2s;
  display: flex; align-items: center;
}
.logout-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.logout-btn:hover { color: #ef4444; }

/* ══════════════════════════════════════════
   MAIN WRAPPER + TOPBAR
══════════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray2);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  box-shadow: 0 1px 0 var(--gray2);
}
.sidebar-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 4px;
  color: var(--navy);
}
.sidebar-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.topbar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--navy);
  flex: 1;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 13px; color: var(--muted); }

/* ══════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════ */
.page-content { padding: 28px; flex: 1; }

/* ══════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════ */
.flash-container { padding: 0 28px; }
.alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 8px; margin-top: 12px;
  font-size: 14px; font-weight: 600;
}
.alert button {
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; opacity: .6;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef9c3; color: #854d0e; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ══════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--gray2);
}
.kpi-wide { grid-column: span 2; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; }
.kpi-blue  { background: linear-gradient(135deg, var(--blue), var(--blue2)); }
.kpi-green { background: linear-gradient(135deg, #22c55e, #4ade80); }
.kpi-yellow{ background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.kpi-navy  { background: linear-gradient(135deg, var(--navy), var(--navy3)); }
.kpi-body { display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.kpi-value { font-family: 'Barlow Condensed', sans-serif; font-size: 32px; font-weight: 900; color: var(--navy); line-height: 1; }

/* ══════════════════════════════════════════
   CARD
══════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray2);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray2);
}
.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700; color: var(--navy);
}

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }

/* Seletor de busca (acervo / materiais) e caixa de base semelhante */
.picker-list{border:1px solid var(--gray2);border-radius:8px;max-height:240px;overflow:auto;margin-top:6px;}
.picker-item{padding:8px 10px;cursor:pointer;font-size:13px;border-bottom:1px solid var(--gray2);}
.picker-item:last-child{border-bottom:0;}
.picker-item:hover{background:var(--gray);}
.picker-chosen{margin-top:6px;font-size:13px;background:#eaf6fd;padding:8px 10px;border-radius:8px;}
.base-box{border:1px dashed var(--blue,#3a9fd6);border-radius:10px;padding:12px 14px;background:#f7fbfe;margin-top:6px;}

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead tr { background: var(--gray); }
.data-table th {
  padding: 11px 14px; text-align: left;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
  border-bottom: 1px solid var(--gray2);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray2);
  color: var(--text);
}
.data-table tbody tr:hover { background: #f8fafd; }
.data-table tbody tr:last-child td { border-bottom: none; }
.mono { font-family: monospace; font-size: 13px; color: var(--navy2); }
.empty-state { text-align: center; color: var(--muted); padding: 40px !important; font-size: 14px; }
.link-count {
  display: inline-block; background: var(--gray);
  color: var(--navy); font-weight: 700; font-size: 12px;
  padding: 2px 10px; border-radius: 20px;
  transition: background .2s;
}
.link-count:hover { background: var(--blue); color: var(--white); }

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; white-space: nowrap;
}
.badge-em-andamento { background: #dbeafe; color: #1e40af; }
.badge-ganho        { background: #dcfce7; color: #166534; }
.badge-perdido      { background: #fee2e2; color: #991b1b; }
.badge-cancelado    { background: #f3f4f6; color: #6b7280; }

/* ══════════════════════════════════════════
   TOOLBAR
══════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.filter-form { display: flex; align-items: center; gap: 10px; }
.filter-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.select-input {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--gray2); font-family: 'Barlow', sans-serif;
  font-size: 13px; color: var(--text); background: var(--white);
  outline: none; cursor: pointer;
}
.select-input:focus { border-color: var(--blue); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-weight: 700; font-size: 13px;
  letter-spacing: .5px; cursor: pointer;
  border: 2px solid transparent; transition: all .2s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.btn-primary {
  background: var(--blue); color: var(--white); border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue2); border-color: var(--blue2); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--blue); border-color: var(--blue);
}
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-ghost {
  background: transparent; color: var(--muted); border-color: var(--gray2);
}
.btn-ghost:hover { background: var(--gray); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ══════════════════════════════════════════
   ROW ACTIONS
══════════════════════════════════════════ */
.row-actions { display: flex; gap: 6px; align-items: center; }
.action-btn {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray); border: none; cursor: pointer;
  color: var(--muted); transition: all .2s;
}
.action-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.action-btn:hover { background: var(--blue); color: var(--white); }
.action-btn-danger:hover { background: #ef4444; color: var(--white); }

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(13,31,60,.55); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 14px;
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--navy);
}
.modal-close {
  background: none; border: none; font-size: 22px;
  color: var(--muted); cursor: pointer; line-height: 1;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }
.modal-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 8px;
}

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 13px;
  border: 1px solid var(--gray2);
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px; color: var(--text);
  background: var(--white); outline: none;
  transition: border .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(58,159,214,.12); }
.form-group textarea { resize: vertical; }

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
body.login-page { background: var(--gray); display: flex; min-height: 100vh; }
.login-wrapper { display: flex; width: 100%; min-height: 100vh; }

.login-brand {
  flex: 0 0 420px;
  background: linear-gradient(145deg, var(--navy) 0%, #1a3a6e 60%, #0d2848 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 48px;
  position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute;
  right: -100px; top: -100px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(58,159,214,.15) 0%, transparent 70%);
  pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 1; }
.login-brand .logo-basy { margin-bottom: 40px; }
.login-brand-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px; font-weight: 900;
  color: var(--white); margin-bottom: 12px;
}
.login-brand-desc { font-size: 15px; color: rgba(255,255,255,.55); line-height: 1.6; margin-bottom: 40px; }
.login-features { display: flex; flex-direction: column; gap: 14px; }
.login-feature {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.7); font-size: 14px; font-weight: 600;
}
.login-feature svg { width: 18px; height: 18px; stroke: var(--blue2); fill: none; stroke-width: 2; flex-shrink: 0; }

.login-form-panel {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.login-form-inner { width: 100%; max-width: 380px; }
.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px; font-weight: 900; color: var(--navy);
  margin-bottom: 6px;
}
.login-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.btn-login {
  width: 100%; padding: 13px;
  background: var(--blue); color: var(--white);
  border: none; border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all .25s; margin-top: 8px;
}
.btn-login:hover { background: var(--blue2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(58,159,214,.4); }

/* ══════════════════════════════════════════
   BADGES SITUAÇÃO OC
══════════════════════════════════════════ */
.badge-oc {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; white-space: nowrap;
}
.badge-oc-fazer              { background: #f3f4f6; color: #374151; }
.badge-oc-enviado            { background: #dbeafe; color: #1e40af; }
.badge-oc-pronto-para-envio  { background: #fef9c3; color: #854d0e; }
.badge-oc-entrega-parcial    { background: #ffedd5; color: #9a3412; }
.badge-oc-entregue           { background: #dcfce7; color: #166534; }
.badge-oc-faturado           { background: #d1fae5; color: #065f46; }
.badge-oc-cancelado          { background: #fee2e2; color: #991b1b; }

/* ══════════════════════════════════════════
   PROJETOS — STATUS BADGES
══════════════════════════════════════════ */
.badge-proj {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-proj-iniciando    { background: #ede9fe; color: #5b21b6; }
.badge-proj-em-andamento { background: #dbeafe; color: #1e40af; }
.badge-proj-stand-by     { background: #fef9c3; color: #854d0e; }
.badge-proj-concluído    { background: #dcfce7; color: #166534; }
.badge-proj-cancelado    { background: #f3f4f6; color: #6b7280; }

/* ══════════════════════════════════════════
   BID AEGEA
══════════════════════════════════════════ */
/* ══════════════════════════════════════════
   ALERTAS
══════════════════════════════════════════ */
.alerta-box {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alerta-box.alerta-danger {
  background: #fff5f5;
  border: 1px solid #fca5a5;
}
.alerta-box.alerta-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
}
.alerta-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}
.alerta-titulo.danger { color: #991b1b; }
.alerta-titulo.warning { color: #92400e; }
.alerta-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alerta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  gap: 12px;
}
.alerta-item-nome { font-weight: 600; color: var(--text); flex: 1; }
.alerta-item-sub  { font-size: 12px; color: var(--muted); }
.alerta-dias-vencido  { color: #dc2626; font-weight: 700; font-size: 12px; white-space: nowrap; }
.alerta-dias-proximo  { color: #d97706; font-weight: 700; font-size: 12px; white-space: nowrap; }

.bid-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a6e 100%);
  border-radius: 12px;
  padding: 24px 32px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.bid-banner-title { font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.bid-banner-sub   { font-size: 13px; opacity: .75; margin-top: 4px; }
.bid-banner-value { font-size: 28px; font-weight: 900; color: var(--blue2); }
.bid-banner-label { font-size: 12px; opacity: .7; text-align: right; }

.bid-progress-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.bid-progress-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bid-progress-title  { font-weight: 700; font-size: 14px; color: var(--text); }
.bid-progress-pct    { font-size: 22px; font-weight: 900; color: var(--blue); }
.bid-progress-bar    { height: 14px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bid-progress-fill   { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue2)); border-radius: 99px; transition: width .6s ease; }
.bid-progress-legend { display: flex; gap: 20px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.bid-progress-legend span strong { color: var(--text); }

/* BID status badges */
.badge-bid { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-bid-ativo      { background: #dcfce7; color: #166534; }
.badge-bid-prospectar { background: #fee2e2; color: #991b1b; }
.badge-bid-fechado    { background: #dbeafe; color: #1e40af; }
.badge-bid-confirmado { background: #fef9c3; color: #854d0e; }
.badge-bid-negociacao { background: #ede9fe; color: #5b21b6; }
.badge-bid-cancelado  { background: #f3f4f6; color: #6b7280; }
.badge-bid-critica    { background: #fee2e2; color: #991b1b; }
.badge-bid-alta       { background: #ffedd5; color: #9a3412; }
.badge-bid-media      { background: #fef9c3; color: #854d0e; }
.badge-bid-pendente   { background: #f3f4f6; color: #374151; }
.badge-bid-concluido  { background: #dcfce7; color: #166534; }

/* ══════════════════════════════════════════
   FUNIL — SEGMENTO BARS
══════════════════════════════════════════ */
.seg-bars { display: flex; flex-direction: column; gap: 10px; }
.seg-bar-row { display: flex; align-items: center; gap: 12px; }
.seg-bar-label {
  width: 200px; font-size: 13px; font-weight: 600;
  color: var(--text); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; flex-shrink: 0;
}
.seg-bar-track {
  flex: 1; height: 10px; background: var(--gray2);
  border-radius: 99px; overflow: hidden;
}
.seg-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  transition: width .4s ease;
}
.seg-bar-info {
  display: flex; gap: 10px; font-size: 12px;
  color: var(--muted); white-space: nowrap; min-width: 160px;
}
.seg-bar-info strong { color: var(--navy); }

/* ══════════════════════════════════════════
   FUNIL — KANBAN
══════════════════════════════════════════ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-col {
  background: var(--gray);
  border-radius: 12px;
  border: 1px solid var(--gray2);
  overflow: hidden;
  min-height: 200px;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.col-yellow { background: #fef9c3; }
.col-green  { background: #dcfce7; }
.col-red    { background: #fee2e2; }
.col-gray   { background: #f3f4f6; }

.kanban-col-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--navy);
}
.kanban-col-icon { font-size: 16px; }
.kanban-col-count {
  margin-left: auto;
  background: rgba(0,0,0,.1);
  border-radius: 20px; padding: 1px 9px;
  font-size: 12px; font-weight: 700; color: var(--navy);
}
.kanban-col-valor {
  font-size: 12px; font-weight: 700;
  color: var(--muted); margin-top: 4px;
}

/* Cards */
.kanban-cards {
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 80px;
  transition: background .2s;
}
.kanban-cards.drag-over {
  background: rgba(58,159,214,.08);
  border-radius: 8px;
  outline: 2px dashed var(--blue);
}

.kanban-card {
  background: var(--white);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  border: 1px solid var(--gray2);
  cursor: grab;
  transition: transform .15s, box-shadow .15s;
  user-select: none;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.kanban-card.dragging {
  opacity: .5; transform: rotate(1.5deg);
  cursor: grabbing;
}

.kanban-card-top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 6px;
}
.kanban-card-num {
  font-family: monospace; font-size: 11px;
  color: var(--blue); font-weight: 700;
}
.kanban-card-uf {
  font-size: 10px; font-weight: 700; background: var(--gray);
  color: var(--muted); padding: 1px 6px; border-radius: 4px;
}
.kanban-card-nome {
  font-size: 13px; font-weight: 700; color: var(--navy);
  line-height: 1.3; margin-bottom: 4px;
}
.kanban-card-cliente {
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.kanban-card-seg {
  display: inline-block; font-size: 10px; font-weight: 600;
  background: rgba(58,159,214,.1); color: var(--navy2);
  border-radius: 20px; padding: 2px 8px; margin-bottom: 8px;
}
.kanban-card-bottom {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 4px;
}
.kanban-card-valor {
  font-size: 13px; font-weight: 700;
  color: var(--navy); font-variant-numeric: tabular-nums;
}
.kanban-card-edit {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .2s;
  background: var(--gray);
}
.kanban-card-edit svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.kanban-card-edit:hover { background: var(--blue); color: var(--white); }

.kanban-empty {
  text-align: center; color: var(--muted);
  font-size: 13px; padding: 20px 0;
}

/* Toast */
.kanban-toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--navy); color: var(--white);
  padding: 12px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(10px);
  transition: all .3s; pointer-events: none; z-index: 999;
}
.kanban-toast.show { opacity: 1; transform: translateY(0); }
.kanban-toast-success { background: #166534; }
.kanban-toast-error   { background: #991b1b; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .kpi-wide { grid-column: span 1; }
  .login-brand { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .seg-bar-label { width: 120px; }
}
@media (max-width: 600px) {
  .kanban-board { grid-template-columns: 1fr; }
}
