* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    background: #111827;
    color: #ffffff;
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand a {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav a {
    color: #ffffff;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    border: none;
    background: #dc2626;
    color: #ffffff;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}

.page-content {
    padding: 2rem 0;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

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

.page-header {
    margin-bottom: 1.5rem;
}

.muted {
    color: #6b7280;
}

.auth-wrapper {
    min-height: calc(100vh - 140px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 420px);
}

.stack-md > * + * {
    margin-top: 1rem;
}

.stack-lg > * + * {
    margin-top: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
}

.btn-primary,
.btn-danger,
.btn-secondary {
    border: none;
    color: #ffffff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    background: #2563eb;
}

.btn-danger {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
}

.btn-link {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border-radius: 8px;
    font-weight: 600;
}

.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
}

.app-table th,
.app-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.line-item-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    background: #fafafa;
}

.comment-box {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    background: #fafafa;
}

.formset-row {
    position: relative;
}

.formset-row h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.filter-pill {
    display: inline-block;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 600;
    text-decoration: none;
}

.filter-pill:hover {
    text-decoration: none;
    background: #dbeafe;
}

.filter-pill.active {
    background: #2563eb;
    color: #ffffff;
}
