body {
  font-family: ui-sans-serif, system-ui;
  padding: 16px;
}

.topbar{
  isolation: isolate; /* создаём нормальный stacking context */
}

.notifItem{
    position:relative;
  }
  .notifDot{
    width:8px; height:8px;
    border-radius:999px;
    background:#ef4444;
    display:inline-block;
    margin-left:8px;
    transform: translateY(-1px) scale(1);
    opacity:1;
    transition: opacity .22s ease, transform .22s ease;
    flex: 0 0 auto;
  }
  .notifDot.isHiding{
    opacity:0;
    transform: translateY(-1px) scale(0.6);
  }

.kpi {
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}

.kpi .box {
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:10px 12px;
  min-width:220px;
  background:#fff;
}

.kpi .h {
  font-size:12px;
  color:#6b7280;
}

.kpi .v {
  font-size:18px;
  font-weight:700;
  margin-top:2px;
}

.tableWrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid #e5e7eb;
  border-radius:10px;
}

/* scroll bar сверху */
.topScroll{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  height:12px;
  margin:6px 0;
  border:1px solid #e5e7eb;
  border-radius:10px;
}
.topScrollInner{ height:1px; }

.pagerHidden{
  display:none!important;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

select, button {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

button {
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid #eee;
  padding: 10px 8px;
  vertical-align: top;
  font-size: 14px;
}

th {
  text-align: left;
  font-weight: 600;
  color: #111827;
  background: #fafafa;
  position: sticky;
  top: 0;
}

.muted {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.2;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
}

.danger {
  background: #fee2e2;
}

.loader {
  color: #6b7280;
}

a {
  color: #111827;
  text-decoration: none;
}

/* ===== TOP BAR ===== */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #111827;
  background: #fff;
}

.nav-btn.active {
  background: #11182710;
}

.account-btn {
  margin-left: auto;
  font-weight: 500;
}

.logout-btn {
  color: #991b1b;
}

#bell {
  cursor: pointer;
  position: relative;
}

#bellBadge {
  display: none;
  position: absolute;
  top: -6px;
  right: -8px;
  background: red;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
}

.notif-wrap{
  position:relative;
}

.notif-btn{
  width:36px;
  height:36px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

#notifBadge{
  position:absolute;
  top:-6px;
  right:-6px;
  background:#ef4444;
  color:white;
  border-radius:10px;
  font-size:11px;
  padding:2px 6px;
  display:none;
}

.notif-popover{
  position:absolute;
  right:0;
  top:44px;
  width:320px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.15);
  display:none;
  z-index:9999;
}

.notif-title{
  padding:10px 12px;
  border-bottom:1px solid #e5e7eb;
  font-weight:600;
}

.notif-list{
  max-height:260px;
  overflow:auto;
  padding:8px;
}

.notif-item{
  padding:8px;
  border-radius:8px;
  font-size:13px;
}

.notif-item + .notif-item{
  margin-top:6px;
  border-top:1px solid #f3f4f6;
}

.notif-item b{
  font-weight:600;
}

.notif-item .muted{
  font-size:11px;
}

/* ===== MODALS ===== */

.modalBack{
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,.45) !important;
  z-index: 10050 !important;
}

.modalBack .modal{
  background:#fff;
  border-radius:14px;
  padding:16px;
  max-width:720px;
  width:92%;
  max-height:90vh;
  overflow:auto;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}

#actModalBack{
  position: fixed !important;
  inset: 0 !important;
  display: none;              /* показываем через JS: flex */
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,.45) !important;
  z-index: 10050 !important;
}

/* IMPORTANT: убиваем любые top/left/position у .modal */
#actModalBack .modal{
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;

  background: #fff !important;
  border-radius: 14px !important;
  padding: 16px !important;

  width: min(720px, 92vw) !important;
  max-height: 90vh !important;
  overflow: auto !important;

  box-shadow: 0 20px 60px rgba(0,0,0,.35) !important;
}

/* =========================================================
   ✅ RETURNS: только мягкая подсветка строки
   ❌ УБРАЛИ псевдо-точку td:first-child::before (она ломала таблицу)
   ========================================================= */
tr.return-row.return-unseen td{
  background:#eff6ff;
}
tr.return-row.util-soon-7 td { background: #fffbeb; }
tr.return-row.util-soon-3 td { background: #fee2e2; }

/* summary modal uses the same modalBack as others */
#sumModalBack{
  z-index: 10060;
}
