:root{
  --bg:#080c10;
  --bg-soft:#0c1117;
  --panel:#101720;
  --panel-2:#121b25;
  --panel-3:#0d141c;
  --stroke:rgba(255,255,255,.08);
  --stroke-2:rgba(255,255,255,.12);
  --text:#edf5f1;
  --muted:#8fa09a;
  --dim:#62736c;
  --accent:#35d58c;
  --accent-soft:rgba(53,213,140,.13);
  --accent-line:rgba(53,213,140,.32);
  --danger:#ef6f7f;
  --warning:#e4b85f;
  --shadow:0 18px 55px rgba(0,0,0,.34);
  --radius:22px;
  --font:Inter,"Plus Jakarta Sans",ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(53,213,140,.09), transparent 34%),
    linear-gradient(180deg,#080c10 0%,#0b1016 45%,#080c10 100%);
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.022) 1px,transparent 1px);
  background-size:30px 30px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.55),transparent 88%);
  z-index:0;
}

body::after{
  content:"";
  position:fixed;
  top:-240px;
  right:-230px;
  width:560px;
  height:560px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(53,213,140,.11),transparent 68%);
  pointer-events:none;
  z-index:0;
}

.page-glow{
  position:fixed;
  left:-220px;
  bottom:-260px;
  width:580px;
  height:580px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(53,213,140,.07),transparent 70%);
  pointer-events:none;
  z-index:0;
}

.app{
  width:min(1120px,calc(100% - 42px));
  margin:0 auto;
  padding:36px 0 56px;
  position:relative;
  z-index:1;
}

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

.brand{
  display:flex;
  align-items:center;
  gap:15px;
}

.brand-mark{
  width:54px;
  height:54px;
  border-radius:17px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,rgba(53,213,140,.16),rgba(53,213,140,.065));
  border:1px solid var(--accent-line);
  box-shadow:0 18px 38px rgba(0,0,0,.26),0 0 28px rgba(53,213,140,.10);
}

.brand-mark svg{
  width:31px;
  height:31px;
  display:block;
  fill:none;
  stroke:var(--accent);
  stroke-width:3;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 0 10px rgba(53,213,140,.32));
}

.brand-mark svg circle{
  fill:var(--accent);
  stroke:none;
}

h1{
  margin:0;
  font-size:30px;
  line-height:1;
  letter-spacing:-.04em;
  color:#f8fffb;
}

p{
  margin:0;
  color:var(--muted);
  line-height:1.65;
}

.brand p{
  font-size:13px;
  margin-top:6px;
}

.server-pill{
  height:42px;
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding:0 15px;
  border-radius:999px;
  color:#dffcf1;
  font-size:12px;
  font-weight:900;
  border:1px solid var(--accent-line);
  background:rgba(53,213,140,.075);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.server-pill span{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 16px rgba(53,213,140,.78);
}

.home-btn{display:none!important}

.mini-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:15px;
  margin-bottom:16px;
}

.mini-stats article{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.024));
  border:1px solid var(--stroke);
  border-radius:20px;
  padding:18px 20px;
  min-height:105px;
  box-shadow:var(--shadow);
}

.mini-stats article::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg,rgba(53,213,140,.06),transparent 48%);
  pointer-events:none;
}

.mini-stats span,.mini-stats b{
  position:relative;
  z-index:1;
}

