/* ==========================================================================
   Domain Manager — Design System (Light · Navy)
   ========================================================================== */
:root {
  /* Light theme (default) */
  --bg: #f4f6fc;
  --bg-grad: radial-gradient(1100px 520px at 100% -10%, #e8edfb 0%, transparent 60%), #f4f6fc;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --surface-3: #eef1f9;
  --border: #e7ebf5;
  --border-soft: #eef1f8;
  --text: #131a33;
  --text-2: #59627c;
  --muted: #939db6;

  --navy: #1e2a63;
  --primary: #223a8f;
  --primary-2: #3a5ad9;
  --primary-3: #6d86f0;
  --primary-soft: #e9edfc;
  --primary-softer: #f1f4fe;

  --teal: #14b8a6;
  --teal-soft: #dcf7f3;
  --amber: #f5a524;
  --amber-soft: #fdf0d9;
  --red: #ef5a6f;
  --red-soft: #fde3e7;
  --green: #17c07d;
  --green-soft: #d7f6e9;
  --violet: #7c5cff;
  --violet-soft: #ece7ff;

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -20px rgba(30, 45, 100, 0.22);
  --shadow-sm: 0 6px 20px -12px rgba(30, 45, 100, 0.18);
  --shadow-card: 0 1px 2px rgba(30, 45, 100, 0.04), 0 12px 28px -18px rgba(30, 45, 100, 0.16);
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-grad: radial-gradient(1100px 600px at 100% -10%, #16224a 0%, transparent 55%), #0b1020;
  --surface: #121a30;
  --surface-2: #172142;
  --surface-3: #1e2a4d;
  --border: #223057;
  --border-soft: #1a2445;
  --text: #eef2fb;
  --text-2: #aab6d6;
  --muted: #6f7ca0;
  --primary: #4f74ff;
  --primary-2: #6d86f0;
  --primary-3: #8ea3ff;
  --primary-soft: rgba(79, 116, 255, 0.16);
  --primary-softer: rgba(79, 116, 255, 0.10);
  --teal-soft: rgba(20, 184, 166, 0.16);
  --amber-soft: rgba(245, 165, 36, 0.16);
  --red-soft: rgba(239, 90, 111, 0.16);
  --green-soft: rgba(23, 192, 125, 0.16);
  --violet-soft: rgba(124, 92, 255, 0.16);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 6px 20px -12px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 10px 26px -18px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.error { color: var(--red); font-size: 13px; margin-top: 4px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 12px; padding: 10px 16px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform 0.08s, filter 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  color: var(--text); background: var(--surface-3);
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff; box-shadow: 0 10px 22px -10px var(--primary-2);
}
.btn.primary:hover { box-shadow: 0 12px 26px -8px var(--primary-2); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--primary-2); color: var(--primary); }
.btn.full { width: 100%; }
.btn.lg { padding: 13px 18px; font-size: 15px; border-radius: 13px; }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 9px; }

.icon-btn {
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  width: 36px; height: 36px; display: grid; place-items: center;
  cursor: pointer; color: var(--muted); transition: 0.15s;
}
.icon-btn:hover { color: var(--primary); background: var(--primary-soft); }
.icon-btn .ico { width: 18px; height: 18px; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Auth / Unlock (split screen) ---------- */
.auth-screen {
  position: relative; min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 24px;
}
.auth-shell {
  width: 100%; max-width: 1000px; min-height: 620px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
}

/* Left brand panel */
.auth-side {
  position: relative; overflow: hidden; padding: 42px 44px;
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, var(--primary-2) 0%, var(--navy) 60%, #131c46 100%);
  color: #fff;
}
.auth-blob { position: absolute; border-radius: 50%; filter: blur(10px); opacity: 0.5; pointer-events: none; }
.auth-blob.b1 { width: 260px; height: 260px; background: radial-gradient(circle, rgba(120,150,255,.6), transparent 70%); top: -70px; right: -60px; }
.auth-blob.b2 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(90,120,255,.35), transparent 70%); bottom: -110px; left: -80px; }
.auth-side-top, .auth-side-mid, .auth-side-bot { position: relative; z-index: 1; }
.auth-side-mid { margin-top: auto; margin-bottom: auto; }
.auth-side-mid h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin: 8px 0 14px; }
.auth-side-mid > p { color: rgba(255, 255, 255, 0.78); font-size: 14.5px; max-width: 340px; margin-bottom: 26px; }
.auth-features { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 13px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.92); }
.af-ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, 0.14); display: grid; place-items: center; flex-shrink: 0; }
.af-ico .ico { width: 19px; height: 19px; color: #fff; }
.auth-side-bot { color: rgba(255, 255, 255, 0.6); }

/* Right form side */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 42px; }
.auth-card {
  position: relative; width: 100%; max-width: 360px;
  background: transparent; border: none; padding: 0; box-shadow: none;
}
.auth-card-head { margin-bottom: 24px; }
.auth-card-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.unlock-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; }
.field-icon { position: relative; }
.field-icon .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.field-icon input { padding-left: 42px; }
.auth-card form .btn.primary { margin-top: 22px; }

