/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1d23;
  line-height: 1.6;
}
a { color: #3b5bdb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e6ea;
  padding: 0 1.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-size: 1.1rem; font-weight: 700; color: #1a1d23; }
.site-header nav { display: flex; gap: 1rem; align-items: center; }
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center;
  padding: .45rem .9rem;
  border-radius: 6px;
  border: 1px solid #ced4da;
  background: #fff;
  color: #1a1d23;
  font-size: .875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn:hover { background: #f1f3f5; text-decoration: none; }
.btn-primary { background: #3b5bdb; color: #fff; border-color: #3b5bdb; }
.btn-primary:hover { background: #2f4ac4; }
.btn-danger { background: #e03131; color: #fff; border-color: #c92a2a; }
.btn-danger:hover { background: #c92a2a; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-link {
  background: none; border: none; color: #3b5bdb;
  cursor: pointer; font-size: inherit; padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.75rem; }
.header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { display: block; font-size: .85rem; color: #868e96; margin-bottom: .25rem; }
.breadcrumb:hover { color: #3b5bdb; }

/* ---- Cards ---- */
.card {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 1.5rem;
}
.mt-lg { margin-top: 2rem; }

/* ---- Feed list ---- */
.feed-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.feed-card {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: box-shadow .15s;
}
.feed-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.feed-title { font-size: 1.05rem; font-weight: 600; }
.feed-desc { color: #495057; font-size: .875rem; margin-top: .2rem; }
.feed-meta { font-size: .8rem; color: #868e96; margin-top: .25rem; }
.feed-card-actions { flex-shrink: 0; }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e6ea;
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: .6rem 1.25rem;
  font-size: .95rem;
  font-weight: 500;
  color: #868e96;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: #1a1d23; }
.tab-btn.active { color: #3b5bdb; border-bottom-color: #3b5bdb; }
.tab-panel { }
.tab-panel.hidden { display: none; }

/* ---- Advanced disclosure ---- */
details { border: 1px solid #e2e6ea; border-radius: 6px; padding: .75rem 1rem; }
details[open] { padding-bottom: 1rem; }
.advanced-toggle {
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: #495057;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  user-select: none;
}
.advanced-toggle::-webkit-details-marker { display: none; }
.advanced-toggle::before { content: '▶'; font-size: .7rem; transition: transform .15s; }
details[open] .advanced-toggle::before { transform: rotate(90deg); }

/* ---- Item list ---- */
.item-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 6px;
}
.item-title { font-weight: 500; display: block; }
.item-url { font-size: .8rem; color: #868e96; }
.item-date { font-size: .8rem; color: #868e96; }
.inline-form { flex-shrink: 0; }

/* ---- Forms ---- */
.form-grid { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; font-weight: 500; color: #343a40; }
label input, label textarea, label select {
  padding: .5rem .75rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: #1a1d23;
  transition: border-color .15s;
  width: 100%;
}
label input:focus, label textarea:focus { outline: none; border-color: #3b5bdb; box-shadow: 0 0 0 3px rgba(59,91,219,.1); }
.hint { font-weight: 400; color: #868e96; font-size: .8rem; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
hr { border: none; border-top: 1px solid #e2e6ea; margin: 1.25rem 0; }

/* ---- Auth box ---- */
.auth-box {
  max-width: 400px;
  margin: 5rem auto;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  padding: 2rem;
}
.auth-box h1 { margin-bottom: 1.25rem; font-size: 1.4rem; }
.auth-box .form-grid { gap: 1rem; }
.auth-box .btn-primary { width: 100%; justify-content: center; margin-top: .25rem; }

/* ---- Misc ---- */
.error {
  background: #fff5f5;
  border: 1px solid #ffc9c9;
  color: #c92a2a;
  padding: .6rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.empty-state { color: #868e96; font-style: italic; }

/* ---- Ping log ---- */
.ping-url-note { margin-bottom: 1.25rem; color: #495057; font-size: .9rem; }
.ping-url-note code { background: #f1f3f5; padding: .1em .35em; border-radius: 4px; font-size: .85em; }
.ping-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.ping-table th { text-align: left; padding: .5rem .75rem; border-bottom: 2px solid #e2e6ea; color: #495057; font-weight: 600; }
.ping-table td { padding: .5rem .75rem; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
.ping-table tr:last-child td { border-bottom: none; }
.ping-time { white-space: nowrap; color: #868e96; font-size: .8rem; }
.ping-attempt { text-align: center; }
.ping-error { color: #c92a2a; font-size: .8rem; max-width: 220px; word-break: break-all; }
.ping-url { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; padding: .15em .55em; border-radius: 4px; font-size: .78rem; font-weight: 600; }
.badge-success { background: #d3f9d8; color: #2b8a3e; }
.badge-retry   { background: #fff3bf; color: #805b10; }
.badge-danger  { background: #ffe3e3; color: #c92a2a; }
.badge-pending { background: #e9ecef; color: #868e96; }
