.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.7rem 1.35rem;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--hard-sm);
  transform: translate(0, 0);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6); }
[data-theme="light"] .btn:hover { box-shadow: 4px 4px 0 #151936; }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.btn-primary:hover { box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6), var(--glow); filter: brightness(1.06); }
.btn-danger { background: var(--bad); border-color: transparent; color: #2b060d; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--border); }
.btn-ghost:hover { box-shadow: var(--hard-sm); background: var(--card); }
.btn-sm { padding: 0.42rem 0.8rem; font-size: 0.83rem; border-width: 1.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-sm);
  border: 2px solid var(--border); background: var(--card); color: var(--text);
  box-shadow: var(--hard-sm); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-icon:hover { transform: translate(-1px, -1px); }
.btn-icon:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-icon svg { width: 19px; height: 19px; }

.card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--hard);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card.lift:hover { transform: translate(-2px, -3px); box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.6); }
[data-theme="light"] .card.lift:hover { box-shadow: 7px 7px 0 #151936; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-hd h3 { font-size: 1.08rem; display: flex; align-items: center; gap: 0.55rem; }
.card-hd h3 svg { width: 20px; height: 20px; color: var(--brand2); }

.grid { display: grid; gap: 1.2rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.field { margin-bottom: 1rem; }
.lbl { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.4rem; }
.lbl .req { color: var(--bad); }
.input, .select, .textarea {
  width: 100%;
  background: var(--inset);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 0.68rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand1); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--faint); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }
.input-wrap { position: relative; }
.input-wrap .btn-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-width: 1.5px; box-shadow: none; }

.check { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.check input { width: 19px; height: 19px; margin-top: 3px; accent-color: var(--brand1); flex: none; cursor: pointer; }

.errbox {
  display: none;
  background: rgba(251, 113, 133, 0.1);
  border: 1.5px solid var(--bad);
  color: var(--bad);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.errbox.show { display: block; animation: shake 0.4s ease; }
.okbox {
  display: none;
  background: rgba(52, 211, 153, 0.1);
  border: 1.5px solid var(--ok);
  color: var(--ok);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.okbox.show { display: block; }

.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.12rem 0.5rem;
  background: var(--card2);
}
.b-A { color: #c4b5fd; border-color: #7c5cff; background: rgba(124, 92, 255, 0.14); }
.b-AAAA { color: #93c5fd; border-color: #3b82f6; background: rgba(59, 130, 246, 0.14); }
.b-CNAME { color: #67e8f9; border-color: #22d3ee; background: rgba(34, 211, 238, 0.12); }
.b-TXT { color: #fcd34d; border-color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.b-MX { color: #f9a8d4; border-color: #ec4899; background: rgba(236, 72, 153, 0.12); }
.b-SRV { color: #6ee7b7; border-color: #10b981; background: rgba(16, 185, 129, 0.12); }
.b-CAA { color: #fdba74; border-color: #f97316; background: rgba(249, 115, 22, 0.12); }
[data-theme="light"] .badge { color: #151936; }

.pill { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; font-weight: 700; border-radius: 999px; padding: 0.28rem 0.85rem; border: 1.5px solid var(--border); background: var(--card2); }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.pill.ok { color: var(--ok); border-color: var(--ok); } .pill.ok .dot { background: var(--ok); animation: pulse 1.6s infinite; }
.pill.bad { color: var(--bad); border-color: var(--bad); } .pill.bad .dot { background: var(--bad); }
.pill.warn { color: var(--warn); border-color: var(--warn); } .pill.warn .dot { background: var(--warn); }

.switch { position: relative; display: inline-flex; width: 48px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .tr { position: absolute; inset: 0; border-radius: 999px; background: var(--inset); border: 2px solid var(--border); transition: 0.2s ease; }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: 0.2s ease; }
.switch input:checked + .tr { background: rgba(249, 115, 22, 0.25); border-color: #f97316; }
.switch input:checked + .tr::after { left: 23px; background: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, 0.7); }
.switch input:disabled + .tr { opacity: 0.45; cursor: not-allowed; }

.tbl-wrap { overflow-x: auto; border: 2px solid var(--border); border-radius: var(--r-md); background: var(--inset); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.7rem 0.9rem; border-bottom: 2px solid var(--border); white-space: nowrap; }
.tbl td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.15s ease; }
.tbl tbody tr:hover { background: rgba(124, 92, 255, 0.06); }
.tbl .mono { word-break: break-all; }
.tbl .acts { display: flex; gap: 0.4rem; white-space: nowrap; }
.mini-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--text); transition: 0.15s ease; }
.mini-btn:hover { border-color: var(--brand1); color: var(--brand2); transform: translateY(-1px); }
.mini-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.mini-btn svg { width: 15px; height: 15px; }

.tabs { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tab { border: 2px solid var(--border); background: var(--card); color: var(--text); font-weight: 700; font-size: 0.88rem; border-radius: 999px; padding: 0.45rem 1.1rem; box-shadow: var(--hard-sm); transition: 0.15s ease; }
.tab:hover { transform: translateY(-2px); }
.tab.on { background: var(--brand-grad); border-color: transparent; color: #fff; }
.tab.add { border-style: dashed; color: var(--muted); box-shadow: none; }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--border); box-shadow: var(--hard-sm); }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 0.95rem; }

.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 2px solid var(--border); }
.nav-in { height: var(--nav-h); display: flex; align-items: center; gap: 1.2rem; }
.nav .links { display: flex; gap: 1.4rem; margin-left: 1.5rem; font-weight: 600; font-size: 0.92rem; color: var(--muted); }
.nav .links a { position: relative; transition: color 0.15s ease; }
.nav .links a:hover, .nav .links a.on { color: var(--text); }
.nav .links a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; border-radius: 3px; background: var(--brand-grad); }
.nav .spacer { flex: 1; }
.nav .actions { display: flex; align-items: center; gap: 0.6rem; }
.burger { display: none; }
.mnav { display: none; border-top: 2px solid var(--border); background: var(--bg); padding: 0.8rem 4%; flex-direction: column; gap: 0.2rem; }
.mnav.open { display: flex; }
.mnav a { padding: 0.7rem 0.4rem; font-weight: 700; border-bottom: 1px dashed var(--border-soft); }
.mnav a:last-child { border-bottom: none; }
@media (max-width: 860px) { .nav .links { display: none; } .burger { display: inline-flex; } .nav .actions .btn { padding: 0.55rem 0.9rem; } }
@media (max-width: 640px) { .hide-m { display: none !important; } }
@media (max-width: 560px) {
  .nav .actions > .btn { display: none; }
  .nav .brand em, .topbar .brand em { display: none; }
  .nav .brand, .topbar .brand { font-size: 1.05rem; }
}

.footer { border-top: 2px solid var(--border); background: var(--bg2); margin-top: 4rem; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.footer p { color: var(--muted); font-size: 0.9rem; margin-top: 0.8rem; max-width: 320px; }
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.9rem; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; font-weight: 600; font-size: 0.92rem; }
.footer ul a:hover { color: var(--brand2); }
.footer-base { border-top: 1.5px solid var(--border-soft); padding: 1.2rem 0 1.6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 860px) { .footer-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-in { grid-template-columns: 1fr; } }

body.app { padding-top: var(--nav-h); }
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 60; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 2px solid var(--border); }
.topbar-in { height: 100%; width: min(1400px, 96%); margin: 0 auto; display: flex; align-items: center; gap: 0.8rem; }
.topbar .brand img { width: 32px; height: 32px; }
.topbar .brand { font-size: 1.05rem; }
.user-chip { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.86rem; border: 1.5px solid var(--border); background: var(--card); border-radius: 999px; padding: 0.32rem 0.85rem 0.32rem 0.4rem; }
.user-chip .av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; }
.sidebar { position: fixed; top: var(--nav-h); left: 0; bottom: 0; width: var(--side-w); z-index: 55; background: var(--bg2); border-right: 2px solid var(--border); padding: 1.2rem 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; transition: transform 0.25s ease; }
.sidebar a { display: flex; align-items: center; gap: 0.7rem; font-weight: 700; font-size: 0.92rem; padding: 0.68rem 0.85rem; border-radius: var(--r-sm); color: var(--muted); border: 1.5px solid transparent; transition: 0.15s ease; }
.sidebar a svg { width: 19px; height: 19px; flex: none; }
.sidebar a:hover { color: var(--text); background: var(--card); }
.sidebar a.on { color: var(--text); background: var(--card); border-color: var(--border); box-shadow: var(--hard-sm); }
.sidebar a.on svg { color: var(--brand2); }
.sidebar .side-foot { margin-top: auto; padding-top: 1rem; border-top: 1.5px dashed var(--border-soft); font-size: 0.8rem; color: var(--faint); }
.app-main { margin-left: var(--side-w); padding: 2rem 0 4rem; min-height: calc(100vh - var(--nav-h)); }
.app-main .wrap { width: min(1080px, 93%); }
.page-hd { margin-bottom: 1.6rem; }
.page-hd h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.page-hd p { color: var(--muted); }
.scrim { display: none; }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-105%); }
  body.side-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,0.4); }
  body.side-open .scrim { display: block; position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(0,0,0,0.55); z-index: 54; }
  .app-main { margin-left: 0; }
}
@media (min-width: 1024px) { #btn-side { display: none; } }

.quota { background: var(--inset); border: 2px solid var(--border); border-radius: var(--r-md); padding: 1rem 1.1rem; }
.quota .bar { height: 12px; border-radius: 999px; background: var(--card2); border: 1.5px solid var(--border); overflow: hidden; margin: 0.6rem 0 0.3rem; }
.quota .bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width 0.6s cubic-bezier(0.2, 0.7, 0.3, 1); }

