:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --stroke: rgba(15,23,42,.08);
  --shadow: 0 18px 50px rgba(15,23,42,.08);
  --shadow-soft: 0 10px 24px rgba(15,23,42,.06);
  --brand: #2563eb;
  --brand-2: #111827;
  --radius: 18px;
}

.app-body{
  background: radial-gradient(1000px 600px at 15% -10%, rgba(37,99,235,.10), transparent 60%),
              radial-gradient(900px 500px at 95% 10%, rgba(17,24,39,.06), transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-shell{
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--stroke);
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
}

.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(135deg, rgba(37,99,235,1), rgba(16,185,129,.9));
}

.brand-text .brand-title{
  font-weight: 700;
  line-height: 1.1;
}

.brand-text .brand-sub{
  font-size: 12px;
  color: var(--muted);
}

.btn-ghost{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.6);
  border-radius: 14px;
}

.menu{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}

.menu-item:hover{
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.10);
}

.menu-item.active{
  background: rgba(37,99,235,.10);
  border-color: rgba(37,99,235,.18);
}

.menu-item.logout{
  background: rgba(17,24,39,.06);
}

.content{
  padding: 22px 22px 36px;
}

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.page-title{
  font-size: 22px;
  font-weight: 800;
}

.page-subtitle{
  font-size: 13px;
  color: var(--muted);
}

.page{
  width: 100%;
}

.stats-grid{
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card{
  background: rgba(255,255,255,.78);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px 14px;
  box-shadow: var(--shadow-soft);
}

.stat-card.clickable{
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.stat-card.clickable:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.stat-card.wide{
  grid-column: span 2;
}

.stat-label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value{
  font-size: 22px;
  font-weight: 800;
}

.stat-sums{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sum-strike{
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 700;
}

.sum-strong{
  font-weight: 900;
}

.dups-banner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, rgba(17,24,39,.92), rgba(15,23,42,.96));
  color: #fff;
  box-shadow: var(--shadow);
}

.dups-title{
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .6px;
}

.dups-sub{
  margin-top: 4px;
  color: rgba(255,255,255,.7) !important;
}

.premium-card{
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.85);
  box-shadow: var(--shadow);
}

.table-wrap{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: auto;
  max-height: 62vh;
  background: #fff;
}

.table-head-sticky th{
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 0 1px 0 var(--stroke);
}

.columns-box{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.login-body{
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(900px 500px at 20% 0%, rgba(37,99,235,.14), transparent 55%),
              radial-gradient(900px 500px at 90% 10%, rgba(16,185,129,.10), transparent 60%),
              var(--bg);
}

.login-card{
  width: min(520px, 92vw);
  border-radius: 22px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
}

.brand-mark-lg{
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: .5px;
  background: linear-gradient(135deg, rgba(37,99,235,1), rgba(16,185,129,.9));
}

.sidebar.collapsed{
  width: 88px;
  padding: 18px 10px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-label{
  display: none;
}

.sidebar.collapsed .brand{
  justify-content: center;
}

.app-shell.sidebar-collapsed{
  grid-template-columns: 88px 1fr;
}

.premium-modal{
  border-radius: 22px;
  border: 1px solid var(--stroke);
}

.dup-row{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 12px;
  background: rgba(255,255,255,.95);
}

.dup-row:hover{
  box-shadow: var(--shadow-soft);
}

.badge-soft{
  background: rgba(37,99,235,.08);
  color: rgba(37,99,235,1);
  border: 1px solid rgba(37,99,235,.15);
}

@media (max-width: 1200px){
  .stats-grid{
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
  .stat-card.wide{
    grid-column: span 3;
  }
}
@media (max-width: 860px){
  .app-shell{
    grid-template-columns: 1fr;
  }
  .sidebar{
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
  }
}

#dupsList { gap: 12px !important; }

.dup-card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  width: 100%;
}

.dup-fields{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 14px;
}

@media (max-width: 900px){
  .dup-fields{ grid-template-columns: 1fr; }
}

.field{
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 10px;
  background: rgba(17,24,39,.02);
}

.field .k{
  font-size: 11px;
  color:#6b7280;
  margin-bottom: 4px;
}

.field .v{
  font-size: 13px;
  color:#111827;
  font-weight: 600;
  word-break: break-word;
}
/* Модалка шире */
.dups-modal-wide{
  max-width: 95vw !important;
  width: 95vw !important;
}

/* Контейнер дублей = сетка слева направо */
/* контейнер карточек */
#dupsList{
  display: grid;

  /* сколько влезет карточек — столько и будет */
  grid-template-columns: repeat(auto-fill, 300px);

  gap: 16px;

  /* начинаем слева, НЕ центрируем */
  justify-content: start;

  align-items: start;
}
#dupsList{
  display: grid;

  /* сколько влезет карточек — столько и будет */
  grid-template-columns: repeat(auto-fill, 300px);

  gap: 16px;

  /* начинаем слева, НЕ центрируем */
  justify-content: start;

  align-items: start;
}
.field{
  width: 100%;
}