* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

/* Sticky Menü oben */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #111827;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.topbar a {
    color: #fff;
    margin-right: 14px;
}

.brand a {
    font-weight: bold;
    font-size: 20px;
}

/* Inhalt füllt die verfügbare Höhe, damit Footer unten bleibt */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 16px;
    flex: 1;
}

/* Footer bleibt unten */
.footer {
    position: sticky;
    bottom: 0;
    z-index: 900;
    text-align: center;
    color: #6b7280;
    padding: 14px 24px;
    background: #f4f6f8;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

/* Dashboard / Kachel-Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    align-items: stretch;
    margin-bottom: 24px;
}

.grid + .card {
    margin-top: 8px;
}

.stat {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    min-height: 120px;
    overflow-wrap: anywhere;
}

.stat .num {
    font-size: 30px;
    font-weight: bold;
}

label {
    font-weight: bold;
    display: block;
    margin: 12px 0 5px;
}

input,
select,
textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}

textarea {
    min-height: 100px;
}

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

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #2563eb;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    margin: 6px 6px 6px 0;
}

.btn.secondary {
    background: #64748b;
}

.btn.danger {
    background: #dc2626;
}

.btn.success {
    background: #16a34a;
}

.btn.warning {
    background: #d97706;
}

.btn.disabled,
.btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

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

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

tr:hover td {
    background: #f9fafb;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

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

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

.alert-info {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 13px;
}

.badge.green {
    background: #dcfce7;
    color: #14532d;
}

.badge.red {
    background: #fee2e2;
    color: #7f1d1d;
}

.badge.blue {
    background: #dbeafe;
    color: #1e3a8a;
}

.small {
    color: #64748b;
    font-size: 13px;
}

.login-box {
    max-width: 460px;
    margin: 70px auto;
}

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

.qr {
    max-width: 180px;
    border: 1px solid #e5e7eb;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
}

.ticket {
    border: 2px dashed #334155;
    border-radius: 14px;
    padding: 18px;
    background: #fff;
    max-width: 620px;
}

.ticket-code {
    font-family: monospace;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
}

.points-bar {
    position: sticky;
    top: 58px;
    z-index: 10;
    background: #111827;
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.points-bar strong {
    font-size: 20px;
}

.points-ok {
    color: #86efac;
}

.points-bad {
    color: #fca5a5;
}

.vote-input {
    max-width: 90px;
}

.search-box {
    margin-bottom: 12px;
}

/* Druckansicht */
@media print {
    .topbar,
    .footer,
    .no-print {
        display: none;
    }

    body {
        background: #fff;
        display: block;
    }

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

    .card {
        box-shadow: none;
    }
}