/* admin.caltoya.com — inherits caltoya.com warm-dark + orange palette */
:root {
  --bg:         #0b0a0a;
  --bg-soft:    #14110f;
  --card:       #1a1614;
  --card-2:     #221c19;
  --card-line:  rgba(255,255,255,0.06);
  --text:       #f4ede4;
  --muted:      #8a8278;
  --muted-2:    #6f675e;
  --orange:     #f97316;
  --orange-deep:#ea580c;
  --orange-soft:rgba(249,115,22,0.12);
  --blue:       #4a90c8;
  --green:      #6dbf6d;
  --red:        #e26b6b;
  --gold:       #d4a574;
  --display:    "Lilita One","Bagel Fat One","Bowlby One SC","Fredoka","Trebuchet MS",sans-serif;
  --ui:         "Inter","Avenir Next","Segoe UI",system-ui,sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--ui);
  background-color: #08070a;
  background-image:
    radial-gradient(900px 600px at 85% 105%, rgba(249,115,22,0.18) 0%, rgba(249,115,22,0) 60%),
    radial-gradient(700px 500px at -10% 60%, rgba(98,40,215,0.12) 0%, rgba(98,40,215,0) 55%),
    radial-gradient(500px 400px at 50% 100%, rgba(238,42,123,0.08) 0%, rgba(238,42,123,0) 60%);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { padding: 4rem; text-align: center; color: var(--muted); }

/* ----- layout ----- */
.app {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(11,10,10,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-line);
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--orange);
  letter-spacing: 0.02em;
}
.brand .dot { color: var(--text); }
.health {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.health .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.health.ok .pulse    { background: var(--green); box-shadow: 0 0 8px var(--green); }
.health.stale .pulse { background: var(--gold);  box-shadow: 0 0 8px var(--gold); }
.health.down .pulse  { background: var(--red);   box-shadow: 0 0 10px var(--red); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.nav {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--card-line);
  overflow-x: auto;
  background: rgba(11,10,10,0.6);
}
.nav a {
  display: inline-block;
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.main {
  padding: 1.5rem 1.25rem 4rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ----- common ----- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; color: var(--text); margin: 0; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.page-title { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1.25rem; }
.page-title h1 { text-transform: lowercase; }
.page-title .subtitle { color: var(--muted); font-size: 0.9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 14px;
  padding: 1.25rem;
}
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .main { padding: 1rem 0.85rem 4rem; }
}

.kv { display: flex; flex-direction: column; gap: 0.15rem; }
.kv .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.kv .v {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--text);
}
.kv .v.accent { color: var(--orange); }
.kv .v.big { font-size: 2.2rem; }
.kv .v.small { font-size: 1.2rem; font-family: var(--ui); font-weight: 600; }

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pill.muted { background: rgba(255,255,255,0.05); color: var(--muted); }
.pill.fanclub { background: rgba(212,165,116,0.15); color: var(--gold); }
.pill.green { background: rgba(109,191,109,0.12); color: var(--green); }

.bar {
  position: relative;
  height: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-deep));
  border-radius: inherit;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--card-line);
}
th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-variant-numeric: tabular-nums; }
.amt { color: var(--orange); font-weight: 600; }
.muted { color: var(--muted); }

input[type=text], input[type=search], input[type=number], textarea, select {
  background: var(--bg-soft);
  border: 1px solid var(--card-line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font: inherit;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--orange);
}
button, .btn {
  background: var(--orange);
  color: #1a0f08;
  border: 0;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--card-line);
}
button.ghost:hover { color: var(--text); border-color: var(--text); }
button.danger { background: var(--red); color: #1a0808; }
button.btn-sm { padding: 0.3rem 0.55rem; font-size: 0.75rem; margin-left: 0.25rem; }

.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
  border: 1px solid transparent;
}
.chip.active { background: var(--orange-soft); color: var(--orange); border-color: var(--orange); }

.row-link { cursor: pointer; }
.row-link:hover { background: rgba(255,255,255,0.02); }

.empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
  animation: pulse 1.5s infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.chat-line {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.85rem;
}
.chat-line .who { color: var(--orange); font-weight: 600; margin-right: 0.4rem; }
.chat-line .who.mod { color: var(--gold); }
.chat-line .who.bc  { color: var(--blue); }
.chat-line .when { color: var(--muted-2); font-size: 0.7rem; margin-left: 0.4rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.85rem; }
.section-head h2 { margin: 0; }
.section-head .meta { color: var(--muted); font-size: 0.8rem; }

.error-banner {
  background: rgba(226,107,107,0.1);
  border: 1px solid rgba(226,107,107,0.3);
  color: var(--red);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

/* responsive table → cards on small */
@media (max-width: 560px) {
  .stack-mobile thead { display: none; }
  .stack-mobile tr {
    display: block;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: var(--card-2);
    border-radius: 10px;
  }
  .stack-mobile td {
    display: flex;
    justify-content: space-between;
    border-bottom: 0;
    padding: 0.25rem 0;
  }
  .stack-mobile td::before {
    content: attr(data-label);
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }
}
