:root{
  --bg:#05070b;
  --card:#0b101a;
  --line:#1a2638;

  --text:#d7e1f0;
  --muted:#8aa0c2;

  --green:#22ff7a;
  --green2:#00c85f;

  --shadow:0 20px 60px rgba(0,0,0,.65);
  --radius:18px;

  --danger:#ff3b3b;
  --warn:#ffb020;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  overflow-x:hidden;

  /* Base background */
  background:
    radial-gradient(900px 600px at 20% -10%, rgba(34,255,122,.14), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(0,200,95,.10), transparent 55%),
    radial-gradient(800px 700px at 50% 110%, rgba(34,255,122,.10), transparent 60%),
    var(--bg);
}

/* =========================
   Animated subtle background (shared login + dashboard)
   ========================= */
.bgGlow{
  position:fixed; inset:-220px;
  pointer-events:none;
  opacity:.95;
  filter: blur(7px);
  transform: translate3d(0,0,0);
  will-change: transform, opacity;

  background:
    radial-gradient(620px 320px at 18% 12%, rgba(34,255,122,.12), transparent 62%),
    radial-gradient(560px 300px at 78% 18%, rgba(0,200,95,.10), transparent 62%),
    radial-gradient(700px 360px at 55% 88%, rgba(34,255,122,.08), transparent 60%);
  animation: nebulaMove 18s ease-in-out infinite;
}

/* small grain overlay */
.bgGlow::after{
  content:"";
  position:absolute; inset:0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,.06), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.04), transparent 40%),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.04), transparent 40%);
  mix-blend-mode: overlay;
  opacity:.08;
  animation: grain 10s steps(8) infinite;
}

@keyframes nebulaMove{
  0%   { transform: translate3d(0,0,0) scale(1); opacity:.92; }
  40%  { transform: translate3d(18px,-10px,0) scale(1.03); opacity:1; }
  70%  { transform: translate3d(-14px,12px,0) scale(1.02); opacity:.96; }
  100% { transform: translate3d(0,0,0) scale(1); opacity:.92; }
}
@keyframes grain{
  0%,100%{ transform: translate3d(0,0,0); }
  20%{ transform: translate3d(-6px, 4px,0); }
  40%{ transform: translate3d(5px, -3px,0); }
  60%{ transform: translate3d(-3px,-6px,0); }
  80%{ transform: translate3d(6px, 3px,0); }
}

.muted{color:var(--muted)}
.hide{display:none !important}

/* =========================
   Buttons
   ========================= */
.btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  color: var(--text);
  padding:10px 14px;
  border-radius: 14px;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: .15s ease;
  user-select:none;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:hover{
  transform:translateY(-1px);
  border-color: rgba(34,255,122,.35);
  box-shadow: 0 12px 40px rgba(34,255,122,.10), 0 10px 30px rgba(0,0,0,.35);
}
.btn:active{transform:translateY(0)}
.btn.primary{
  border-color: rgba(34,255,122,.35);
  background: linear-gradient(180deg, rgba(34,255,122,.14), rgba(0,0,0,.05));
  box-shadow: 0 12px 40px rgba(34,255,122,.12), 0 10px 30px rgba(0,0,0,.35);
}

.btn.danger:hover, .btn.danger:focus-visible{
  border-color: rgba(255,59,59,.55);
  box-shadow: 0 0 0 4px rgba(255,59,59,.12), 0 18px 55px rgba(255,59,59,.14), 0 10px 30px rgba(0,0,0,.35);
}
.btn.danger:hover{
  animation: dangerPulse 1.6s ease-in-out infinite;
}
@keyframes dangerPulse{
  0%,100%{ filter: drop-shadow(0 0 0 rgba(255,59,59,0)); }
  50%{ filter: drop-shadow(0 0 14px rgba(255,59,59,.35)); }
}

.iconBtn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  color: var(--text);
  width:38px; height:38px;
  border-radius: 14px;
  cursor:pointer;
}
.iconBtn:hover{border-color: rgba(34,255,122,.35)}

/* =========================
   Topbar / Brand
   ========================= */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px;
}
.brand{display:flex; gap:12px; align-items:center}

.logoDot{
  width:14px; height:14px; border-radius:50%;
  background: var(--green);
  box-shadow: 0 0 20px rgba(34,255,122,.45);
  animation: glowPulse 2.6s ease-in-out infinite;
}

@keyframes glowPulse{
  0%,100%{
    box-shadow:
      0 0 12px rgba(34,255,122,.35),
      0 0 26px rgba(34,255,122,.18);
    transform: scale(1);
  }
  50%{
    box-shadow:
      0 0 18px rgba(34,255,122,.55),
      0 0 44px rgba(34,255,122,.22);
    transform: scale(1.06);
  }
}

.brandLogo{
  width:34px;
  height:34px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 45px rgba(0,0,0,.35);
}

.title{font-weight:800; letter-spacing:.2px}
.sub{font-size:12.5px}

.right{display:flex; gap:10px; align-items:center}

/* User chip with breathing glow */
.chip{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  padding:8px 12px;
  border-radius: 14px;
  display:flex; gap:8px; align-items:baseline;
  transition: .15s ease;
}
.chip .k{font-size:12px}
.chip .v{font-weight:700}

.chip.user{
  border-color: rgba(34,255,122,.22);
  box-shadow: 0 0 0 4px rgba(34,255,122,.06);
  animation: userPulse 2.8s ease-in-out infinite;
}
@keyframes userPulse{
  0%,100%{
    box-shadow:
      0 0 0 4px rgba(34,255,122,.06),
      0 16px 55px rgba(34,255,122,.08);
  }
  50%{
    box-shadow:
      0 0 0 6px rgba(34,255,122,.10),
      0 18px 65px rgba(34,255,122,.12);
  }
}

