:root {
  --red: #ed263d;
  --red2: #9f1425;
  --red-soft: #35151c;
  --bg: #080809;
  --panel: #141416;
  --panel2: #1c1c20;
  --line: #342d30;
  --text: #f7f4f5;
  --muted: #aaa1a4;
  --danger: #ff6877;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 85% 5%, rgba(157, 20, 37, .17), transparent 28rem), var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  background: #0d0d0f;
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 32px rgba(0, 0, 0, .22);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand img, .mobile-head img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; }
.brand div { display: flex; flex-direction: column; }
.brand b { font-size: 15px; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 12px; }
nav { display: grid; gap: 7px; }
nav a { padding: 13px 15px; border-radius: 11px; color: var(--muted); font-weight: 700; }
nav a:hover, nav a.active { background: var(--red-soft); color: #fff; box-shadow: inset 3px 0 var(--red); }
.logout {
  margin-top: auto;
  min-height: 46px;
  padding: 12px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #242125;
  border: 1px solid #463b3f;
  border-radius: 11px;
  font-weight: 800;
  transition: .15s ease;
}
.logout:hover { color: #fff; border-color: var(--danger); background: #6c1824; }
.content { max-width: 1500px; margin-left: 250px; padding: 42px 48px; }
.mobile-head, .menu-backdrop { display: none; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-title h1 { margin: 4px 0 6px; font-size: 30px; }
.page-title p { margin: 0; color: var(--muted); }
.button, button {
  border: 0;
  border-radius: 11px;
  padding: 13px 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.primary { background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff; box-shadow: 0 8px 22px rgba(237, 38, 61, .16); }
.primary:hover { filter: brightness(1.09); }
.secondary { background: var(--panel2); border: 1px solid var(--line); }
.search-wrap {
  height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.search-wrap:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(237, 38, 61, .12); }
.search-wrap span { color: var(--red); font-size: 28px; }
.search-wrap input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.list-head { display: flex; justify-content: space-between; padding: 24px 4px 11px; color: var(--muted); }
.device-list { display: grid; gap: 10px; }
.device-row {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  background: linear-gradient(135deg, #171719, #121214);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.device-row:hover { border-color: #66404a; }
.device-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); font-weight: 900; }
.device-icon.pending { background: #453b14; color: #ffd45b; }
.device-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.device-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-main code { color: var(--muted); font-size: 13px; }
.badge { padding: 7px 10px; border-radius: 50px; font-size: 11px; font-weight: 850; }
.badge.active { color: #ff8e9b; background: var(--red-soft); }
.badge.pending { color: #ffd45b; background: #453b14; }
.badge.blocked { color: #d5cdd0; background: #2d292b; }
.actions { display: flex; align-items: center; gap: 8px; }
.actions .activate { padding: 10px 13px; border: 1px solid #765f22; border-radius: 10px; color: #ffe07b; background: #302a16; font-size: 13px; font-weight: 750; }
.icon-action {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  color: #f7edef;
  background: #242125;
  border: 1px solid #463b3f;
  border-radius: 10px;
  transition: .15s ease;
}
.icon-action:hover { color: #fff; border-color: var(--red); background: var(--red-soft); transform: translateY(-1px); }
.icon-action svg { width: 20px; height: 20px; fill: currentColor; }
.icon-action.danger { color: var(--danger); }
.icon-action.danger:hover { color: #fff; background: #6c1824; }
.danger { color: var(--danger) !important; }
.empty { padding: 45px; color: var(--muted); text-align: center; }
.narrow { max-width: 760px; }
.back { display: inline-block; margin-bottom: 15px; color: #ff6d7e; font-weight: 700; }
.panel-form {
  display: grid;
  gap: 20px;
  padding: 26px;
  background: linear-gradient(145deg, #171719, #111113);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.panel-form.compact { grid-template-columns: minmax(160px, 1fr) minmax(280px, 2fr) 190px; align-items: end; margin-bottom: 22px; }
.panel-form.compact .dns-submit {
  width: 190px;
  min-width: 190px;
  height: 49px;
  min-height: 49px;
  padding: 0 16px;
  white-space: nowrap;
}
.panel-form label, .login-card label { display: grid; gap: 8px; color: #d8d0d3; font-size: 13px; font-weight: 700; }
.panel-form input, .panel-form textarea, .login-card input {
  width: 100%;
  padding: 14px;
  border: 1px solid #3c3437;
  border-radius: 11px;
  outline: 0;
  background: #0c0c0e;
  color: var(--text);
  font: inherit;
}
.panel-form input:focus, .panel-form textarea:focus, .login-card input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(237, 38, 61, .12); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.simple-table { display: grid; gap: 8px; }
.simple-table > div { display: grid; grid-template-columns: 180px minmax(220px, 1fr) auto auto; gap: 15px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.simple-table span { color: var(--muted); }
.dns-actions { display: flex; align-items: center; gap: 8px; }
.dns-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  color: #fff;
  background: #242125;
  border: 1px solid #463b3f;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: .15s ease;
}
.dns-action:hover { color: #fff; border-color: var(--red); background: var(--red-soft); }
.dns-action.danger:hover { color: #fff !important; background: #6c1824; }
.alert { padding: 13px 16px; border-radius: 11px; margin-bottom: 20px; }
.alert.success { background: #32161d; border: 1px solid #712635; color: #ff9ba7; }
.alert.error { background: #401a1e; color: #ffadb2; }
.login-page { display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 30px; display: grid; gap: 18px; background: linear-gradient(145deg, #18171a, #0f0f11); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
.login-card img { width: 112px; height: 112px; object-fit: contain; margin: auto; border-radius: 50%; }
.login-card h1 { margin: 0; text-align: center; }
.login-card p { margin: -10px 0 4px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  body { padding-top: 72px; }
  .mobile-head {
    position: fixed;
    z-index: 50;
    inset: 0 0 auto 0;
    height: 72px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 13, 15, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .mobile-brand { display: flex; align-items: center; gap: 10px; }
  .mobile-head img { width: 46px; height: 46px; }
  .menu-toggle { width: 46px; height: 46px; padding: 11px; flex-direction: column; gap: 5px; background: var(--red-soft); border: 1px solid #6e2733; }
  .menu-toggle span { width: 22px; height: 2px; display: block; background: #fff; border-radius: 3px; }
  .sidebar {
    width: min(82vw, 310px);
    padding: 22px 18px;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand { display: flex; }
  .menu-backdrop { position: fixed; z-index: 20; inset: 0; display: block; pointer-events: none; opacity: 0; background: rgba(0, 0, 0, .68); transition: opacity .22s ease; }
  .menu-backdrop.open { pointer-events: auto; opacity: 1; }
  .content { margin: 0; padding: 24px 18px; }
  .device-row { grid-template-columns: 44px 1fr auto; }
  .device-row .actions { grid-column: 2 / -1; }
  .panel-form.compact { grid-template-columns: 1fr; }
  .panel-form.compact .dns-submit { width: 100%; min-width: 0; }
  .simple-table > div { grid-template-columns: 1fr; }
  .dns-actions { flex-wrap: wrap; }
  .page-title { align-items: flex-start; }
  .login-page { padding-top: 20px; }
}
@media (max-width: 540px) {
  .page-title { flex-direction: column; }
  .page-title .button { width: 100%; }
  .page-title h1 { font-size: 27px; }
  .device-row { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .device-row > .badge { grid-column: 2; justify-self: start; }
  .device-row .actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 4px; border-top: 1px solid #2c2729; }
  .list-head small { display: none; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions > * { width: 100%; }
}
