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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  background: #f5f5f5;
  color: #111;
}

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 700;
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  color: #111;
  text-decoration: none;
  display: block;
  letter-spacing: -0.01em;
}

.sidebar-nav { padding: 1rem 0; flex: 1; }

.nav-item {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 14px;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: #f7f7f7; color: #111; }
.nav-item.active { color: #111; font-weight: 600; border-left-color: #111; background: #f2f2f2; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid #e2e2e2; }

.main {
  flex: 1;
  padding: 2.25rem 2.75rem;
  max-width: 780px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
  color: #0a0a0a;
}

/* ── Section ── */
.section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.section-head {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid #ebebeb;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  background: #fafafa;
  border-radius: 8px 8px 0 0;
}
.section-body { padding: 1.4rem; }

/* ── Form ── */
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.4rem;
}
.label-hint { font-weight: 400; color: #888; margin-left: 0.3rem; }

input[type=text], input[type=password] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 15px;
  color: #111;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { outline: none; border-color: #555; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
input::placeholder { color: #bbb; }
input.err { border-color: #d0392b; }
input.shake { animation: shake 0.25s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  30%      { transform: translateX(-5px); }
  70%      { transform: translateX(5px); }
}

.field-hint { font-size: 13px; color: #888; margin-top: 0.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.parse-note { font-size: 13px; color: #2e7d32; margin-top: 0.35rem; display: none; }
.parse-note.show { display: block; }

.divider-text { text-align: center; font-size: 13px; color: #aaa; margin: 1rem 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover    { opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-dark    { background: #111; color: #fff; }
.btn-outline { background: #fff; border: 1px solid #ccc; color: #333; }
.btn-green   { background: #2e7d32; color: #fff; }

/* ── Alerts ── */
.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 5px;
  font-size: 14px;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert-error   { background: #fdf0f0; color: #b71c1c; border-color: #d0392b; }
.alert-success { background: #f1f8f1; color: #1b5e20; border-color: #2e7d32; }
.alert-info    { background: #f0f4ff; color: #1a3a8f; border-color: #3a5fd0; }

/* ── Table ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: #fafafa;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e2e2e2;
  white-space: nowrap;
}
td { padding: 0.65rem 1rem; border-bottom: 1px solid #f0f0f0; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.td-id { color: #bbb; font-size: 13px; }

/* ── Modal ── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35); z-index: 100;
  align-items: center; justify-content: center; padding: 1rem;
}
.overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 6px;
  width: 100%; max-width: 460px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-head {
  padding: 1rem 1.25rem; border-bottom: 1px solid #e2e2e2;
  font-weight: 600; font-size: 15px;
}
.modal-body { padding: 1.25rem; }
.modal-foot {
  padding: 1rem 1.25rem; border-top: 1px solid #e2e2e2;
  display: flex; justify-content: flex-end; gap: 0.75rem;
}

.review-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.review-table td { padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.review-table td:first-child { color: #777; width: 45%; font-size: 13px; }
.review-table td:last-child  { font-weight: 500; }
.review-table tr:last-child td { border-bottom: none; }

/* ── Misc ── */
.placeholder { padding: 2.5rem; text-align: center; color: #bbb; font-size: 14px; }
.badge-count {
  display: inline-block; background: #ebebeb; color: #555;
  font-size: 12px; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 10px; margin-left: 0.5rem;
}
.form-actions { margin-top: 1.5rem; }
.restart-desc { font-size: 14px; color: #555; line-height: 1.6; }
