:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #10b981;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 10% 0%, #eef2ff 0%, #f6f7fb 55%, #f6f7fb 100%);
  color: var(--text);
}
body > * {
  position: relative;
  z-index: 1;
}
.watermark {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 160px;
  height: 160px;
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: contain;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
}
.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav .active { color: var(--text); font-weight: 600; }
.spacer { flex: 1; }
.badge {
  font-size: 12px;
  color: #fff;
  background: var(--primary);
  padding: 6px 10px;
  border-radius: 999px;
}
.demo-badge {
  background: #111827;
}
.expiring-highlight {
  margin-left: auto;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 10;
}
.toast.t180 { background: #0f172a; }
.toast.t90 { background: #b45309; }
.toast.t60 { background: #c2410c; }
.toast.t30 { background: #b91c1c; }
.demo-toast {
  background: #0f172a;
}
.link {
  color: var(--primary-dark);
  font-size: 13px;
  text-decoration: none;
  margin-right: 8px;
}
.link:hover { text-decoration: underline; }
.topbar-action {
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.topbar-action:hover {
  background: #e5e9f0;
}
.domain-garden-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}
.domain-garden-logo {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.domain-garden-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  width: 140px;
}
.link.danger {
  color: var(--danger);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.actions {
  white-space: nowrap;
}
.registrar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.thumb {
  width: 84px;
  height: 100%;
  max-height: 64px;
  object-fit: cover;
  border-radius: 0;
  border: none;
  margin-right: 0;
}
.thumb.placeholder {
  display: inline-block;
  background: #f8fafc;
  border: 1px dashed var(--line);
}
.favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
}
.favicon.placeholder {
  display: inline-block;
  background: transparent;
  border: 1px dashed var(--line);
}
.registrar-logo {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}
.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  fill: currentColor;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f1f4f8;
  color: #475569;
  cursor: pointer;
}
.icon-button:hover {
  background: #e7ebf2;
  color: #1f2937;
}
.inline {
  display: inline;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 15;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  padding: 16px;
  z-index: 20;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.drawer-title {
  font-weight: 700;
  font-size: 18px;
}
.drawer {
  overflow: auto;
}
.drawer-body {
  overflow: visible;
  padding-right: 6px;
}
.demo-drawer .drawer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}
.drawer-section {
  padding-right: 6px;
}
.account-section {
  margin-top: 18px;
}
.drawer-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.drawer.open {
  transform: translateX(0);
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.shortcuts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 300px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: none;
  z-index: 30;
}
.shortcuts.open { display: block; }
.shortcuts-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-bottom: 10px;
}
.shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}
.version {
  position: fixed;
  left: 12px;
  bottom: 10px;
  font-size: 11px;
  color: var(--muted);
}

.container {
  max-width: 1200px;
  margin: 24px auto 60px;
  padding: 0 24px;
  background: transparent;
}
.demo-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 10px 0 18px;
  flex-wrap: wrap;
}
.header h1 {
  margin: 0;
  font-size: 28px;
}
.header .hint {
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.select, .btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
}
.btn.danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
tbody tr:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
tbody tr.selected {
  background: #eef2ff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.sort-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.sort-btn::after {
  content: "⇅";
  margin-left: 6px;
  font-size: 11px;
  color: #94a3b8;
}
.sort-btn.asc::after { content: "↑"; }
.sort-btn.desc::after { content: "↓"; }
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
tbody tr {
  height: 64px;
}
.domain-cell {
  padding: 0 16px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
}
.domain-media {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 110px;
  flex: 0 0 110px;
}
.domain-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.domain-registrar-line {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.edit-label {
  display: none;
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
}
.domain-registrar {
  display: none;
  color: var(--muted);
  font-size: 12px;
}
.muted { color: var(--muted); }
.pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill.ok { background: #ecfdf5; color: var(--ok); }
.pill.warn { background: #fff7ed; color: #f97316; }
.pill.danger { background: #fef2f2; color: var(--danger); }
.pill.unknown { background: #fef9c3; color: #a16207; }

.footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}

.auth-card {
  max-width: 420px;
  margin: 80px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.auth-title {
  font-size: 22px;
  font-weight: 700;
}
.auth-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 16px;
}
.auth-label {
  display: block;
  font-size: 13px;
  margin: 10px 0 6px;
}
.auth-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.date-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.date-input {
  padding-right: 38px;
}
.date-btn {
  position: absolute;
  right: 6px;
  border: 1px solid var(--line);
  background: #f1f4f8;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.date-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.auth-button {
  width: 100%;
  margin-top: 14px;
}
.auth-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 4px;
}
.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}
.auth-links {
  margin-top: 10px;
  font-size: 12px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 13px;
  margin-bottom: 8px;
}
.col-hidden {
  display: none;
}

@media (max-width: 1200px) {
  .container { padding: 0 20px; }
  .topbar-inner { padding: 12px 20px; }
  .domain-garden-input { width: 120px; }
}

@media (max-width: 1050px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .controls .btn.primary {
    grid-column: 1 / -1;
    width: 100%;
  }
  .domain-garden-search {
    order: 3;
  }
  .topbar-action {
    order: 4;
  }
}

@media (max-width: 900px) {
  tbody {
    background: transparent;
    padding: 0;
    border-radius: 0;
  }
  .controls { grid-template-columns: 1fr; }
  .nav { display: none; }
  .domain-garden-search,
  .topbar-action {
    display: none;
  }
  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }
  .topbar-inner {
    gap: 10px 14px;
    justify-content: space-between;
  }
  .spacer { display: none; }
  .domain-garden-search {
    width: 100%;
  }
  .domain-garden-input {
    width: 100%;
  }
  thead { display: none; }
  table, tbody { display: block; width: 100%; }
  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 12px;
    row-gap: 14px;
    height: auto;
    padding: 16px;
    border-bottom: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
  }
  tbody td {
    display: block;
    width: 100%;
    border-bottom: none;
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.4;
  }
  tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  tbody td[data-col="domain"] { grid-column: 1 / -1; }
  tbody td[data-col="registrar"] { grid-column: 1 / -1; }
  tbody td[data-col="expiration"] { grid-column: 1; }
  tbody td[data-col="days"] { grid-column: 2; }
  tbody td[data-col="status"] { grid-column: 3; }
  tbody td[data-col="email"] { grid-column: 1; }
  tbody td[data-col="project"] { grid-column: 2; }
  tbody td.actions { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; }
  tbody td[data-col="expiration"]::before,
  tbody td[data-col="days"]::before,
  tbody td[data-col="status"]::before { margin-bottom: 2px; }
  tbody td[data-col="domain"]::before {
    display: none;
  }
  tbody td[data-col="email"],
  tbody td[data-col="project"] { display: none; }
  tbody td.actions::before { display: none; }
  tbody td[data-col="registrar"] {
    display: none;
  }
  tbody td:not([data-col="domain"]):not([data-col="registrar"]):not([data-col="expiration"]):not([data-col="days"]):not([data-col="status"]) {
    grid-column: 1 / -1;
  }
  .domain-cell {
    padding: 0;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .domain-media {
    width: calc(100% + 32px);
    flex: 0 0 auto;
    justify-content: space-between;
    margin: -16px -16px 0;
  }
  .domain-media .thumb {
    width: 100%;
    height: 160px;
    max-height: none;
    border-radius: 14px 14px 0 0;
    object-fit: cover;
    object-position: top;
  }
  tbody td[data-col="domain"] {
    padding: 0;
  }
  .domain-title {
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    gap: 10px;
  }
  .domain-registrar-line {
    display: inline-flex;
  }
  .domain-registrar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
  }
  .domain-registrar .registrar-logo {
    width: 16px;
    height: 16px;
  }
  .pill {
    font-size: 12px;
    padding: 6px 10px;
  }
  .actions { margin-top: 6px; }
  .actions .icon-button {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    justify-content: center;
    gap: 8px;
    background: #f1f5f9;
  }
  .edit-label {
    display: inline-flex;
  }

  .table-card {
    background: transparent;
    border: none;
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .container { margin-top: 16px; }
  .header h1 { font-size: 24px; }
  .search { box-shadow: none; }
  .table-card { border-radius: 12px; }
}

@media (max-width: 520px) {
  .topbar-inner { padding: 10px 14px; }
  .container { padding: 0 14px; }
  .domain-media { gap: 6px; }
  .domain-media .thumb {
    width: 100%;
    height: 140px;
  }
  .auth-card { margin-top: 40px; }
}
.burger {
  display: none;
  border: 1px solid var(--line);
  background: #eef2f6;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
}
.topbar-menu {
  display: none;
  position: absolute;
  right: 16px;
  top: 54px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 50;
  min-width: 200px;
}
.topbar-menu.open { display: block; }
.topbar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.topbar-menu-item:hover { background: #f1f5f9; }
.topbar-menu-item.danger { color: var(--danger); }

@media (max-width: 900px) {
  .burger { display: inline-flex !important; }
}
