:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #17202a;
    --muted: #667085;
    --border: #d0d5dd;
    --primary: #1f6feb;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    min-height: 64px;
    padding: 0 28px;
    background: #0b1220;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand, .brand:visited {
    color: white;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
}

.nav { display: flex; gap: 16px; align-items: center; }
.inline-form { display: inline; }
.link-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-title h1, .card h1, .card h2 { margin-top: 0; }
.page-title p, .muted, .empty { color: var(--muted); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    margin-bottom: 18px;
}

.login-card, .form-card { max-width: 560px; margin: 40px auto; }
.grid { display: grid; gap: 18px; }
.card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: #111827;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}
.button.primary { background: var(--primary); color: white; border-color: var(--primary); }
.button.secondary { background: #f9fafb; }
.button.danger-bg { background: var(--danger); color: white; border-color: var(--danger); }
.export-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}
th, td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
th { background: #f9fafb; font-weight: 700; }
tr.missing td { color: var(--muted); }
.actions { white-space: nowrap; }
.actions a { margin-right: 10px; }
a.danger { color: var(--danger); }

.form { display: grid; gap: 10px; }
.form input, .form select, .filter-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
}
.form label, .filter-form label { font-weight: 700; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.filter-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.filter-form select { min-width: 240px; }

.messages { margin-bottom: 16px; }
.message {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
}
.message.success { border-color: #65a30d; }
.message.warning, .error { color: var(--danger); }

@media (max-width: 760px) {
    .topbar, .page-title, .card-header { flex-direction: column; align-items: flex-start; }
    .container { padding: 18px; }
}
.site-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 28px 28px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}