.mini-stats span{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.mini-stats b{
  display:block;
  margin-top:9px;
  font-size:31px;
  line-height:1;
  color:#f3faf6;
}

.nav-card{
  display:grid;
  grid-template-columns:1fr 1fr 1fr auto;
  gap:10px;
  align-items:center;
  background:rgba(16,23,32,.76);
  border:1px solid var(--stroke);
  border-radius:21px;
  padding:10px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
}

.nav-btn,.add-domain-btn,.primary-btn,.soft-btn,.danger-btn,.mini-btn,.row-btn{
  appearance:none;
  cursor:pointer;
  font-family:inherit;
  font-weight:900;
  transition:.18s ease;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
}

.nav-btn{
  height:44px;
  border:1px solid transparent;
  border-radius:15px;
  color:var(--muted);
  background:transparent;
}

.nav-btn:hover{
  color:#fff;
  background:rgba(255,255,255,.045);
  border-color:var(--stroke);
}

.nav-btn.active{
  color:#07110d;
  background:var(--accent);
  box-shadow:0 14px 30px rgba(53,213,140,.18);
}

.add-domain-btn,.primary-btn{
  min-height:44px;
  border:1px solid var(--accent-line);
  border-radius:15px;
  padding:0 18px;
  color:#07110d;
  background:var(--accent);
  box-shadow:0 14px 30px rgba(53,213,140,.17);
}

.soft-btn{
  min-height:42px;
  border-radius:14px;
  padding:0 16px;
  color:#c8d6d0;
  background:rgba(255,255,255,.045);
  border:1px solid var(--stroke);
}

.danger-btn{
  min-height:42px;
  border-radius:14px;
  padding:0 16px;
  color:#ffdce1;
  background:rgba(239,111,127,.10);
  border:1px solid rgba(239,111,127,.24);
}

.primary-btn:hover,.add-domain-btn:hover,.soft-btn:hover,.danger-btn:hover,.mini-btn:hover,.row-btn:hover{
  transform:translateY(-1px);
  filter:brightness(1.04);
}

.panel{
  display:none;
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.025));
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:28px;
  box-shadow:var(--shadow);
  animation:fadeIn .22s ease both;
}

.panel.active{display:block}

.panel::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 0 0,rgba(53,213,140,.055),transparent 38%);
  pointer-events:none;
}

.panel>*{
  position:relative;
  z-index:1;
}

@keyframes fadeIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:20px;
}

.section-head h2{
  margin:0;
  font-size:27px;
  letter-spacing:-.04em;
  color:#f8fffb;
}

.section-head p{
  font-size:14px;
  margin-top:4px;
}

.field{
  width:100%;
  height:46px;
  border-radius:15px;
  border:1px solid var(--stroke);
  background:rgba(8,12,16,.62);
  color:var(--text);
  outline:none;
  padding:0 15px;
  font-family:inherit;
  transition:.18s ease;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.field:focus{
  border-color:var(--accent-line);
  box-shadow:0 0 0 4px rgba(53,213,140,.08),inset 0 1px 0 rgba(255,255,255,.035);
}

.field::placeholder,input::placeholder,textarea::placeholder{
  color:rgba(143,160,154,.62);
}

select.field option{
  background:#101820;
  color:#fff;
}

.small-select{max-width:230px}

.add-category-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  margin-bottom:16px;
}

.category-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:15px;
}

.category-card{
  position:relative;
  overflow:hidden;
  background:rgba(11,16,22,.74);
  border:1px solid var(--stroke);
  border-radius:19px;
  padding:17px;
  box-shadow:0 14px 36px rgba(0,0,0,.20);
}

.category-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg,rgba(53,213,140,.045),transparent 48%);
  pointer-events:none;
}

.category-card>*{
  position:relative;
  z-index:1;
}

.cat-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:14px;
}

.cat-top b{
  font-size:18px;
  color:#f8fffb;
}

.cat-top span{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:12px;
}

.cat-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  margin-top:7px;
}

.cat-dot.on{
  background:var(--accent);
  box-shadow:0 0 16px rgba(53,213,140,.74);
}

.cat-dot.off{
  background:#56645f;
}

.cat-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.mini-btn,.row-btn{
  min-height:34px;
  border-radius:12px;
  padding:0 12px;
  background:rgba(255,255,255,.045);
  color:#c8d6d0;
  border:1px solid var(--stroke);
  font-size:12px;
}

.mini-btn.primary{
  color:#07110d;
  background:var(--accent);
  border-color:var(--accent-line);
}

.mini-btn.danger,.row-btn.danger{
  color:#ffdce1;
  background:rgba(239,111,127,.10);
  border-color:rgba(239,111,127,.24);
}

.domain-preview{
  margin-top:13px;
  max-height:170px;
  overflow:auto;
  border:1px solid var(--stroke);
  border-radius:15px;
  background:rgba(8,12,16,.52);
}

