:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --background: #f4f6f8;
    --surface: #ffffff;
    --border: #d9dee5;
    --text: #17202a;
    --muted: #64748b;
    --danger: #dc2626;
    --success: #15803d;
}

* {
    box-sizing: border-box;
}

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

.site-header {
    background: #111827;
    color: white;
}

.header-inner {
    max-width: 1300px;
    margin: auto;
    padding: 15px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

nav a {
    color: #e5e7eb;
    text-decoration: none;
}

nav a:hover {
    color: white;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 30px 20px;
}

h1 {
    margin-top: 0;
}

h2 {
    margin-top: 0;
}

.panel,
.form-panel,
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
}

.login-box {
    max-width: 420px;
    margin: 60px auto;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 18px;
}

input,
select,
textarea {
    width: 100%;
    display: block;
    margin-top: 7px;

    padding: 11px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    background: white;
    color: var(--text);

    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #93c5fd;
    border-color: var(--primary);
}

button,
.button {
    display: inline-block;

    border: 0;
    border-radius: 6px;

    background: #e5e7eb;
    color: #111827;

    padding: 10px 15px;

    font: inherit;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    filter: brightness(0.96);
}

.primary {
    background: var(--primary);
    color: white;
}

.primary:hover {
    background: var(--primary-dark);
}

.large {
    padding: 14px 20px;
    font-size: 1.05rem;
}

.small {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.danger-button {
    background: var(--danger);
    color: white;
}

.alert {
    padding: 14px 18px;
    border-radius: 7px;
    margin-bottom: 20px;
}

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

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

.cards {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 25px;
}

.card span {
    display: block;
    color: var(--muted);
}

.card strong {
    display: block;
    font-size: 2.5rem;
    margin-top: 5px;
}

.danger-card strong {
    color: var(--danger);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-actions > a.button,
.page-actions > form {
    margin: 0;
}

.page-actions > form {
    display: flex;
    align-items: center;
}

.page-actions > form > label.button {
    margin: 0;
}


.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    margin: 0;
}

.search-form button {
    flex-shrink: 0;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
}

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

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

th {
    background: #f8fafc;
    font-weight: 700;
}

tr.overdue {
    background: #fff1f2;
}

code {
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 4px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 700;
}

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

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}


.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
    margin: 0;
}

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

.hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 20px;
}

.success-box {
    background: #dcfce7;
    color: #166534;
    border-radius: 10px;
    padding: 25px;
    margin-top: 25px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 15px;

    background: white;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;

    margin-bottom: 25px;
}

.filters label {
    margin: 0;
}

.filters label:not(.checkbox) {
    min-width: 180px;
}

.filters .checkbox {
    padding-bottom: 12px;
}

.public-header {
    text-align: center;
    margin-bottom: 30px;
}

.public-header p {
    color: var(--muted);
}

.game-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.game-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px;
}

.game-card h2 {
    margin-bottom: 5px;
}

.game-id {
    color: var(--muted);
    font-family: monospace;
}

.available {
    color: var(--success);
    font-weight: 700;
}

.not-available {
    color: #c62828;
    font-weight: bold;
}


@media (max-width: 700px) {

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        flex-direction: column;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }

    .filters {
        display: block;
    }

    .filters label,
    .filters button {
        margin-bottom: 15px;
    }

}

@media print {

    .site-header,
    .search-form,
    .filters,
    .page-heading .button,
    button {
        display: none !important;
    }

    body {
        background: white;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    table {
        font-size: 10pt;
    }

    th,
    td {
        border: 1px solid #999;
    }

}
