/* ── RaccoonGang Branded Styles ─────────────────────────────────
   Warm palette matching raccoongang.com (2025+):
   Charcoal #333 · Terracotta #c4895e · Sage #7ea88b · Warm white
   ─────────────────────────────────────────────────────────────── */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
    --rg-charcoal: #333333;
    --rg-charcoal-light: #444444;
    --rg-terra: #c4895e;
    --rg-terra-hover: #b57a50;
    --rg-sage: #7ea88b;
    --rg-sage-light: #9ec5a8;
    --rg-text: #333333;
    --rg-text-secondary: #777777;
    --rg-bg: #faf9f7;
    --rg-bg-white: #ffffff;
    --rg-border: #e8e4e0;
    --rg-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Pico.css Overrides ─────────────────────────────────────── */
[data-theme="light"],
:root:not([data-theme="dark"]) {
    --pico-primary: var(--rg-sage);
    --pico-primary-hover: #6e9a7b;
    --pico-primary-focus: rgba(126, 168, 139, 0.2);
    --pico-primary-background: var(--rg-sage);
    --pico-primary-hover-background: #6e9a7b;
    --pico-primary-inverse: #fff;
    --pico-color: var(--rg-text);
    --pico-h1-color: var(--rg-charcoal);
    --pico-h2-color: var(--rg-charcoal);
    --pico-h3-color: var(--rg-charcoal);
    --pico-h4-color: var(--rg-charcoal);
}

/* ── Top Navigation ─────────────────────────────────────────── */
.top-nav {
    background: var(--rg-bg-white);
    padding: 0 2rem;
    border-bottom: 1px solid var(--rg-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.top-nav .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.top-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.7rem 0;
}

.top-nav .nav-brand img {
    height: 36px;
    width: auto;
}

.top-nav .nav-brand span {
    color: var(--rg-text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-left: 1px solid var(--rg-border);
    padding-left: 0.75rem;
    white-space: nowrap;
}

.top-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-nav .nav-links a {
    color: var(--rg-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.top-nav .nav-links a:hover {
    color: var(--rg-charcoal);
    background: var(--rg-bg);
}

.top-nav .nav-links .btn-add {
    background: var(--rg-sage);
    color: #fff;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.top-nav .nav-links .btn-add:hover {
    background: #6e9a7b;
    color: #fff;
}

/* ── Nav User ──────────────────────────────────────────────── */
.top-nav .nav-user {
    color: var(--rg-text-secondary);
    font-size: 0.8rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--rg-border);
    margin-left: 0.25rem;
}

.top-nav .nav-logout {
    color: var(--rg-text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0.7;
}

.top-nav .nav-logout:hover {
    opacity: 1;
    color: #c0392b;
}

/* ── Page Layout ────────────────────────────────────────────── */
body {
    background: var(--rg-bg);
}

main.container {
    max-width: 1200px;
    padding-top: 2rem;
}

hgroup {
    margin-bottom: 2rem;
}

hgroup h1 {
    color: var(--rg-charcoal);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

hgroup p {
    color: var(--rg-text-secondary);
}

/* ── Cards (article) ────────────────────────────────────────── */
article {
    background: var(--rg-bg-white);
    border: 1px solid var(--rg-border);
    border-radius: 8px;
    box-shadow: var(--rg-card-shadow);
    padding: 1.5rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
figure > table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--rg-border);
}

figure > table thead th {
    background: var(--rg-charcoal);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.7rem 1rem;
    border-bottom: none;
}

figure > table tbody td {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--rg-border);
    background: var(--rg-bg-white);
}

figure > table tbody tr:last-child td {
    border-bottom: none;
}

figure > table tbody tr:nth-child(even) td {
    background: var(--rg-bg);
}

figure > table tbody tr:hover td {
    background: rgba(126, 168, 139, 0.04);
}

/* ── Buttons ─────────────────────────────────────────────────── */
[role="button"].outline,
button.outline {
    border-color: var(--rg-border);
    color: var(--rg-charcoal);
    font-size: 0.85rem;
    font-weight: 500;
}

[role="button"].outline:hover,
button.outline:hover {
    border-color: var(--rg-sage);
    color: var(--rg-sage);
    background: rgba(126, 168, 139, 0.05);
}

button[type="submit"]:not(.outline):not(.secondary):not(.contrast) {
    background: var(--rg-sage);
    border-color: var(--rg-sage);
    font-weight: 600;
}

button[type="submit"]:not(.outline):not(.secondary):not(.contrast):hover {
    background: #6e9a7b;
    border-color: #6e9a7b;
}

a[role="button"]:not(.outline):not(.secondary):not(.contrast) {
    background: var(--rg-sage);
    border-color: var(--rg-sage);
    color: #fff;
    font-weight: 600;
}

a[role="button"]:not(.outline):not(.secondary):not(.contrast):hover {
    background: #6e9a7b;
    border-color: #6e9a7b;
}

/* ── Action Buttons ──────────────────────────────────────────── */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons a[role="button"] {
    padding: 0.25rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* ── Status Badges ───────────────────────────────────────────── */
mark {
    background: var(--rg-terra);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

mark.error {
    background: #c0392b;
    color: white;
}

mark.generating {
    background: var(--rg-sage);
    color: white;
}

/* ── Flash Messages ──────────────────────────────────────────── */
.flash-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: rgba(196, 137, 94, 0.1);
    border: 1px solid rgba(196, 137, 94, 0.3);
    border-radius: 8px;
    color: var(--rg-text);
}

/* ── Generate Form ───────────────────────────────────────────── */
.generate-form button {
    margin-top: 0;
}

/* ── Report Toolbar ──────────────────────────────────────────── */
.report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rg-border);
}

/* ── Report Preview ──────────────────────────────────────────── */
.report-preview {
    padding: 2rem;
    background: var(--rg-bg-white);
    border: 1px solid var(--rg-border);
    border-radius: 8px;
    box-shadow: var(--rg-card-shadow);
}

/* ── Fieldsets & Details ─────────────────────────────────────── */
fieldset {
    border-color: var(--rg-border);
    border-radius: 8px;
}

details summary {
    color: var(--rg-charcoal);
    font-weight: 600;
}

/* ── Code Tags ───────────────────────────────────────────────── */
code {
    background: var(--rg-bg);
    border: 1px solid var(--rg-border);
    border-radius: 4px;
    font-size: 0.85em;
    padding: 0.1em 0.35em;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rg-border);
    text-align: center;
    opacity: 0.6;
}

footer.site-footer small {
    color: var(--rg-text-secondary);
    font-size: 0.8rem;
}
