:root{
  --nw-bg: #f6f8fc;
  --nw-card: #ffffff;
  --nw-border: #e6ebf2;
  --nw-text: #0f172a;
  --nw-muted: #64748b;
  --nw-accent: #2b7cff;
  --nw-accent-soft: rgba(43,124,255,.10);
  --nw-danger: #e11d48;
  --nw-warn: #f59e0b;
}

html,body{ height:100%; }
body{
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(43,124,255,.10), transparent 60%),
    radial-gradient(900px 500px at 85% 15%, rgba(43,124,255,.08), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--nw-bg) 60%, #f3f6fb 100%);
  color: var(--nw-text);
}

a{ color: var(--nw-accent); text-decoration: none; }
a:hover{ text-decoration: none !important; }

.container-nw{ max-width: 1600px; }

.nw-pagehead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.nw-title{
  font-weight: 800;
  letter-spacing: -.2px;
  margin: 0;
  font-size: 22px;
}
.nw-subtitle{ margin-top: 2px; }

.nw-pad{ padding: 1.5rem; }

.nw-navbar{
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nw-border);
}
.nw-navbar .container-nw{ padding-top: .5rem; padding-bottom: .5rem; }
.nw-brand{
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--nw-text) !important;
}
.nw-badge{
  display:inline-flex;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(43,124,255,.25);
  background: var(--nw-accent-soft);
  color: var(--nw-accent);
  font-weight: 700;
}

.nw-muted{ color: var(--nw-muted) !important; }

.nw-card{
  background: var(--nw-card);
  border: 1px solid var(--nw-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}

.nw-linkcard{
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.nw-linkcard:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  border-color: rgba(43,124,255,.22);
}

.nw-code{
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 3px 8px;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.btn-nw{
  background: var(--nw-accent);
  border-color: var(--nw-accent);
  color: #fff;
  font-weight: 700;
}
.btn-nw:hover{
  filter: brightness(.95);
  color: #fff;
}

.btn-outline-secondary{
  border-color: #cbd5e1;
  color: #334155;
}
.btn-outline-secondary:hover{
  background: #f1f5f9;
  border-color: #b6c2d1;
  color: #0f172a;
}

.nw-shell{ align-items: flex-start; }

.nw-side{
  position: sticky;
  top: 92px; /* navbar height */
}

.nw-side .nw-side-title{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nw-muted);
  font-weight: 800;
}

.nw-nav{
  display:flex;
  flex-direction:column;
  gap: 6px;
  margin-top: 10px;
}
.nw-nav a{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #0f172a;
  border: 1px solid transparent;
  text-decoration:none;
}
.nw-nav a:hover{
  background: #f8fafc;
  border-color: #eef2f7;
}
.nw-nav a.active{
  background: var(--nw-accent-soft);
  border-color: rgba(43,124,255,.25);
  color: var(--nw-text);
  font-weight: 800;
}
.nw-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
  flex: 0 0 auto;
}
.nw-nav a.active .nw-dot{ background: var(--nw-accent); }

.nw-quick .btn{
  width: 100%;
  font-weight: 700;
}

.nw-footer{
  color: #64748b;
  font-size: 13px;
}

