:root {
    --border: #d7dde5;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #49afcd;
    --danger: #b42318;
    --bg: #f8fafc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

.page {
    margin: 0 auto;
    max-width: 980px;
    padding: 24px 16px 48px;
}

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 16px;
}

.topbar nav {
    align-items: center;
    display: flex;
    gap: 12px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.button,
button {
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    padding: 8px 12px;
}

.button.secondary,
button.secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.logout-form {
    display: inline;
}

.logout-form button {
    background: transparent;
    border: 0;
    color: var(--primary);
    padding: 0;
}

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

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

input,
select,
textarea {
    border: 1px solid var(--border);
    border-radius: 4px;
    font: inherit;
    padding: 9px 10px;
    width: 100%;
}

.errorlist,
.message.error {
    color: var(--danger);
}

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

.messages {
    list-style: none;
    padding: 0;
}

.message {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 10px;
}

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

.detail-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.detail-item strong {
    display: block;
}

.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.document-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    list-style: none;
    padding: 0;
}

.document-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
}

.document-preview {
    display: block;
    height: 140px;
    object-fit: contain;
    width: 100%;
}

.document-name {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

/* Login page */

.auth-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.auth-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    max-width: 380px;
    padding: 28px 32px 32px;
    width: 100%;
}

.auth-logo {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-logo-img {
    height: auto;
    max-width: 220px;
}

.auth-notice {
    background: #fdf3d6;
    border: 1px solid #f0deA0;
    border-radius: 4px;
    margin-bottom: 18px;
    overflow: hidden;
    padding: 9px 0;
}

.auth-notice-track {
    color: #7a5d12;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    will-change: transform;
    animation: auth-marquee 16s linear infinite;
    animation-delay: -8s;
}

.auth-notice-track span {
    display: inline-block;
    padding-left: 100%;
}

@keyframes auth-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

.auth-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin: 0 0 16px;
    text-align: center;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-field input {
    padding: 11px 12px;
}

.auth-links {
    text-align: right;
}

.auth-links a {
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
}

.auth-submit {
    background: var(--primary);
    border: 0;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    padding: 12px;
    width: 100%;
}

.auth-signup {
    color: var(--text);
    font-size: 14px;
    margin: 18px 0 4px;
    text-align: center;
}

.auth-signup a {
    font-weight: 400;
}

.auth-footer {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    margin: 14px 0 0;
    text-align: center;
}
