/* UniCommons — app.css
   Clean, readable, minimal. Dark-on-cream academic palette.
   ~10KB, no dependencies. */

:root {
    --brand: #002147;
    --brand-soft: #1F3A5F;
    --accent: #2D5F3F;
    --gold: #D4AF37;
    --warn: #B45309;
    --danger: #B91C1C;
    --bg: #F5F1E8;
    --bg-soft: #FAF7EF;
    --card: #FFFFFF;
    --ink: #1F2937;
    --mute: #6B7280;
    --line: #E5E7EB;
    --line-dark: #D1D5DB;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { text-decoration: underline; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ----- Header ----- */
.site-header {
    background: white; border-bottom: 1px solid var(--line);
    padding: 16px 0;
}
.site-header .bar {
    display: flex; align-items: center; justify-content: space-between;
}
.logo {
    font-weight: 700; color: var(--brand); text-decoration: none;
    font-size: 20px; letter-spacing: -0.015em;
}
nav a {
    margin-left: 20px; text-decoration: none; color: var(--mute);
    font-size: 15px;
}
nav a:hover { color: var(--brand); }
nav a.btn-nav {
    background: var(--brand); color: white; padding: 6px 14px;
    border-radius: 6px; font-weight: 500;
}
nav a.btn-nav:hover { background: var(--brand-soft); text-decoration: none; }

/* ----- Main ----- */
main { padding: 40px 0 80px; }
h1 { font-size: 28px; margin: 0 0 14px; color: var(--brand); letter-spacing: -0.015em; }
h2 { font-size: 22px; margin: 0 0 12px; color: var(--brand-soft); }
h3 { font-size: 18px; margin: 0 0 8px; color: var(--brand-soft); }
p { margin: 0 0 14px; }

/* ----- Cards ----- */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; padding: 28px; margin-bottom: 20px;
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }

/* ----- Forms ----- */
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; }
input[type=email], input[type=password], input[type=text], input[type=number],
textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-dark);
    border-radius: 6px; font-size: 15px; font-family: inherit;
    background: white; color: var(--ink);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 33, 71, 0.1);
}

/* ----- Buttons ----- */
.btn {
    display: inline-block; padding: 10px 18px; background: var(--brand);
    color: white; border: none; border-radius: 6px; cursor: pointer;
    font-size: 15px; font-weight: 500; text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--brand-soft); text-decoration: none; }
.btn.btn-ghost {
    background: transparent; color: var(--brand);
    border: 1px solid var(--line-dark);
}
.btn.btn-ghost:hover { background: var(--bg-soft); }
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: #991B1B; }
.btn.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ----- Alerts ----- */
.alert {
    padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px;
}
.alert-error   { background: #FEE2E2; border: 1px solid #FCA5A5; color: #991B1B; }
.alert-info    { background: #DBEAFE; border: 1px solid #93C5FD; color: #1E3A8A; }
.alert-success { background: #D1FAE5; border: 1px solid #86EFAC; color: #065F46; }
.alert-warn    { background: #FEF3C7; border: 1px solid #FCD34D; color: #92400E; }

/* ----- Misc ----- */
.muted { color: var(--mute); font-size: 14px; }
.small { font-size: 13px; }
.mt-20 { margin-top: 20px; }
.mt-12 { margin-top: 12px; }
code, pre {
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 13px; background: var(--bg-soft); padding: 1px 5px; border-radius: 3px;
}

/* ----- Posts feed ----- */
.post {
    border-bottom: 1px solid var(--line); padding: 18px 0;
}
.post:first-child { padding-top: 0; }
.post:last-child { border-bottom: none; padding-bottom: 0; }
.post-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
}
.post-author { font-weight: 600; color: var(--brand); }
.post-time { color: var(--mute); font-size: 13px; }
.post-body { white-space: pre-wrap; word-wrap: break-word; margin-bottom: 8px; }
.post-actions { font-size: 13px; color: var(--mute); }
.post-actions form, .post-actions a { display: inline; margin-right: 12px; }
.post-actions button {
    background: none; border: none; color: var(--mute); cursor: pointer;
    padding: 0; font-size: 13px; text-decoration: underline;
}
.post-actions button:hover { color: var(--danger); }

/* ----- Footer ----- */
footer {
    padding: 32px 0; text-align: center; color: var(--mute);
    font-size: 13px; border-top: 1px solid var(--line); margin-top: 40px;
}
footer a { color: var(--mute); }

/* ----- Admin layout ----- */
.admin-body { background: var(--bg-soft); }
.admin-header { background: var(--brand); border-bottom: none; }
.admin-header .logo { color: white; }
.admin-header nav a { color: rgba(255,255,255,0.8); }
.admin-header nav a:hover { color: white; }

.admin-layout {
    display: grid; grid-template-columns: 220px 1fr; gap: 24px;
    max-width: 1200px; margin: 0 auto; padding: 24px;
}
.admin-nav {
    background: white; border: 1px solid var(--line); border-radius: 10px;
    padding: 16px 0; height: fit-content;
}
.admin-nav a {
    display: block; padding: 10px 20px; color: var(--ink); text-decoration: none;
    font-size: 15px; border-left: 3px solid transparent;
}
.admin-nav a:hover { background: var(--bg); text-decoration: none; }
.admin-main { min-width: 0; }

/* ----- Tables ----- */
.table-card {
    background: white; border: 1px solid var(--line); border-radius: 10px;
    overflow: hidden;
}
table.data {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
table.data th, table.data td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line);
}
table.data th {
    background: var(--bg); font-weight: 600; color: var(--brand-soft);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: var(--bg-soft); }
.pill {
    display: inline-block; padding: 2px 8px; border-radius: 3px;
    font-size: 12px; font-weight: 600;
}
.pill-active { background: #D1FAE5; color: #065F46; }
.pill-pending { background: var(--bg); color: var(--mute); }
.pill-suspended { background: #FEF3C7; color: #92400E; }
.pill-banned { background: #FEE2E2; color: #991B1B; }

/* ----- Stats grid ----- */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat {
    background: white; border: 1px solid var(--line); border-radius: 10px;
    padding: 16px 20px;
}
.stat-label {
    color: var(--mute); font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 6px;
}
.stat-value {
    font-size: 28px; font-weight: 700; color: var(--brand);
    letter-spacing: -0.02em;
}

/* ----- Filter row ----- */
.filters {
    display: flex; gap: 12px; align-items: center; margin-bottom: 16px;
    flex-wrap: wrap;
}
.filters form { display: inline-flex; gap: 8px; }
.filters input[type=text] { width: 220px; }
.tab-links a {
    padding: 6px 12px; border-radius: 6px; text-decoration: none;
    color: var(--mute); font-size: 14px;
}
.tab-links a.active { background: var(--brand); color: white; }

/* ----- Responsive ----- */
@media (max-width: 720px) {
    .admin-layout { grid-template-columns: 1fr; padding: 12px; }
    .admin-nav {
        display: flex; overflow-x: auto; padding: 8px;
    }
    .admin-nav a { border-left: none; border-bottom: 2px solid transparent; padding: 8px 14px; }
    .wrap { padding: 0 16px; }
    nav a { margin-left: 12px; font-size: 14px; }
    h1 { font-size: 24px; }
}