.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 15, 0.7); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 2rem; overflow-y: auto; animation: fadeIn 0.2s ease; }
.modal { width: min(560px, 100%); background: var(--card); border: 2px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--hard), var(--glow); animation: popIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.modal-hd { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; border-bottom: 2px solid var(--border); }
.modal-hd h3 { font-size: 1.05rem; }
.modal-bd { padding: 1.3rem; }
.modal-ft { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 1.3rem; border-top: 2px solid var(--border); flex-wrap: wrap; }

#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.6rem; max-width: min(360px, 90vw); }
.toast { background: var(--card); border: 2px solid var(--border); border-radius: var(--r-md); box-shadow: var(--hard); padding: 0.75rem 1rem; font-size: 0.88rem; font-weight: 600; display: flex; gap: 0.6rem; align-items: flex-start; animation: slideIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.toast.ok { border-color: var(--ok); } .toast.ok svg { color: var(--ok); }
.toast.bad { border-color: var(--bad); } .toast.bad svg { color: var(--bad); }
.toast.out { opacity: 0; transform: translateX(30px); transition: 0.3s ease; }

.sk { border-radius: 8px; background: linear-gradient(90deg, var(--card2) 25%, var(--border-soft) 50%, var(--card2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; min-height: 1em; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty svg { width: 44px; height: 44px; opacity: 0.5; margin-bottom: 0.6rem; }

.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; border: 1.5px solid var(--border); background: var(--card); border-radius: 8px; padding: 0.3rem 0.7rem; box-shadow: var(--hard-sm); }
.chip svg { width: 14px; height: 14px; color: var(--brand2); }

.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; vertical-align: -3px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.8); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -24px) scale(1.08); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
