/* ═══════════════════════════════════════════════════════
   SMART FILTER BAR
   ═══════════════════════════════════════════════════════ */

.sfb-wrapper { position:relative; margin-bottom:0; }
.sfb-form    { margin:0; }

/* Barra */
.sfb-bar {
  display:flex; align-items:center; gap:.35rem;
  flex-wrap:wrap; padding:.55rem 0 .3rem;
}

/* Búsqueda */
.sfb-search-box {
  display:flex; align-items:center; gap:.45rem;
  height:34px; min-width:190px; max-width:280px; flex:1 1 190px;
  padding:0 .75rem;
  border:1.5px solid #dde1ea; border-radius:8px;
  background:#fff; color:#6b778c;
  transition:border-color .15s, box-shadow .15s;
}
.sfb-search-box:focus-within {
  border-color:#0c66e4; box-shadow:0 0 0 3px rgba(12,102,228,.12); color:#172b4d;
}
.sfb-search-input { flex:1; border:0; outline:0; font-size:.85rem; color:#172b4d; background:transparent; }
.sfb-search-input::placeholder { color:#a0aab4; }
.sfb-search-clear {
  background:none; border:none; cursor:pointer; color:#a0aab4; font-size:1.1rem; line-height:1; padding:0 2px;
}
.sfb-search-clear:hover { color:#44546f; }

/* Chip wrappers */
.sfb-chip-wrap { display:inline-flex; align-items:center; }
.sfb-chip-hidden { display:none !important; }

/* Reestilo de chips en la smart bar */
.sfb-bar .jira-filter-chip,
.sfb-bar .jira-basic-pill {
  height:34px; border-radius:8px;
  border:1.5px solid #dde1ea; background:#fafbfc;
  color:#44546f; font-weight:600; font-size:.83rem;
  transition:all .15s; white-space:nowrap;
}
.sfb-bar .jira-filter-chip:hover { border-color:#b3c2d3; background:#f1f4f8; color:#172b4d; }
.sfb-bar .jira-filter-chip.has-selection { background:#e9f2ff; border-color:#579dff; color:#0c66e4; }
.sfb-bar .jira-filter-chip::after { content:"⌄"; font-size:.7rem; opacity:.7; }
.jira-filter-chip-icon { flex:none;line-height:1; }
.jira-filter-chip-label { min-width:0; }

/* Chips de fecha */
.sfb-date-menu { min-width:240px; }
.sfb-date-row  { display:flex; align-items:center; gap:.5rem; padding:.35rem .5rem; }
.sfb-date-label { font-size:.78rem; color:#6b778c; min-width:44px; }
.sfb-date-input { flex:1; height:30px; border:1px solid #dde1ea; border-radius:6px; padding:0 .5rem; font-size:.83rem; }

/* Toggle chip */
.sfb-toggle-chip {
  display:inline-flex; align-items:center; gap:.35rem;
  height:34px; padding:0 .8rem;
  border:1.5px solid #dde1ea; border-radius:8px;
  background:#fafbfc; color:#44546f;
  font-size:.83rem; font-weight:600; cursor:pointer; user-select:none;
  transition:all .15s;
}
.sfb-toggle-chip:hover { border-color:#b3c2d3; background:#f1f4f8; }
.sfb-toggle-chip.sfb-toggle-active { background:#e9f2ff; border-color:#579dff; color:#0c66e4; }
.sfb-toggle-input { width:14px; height:14px; accent-color:#0c66e4; }

/* Text chip */
.sfb-text-chip {
  height:34px; padding:0 .75rem;
  border:1.5px solid #dde1ea; border-radius:8px;
  background:#fafbfc; color:#172b4d; font-size:.83rem;
  outline:none; transition:all .15s; min-width:90px;
}
.sfb-text-chip:focus { border-color:#0c66e4; box-shadow:0 0 0 3px rgba(12,102,228,.1); }
.sfb-text-chip.has-selection { border-color:#579dff; background:#e9f2ff; }

/* Botón Más filtros */
.sfb-more-btn {
  display:inline-flex; align-items:center; gap:.4rem;
  height:34px; padding:0 .85rem;
  border:1.5px dashed #b3c2d3; border-radius:8px;
  background:#fafbfc; color:#44546f;
  font-size:.83rem; font-weight:600; cursor:pointer;
  transition:all .15s; white-space:nowrap;
}
.sfb-more-btn:hover { border-color:#0c66e4; color:#0c66e4; background:#f0f6ff; border-style:solid; }
.sfb-more-badge {
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; border-radius:50%;
  background:#e34935; color:#fff; font-size:.68rem; font-weight:800; line-height:1;
}

/* Controles */
.sfb-controls { display:flex; align-items:center; gap:.45rem; margin-left:auto; }
.sfb-apply-btn { height:34px; border-radius:8px !important; font-size:.83rem; }
.sfb-clear-link { color:#44546f; font-size:.82rem; text-decoration:none; padding:0 .2rem; white-space:nowrap; }
.sfb-clear-link:hover { text-decoration:underline; color:#0c66e4; }

/* Tags activos */
.sfb-active-row {
  display:flex; align-items:center; flex-wrap:wrap; gap:.35rem;
  min-height:0; padding:0; transition:all .2s;
}
.sfb-active-row:not(:empty) { padding:.3rem 0 .4rem; }

.sfb-tag {
  display:inline-flex; align-items:center; gap:.3rem;
  padding:.25rem .5rem .25rem .6rem;
  border-radius:6px; background:#e9f2ff; border:1px solid #cce0ff;
  font-size:.78rem; color:#0c66e4; font-weight:600;
  animation:sfb-tag-in .15s ease;
}
@keyframes sfb-tag-in { from { opacity:0; transform:translateY(-3px); } to { opacity:1; transform:none; } }
.sfb-tag-lbl { color:#0c66e4; }
.sfb-tag-x {
  background:none; border:none; cursor:pointer;
  color:#579dff; font-size:1rem; line-height:1; padding:0 1px;
  transition:color .1s;
}
.sfb-tag-x:hover { color:#e34935; }
.sfb-clear-all-tag {
  background:none; border:none; cursor:pointer;
  color:#44546f; font-size:.78rem; text-decoration:underline; padding:.25rem .3rem;
}
.sfb-clear-all-tag:hover { color:#0c66e4; }

/* Overlay */
.sfb-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(9,30,66,.32); z-index:1200;
  animation:sfb-fade-in .18s ease;
}
.sfb-overlay.open { display:block; }
@keyframes sfb-fade-in { from { opacity:0; } to { opacity:1; } }

/* Drawer */
.sfb-drawer {
  position:fixed; top:0; right:-380px;
  width:340px; max-width:100vw; height:100vh;
  background:#fff; border-left:1px solid #dde1ea;
  box-shadow:-6px 0 32px rgba(9,30,66,.18);
  z-index:1201; display:flex; flex-direction:column;
  transition:right .25s cubic-bezier(.4,0,.2,1);
}
.sfb-drawer.open { right:0; }

.sfb-drawer-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:1rem 1.2rem .85rem; border-bottom:1px solid #f1f3f5; flex-shrink:0;
}
.sfb-drawer-title { font-size:.96rem; font-weight:800; color:#172b4d; }
.sfb-drawer-close {
  background:none; border:none; cursor:pointer; color:#6b778c;
  padding:.3rem; border-radius:6px; transition:all .12s;
}
.sfb-drawer-close:hover { background:#f1f3f5; color:#172b4d; }

.sfb-drawer-hint {
  font-size:.8rem; color:#6b778c;
  padding:.55rem 1.2rem .45rem;
  background:#f8fafc; border-bottom:1px solid #f1f3f5; flex-shrink:0;
}

.sfb-drawer-body { flex:1; overflow-y:auto; padding:.5rem .65rem; }

.sfb-drawer-item {
  display:flex; align-items:center; gap:.6rem;
  padding:.6rem .65rem; border-radius:8px; cursor:pointer;
  transition:background .12s; margin-bottom:1px;
}
.sfb-drawer-item:hover { background:#f4f6f9; }
.sfb-drawer-check { width:16px; height:16px; accent-color:#0c66e4; cursor:pointer; flex-shrink:0; }
.sfb-drawer-item-icon { font-size:.9rem; flex-shrink:0; }
.sfb-drawer-item-label { flex:1; font-size:.87rem; color:#172b4d; font-weight:500; }
.sfb-drawer-item-active { color:#0c66e4; font-size:.6rem; }

.sfb-drawer-foot {
  display:flex; gap:.55rem; align-items:center;
  padding:.8rem 1.2rem; border-top:1px solid #f1f3f5; flex-shrink:0;
}
.sfb-drawer-save   { flex:1; border-radius:8px !important; }
.sfb-drawer-cancel { border-radius:8px !important; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sfb-search-box,
  :root:not([data-theme="light"]) .sfb-text-chip { background:#1e2736; border-color:#3a4559; color:#a9b4c9; }
  :root:not([data-theme="light"]) .sfb-search-input { color:#d0d9e8; }
  :root:not([data-theme="light"]) .sfb-bar .jira-filter-chip,
  :root:not([data-theme="light"]) .sfb-bar .jira-basic-pill,
  :root:not([data-theme="light"]) .sfb-toggle-chip,
  :root:not([data-theme="light"]) .sfb-more-btn { background:#1e2736; border-color:#3a4559; color:#a9b4c9; }
  :root:not([data-theme="light"]) .sfb-bar .jira-filter-chip.has-selection,
  :root:not([data-theme="light"]) .sfb-toggle-chip.sfb-toggle-active { background:#1c3461; border-color:#2e6fca; color:#85b8ff; }
  :root:not([data-theme="light"]) .sfb-tag { background:#1c3461; border-color:#2e6fca; color:#85b8ff; }
  :root:not([data-theme="light"]) .sfb-tag-lbl { color:#85b8ff; }
  :root:not([data-theme="light"]) .sfb-drawer { background:#141c28; border-color:#2a3547; }
  :root:not([data-theme="light"]) .sfb-drawer-title { color:#d0d9e8; }
  :root:not([data-theme="light"]) .sfb-drawer-hint { background:#1a2335; border-color:#2a3547; color:#7a8a9e; }
  :root:not([data-theme="light"]) .sfb-drawer-item:hover { background:#1e2a3f; }
  :root:not([data-theme="light"]) .sfb-drawer-item-label { color:#c9d5e4; }
  :root:not([data-theme="light"]) .sfb-drawer-foot { border-color:#2a3547; }
}
:root[data-theme="dark"] .sfb-search-box,
:root[data-theme="dark"] .sfb-text-chip { background:#1e2736; border-color:#3a4559; color:#a9b4c9; }
:root[data-theme="dark"] .sfb-search-input { color:#d0d9e8; }
:root[data-theme="dark"] .sfb-bar .jira-filter-chip,
:root[data-theme="dark"] .sfb-bar .jira-basic-pill,
:root[data-theme="dark"] .sfb-toggle-chip,
:root[data-theme="dark"] .sfb-more-btn { background:#1e2736; border-color:#3a4559; color:#a9b4c9; }
:root[data-theme="dark"] .sfb-bar .jira-filter-chip.has-selection,
:root[data-theme="dark"] .sfb-toggle-chip.sfb-toggle-active { background:#1c3461; border-color:#2e6fca; color:#85b8ff; }
:root[data-theme="dark"] .sfb-tag { background:#1c3461; border-color:#2e6fca; color:#85b8ff; }
:root[data-theme="dark"] .sfb-drawer { background:#141c28; border-color:#2a3547; }
:root[data-theme="dark"] .sfb-drawer-title { color:#d0d9e8; }
:root[data-theme="dark"] .sfb-drawer-hint { background:#1a2335; border-color:#2a3547; color:#7a8a9e; }
:root[data-theme="dark"] .sfb-drawer-item:hover { background:#1e2a3f; }
:root[data-theme="dark"] .sfb-drawer-item-label { color:#c9d5e4; }
:root[data-theme="dark"] .sfb-drawer-foot { border-color:#2a3547; }

/* Responsive */
@media(max-width:768px) {
  .sfb-search-box { min-width:130px; max-width:100%; }
  .sfb-drawer { width:100%; right:-100%; }
  .sfb-controls { margin-left:0; }
  .sfb-bar { gap:.25rem; }
}