.table thead th{
  font-size: 12px;
  color: var(--nw-muted);
  font-weight: 800;
  text-transform: none;
}
.table tbody td{ border-top-color: #eef2f7; }
.table tbody tr:hover{ background: #f8fafc; }

.badge-nw-in{
  background: rgba(34,197,94,.12);
  color: #166534;
  border: 1px solid rgba(34,197,94,.25);
}
.badge-nw-out{
  background: rgba(239,68,68,.10);
  color: #7f1d1d;
  border: 1px solid rgba(239,68,68,.22);
}
.badge-nw-pending{
  background: rgba(245,158,11,.12);
  color: #7c2d12;
  border: 1px solid rgba(245,158,11,.22);
}

.form-select, .form-control{
  background-color: #ffffff;
  border-color: #d7dee8;
  color: #0f172a;
}
.form-select:focus, .form-control:focus{
  border-color: rgba(43,124,255,.5);
  box-shadow: 0 0 0 .2rem rgba(43,124,255,.15);
}

@media (max-width: 991.98px){
  .nw-side{ position: static; top:auto; }
  .nw-pad{ padding: 1.25rem; }
  .nw-title{ font-size: 20px; }
  .nw-navbar .container-nw{ padding-top: .45rem; padding-bottom: .45rem; }
}


/* Qiwi-like tiles */
.nw-tiles{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 768px){
  .nw-tiles{ grid-template-columns: 1fr; }
}
.nw-tile{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid var(--nw-border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,.6) 100%);
  text-decoration:none;
  color: var(--nw-text);
  transition: transform .08s ease, box-shadow .08s ease;
}
.nw-tile:hover{
  text-decoration:none;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15,23,42,.06);
}
.nw-tile.active{
  border-color: rgba(43,124,255,.35);
  box-shadow: 0 12px 28px rgba(43,124,255,.10);
  background: linear-gradient(180deg, rgba(43,124,255,.08) 0%, rgba(255,255,255,.75) 100%);
}
.nw-tile.active .badge{ background: rgba(43,124,255,.12) !important; color: #0f172a; }
.nw-tile.active .nw-tile-ico{ background: rgba(43,124,255,.14); }
.nw-tile:focus-visible{
  outline: 3px solid rgba(43,124,255,.22);
  outline-offset: 2px;
}
.nw-tile-ico{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--nw-accent-soft);
  color: var(--nw-accent);
  font-size: 20px;
}
.nw-tile-title{ font-weight: 700; margin:0; }
.nw-tile-sub{ margin:0; font-size: 13px; color: var(--nw-muted); }

.nw-empty{
  border: 1px dashed var(--nw-border);
  border-radius: 16px;
  padding: 20px;
  text-align:center;
  background: rgba(255,255,255,.55);
}
.nw-empty-icon{
  font-size: 28px;
  margin-bottom: 8px;
}

.nw-badge-status{
  font-size: 12px;
  padding: .35rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--nw-border);
  background: rgba(255,255,255,.8);
  color: var(--nw-muted);
}
.nw-badge-status.ok{ border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.10); color: #166534; }
.nw-badge-status.warn{ border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.12); color: #92400e; }
.nw-badge-status.bad{ border-color: rgba(225,29,72,.22); background: rgba(225,29,72,.10); color: #9f1239; }


/* Services catalog */
.service-card{
  border: 1px solid var(--nw-border);
  border-radius: 16px;
  transition: transform .12s ease, box-shadow .12s ease;
  background: rgba(255,255,255,.7);
}
.service-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(20,60,120,.10);
}
.service-icon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(47,128,237,.18);
  background: linear-gradient(135deg, rgba(86,204,242,.18), rgba(47,128,237,.12));
  color: #2F80ED;
  flex: 0 0 auto;
}
.service-icon i{ font-size: 22px; }
.service-pill{ font-weight: 500; }

@media (max-width: 576px){
  .service-card .card-body{ padding: 14px; }
}


/* Admin UI improvements */
.admin-tabs{ position: sticky; top: 10px; z-index: 10; backdrop-filter: blur(8px); }
.admin-tabs__scroller{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-tabs__scroller::-webkit-scrollbar{ height: 6px; }
.admin-tabs__scroller::-webkit-scrollbar-thumb{ background: rgba(47,128,237,.25); border-radius: 999px; }
.admin-tabs .nav-link{ white-space: nowrap; border: 1px solid transparent; }
.admin-tabs .nav-link:not(.active){ color: var(--nw-muted); }
.admin-tabs .nav-link.active{ box-shadow: 0 8px 20px rgba(20,60,120,.10); }

.admin-stat{
  border: 1px solid var(--nw-border);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  padding: 14px 16px;
}
.admin-stat__label{ font-size: 12px; color: var(--nw-muted); }
.admin-stat__value{ font-size: 26px; font-weight: 700; line-height: 1.05; margin-top: 4px; }

.admin-table thead th{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--nw-border);
}
.admin-table td{ vertical-align: middle; }

.admin-kv{ border: 1px solid var(--nw-border); border-radius: 16px; padding: 14px 16px; background: rgba(255,255,255,.72); }
.admin-kv__k{ font-size: 12px; color: var(--nw-muted); margin-bottom: 4px; }
.admin-kv__v{ font-size: 15px; font-weight: 600; word-break: break-word; }