@media (max-width: 780px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; max-width: 420px; }
  .auth-side { display: none; }
  .auth-main { padding: 36px 30px; }
  .auth-card { max-width: 100%; }
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand.small { margin-bottom: 28px; }
.brand-name { font-weight: 800; font-size: 15px; display: block; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--primary-2), var(--navy));
  color: #fff; font-size: 20px; box-shadow: 0 10px 22px -8px var(--primary); flex-shrink: 0;
}
.logo-mark.lock { background: linear-gradient(140deg, #2b3a72, #16204a); }

.tabs { display: flex; gap: 4px; margin: 22px 0 16px; background: var(--surface-2); padding: 4px; border-radius: 12px; border: 1px solid var(--border-soft); }
.tab { flex: 1; background: transparent; border: none; color: var(--muted); padding: 9px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; transition: 0.15s; }
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

form label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 13px; color: var(--text); font: inherit; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
textarea { resize: vertical; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 18px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar nav { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; text-align: left;
  background: transparent; border: none; color: var(--text-2);
  padding: 11px 13px; border-radius: 12px; cursor: pointer; font: inherit;
  font-weight: 500; font-size: 14.5px; transition: 0.15s; position: relative;
}
.nav-item .ico { width: 19px; height: 19px; color: var(--muted); transition: 0.15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 10px 20px -10px var(--primary-2); }
.nav-item.active .ico { color: #fff; }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); padding: 1px 9px; border-radius: 20px; }
.nav-item.active .nav-count { background: rgba(255, 255, 255, 0.22); color: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.user-card { display: flex; align-items: center; gap: 11px; padding: 6px 4px 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--primary-2), var(--navy)); color: #fff; font-weight: 700; font-size: 15px;
}
.user-meta { min-width: 0; display: flex; flex-direction: column; }
.user-email { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-actions { display: flex; gap: 4px; }

.content { padding: 28px 34px 44px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; }
.topbar h2 { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; }

.view { animation: fade 0.28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; max-width: 440px; }
.search-wrap .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search { padding-left: 42px; border-radius: 12px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-card); }
.panel.no-pad { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.panel-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; }
.stat-ico svg { width: 24px; height: 24px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-ico.blue { background: var(--primary-soft); } .stat-ico.blue svg { stroke: var(--primary-2); }
.stat-ico.amber { background: var(--amber-soft); } .stat-ico.amber svg { stroke: var(--amber); }
.stat-ico.red { background: var(--red-soft); } .stat-ico.red svg { stroke: var(--red); }
.stat-ico.green { background: var(--green-soft); } .stat-ico.green svg { stroke: var(--green); }
.stat-ico.teal { background: var(--teal-soft); } .stat-ico.teal svg { stroke: var(--teal); }
.stat-ico.violet { background: var(--violet-soft); } .stat-ico.violet svg { stroke: var(--violet); }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; display: block; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); }

/* Hero (gradient) stat card */
.stat-card.hero { background: linear-gradient(140deg, var(--primary-2), var(--navy)); border: none; color: #fff; }
.stat-card.hero .stat-label { color: rgba(255, 255, 255, 0.78); }
.stat-card.hero .stat-ico { background: rgba(255, 255, 255, 0.16); }
.stat-card.hero .stat-ico svg { stroke: #fff; }

/* ---------- Upcoming ---------- */
.upcoming { display: flex; flex-direction: column; gap: 9px; }
.upcoming-item {
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 13px;
  padding: 13px 16px; display: flex; justify-content: space-between; align-items: center; transition: 0.15s;
}
.upcoming-item:hover { border-color: var(--border); transform: translateX(2px); }
.upcoming-item .u-left { display: flex; align-items: center; gap: 12px; }

/* ---------- Table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { text-align: left; padding: 14px 20px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table td { padding: 15px 20px; border-bottom: 1px solid var(--border-soft); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover td { background: var(--surface-2); }

.cell-domain { display: flex; align-items: center; gap: 12px; }
.dom-avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; }
.dom-name { font-weight: 600; }
.dom-tech { font-size: 12px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--green-soft); color: #0f9d64; }
.badge.warn { background: var(--amber-soft); color: #c07d10; }
.badge.danger { background: var(--red-soft); color: #d43a52; }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.badge.info { background: var(--primary-soft); color: var(--primary); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.empty { padding: 64px 20px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ico { font-size: 42px; margin-bottom: 6px; opacity: 0.9; }
.empty p { font-weight: 600; font-size: 15px; }

/* ---------- Reports ---------- */
.reports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; gap: 7px; }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.bar-top .bar-label { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bar-top .bar-val { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--text-2); }
.bar-track { height: 9px; border-radius: 20px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--primary), var(--primary-3)); transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.bars .muted-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* ---------- Accounts grid ---------- */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.account-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-card); transition: transform 0.15s, box-shadow 0.15s;
}
.account-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.account-head .dom-avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 16px; }
.account-card h4 { font-size: 15.5px; font-weight: 700; }
.account-card .svc { color: var(--muted); font-size: 12.5px; }
.account-field { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; font-size: 13.5px; border-top: 1px solid var(--border-soft); }
.account-field .k { color: var(--muted); font-size: 12px; }
.account-field .v { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }
.account-field a.v { color: var(--primary-2); text-decoration: none; }
.account-actions { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(19, 26, 51, 0.42); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; animation: fade 0.2s ease; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 30px; width: 100%; max-width: 580px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.modal-card h3 { margin-bottom: 22px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.checks { grid-column: 1 / -1; display: flex; gap: 22px; margin-top: 6px; flex-wrap: wrap; }
.check { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; color: var(--text) !important; font-size: 14px !important; cursor: pointer; }
.check input { width: auto; accent-color: var(--primary-2); }
.pw-row { display: flex; gap: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; border: 1px solid var(--navy); padding: 13px 22px; border-radius: 13px; box-shadow: var(--shadow); z-index: 100; font-size: 14px; font-weight: 500; animation: slideUp 0.25s ease; }
.toast.err { background: var(--red); border-color: var(--red); }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border); background-clip: padding-box; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .sidebar nav { flex-direction: row; margin: 0; flex-wrap: wrap; }
  .nav-item .nav-count { display: none; }
  .sidebar-footer { margin: 0 0 0 auto; padding-top: 0; border: none; display: flex; align-items: center; gap: 8px; }
  .user-card { padding: 0; }
  .user-meta { display: none; }
  .content { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
}
