:root {
    --bg: #1a1a1a;
    --bg-secondary: #242424;
    --text: #e0e0e0;
    --text-muted: #999;
    --accent: #f0a500;
    --accent-hover: #ffbe3d;
    --code-bg: #2d2d2d;
    --border: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    padding: 2rem 1rem;
}

.site-header {
    max-width: 42rem;
    margin: 0 auto 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.site-brand {
    text-decoration: none;
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: 1.2rem;
    font-weight: 700;
}

.site-brand:hover {
    text-decoration: none;
}

.site-brand-name {
    color: var(--accent);
}

.site-brand-tld {
    color: var(--text-muted);
}

.site-brand:hover .site-brand-name {
    color: var(--accent-hover);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    align-items: center;
}

.nav-logout {
    margin: 0;
    padding: 0;
    display: inline;
}

.nav-logout button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.nav-logout button:hover {
    text-decoration: underline;
}

main {
    max-width: 42rem;
    margin: 0 auto;
}

h1 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent);
    text-decoration: none;
}

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

.journal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.journal-table th,
.journal-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.journal-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.journal-table td {
    font-size: 0.9rem;
}

.journal-type {
    color: var(--accent);
    font-weight: 500;
}

.journal-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 4rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: var(--bg);
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-danger:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    min-width: 5.5rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
}

.chemicals-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.chemicals-table th,
.chemicals-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.chemicals-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: stretch;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.empty-state {
    color: var(--text-muted);
    padding: 2rem 0;
    text-align: center;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.flash-success {
    background: #1a3a1a;
    border: 1px solid #2d5a2d;
    color: #7dbb7d;
}

.flash-error {
    background: #3a1a1a;
    border: 1px solid #5a2d2d;
    color: #bb7d7d;
}

.render-time {
    max-width: 42rem;
    margin: 2rem auto 0;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .journal-table thead {
        display: none;
    }

    .journal-table tbody tr {
        display: block;
        background: var(--surface);
        border-radius: 0.5rem;
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border);
    }

    .journal-table tbody td {
        display: block;
        padding: 0.1rem 0;
        border: none;
    }

    .journal-table .journal-time {
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    .journal-table .journal-type {
        font-weight: bold;
        color: var(--accent);
    }
}
