/* TebManager UX Pro — competitive UI layer */
.teb-breadcrumb{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.8rem;color:var(--teb-muted,#8a8796);margin:0 0 12px}
.teb-breadcrumb a{color:inherit;text-decoration:none}
.teb-breadcrumb a:hover{color:var(--teb-primary,#7367f0)}
.teb-breadcrumb__sep{opacity:.5}
.teb-empty{text-align:center;padding:40px 20px;border:1px dashed var(--teb-border,#e6e6e8);border-radius:16px;background:rgba(115,103,240,.03)}
.teb-empty__icon{font-size:2.2rem;margin-bottom:8px}
.teb-empty h3{margin:0 0 6px;font-size:1.05rem}
.teb-empty p{margin:0 0 14px;color:var(--teb-muted);font-size:.9rem}
.teb-skeleton{display:grid;gap:10px}
.teb-skeleton__line{height:14px;border-radius:8px;background:linear-gradient(90deg,rgba(0,0,0,.06),rgba(0,0,0,.12),rgba(0,0,0,.06));background-size:200% 100%;animation:tebSk 1.2s infinite}
.teb-skeleton__line--lg{height:48px}
@keyframes tebSk{0%{background-position:200% 0}100%{background-position:-200% 0}}
.teb-chip-filters{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.teb-chip{border:1px solid var(--teb-border);background:transparent;border-radius:999px;padding:6px 12px;font:inherit;font-size:.8rem;cursor:pointer;color:var(--teb-text)}
.teb-chip.is-active{background:var(--teb-primary,#7367f0);border-color:var(--teb-primary);color:#fff}
.teb-table-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin-bottom:10px}
.teb-table-toolbar__left,.teb-table-toolbar__right{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.teb-bulk-bar{position:sticky;bottom:12px;display:none;gap:8px;align-items:center;padding:10px 14px;border-radius:14px;background:#1e1b2e;color:#fff;box-shadow:0 8px 28px rgba(0,0,0,.2);z-index:40}
.teb-bulk-bar.is-on{display:flex}




.teb-help{display:none!important;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;border:1px solid var(--teb-border);font-size:.7rem;cursor:help;color:var(--teb-muted);position:relative}
.teb-help:hover::after{content:attr(data-tip);position:absolute;bottom:125%;right:0;min-width:160px;padding:8px 10px;border-radius:10px;background:#1e1b2e;color:#fff;font-size:.75rem;z-index:20;white-space:normal}
.teb-reltime{color:var(--teb-muted);font-size:.78rem}
.teb-mobile-nav{display:none;position:fixed;bottom:0;left:0;right:0;background:var(--teb-card,#fff);border-top:1px solid var(--teb-border);padding:6px 8px calc(6px + env(safe-area-inset-bottom));z-index:50;justify-content:space-around}
.teb-mobile-nav a{display:flex;flex-direction:column;align-items:center;gap:2px;text-decoration:none;color:var(--teb-muted);font-size:.65rem;padding:6px}
.teb-mobile-nav a.is-active{color:var(--teb-primary)}
@media(max-width:991px){
  .teb-mobile-nav{display:flex}
  body.teb-panel{padding-bottom:64px}
}
.teb-status-select{border:0;background:transparent;font:inherit;font-weight:600;cursor:pointer;padding:2px 4px;border-radius:8px}
.teb-fav-star{cursor:pointer;opacity:.45}
.teb-fav-star.is-on{opacity:1;color:#f59e0b}
.teb-split{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:900px){.teb-split{grid-template-columns:1fr}}
.teb-sticky-save{position:sticky;bottom:0;display:none;gap:8px;padding:12px;background:var(--teb-card,#fff);border-top:1px solid var(--teb-border);z-index:30}
.teb-sticky-save.is-dirty{display:flex}
.teb-kbd{font-size:.7rem;border:1px solid var(--teb-border);border-radius:6px;padding:1px 6px;background:rgba(0,0,0,.04)}
.teb-recent-row{display:flex;gap:8px;overflow:auto;padding-bottom:6px;margin-bottom:12px}
.teb-recent-chip{flex:0 0 auto;padding:8px 12px;border-radius:12px;border:1px solid var(--teb-border);background:var(--teb-card,#fff);font-size:.8rem;cursor:pointer;text-decoration:none;color:inherit}
.teb-ux-toolbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.teb-copy-ok{outline:2px solid #28c76f}


/* منوی حرفه‌ای سایدبار */
.teb-sidebar__brand{padding:1.1rem 1.15rem 0.85rem;border-bottom:1px solid rgba(255,255,255,.06)}
.teb-brand-name{font-weight:800;letter-spacing:-.02em}
.teb-brand-sub{font-size:.72rem;opacity:.75;display:block;margin-top:2px}
.teb-nav{padding:.65rem .55rem 1rem;display:flex;flex-direction:column;gap:2px}
.teb-nav__item{border-radius:12px;padding:.65rem .85rem;font-weight:600;font-size:.9rem;transition:background .15s,color .15s,transform .12s}
.teb-nav__item:hover{background:rgba(115,103,240,.12)}
.teb-nav__item.is-active,.teb-nav__item.active{background:rgba(115,103,240,.18);color:var(--teb-primary,#7367f0);box-shadow:inset 3px 0 0 var(--teb-primary,#7367f0)}
.teb-nav__icon{opacity:.9}
.teb-page-heading__title{font-size:1.15rem;font-weight:800;margin:0;letter-spacing:-.02em}
.teb-topbar--pro{backdrop-filter:blur(8px)}


/* منوی جمع‌شده: فقط آیکون */
body.teb-sidebar-collapsed .teb-nav__label,
body.teb-sidebar-collapsed .teb-brand-text,
body.teb-sidebar-collapsed .teb-sidebar__foot { display: none !important; }
body.teb-sidebar-collapsed .teb-sidebar { width: 72px !important; }
body.teb-sidebar-collapsed .teb-nav__item { justify-content: center; padding-left: .65rem; padding-right: .65rem; }
body.teb-sidebar-collapsed .teb-main-wrap { margin-right: 72px; }
@media (max-width: 991px) {
  body.teb-sidebar-collapsed .teb-main-wrap { margin-right: 0; }
}

/* جستجوی زنده هدر */
.teb-topbar-search--live {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: min(420px, 42vw);
  padding: 0 12px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--teb-border, #e6e6e8);
  background: var(--teb-card, #fff);
  cursor: text;
}
.teb-topbar-search--live .teb-topbar-search__input {
  flex: 1;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  font: inherit;
  width: 100%;
  min-width: 0;
  color: inherit;
  box-shadow: none !important;
}
.teb-topbar-search--live:focus-within {
  border-color: var(--teb-primary, #7367f0);
  box-shadow: 0 0 0 3px rgba(115,103,240,.15);
}
.teb-cmdk { z-index: 10050 !important; pointer-events: auto; }
.teb-cmdk.is-open { display: flex !important; }
.teb-badge-count {
  position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px;
  border-radius: 999px; background: #ea5455; color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  font-weight: 700;
}
.teb-icon-btn--badge { position: relative; }
.teb-notif-item { padding: 10px 0; border-bottom: 1px solid var(--teb-border); }
.teb-notif-item:last-child { border-bottom: 0; }
.teb-notif-item a { color: inherit; text-decoration: none; font-weight: 600; }
.teb-dcard--vip { background: linear-gradient(135deg,#1e1b4b,#4c1d95); color:#fff; }
.teb-dcard--gold { background: linear-gradient(135deg,#78350f,#ca8a04); color:#fff; }
.teb-dcard--silver { background: linear-gradient(135deg,#334155,#94a3b8); color:#fff; }

/* Override panel.css button-like search */
.teb-topbar-search--live{cursor:text!important;pointer-events:auto!important}
.teb-topbar-search--live input.teb-topbar-search__input{
  pointer-events:auto!important;
  cursor:text!important;
  -webkit-appearance:none;
  appearance:none;
  height:38px;
  line-height:38px;
  padding:0 4px;
  margin:0;
}

.teb-breadcrumb,.teb-recent-row,.teb-page-heading__crumb{display:none!important}
.teb-topbar-search--live{position:relative!important}
.teb-header-search-results{position:absolute;top:calc(100% + 6px);right:0;left:0;background:var(--teb-card,#fff);border:1px solid var(--teb-border,#e6e6e8);border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.12);max-height:360px;overflow:auto;z-index:10060}
.teb-header-search-results[hidden]{display:none!important}
.teb-hsr-item{display:flex;justify-content:space-between;gap:8px;padding:10px 14px;cursor:pointer;border-bottom:1px solid var(--teb-border,#eee);color:inherit;text-decoration:none;font-size:.9rem}
.teb-hsr-item:hover,.teb-hsr-item.is-active{background:rgba(115,103,240,.1)}
.teb-hsr-hint{font-size:.75rem;color:var(--teb-muted,#888)}
body.teb-sidebar-collapsed .teb-nav__label,body.teb-sidebar-collapsed .teb-brand-text{display:none!important}
body.teb-sidebar-collapsed .teb-sidebar{width:72px!important}
body.teb-sidebar-collapsed .teb-nav__item{justify-content:center}


/* === FIX 2026: collapsed sidebar + header + search === */
@media (min-width: 1200px) {
  body.teb-sidebar-collapsed .teb-sidebar {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    transform: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.teb-sidebar-collapsed .teb-main-wrap {
    margin-right: 72px !important;
    width: auto !important;
  }
  body.teb-sidebar-collapsed .teb-topbar {
    width: 100% !important;
  }
  body.teb-sidebar-collapsed .teb-nav__label,
  body.teb-sidebar-collapsed .teb-brand-text,
  body.teb-sidebar-collapsed .teb-sidebar__foot {
    display: none !important;
  }
  body.teb-sidebar-collapsed .teb-nav__item {
    justify-content: center !important;
  }
  body.teb-sidebar-collapsed .teb-sidebar__brand {
    justify-content: center;
    padding: 0.75rem 0.35rem;
  }
}
.teb-topbar-search--live,
#teb-header-search-wrap {
  display: flex !important;
  position: relative !important;
  z-index: 50;
  min-width: 200px;
  max-width: min(440px, 48vw);
  flex: 1;
  pointer-events: auto !important;
}
#teb-header-search {
  pointer-events: auto !important;
  cursor: text !important;
  width: 100% !important;
  flex: 1 !important;
  border: 0 !important;
  background: transparent !important;
  outline: none !important;
}
.teb-header-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid #e8e6ef;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(30,20,60,.18);
  max-height: 420px;
  overflow: auto;
  z-index: 99999;
  text-align: right;
}
body.teb-dark .teb-header-search-results,
body.teb-theme-dark .teb-header-search-results {
  background: #1e1b2e;
  border-color: #2f2b3d;
}
.teb-header-search-results[hidden] { display: none !important; }
.teb-hsr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: .9rem;
}
.teb-hsr-item:hover { background: rgba(115,103,240,.1); }
.teb-hsr-hint {
  font-size: .72rem;
  color: #8a8796;
  white-space: nowrap;
}
.teb-hsr-group {
  padding: 8px 14px 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #8a8796;
}


/* —— حالت تمام‌صفحه: مرورگر تمام‌صفحه؛ منو باقی می‌ماند —— */
html.teb-is-fullscreen,
body.teb-is-fullscreen {
  /* بدون مخفی کردن سایدبار — فقط تمام‌صفحه مرورگر */
}
body.teb-is-fullscreen .teb-topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
}
body.teb-is-fullscreen #teb-fullscreen-toggle {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
/* فوتر اختیاری در تمام‌صفحه جمع شود؛ منو نه */
body.teb-is-fullscreen .teb-panel-footer {
  display: none;
}
#teb-fullscreen-toggle .teb-fs-icon-exit { display: none; }
body.teb-is-fullscreen #teb-fullscreen-toggle .teb-fs-icon-enter { display: none !important; }
body.teb-is-fullscreen #teb-fullscreen-toggle .teb-fs-icon-exit { display: inline !important; }

/* منو در تمام‌صفحه همیشه در دسترس */
body.teb-is-fullscreen .teb-sidebar {
  display: flex !important;
  visibility: visible !important;
}
body.teb-is-fullscreen #teb-menu-toggle {
  display: inline-flex !important;
}

/* نوار ابزار یکسان صفحات */
.teb-page-toolbar .teb-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.teb-page-toolbar .teb-toolbar-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.teb-page-toolbar .teb-field { margin: 0; }


/* Advanced confirm modal */
.teb-confirm{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:99999;padding:16px}
.teb-confirm.is-open{display:flex}
.teb-confirm__backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(4px);animation:tebCfBg .2s ease}
.teb-confirm__box{position:relative;background:var(--teb-card,#fff);color:var(--teb-heading,#1e1b2e);border-radius:20px;max-width:400px;width:100%;padding:28px 24px 20px;box-shadow:0 24px 64px rgba(0,0,0,.28);text-align:center;animation:tebCfIn .25s ease}
.teb-confirm__icon{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#818cf8);color:#fff;display:grid;place-items:center;font-size:1.5rem;font-weight:800;margin:0 auto 14px}
.teb-confirm--danger .teb-confirm__icon{background:linear-gradient(135deg,#ef4444,#f97316)}
.teb-confirm__title{margin:0 0 8px;font-size:1.15rem;font-weight:800}
.teb-confirm__msg{margin:0 0 4px;color:var(--teb-muted,#64748b);font-size:.95rem;line-height:1.6}
.teb-confirm__actions{display:flex;gap:10px;margin-top:22px;justify-content:center}
.teb-confirm__actions .teb-btn{min-width:110px;padding:12px 18px;border-radius:12px;font-weight:700}
.teb-btn--danger{background:#ef4444!important;color:#fff!important;border-color:#ef4444!important}
.teb-btn--danger:hover{background:#dc2626!important}
@keyframes tebCfIn{from{opacity:0;transform:scale(.92) translateY(12px)}to{opacity:1;transform:none}}
@keyframes tebCfBg{from{opacity:0}to{opacity:1}}

.teb-topbar-search--live{max-width:220px!important;flex:0 1 auto!important;width:220px}