.domain-preview div{
  padding:9px 11px;
  border-bottom:1px solid rgba(255,255,255,.07);
  font-size:12px;
  color:#c8d6d0;
}

.domain-preview div:last-child{
  border-bottom:0;
}

.empty-card{
  grid-column:1/-1;
  background:rgba(11,16,22,.62);
  border:1px dashed rgba(255,255,255,.16);
  border-radius:19px;
  padding:26px;
  text-align:center;
  color:var(--muted);
  font-weight:900;
}

.empty-line{
  color:var(--muted)!important;
  text-align:center;
}

.toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:10px;
  margin-bottom:15px;
}

.search-wrap{
  height:46px;
  border:1px solid var(--stroke);
  border-radius:15px;
  background:rgba(8,12,16,.62);
  display:flex;
  align-items:center;
  padding:0 15px;
  gap:10px;
}

.search-wrap span{
  color:var(--accent);
}

.search-wrap input{
  border:0;
  outline:0;
  width:100%;
  font-family:inherit;
  background:transparent;
  color:var(--text);
}

.table-card{
  border:1px solid var(--stroke);
  border-radius:19px;
  overflow:auto;
  background:rgba(8,12,16,.52);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:780px;
}

th,td{
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,.07);
  padding:14px 16px;
  vertical-align:middle;
  font-size:13px;
}

th{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.10em;
  color:#82928b;
  background:rgba(255,255,255,.028);
}

tbody tr:last-child td{
  border-bottom:0;
}

tbody tr:hover td{
  background:rgba(255,255,255,.032);
}

.right{text-align:right}

.empty{
  text-align:center;
  color:var(--muted);
  font-weight:900;
  padding:25px!important;
}

.domain-name{
  display:flex;
  align-items:center;
  gap:11px;
}

.domain-name span{
  width:35px;
  height:35px;
  border-radius:13px;
  background:rgba(53,213,140,.08);
  display:grid;
  place-items:center;
  color:var(--accent);
}

.domain-name b{
  color:#f3faf6;
}

.tag{
  display:inline-flex;
  border:1px solid rgba(53,213,140,.15);
  background:rgba(53,213,140,.055);
  border-radius:999px;
  padding:5px 10px;
  font-size:11px;
  color:#d9ffec;
}

.pill{
  display:inline-flex;
  border-radius:999px;
  padding:7px 12px;
  font-size:11px;
  font-weight:1000;
  border:1px solid var(--stroke);
  margin-right:6px;
}

.pill.ok{
  color:#dffcf1;
  background:rgba(53,213,140,.12);
  border-color:rgba(53,213,140,.26);
}

.pill.bad{
  color:#ffe1e7;
  background:rgba(239,111,127,.12);
  border-color:rgba(239,111,127,.26);
}

.pill.warn{
  color:#fff2cc;
  background:rgba(228,184,95,.13);
  border-color:rgba(228,184,95,.26);
}

.pill.muted{
  color:#c3d0ca;
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.10);
}

td small{
  display:block;
  margin-top:4px;
  color:var(--muted);
}

.modal,.scan-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(3,6,9,.70);
  backdrop-filter:blur(10px);
  z-index:30;
  padding:20px;
}

.modal.show,.scan-overlay.show{
  display:flex;
}

.modal-card{
  width:min(580px,100%);
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(18,27,37,.96),rgba(9,13,18,.96));
  border-radius:23px;
  padding:24px;
  border:1px solid var(--stroke);
  box-shadow:0 35px 100px rgba(0,0,0,.48);
  animation:popIn .22s ease both;
}

.modal-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 0 0,rgba(53,213,140,.07),transparent 44%);
  pointer-events:none;
}

.modal-card>*{
  position:relative;
  z-index:1;
}

@keyframes popIn{
  from{opacity:0;transform:scale(.96) translateY(10px)}
  to{opacity:1;transform:scale(1) translateY(0)}
}

.modal-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  margin-bottom:17px;
}

.modal-head h3{
  margin:0;
  font-size:23px;
  color:#f8fffb;
  letter-spacing:-.03em;
}

.modal-head p{
  font-size:13px;
}

