* {
    box-sizing: border-box;
}

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

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

.topbar {
    background: #111827;
    color: #fff;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    font-weight: 700;
    padding: 14px 0;
}

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

.topnav a {
    color: #fff;
    text-decoration: none;
}

.user-pill {
    background: #374151;
    border-radius: 999px;
    padding: 6px 12px;
}

.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.auth-panel {
    max-width: 480px;
    margin: 80px auto;
}

h1, h2 {
    margin-top: 0;
}

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

.grid-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-weight: 600;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.page-action-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.filter-form-compact {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.filter-form-compact .filter-search {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

input,
select,
button {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

textarea {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 100%;
    resize: vertical;
}

button {
    cursor: pointer;
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

button.danger {
    background: #dc2626;
    border-color: #dc2626;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    background: #fff;
}

.alert {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
}

.alert-success {
    background: #dcfce7;
    color: #14532d;
}

.alert-error {
    background: #fee2e2;
    color: #7f1d1d;
}

.table-wrap {
    overflow-x: auto;
}

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

th, td {
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    padding: 8px;
    vertical-align: top;
}

.users-table th,
.users-table td {
    vertical-align: middle;
}

.articles-table th,
.articles-table td {
    vertical-align: middle;
}

th {
    background: #f9fafb;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-footer-controls {
    margin-top: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-footer-controls .pagination {
    margin-top: 0;
}

.per-page-form label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.pagination a {
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    background: #fff;
}

.pagination a.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.progress-wrap {
    display: grid;
    gap: 12px;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.progress-bar {
    height: 16px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar > span {
    display: block;
    height: 100%;
    background: #2563eb;
}

.progress-bar.secondary > span {
    background: #059669;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal.hidden,
.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.modal-actions > * {
    width: 100%;
}

.full-width {
    grid-column: 1 / -1;
}
