:root {
    --brand-red: #cc0000;
    --brand-red-dark: #a30000;
    --bg: #f0f2f5;
    --text: #1a1a2e;
    --border: #ddd;
    --input-bg: #fafafa;
    --green: #2d7a3a;
    --red: #880000;
    --gray: #888;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    font-weight: 400;
}

h1 {
    color: var(--brand-red);
    font-weight: 700;
    margin-top: 0;
}

a {
    color: var(--brand-red);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th {
    background: var(--brand-red);
    color: #fff;
    text-transform: uppercase;
    font-size: 12px;
    text-align: left;
    padding: 0.6rem 0.8rem;
}

td {
    font-size: 13px;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

tr:hover td {
    background: #fafafa;
}

.btn {
    display: inline-block;
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 0.6rem 1.2rem;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.15s,
        transform 0.15s;
}

.btn:hover {
    background: var(--brand-red-dark);
    transform: translateY(-1px);
}

.btn-green {
    background: var(--green);
}

.btn-red {
    background: var(--red);
}

.btn-gray {
    background: var(--gray);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 12px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 480px;
}

label {
    font-weight: 600;
    font-size: 13px;
    color: #444;
    display: block;
    margin-bottom: 0.3rem;
}

input,
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 0.5rem 0.7rem;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-red);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-row input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

.badge {
    display: inline-block;
    border-radius: 20px;
    padding: 0.15rem 0.7rem;
    font-size: 11px;
    font-weight: 600;
}

.badge-green {
    background: #e3f5e6;
    color: #1e6b2c;
}

.badge-red {
    background: #fbe2e2;
    color: #a30000;
}

.badge-yellow {
    background: #fff6d9;
    color: #8a6d00;
}

.badge-blue {
    background: #e2eefb;
    color: #1a4e8a;
}

.badge-gray {
    background: #eee;
    color: #555;
}

.flash {
    background: #fffbe6;
    border-left: 4px solid #d4a017;
    padding: 0.75rem 1rem;
    margin: 0 auto 1rem;
    max-width: 1200px;
}

.flash-error {
    background: #fbe2e2;
    border-left: 4px solid var(--red);
    padding: 0.75rem 1rem;
    color: var(--red);
}

.navbar {
    background: var(--brand-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 18px;
}

.navbar-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.navbar-links a,
.navbar-user a,
.navbar-user .link-button {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.navbar-links a:hover,
.navbar-user a:hover,
.navbar-user .link-button:hover {
    text-decoration: underline;
}

/* Logout is a POST form (CSRF requires it), styled to read as a plain
   nav link rather than a button. */
.navbar-user .link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 14px;
}

.login-panel {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}