.wrap{padding:0 20px 28px}
.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border:1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panelHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.toolbar{display:flex; gap:10px; flex-wrap:wrap}
.stats{display:flex; gap:10px; flex-wrap:wrap}

.tableWrap{overflow:auto; max-height: calc(100vh - 190px);}
.grid{
  width:100%;
  border-collapse: collapse;
  min-width: 980px;
}
.grid thead th{
  position:sticky; top:0;
  background: rgba(5,7,11,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align:left;
  font-size:12.5px;
  color: var(--muted);
  padding:12px 12px;
  z-index:2;
}
.grid tbody td{
  border-bottom:1px solid rgba(255,255,255,.06);
  padding:11px 12px;
  font-size:13.5px;
  vertical-align:top;
  white-space:pre-wrap;
  word-break:break-word;
}
.grid tbody tr:hover td{background: rgba(34,255,122,.04)}
.grid tbody tr.sel td{
  background: rgba(34,255,122,.10);
  box-shadow: inset 0 0 0 1px rgba(34,255,122,.18);
}

.w-client{width:240px}
.w-tel{width:140px}
.w-tech{width:200px}
.w-secret{width:180px}
.w-averif{width:300px}
.w-prob{width:320px}

.cell{position:relative;}
.cell.editing{padding:6px 8px !important;}
.inlineInput{
  width:100%;
  padding:10px 10px;
  border-radius: 12px;
  border:1px solid rgba(34,255,122,.25);
  background: rgba(0,0,0,.28);
  color: var(--text);
  outline:none;
}

/* Secret */
.secretMask{
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
}
.secretMask .pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(34,255,122,.18);
  background: rgba(34,255,122,.06);
  color: var(--muted);
}
.secretReveal{
  display:inline-flex;
  gap:10px;
  align-items:center;
}
.secretReveal .copyBtn{
  padding:6px 10px;
  border-radius: 12px;
  border:1px solid rgba(34,255,122,.25);
  background: rgba(34,255,122,.08);
  cursor:pointer;
  color: var(--text);
}
.secretReveal .copyBtn:hover{border-color: rgba(34,255,122,.45)}
.secretReveal input{
  width:100%;
  padding:9px 10px;
  border-radius:12px;
  border:1px solid rgba(34,255,122,.25);
  background: rgba(0,0,0,.28);
  color: var(--text);
  outline:none;
}

/* Toast */
.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  padding:12px 14px;
  border-radius: 14px;
  background: rgba(11,16,26,.92);
  border:1px solid rgba(34,255,122,.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  max-width: 420px;
}

/* Messages */
.msg{
  margin-top:12px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
  font-size:13px;
}
.msg.ok{border-color: rgba(34,255,122,.25); background: rgba(34,255,122,.06)}
.msg.err{border-color: rgba(255,59,59,.25); background: rgba(255,59,59,.06)}

/* Modals */
.modalOverlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:50;
}
.modal{
  width:min(860px, 100%);
  border-radius: 20px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(11,16,26,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow:hidden;
}
.modal.big{width:min(1100px, 100%)}
.modalHead{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modalTitle{font-weight:800}
.modalBody{padding:14px 16px}
.modalFoot{
  padding:14px 16px;
  display:flex; justify-content:flex-end; gap:10px;
  border-top:1px solid rgba(255,255,255,.08);
}
.formGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 860px){
  .formGrid{grid-template-columns: 1fr;}
  .grid{min-width: 760px;}
}
.row label{display:block; font-size:12.5px; color:var(--muted); margin:0 0 6px}
.row input, .row select{
  width:100%;
  padding:10px 11px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.24);
  color: var(--text);
  outline:none;
}
.row input:focus, .row select:focus{
  border-color: rgba(34,255,122,.30);
  box-shadow: 0 0 0 4px rgba(34,255,122,.10);
}

/* Reports */
.reportBox{
  width:100%;
  min-height: 420px;
  resize: vertical;
  padding:12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.7px;
  line-height: 1.45;
}

.actionsInline{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:center;
}

.oldLayout{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:12px;
}
@media (max-width: 980px){
  .oldLayout{grid-template-columns: 1fr}
}
.oldList{
  border:1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  overflow:auto;
  max-height: 420px;
  background: rgba(0,0,0,.16);
}
.oldItem{
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.06);
  cursor:pointer;
}
.oldItem:hover{background: rgba(34,255,122,.05)}
.oldItem.active{
  background: rgba(34,255,122,.10);
  box-shadow: inset 0 0 0 1px rgba(34,255,122,.18);
}

/* =========================
   Login
   ========================= */
.authWrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
}
.authCard{
  width:min(520px, 100%);
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(11,16,26,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding:18px 18px 14px;
}
.authHeader h1{margin:6px 0 6px; font-size:22px}
.authHeader p{margin:0 0 10px}

/* Online badge breathing glow */
.badgeOnline{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid rgba(34,255,122,.22);
  background: rgba(34,255,122,.06);
  padding:6px 10px;
  border-radius: 999px;
  font-size:12px;
  color: var(--muted);
  animation: badgePulse 2.4s ease-in-out infinite;
}
@keyframes badgePulse{
  0%,100%{
    box-shadow: 0 0 0 4px rgba(34,255,122,.05), 0 0 18px rgba(34,255,122,.10);
  }
  50%{
    box-shadow: 0 0 0 6px rgba(34,255,122,.10), 0 0 28px rgba(34,255,122,.16);
  }
}
.form .actions{margin-top:12px; display:flex; gap:10px; justify-content:flex-end}
.footer{margin-top:14px; display:flex; gap:10px; align-items:center; justify-content:center; font-size:12px}
.footer .dot{opacity:.6}