:root {
    color-scheme: dark light;
    --bg: #111827;
    --fg: #f9fafb;
    --accent: #2563eb;
    --muted: #6b7280;
    --card-bg: rgba(17, 24, 39, 0.85);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
}

header, footer {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    font-size: 1.25rem;
    font-weight: 600;
}

main {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
}

.card h2 {
    margin-top: 0;
}

.narrow {
    max-width: 360px;
    margin: 0 auto;
}

label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
}

button {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--accent);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.1);
}

dt {
    font-weight: 600;
}

dd {
    margin: 0 0 0.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

th {
    font-weight: 600;
}

.table-wrapper {
    max-height: 320px;
    overflow: auto;
}

.flash {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.flash li {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.flash .error {
    background: rgba(239, 68, 68, 0.2);
}

.flash .success {
    background: rgba(16, 185, 129, 0.2);
}

.flash .info {
    background: rgba(59, 130, 246, 0.2);
}

.muted {
    color: var(--muted);
}

.error {
    color: #f87171;
}

.timestamp {
    color: var(--muted);
    font-size: 0.85rem;
}

.user-info a {
    color: var(--fg);
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
}
