:root {
  --ink: #0b1220;
  --muted: #5c6b7a;
  --accent: #0c8f7c;
  --accent-deep: #0a6f61;
  --accent-soft: rgba(12, 143, 124, 0.12);
  --line: rgba(11, 18, 32, 0.09);
  --paper: #f4f7f6;
  --surface: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #0a6f61;
  --ok-bg: #e7f6f2;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 12px 32px rgba(11, 18, 32, 0.06);
  --radius: 14px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body.panel-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
.panel-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(12, 143, 124, 0.16), transparent 60%),
    radial-gradient(ellipse 40% 35% at 100% 10%, rgba(11, 18, 32, 0.04), transparent 55%),
    linear-gradient(180deg, #eef4f2 0%, var(--paper) 42%);
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.logo span { color: var(--accent-deep); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.login-wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: 72px 24px 48px;
  animation: rise 0.55s ease both;
}
.login-wrap h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin: 20px 0 8px;
}
.sub { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.err, .alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin: 0 0 16px;
}
.alert { display: grid; gap: 4px; }
.alert strong { font-weight: 700; }
.login-form label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.login-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  margin-top: 6px;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--accent-deep); }
.btn:disabled { opacity: 0.65; cursor: wait; }
.btn-sm { width: auto; padding: 8px 12px; font-size: 0.85rem; margin-top: 0; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  width: auto;
  margin-top: 0;
}
.btn-ghost:hover { background: rgba(11, 18, 32, 0.04); }
.btn-primary {
  width: auto;
  min-width: 160px;
  margin-top: 0;
  box-shadow: 0 8px 20px rgba(12, 143, 124, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-danger { background: var(--danger); width: auto; margin-top: 0; }
.btn-danger:hover { background: #912018; }
.hint { margin-top: 24px; font-size: 0.9rem; }
.hint a { color: var(--muted); }

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 24px;
}
.panel-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
  margin-left: 20px;
}
.panel-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.panel-nav a:hover { color: var(--ink); background: rgba(11,18,32,0.04); }
.panel-nav a.is-active {
  color: var(--accent-deep);
  background: var(--accent-soft);
}
.panel-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-left: auto;
}
.user-chip {
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(11,18,32,0.04);
  padding: 6px 10px;
  border-radius: 999px;
}
.dash {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 24px 72px;
  animation: rise 0.55s ease both;
}
.dash-wide { max-width: 720px; }
.dash-form { max-width: 520px; }
.dash h1 {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
  margin: 0 0 8px;
  font-size: 1.75rem;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-head-stack {
  display: block;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.url-preview {
  flex: 0 1 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.url-preview-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.url-preview strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-deep);
  word-break: break-all;
  line-height: 1.4;
}
.url-preview-inline {
  flex: none;
  width: 100%;
  margin-top: 14px;
  box-sizing: border-box;
}
.dash-block {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.dash-block h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 10px;
}
.empty { color: var(--muted); margin: 0; }
.links { margin: 0; padding-left: 18px; }
.links a { color: var(--accent-deep); font-weight: 600; }
.ok {
  background: var(--ok-bg);
  color: var(--ok);
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.muted { color: var(--muted); font-size: 0.88rem; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  word-break: break-all;
  color: var(--accent-deep);
  font-weight: 600;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(11, 18, 32, 0.05);
  padding: 0.12em 0.4em;
  border-radius: 5px;
}

.site-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.site-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.site-table th,
.site-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.site-table tr:last-child td { border-bottom: 0; }
.site-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(11,18,32,0.02);
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-section {
  background: var(--surface);
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 12px;
  padding: 20px 20px 6px;
}
.form-h {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.form-h .opt {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.field-label em {
  color: var(--accent-deep);
  font-style: normal;
  font-weight: 700;
}
.field > input,
.host-port > input,
.create-form input[type="text"],
.create-form input[type="password"],
.create-form input[type="url"],
.create-form input:not([type]) {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #c5ced6;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}
.field > input:focus,
.host-port > input:focus,
.create-form input[type="text"]:focus,
.create-form input[type="password"]:focus,
.create-form input[type="url"]:focus,
.create-form input:not([type]):focus,
.input-affix:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.input-affix {
  display: flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid #c5ced6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}
.input-affix input,
.create-form .input-affix input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  height: 100% !important;
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  padding: 0 12px;
  background: transparent !important;
}
.input-affix .affix {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  background: #f0f3f2;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  border-left: 1px solid rgba(11, 18, 32, 0.12);
  white-space: nowrap;
}
.host-port {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
}
.port-input { text-align: center; font-variant-numeric: tabular-nums; }
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding: 16px 0 8px;
}
.form-footer-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}
.form-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-footer-actions .btn { margin-top: 0; width: auto; }
.form-footer-actions .btn-primary { flex: 1; }

.info-grid { display: grid; gap: 16px; }
.info-grid .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.meta-list { margin: 0; padding: 0; list-style: none; }
.meta-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log-box {
  background: #0b1220;
  color: #d7e2ec;
  padding: 12px 14px;
  border-radius: 10px;
  overflow: auto;
  font-size: 0.78rem;
  max-height: 240px;
  margin: 0 0 16px;
}
.danger-zone { border-top-color: rgba(180, 35, 24, 0.22); }
.panel-top .btn { width: auto; margin-top: 0; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.select-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #c5ced6;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
}
.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #c5ced6;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(11,18,32,0.06);
  color: var(--muted);
}
.badge-pending { background: #fff4e5; color: #b54708; }
.badge-payment_notified { background: #eef2ff; color: #3538cd; }
.badge-paid { background: #ecfdf3; color: #027a48; }
.badge-active { background: #e7f6f2; color: #0a6f61; }
.badge-expired { background: #fef3f2; color: #b42318; }
.badge-cancelled { background: #f2f4f7; color: #475467; }

.pkg-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.pkg-card {
  display: block;
  cursor: pointer;
  position: relative;
}
.pkg-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pkg-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border: 1px solid #c5ced6;
  border-radius: 12px;
  background: #fff;
  min-height: 118px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pkg-card input:checked + .pkg-card-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pkg-card.is-hot .pkg-card-body { border-color: rgba(12, 143, 124, 0.35); }
.pkg-hot {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.pkg-price {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.pkg-meta { font-size: 0.84rem; color: var(--muted); font-weight: 600; }
.pkg-renew {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.pkg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pkg-view {
  background: #fff;
  border: 1px solid rgba(11,18,32,0.12);
  border-radius: 12px;
  padding: 18px;
}
.pkg-view.is-hot { border-color: rgba(12, 143, 124, 0.4); }
.pkg-view h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 6px 0 4px;
}
.pkg-view .btn { width: auto; margin-top: 12px; }
.plan-renew {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}
.alert a { color: inherit; font-weight: 700; }
.textarea-input {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid #c5ced6;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
.textarea-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 4px 0 14px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; }
.is-hot-section { border-color: rgba(12, 143, 124, 0.35) !important; }
.pkg-edit-form .form-section { margin-bottom: 0; }

@media (max-width: 820px) {
  .page-head { flex-direction: column; }
  .url-preview { flex: 1 1 auto; width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .host-port { grid-template-columns: minmax(0, 1fr) 80px; }
  .form-footer-actions { width: 100%; }
  .form-footer-actions .btn { flex: 1; }
  .panel-top { flex-wrap: wrap; }
  .panel-nav { margin-left: 0; order: 3; width: 100%; }
  .pkg-pick, .pkg-grid { grid-template-columns: 1fr; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
}
