:root {
  --ink: #17322c;
  --muted: #6d7c78;
  --line: #e4eae7;
  --surface: #ffffff;
  --canvas: #f5f7f4;
  --green-950: #0e342b;
  --green-800: #185345;
  --green-600: #2c816c;
  --green-100: #dff2ea;
  --lime: #cce970;
  --amber: #e9a834;
  --amber-100: #fff3d8;
  --blue: #5784c3;
  --blue-100: #e8f0fb;
  --shadow: 0 9px 28px rgba(30, 55, 47, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { width: 1.25rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: var(--green-950);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 31px;
  color: #fff;
  font: 800 20px "Manrope", sans-serif;
  letter-spacing: -.6px;
  text-decoration: none;
}
.brand > span:last-child > span { color: var(--lime); }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  color: var(--green-950);
}
.brand-mark svg { width: 22px; fill: currentColor; stroke: none; }
.nav-label {
  margin: 0 10px 9px;
  color: #7fa097;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.regions-label { margin-top: 29px; }
.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #abc0ba;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: rgba(204, 233, 112, .13); }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-icon { display: grid; place-items: center; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-count {
  min-width: 24px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  color: #829e96;
  font-size: 10px;
  text-align: center;
}
.nav-item.active .nav-count { background: var(--lime); color: var(--green-950); }
.region-dot { width: 7px; height: 7px; border-radius: 50%; background: #4b766b; }
.sidebar-footer { margin-top: auto; }
.storage-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 7px 10px;
  color: #b9ccc7;
}
.storage-status > span:last-child { display: grid; gap: 1px; }
.storage-status strong { font-size: 10px; font-weight: 700; }
.storage-status small { color: #66887f; font-size: 8px; }
.storage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(204,233,112,.09);
}
.storage-status.saving .storage-dot { background: var(--amber); }
.storage-status.offline .storage-dot { background: var(--amber); }
.storage-status.error .storage-dot { background: #e46b6b; }
.mini-progress {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.mini-progress-head { display: flex; justify-content: space-between; color: #c7d5d1; font-size: 11px; }
.mini-progress-head strong { color: var(--lime); }
.progress-track { height: 5px; margin: 11px 0 8px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.09); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--lime); transition: width .4s ease; }
.mini-progress p { margin: 0; color: #6f9188; font-size: 10px; }
.export-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: #819e96;
  font-size: 11px;
}
.export-button:hover { color: #fff; }
.export-button svg { width: 15px; }

main { min-height: 100vh; margin-left: 244px; }
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 31px 3.2vw 25px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.7);
}
.eyebrow { display: none; color: var(--green-600); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.topbar-copy h1 { margin: 0; font: 800 25px "Manrope", sans-serif; letter-spacing: -.8px; }
.topbar-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  font-size: 12px;
}
.primary-button { margin-left: auto; background: var(--green-800); color: #fff; box-shadow: 0 6px 15px rgba(24,83,69,.16); }
.primary-button:hover { background: #123f35; transform: translateY(-1px); }
.primary-button svg { width: 16px; }
.secondary-button { border-color: var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { background: #f5f8f6; }
.menu-button { display: none; border: 0; background: transparent; color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 13px;
  padding: 22px 3.2vw 8px;
}
.stat-card {
  position: relative;
  min-height: 143px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(35, 54, 48, .035);
}
.stat-card.featured { display: flex; align-items: center; justify-content: space-between; border-color: #d9e7d1; background: linear-gradient(135deg, #f4f9e9, #eef8ed); }
.stat-label { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-value { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; }
.stat-value strong { font: 800 29px "Manrope", sans-serif; letter-spacing: -1px; }
.stat-value span { color: #92a09c; font-size: 13px; font-weight: 600; }
.stat-card p { margin: 8px 0 0; color: #899692; font-size: 10px; }
.stat-icon {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 9px;
}
.stat-icon svg { width: 17px; }
.stat-icon.green { background: var(--green-100); color: var(--green-600); }
.stat-icon.amber { background: var(--amber-100); color: #c88920; }
.stat-icon.blue { background: var(--blue-100); color: var(--blue); }
.dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; }
.green-dot { background: #55aa83; }
.amber-dot { background: #e9a834; }
.coverage-ring {
  position: relative;
  display: grid;
  width: 65px;
  height: 65px;
  flex: 0 0 auto;
  margin-left: 12px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green-600) 0%, #dfe8dc 0);
}
.coverage-ring::before { content: ""; position: absolute; width: 51px; height: 51px; border-radius: 50%; background: #f1f8eb; }
.coverage-ring span { position: relative; z-index: 1; font: 700 11px "Manrope", sans-serif; }

.portfolio-section { padding: 23px 3.2vw 55px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font: 800 18px "Manrope", sans-serif; letter-spacing: -.45px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-heading p strong { margin-left: 3px; color: var(--green-600); font-weight: 700; }
.toolbar { display: flex; gap: 9px; }
.search-box { display: flex; width: 235px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #899692; }
.search-box:focus-within { border-color: #78a899; box-shadow: 0 0 0 3px rgba(44,129,108,.08); }
.search-box svg { width: 15px; }
.search-box input { width: 100%; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box kbd {
  padding: 1px 5px;
  border: 1px solid #dce3e0;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f7f9f8;
  color: #8b9894;
  font: 9px "DM Sans", sans-serif;
}
.search-box.has-value kbd { display: none; }
.search-box button {
  display: none;
  padding: 2px;
  border: 0;
  background: transparent;
  color: #8b9894;
}
.search-box.has-value button { display: grid; }
.search-box button:hover { color: var(--ink); }
.search-box button svg { width: 13px; }
.toolbar select { padding: 0 28px 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; color: #667570; font-size: 11px; }

.country-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.country-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(35,54,48,.025);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.country-card:hover { transform: translateY(-2px); border-color: #ccd9d4; box-shadow: var(--shadow); }
.country-card.complete { border-color: #d2e6dd; }
.country-card.has-purchase {
  position: relative;
  border-color: #b9dccc;
  background: linear-gradient(135deg, #fff 68%, #f1faf5);
  box-shadow: 0 5px 18px rgba(37, 116, 91, .09);
}
.country-card.has-purchase::before {
  content: "";
  position: absolute;
  inset: 11px auto 11px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--green-600);
}
.country-head { display: flex; align-items: center; gap: 10px; }
.flag-wrap { position: relative; flex: 0 0 auto; }
.flag { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #edf0ee; border-radius: 9px; background: #f9faf9; font-size: 19px; }
.purchased-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green-600);
  color: #fff;
  box-shadow: 0 2px 5px rgba(21,83,68,.25);
}
.purchased-badge svg { width: 9px; stroke-width: 3; }
.country-name { min-width: 0; }
.country-name h3 { margin: 0; overflow: hidden; font: 700 13px "Manrope", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.country-name p { margin: 2px 0 0; color: #96a19e; font-size: 9px; }
.tld-badge { margin-left: auto; padding: 4px 7px; border-radius: 6px; background: #f0f4f2; color: #557069; font: 700 9px "Manrope", sans-serif; }
.country-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef1ef; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; color: #87948f; font-size: 9px; font-weight: 600; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #bbc5c1; }
.status-chip.pending { color: #b87916; }
.status-chip.pending::before { background: var(--amber); }
.status-chip.complete { color: #337c68; }
.status-chip.complete::before { background: #4ba47f; }
.status-chip.bought { color: #24745e; font-weight: 700; }
.status-chip.bought::before { background: #2c816c; box-shadow: 0 0 0 3px #e3f3ec; }
.add-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--green-600);
  font-size: 9px;
  font-weight: 700;
}
.add-small:hover { color: var(--green-950); }
.add-small svg { width: 12px; }
.domain-list { display: grid; gap: 6px; margin-top: 11px; }
.domain-row { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; background: #f7f9f8; }
.domain-check { position: relative; display: grid; width: 16px; height: 16px; flex: 0 0 auto; place-items: center; cursor: pointer; }
.domain-check input { position: absolute; opacity: 0; }
.checkmark { display: grid; width: 15px; height: 15px; place-items: center; border: 1.5px solid #c1ccc8; border-radius: 5px; background: #fff; color: #fff; }
.domain-check input:checked + .checkmark { border-color: var(--green-600); background: var(--green-600); }
.checkmark svg { width: 10px; stroke-width: 2.5; opacity: 0; }
.domain-check input:checked + .checkmark svg { opacity: 1; }
.domain-text { min-width: 0; overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.domain-row.purchased .domain-text { color: #7f8d89; text-decoration: line-through; }
.delete-domain { display: grid; margin-left: auto; padding: 2px; border: 0; background: transparent; color: #a5afac; opacity: 0; }
.domain-row:hover .delete-domain { opacity: 1; }
.delete-domain:hover { color: #c45757; }
.delete-domain svg { width: 12px; }
.empty-state { padding: 60px 20px; border: 1px dashed #cfd9d5; border-radius: 14px; text-align: center; }
.empty-state > span { font-size: 30px; }
.empty-state h3 { margin: 10px 0 5px; font: 700 16px "Manrope", sans-serif; }
.empty-state p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }

dialog { width: min(470px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 25px 80px rgba(6,31,24,.26); }
dialog::backdrop { background: rgba(5,28,23,.55); backdrop-filter: blur(3px); }
#domainForm { padding: 25px; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; }
.dialog-kicker { color: var(--green-600); font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.dialog-head h2 { margin: 4px 0 4px; font: 800 21px "Manrope", sans-serif; }
.dialog-head p { margin: 0 0 22px; color: var(--muted); font-size: 11px; }
.icon-button { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #72807c; }
.icon-button:hover { background: #f5f7f6; }
.icon-button svg { width: 15px; }
.field { margin-bottom: 16px; }
.field > label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.select-wrap, .domain-input-wrap { display: flex; align-items: center; border: 1px solid #dce3e0; border-radius: 9px; background: #fff; }
.select-wrap:focus-within, .domain-input-wrap:focus-within { border-color: #68a18f; box-shadow: 0 0 0 3px rgba(44,129,108,.08); }
.select-wrap > span { padding-left: 12px; font-size: 18px; }
.field select, .field input { width: 100%; padding: 11px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.domain-input-wrap > span { flex: 0 0 auto; margin-right: 8px; padding: 4px 7px; border-radius: 5px; background: #eff4f1; color: #668078; font-size: 9px; font-weight: 700; }
.field small { display: block; margin-top: 5px; color: #98a39f; font-size: 9px; }
.purchase-toggle { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.purchase-toggle input { position: absolute; opacity: 0; }
.checkbox-ui { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border: 1.5px solid #bdc8c4; border-radius: 5px; color: #fff; }
.checkbox-ui svg { width: 12px; stroke-width: 2.4; opacity: 0; }
.purchase-toggle input:checked + .checkbox-ui { border-color: var(--green-600); background: var(--green-600); }
.purchase-toggle input:checked + .checkbox-ui svg { opacity: 1; }
.purchase-toggle strong, .purchase-toggle small { display: block; }
.purchase-toggle strong { font-size: 11px; }
.purchase-toggle small { margin-top: 2px; color: #8d9995; font-size: 9px; }
.form-error { min-height: 14px; margin: 8px 0 0; color: #c54e4e; font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.dialog-actions .primary-button { margin: 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 10px; background: var(--green-950); color: #fff; font-size: 11px; font-weight: 600; box-shadow: 0 14px 35px rgba(7,37,29,.25); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--lime); color: var(--green-950); }
.toast-icon svg { width: 12px; stroke-width: 2.4; }
.overlay { display: none; }

@media (min-width: 1500px) {
  .country-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .country-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .overlay { position: fixed; inset: 0; z-index: 15; background: rgba(5,28,23,.45); }
  .overlay.show { display: block; }
  main { margin-left: 0; }
  .menu-button { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; }
  .topbar { padding: 20px; }
  .topbar-copy p { display: none; }
  .topbar-copy h1 { font-size: 19px; }
  .primary-button { padding: 10px 12px; }
  #addDomainButton { font-size: 0; }
  #addDomainButton svg { width: 18px; }
  .stats, .portfolio-section { padding-left: 20px; padding-right: 20px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .toolbar { width: 100%; }
  .search-box { width: 100%; }
  .toolbar select { max-width: 145px; }
}
@media (max-width: 540px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 130px; padding: 15px; }
  .stat-card.featured { grid-column: 1 / -1; }
  .stats .stat-card:last-child { grid-column: 1 / -1; min-height: 110px; }
  .country-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; }
  .toolbar select { min-height: 38px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
