* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f2f2f2;
    color: #222;
}

/* --- Topbar --- */
.topbar {
    background: #111;
    border-bottom: 3px solid #ff6600;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.brand-sub {
    color: #ff6600;
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.4rem;
}
.topnav a {
    color: #bbb;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}
.topnav a:hover { color: #fff; }
.topnav a.active { color: #ff6600; border-bottom-color: #ff6600; }
.topnav a.logout { color: #888; font-weight: 400; }

/* --- Page --- */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
h1 {
    font-size: 1.6rem;
    margin: 0 0 1.5rem;
}

/* --- Flash --- */
.flash-stack { margin-bottom: 1.5rem; }
.flash {
    padding: 0.8rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}
.flash-ok { background: #e6f7ec; color: #1e7e34; border: 1px solid #a3d9b1; }
.flash-error { background: #fdeaea; color: #b71c1c; border: 1px solid #e57373; }

/* --- Login --- */
.login-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 340px;
    text-align: center;
}
.login-card h1 { font-size: 1.3rem; margin: 0; }
.login-sub { color: #ff6600; font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; margin: 0.2rem 0 1.5rem; }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 0.85rem; font-weight: 600; margin: 1rem 0 0.3rem; }
.login-card input {
    width: 100%; padding: 0.7rem 0.9rem; border: 2px solid #ddd; border-radius: 8px; font-size: 1rem;
}
.login-card input:focus { outline: none; border-color: #ff6600; }
.login-card button {
    margin-top: 1.5rem; width: 100%; background: #ff6600; color: #fff; border: none;
    padding: 0.9rem; border-radius: 30px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer; font-size: 0.9rem;
}
.login-card button:hover { background: #e65c00; }

/* --- Tabs --- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.tabs a {
    text-decoration: none;
    color: #555;
    background: #fff;
    border: 2px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.tabs a.active { background: #ff6600; border-color: #ff6600; color: #fff; }

/* --- Table --- */
.table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    text-align: left; padding: 0.9rem 1.2rem; background: #fafafa; color: #777;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #eee;
}
.data-table td { padding: 0.9rem 1.2rem; border-bottom: 1px solid #f0f0f0; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fff8f2; }

.empty-hint { color: #888; padding: 2rem; text-align: center; }

/* --- Status badge --- */
.status-badge {
    display: inline-block; padding: 0.25rem 0.7rem; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
    background: #eee; color: #555;
}
.status-ausstehend { background: #fff3cd; color: #8a6500; }
.status-bestaetigt { background: #fde3d0; color: #ad4e00; }
.status-kontaktiert { background: #d6e8fb; color: #0a5cad; }
.status-gebucht { background: #ffe0c2; color: #ff6600; }
.status-abgeschlossen { background: #e0f5e6; color: #1e7e34; }
.status-storniert { background: #f4d6d6; color: #a02020; }

/* --- Detail --- */
.back-link { color: #ff6600; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.back-link:hover { text-decoration: underline; }

.detail-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-top: 1.2rem;
    max-width: 640px;
}
.detail-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.5rem; }
.detail-head h1 { margin: 0; }

.detail-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.detail-table th {
    text-align: left; padding: 0.6rem 0; width: 150px; color: #888; font-size: 0.85rem;
    vertical-align: top; border-bottom: 1px solid #f0f0f0;
}
.detail-table td { padding: 0.6rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.95rem; }
.detail-table .pre-line { white-space: pre-line; }

.status-form { border-top: 2px solid #f0f0f0; padding-top: 1.5rem; }
.status-form label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0 0 0.3rem; }
.status-form select,
.status-form textarea {
    width: 100%; padding: 0.7rem 0.9rem; border: 2px solid #ddd; border-radius: 8px;
    font-size: 0.95rem; font-family: inherit; margin-bottom: 1.2rem;
}
.status-form textarea { min-height: 80px; resize: vertical; }
.status-form select:focus, .status-form textarea:focus { outline: none; border-color: #ff6600; }
.status-form button {
    background: #ff6600; color: #fff; border: none; padding: 0.85rem 2rem; border-radius: 30px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; font-size: 0.9rem;
}
.status-form button:hover { background: #e65c00; }

/* --- Fotoauswahl --- */
.page-head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 1rem; margin-bottom: 1.5rem;
}
.page-head h1 { margin: 0; }

.btn-primary {
    display: inline-block; background: #ff6600; color: #fff; text-decoration: none;
    padding: 0.7rem 1.4rem; border-radius: 25px; font-weight: 700; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 0.5px; border: none; cursor: pointer;
}
.btn-primary:hover { background: #e65c00; }

.btn-secondary {
    display: inline-block; background: #fff; color: #555; border: 2px solid #ddd;
    padding: 0.6rem 1.3rem; border-radius: 25px; font-weight: 600; font-size: 0.85rem;
    cursor: pointer; margin-top: 1rem;
}
.btn-secondary:hover { border-color: #ff6600; color: #ff6600; }

.card-heading { font-size: 1.1rem; margin: 0 0 1rem; }

.hinweis-text { font-size: 0.85rem; color: #888; margin: -0.5rem 0 1.2rem; }

.code-box {
    background: #fff8f2; border: 2px dashed #ff6600; border-radius: 10px;
    padding: 1.2rem 1.5rem; margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.3rem;
}
.code-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: #ad4e00; font-weight: 700; }
.code-value { font-size: 1.6rem; font-weight: 700; color: #111; letter-spacing: 1px; font-family: monospace; }

.upload-form { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.upload-form input[type="file"] { flex: 1; min-width: 220px; }
.upload-form button {
    background: #ff6600; color: #fff; border: none; padding: 0.7rem 1.6rem; border-radius: 25px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; font-size: 0.85rem;
}
.upload-form button:hover { background: #e65c00; }

.thumb-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.8rem;
}
.thumb { position: relative; border-radius: 8px; overflow: hidden; background: #eee; aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-selected { outline: 3px solid #ff6600; outline-offset: -3px; }
.thumb-badge {
    position: absolute; bottom: 4px; left: 4px; background: #ff6600; color: #fff;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 10px;
}

@media (max-width: 640px) {
    .topbar-inner { height: auto; padding: 0.8rem 1rem; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .topnav { display: flex; flex-wrap: wrap; gap: 0; row-gap: 0.4rem; }
    .topnav a { margin-left: 0; margin-right: 1.2rem; }
    .page { padding: 1.5rem 1rem 3rem; }
    .data-table th:nth-child(1), .data-table td:nth-child(1) { display: none; }
    .data-table th, .data-table td { padding: 0.7rem 0.8rem; }
    .detail-card { padding: 1.5rem; }
    .detail-table th { width: 100px; font-size: 0.8rem; }
    .detail-head { flex-direction: column; align-items: flex-start; }
    .login-card { padding: 2rem 1.5rem; }
    .code-box { padding: 1rem; }
    .code-value { font-size: 1.3rem; }
    .upload-form { flex-direction: column; align-items: stretch; }
    .upload-form button { width: 100%; }
    .page-head { flex-direction: column; align-items: flex-start; }
}