.icon-close{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.045);
  color:#fff;
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.modal-card label{
  display:block;
  margin:13px 0 7px;
  color:#b9c9c2;
  font-size:12px;
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:.07em;
}

.domain-textarea{
  height:184px!important;
  padding:14px!important;
  resize:vertical;
  line-height:1.5;
}

.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:15px;
}

.scan-box{
  width:min(370px,100%);
  background:linear-gradient(180deg,rgba(18,27,37,.96),rgba(9,13,18,.96));
  border:1px solid var(--stroke);
  border-radius:23px;
  padding:27px;
  text-align:center;
  box-shadow:0 35px 100px rgba(0,0,0,.48);
}

.scan-spinner{
  width:50px;
  height:50px;
  border-radius:50%;
  border:5px solid rgba(255,255,255,.10);
  border-top-color:var(--accent);
  margin:0 auto 16px;
  animation:spin .75s linear infinite;
  box-shadow:0 0 22px rgba(53,213,140,.10);
}

@keyframes spin{to{transform:rotate(360deg)}}

.scan-box b{
  display:block;
  font-size:18px;
  color:#f8fffb;
}

.scan-box span{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:13px;
}

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:40;
  background:#08110d;
  color:#fff;
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:12px 16px;
  font-size:13px;
  font-weight:900;
  box-shadow:0 24px 70px rgba(0,0,0,.35);
  opacity:0;
  transform:translateY(12px);
  pointer-events:none;
  transition:.2s;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(53,213,140,.24);border-radius:999px}
::-webkit-scrollbar-thumb:hover{background:rgba(53,213,140,.34)}

@media(max-width:820px){
  .app{width:min(100% - 24px,1120px);padding-top:20px}
  .topbar,.section-head{display:block}
  .server-pill{margin-top:14px}
  .mini-stats{grid-template-columns:1fr}
  .nav-card{grid-template-columns:1fr 1fr}
  .add-domain-btn{grid-column:1/-1}
  .panel{padding:19px}
  .add-category-box,.toolbar{grid-template-columns:1fr}
  .small-select{max-width:none}
  .category-grid{grid-template-columns:1fr}
  .modal-actions{display:grid}
  .primary-btn,.soft-btn,.danger-btn,.add-domain-btn{width:100%}
}

@media(max-width:520px){
  h1{font-size:25px}
  .brand{align-items:flex-start}
  .brand-mark{width:48px;height:48px;border-radius:16px}
  .nav-card{grid-template-columns:1fr}
  table{min-width:720px}
}


/* Edit domain action */
.row-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.row-btn.edit{
  color:#dffcf1;
  background:rgba(53,213,140,.10);
  border-color:rgba(53,213,140,.24);
}

.field[readonly]{
  opacity:.78;
  cursor:not-allowed;
  background:rgba(255,255,255,.035);
}

@media(max-width:700px){
  .row-actions{
    justify-content:flex-start;
  }
}


/* Category live dot + trash button */
.cat-dot.on{
  animation:catPulse 1.15s ease-in-out infinite;
}

@keyframes catPulse{
  0%,100%{
    opacity:.45;
    transform:scale(.72);
    box-shadow:0 0 0 0 rgba(53,213,140,.35);
  }
  50%{
    opacity:1;
    transform:scale(1.08);
    box-shadow:0 0 0 8px rgba(53,213,140,0),0 0 18px rgba(53,213,140,.82);
  }
}

.mini-btn.trash{
  width:36px;
  min-width:36px;
  padding:0;
  font-size:14px;
  color:#ffdce1;
  background:rgba(239,111,127,.11);
  border-color:rgba(239,111,127,.26);
}

.mini-btn.trash:hover{
  background:rgba(239,111,127,.18);
  border-color:rgba(239,111,127,.42);
}


/* Force readable white text on action buttons */
.add-domain-btn,
.primary-btn,
.nav-btn.active,
.mini-btn.primary{
  color:#fff!important;
  text-shadow:0 1px 0 rgba(0,0,0,.22);
}

.add-domain-btn *,
.primary-btn *,
.nav-btn.active *,
.mini-btn.primary *{
  color:#fff!important;
}
