/* ── Shared admin components ─────────────────────────────────────────────── */
.detail-section {
    background:var(--bg-1); border:1px solid var(--border); border-radius:10px;
    padding:22px 24px; margin-bottom:18px;
}
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--border); margin:14px 0 4px; }
.tab { padding:8px 14px; color:var(--text-2); border-bottom:2px solid transparent; }
.tab:hover { color:var(--text-1); text-decoration:none; }
.tab-active { color:var(--text-1); border-bottom-color:var(--accent); }

table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--border); font-size:.93rem; }
th { color:var(--text-2); font-weight:500; }

.status-badge {
    display:inline-block; padding:2px 8px; border-radius:999px; font-size:.78rem;
    border:1px solid var(--border); background:var(--bg-2);
}
.status-badge.status-ok { border-color:var(--success); color:var(--success); }
.status-badge.status-warn { border-color:var(--warning); color:var(--warning); }
.status-badge.status-error { border-color:var(--danger); color:var(--danger); }

.grav-row { display:flex; align-items:center; gap:16px; margin-bottom:10px; }
.avatar-lg { width:72px; height:72px; border-radius:50%; background:var(--bg-2); }

/* ── Chat widget ─────────────────────────────────────────────────────────── */
.chat-widget { position:fixed; right:18px; bottom:18px; z-index:100; }
.chat-toggle {
    width:44px; height:44px; border-radius:50%;
    border:1px solid var(--border); background:var(--bg-1); color:var(--text-2);
    font-size:1.1rem; cursor:pointer;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
    transition:background 120ms ease, color 120ms ease, transform 120ms ease;
}
.chat-toggle:hover {
    background:var(--accent); color:#fff; transform:scale(1.05);
}
.chat-panel {
    position:absolute; right:0; bottom:64px; width:360px; height:480px;
    background:var(--bg-1); border:1px solid var(--border); border-radius:12px;
    display:flex; flex-direction:column;
    box-shadow:0 12px 36px rgba(0,0,0,.15);
    animation:chat-pop 160ms ease-out;
}
.chat-panel[hidden] { display:none; }
@keyframes chat-pop { from { transform:translateY(8px) scale(.97); opacity:0; } to { transform:none; opacity:1; } }
.chat-header { padding:12px 14px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; font-weight:500; }
.chat-close { background:none; border:none; color:var(--text-2); font-size:1.3rem; cursor:pointer; }
.chat-messages { flex:1; overflow-y:auto; padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.chat-msg {
    max-width:86%; padding:8px 12px; border-radius:12px; font-size:.92rem;
    line-height:1.45; white-space:pre-wrap; word-wrap:break-word;
}
.chat-msg.user { align-self:flex-end; background:var(--accent); color:#fff; }
.chat-msg.assistant { align-self:flex-start; background:var(--bg-2); border:1px solid var(--border); }
.chat-msg.error { align-self:flex-start; background:#fdf0f0; border:1px solid var(--danger); color:var(--danger); }
.chat-typing { align-self:flex-start; color:var(--text-2); font-size:.85rem; font-style:italic; }
.chat-form { display:flex; gap:6px; padding:10px; border-top:1px solid var(--border); }
.chat-input { flex:1; }
.chat-send { padding:8px 14px; background:var(--accent); border:none; color:#fff; border-radius:6px; cursor:pointer; }
[data-theme="dark"] .chat-msg.error { background:#2a1414; color:#f0b6b6; }

/* ── Public: landing page ────────────────────────────────────────────────── */
.pub-hero {
    text-align:center; padding:64px 24px 48px;
}
.pub-hero h1 {
    font-size:2.1rem; font-weight:700; line-height:1.25; margin-bottom:16px;
    color:var(--text-1);
}
.pub-hero p {
    font-size:1.05rem; color:var(--text-2); max-width:540px; margin:0 auto 32px;
    line-height:1.65;
}
.pub-cta-row {
    display:flex; gap:12px; justify-content:center; flex-wrap:wrap;
}
.pub-cta {
    display:inline-block; padding:12px 24px; border-radius:7px;
    font-weight:600; font-size:.95rem; cursor:pointer; border:none;
    text-decoration:none;
}
.pub-cta-primary { background:var(--accent); color:#fff; }
.pub-cta-primary:hover { filter:brightness(1.08); text-decoration:none; }
.pub-cta-secondary { background:var(--bg-1); border:1px solid var(--border); color:var(--text-1); }
.pub-cta-secondary:hover { background:var(--bg-2); text-decoration:none; }

.pub-cards {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
    gap:16px; margin-top:48px;
}
.pub-card {
    background:var(--bg-1); border:1px solid var(--border); border-radius:10px;
    padding:20px 20px 18px;
}
.pub-card h3 { margin-bottom:8px; font-size:1rem; }
.pub-card p { font-size:.88rem; color:var(--text-2); line-height:1.5; }
.pub-card a { font-size:.88rem; font-weight:600; }

/* ── Public: hotlines page ───────────────────────────────────────────────── */
.hotline-grid {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
    gap:16px; margin-top:24px;
}
.hotline-card {
    background:var(--bg-1); border:1px solid var(--border); border-radius:10px;
    padding:20px 22px;
}
.hotline-card h3 { font-size:1rem; margin-bottom:6px; }
.hotline-card .hotline-number {
    font-size:1.25rem; font-weight:700; color:var(--accent); margin-bottom:4px;
}
.hotline-card .hotline-meta { font-size:.82rem; color:var(--text-2); margin-bottom:8px; }
.hotline-card p { font-size:.88rem; color:var(--text-2); line-height:1.5; }
.hotline-tag {
    display:inline-block; padding:2px 8px; border-radius:999px; font-size:.75rem;
    border:1px solid var(--border); color:var(--text-2); margin-right:4px;
}

/* ── Public: resources page ──────────────────────────────────────────────── */
.filter-bar {
    display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px;
}
.filter-btn {
    padding:6px 14px; border-radius:999px; font-size:.85rem;
    border:1px solid var(--border); background:var(--bg-1); color:var(--text-2);
    cursor:pointer; transition:all 100ms ease;
}
.filter-btn:hover, .filter-btn.active {
    background:var(--accent); border-color:var(--accent); color:#fff;
}
.resource-grid {
    display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
    gap:16px;
}
.resource-card {
    background:var(--bg-1); border:1px solid var(--border); border-radius:10px;
    padding:18px 20px; display:flex; flex-direction:column; gap:8px;
}
.resource-card h3 { font-size:.98rem; font-weight:600; }
.resource-card p { font-size:.86rem; color:var(--text-2); line-height:1.5; flex:1; }
.resource-card-footer {
    display:flex; align-items:center; justify-content:space-between;
    margin-top:4px; gap:8px;
}
.topic-tag {
    display:inline-block; padding:2px 9px; border-radius:999px; font-size:.74rem;
    border:1px solid var(--border); color:var(--text-2); background:var(--bg-2);
}
.resource-verified {
    font-size:.74rem; color:var(--text-2);
}
.resource-empty {
    grid-column:1/-1; text-align:center; padding:48px 0;
    color:var(--text-2); font-size:.95rem;
}

/* ── Admin resource management ───────────────────────────────────────────── */
.page-header {
    display:flex; align-items:baseline; justify-content:space-between;
    margin-bottom:22px;
}
