/* Hubex Rechnungsportal – Hotel Biedermeier */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: #f4f2ee;
    color: #2c2a26;
    font-size: 15px;
    line-height: 1.5;
}

/* Kopfzeile */
.topbar {
    background: #3d2f23;
    color: #fff;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.brand { font-weight: 600; font-size: 17px; }
.topbar nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar nav a {
    color: #e8ddcf;
    text-decoration: none;
}
.topbar nav a:hover { color: #fff; text-decoration: underline; }
.userinfo { color: #b8a88f; font-size: 13px; }
.logout { font-size: 13px; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 32px 0 12px; }

/* Übersichtskästen */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
    background: #fff;
    border: 1px solid #e0d9cd;
    border-radius: 8px;
    padding: 14px 20px;
    min-width: 240px;
}
.stat-label { font-size: 13px; color: #7a6f60; }
.stat-value { font-size: 24px; font-weight: 700; color: #a5541c; }
.stat-paid .stat-value { color: #2e7d32; }
.stat-sub { font-size: 12px; color: #9a8f7f; }

/* Filterleiste */
.filterbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filterbar input[type="text"] { min-width: 260px; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e0d9cd; border-radius: 8px; }
table { border-collapse: collapse; width: 100%; }
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee6da;
    vertical-align: top;
    white-space: nowrap;
}
th { background: #faf7f2; font-size: 13px; color: #6b6154; }
tr:last-child td { border-bottom: none; }
td small { color: #9a8f7f; }
.num { text-align: right; }
.files, .actions { white-space: nowrap; }
.actions form { display: inline-block; margin: 0 4px 4px 0; }
.inline-form input[type="password"] { width: 150px; padding: 5px 8px; font-size: 13px; }

/* Status-Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-offen           { background: #fdecdc; color: #a5541c; }
.badge-heruntergeladen { background: #e3ecf7; color: #23538a; }
.badge-bezahlt         { background: #e2f2e3; color: #2e7d32; }
.badge-inaktiv         { background: #eee; color: #777; }

/* Formulare */
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }
input[type="text"], input[type="password"], input[type="file"], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfc5b5;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.filterbar input, .filterbar select { width: auto; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid #a5541c33;
    border-color: #a5541c;
}
.form-card {
    background: #fff;
    border: 1px solid #e0d9cd;
    border-radius: 8px;
    padding: 20px 24px 24px;
    max-width: 760px;
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 180px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #cfc5b5;
    border-radius: 6px;
    background: #fff;
    color: #3d2f23;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { background: #f5efe6; }
.btn-primary { background: #a5541c; border-color: #a5541c; color: #fff; }
.btn-primary:hover { background: #8c4514; }
.btn-success { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.btn-success:hover { background: #256428; }
.btn-danger { background: #fff; border-color: #c62828; color: #c62828; }
.btn-danger:hover { background: #fdecec; }
.btn-light { background: #f5f1ea; }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 16px; }

/* Meldungen */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.flash ul { margin: 0; padding-left: 20px; }
.flash-success { background: #e2f2e3; color: #256428; border: 1px solid #bfe0c1; }
.flash-error   { background: #fdecec; color: #b02a2a; border: 1px solid #f2c4c4; }

/* Login */
.login-box {
    max-width: 400px;
    margin: 8vh auto 0;
    background: #fff;
    border: 1px solid #e0d9cd;
    border-radius: 10px;
    padding: 28px 32px 32px;
}
.login-box h1 { text-align: center; }

.empty { color: #8a7f6f; padding: 30px 0; text-align: center; }

.footer {
    text-align: center;
    color: #9a8f7f;
    font-size: 12px;
    padding: 20px;
}

/* ---------- Mobil (Smartphones & kleine Tablets) ---------- */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .container { padding: 16px 12px 40px; }
    h1 { font-size: 20px; margin-bottom: 14px; }
    h2 { font-size: 16px; }

    /* Kopfzeile */
    .topbar-inner { padding: 10px 12px; }
    .brand { font-size: 14px; }
    .topbar nav { gap: 12px; font-size: 14px; width: 100%; }
    .userinfo { display: block; width: 100%; order: 10; }

    /* Übersichtskästen untereinander */
    .stats { flex-direction: column; gap: 10px; }
    .stat-card { min-width: 0; width: 100%; padding: 12px 16px; }
    .stat-value { font-size: 20px; }

    /* Filter: alles volle Breite */
    .filterbar { flex-direction: column; }
    .filterbar input[type="text"],
    .filterbar select,
    .filterbar .btn { width: 100%; min-width: 0; text-align: center; }
    .filterbar input[type="text"] { text-align: left; }

    /* Tabellen werden zu Karten */
    .table-wrap { border: none; background: transparent; overflow: visible; }
    table, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tr {
        background: #fff;
        border: 1px solid #e0d9cd;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 4px 14px;
    }
    tr:last-child td { border-bottom: 1px solid #f2ece2; }
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid #f2ece2;
        white-space: normal;
        text-align: right;
    }
    td:last-child { border-bottom: none !important; }
    /* Spaltenname links vor jedem Wert */
    td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #6b6154;
        text-align: left;
        flex-shrink: 0;
    }
    .files, .actions { flex-wrap: wrap; justify-content: flex-end; }
    .files::before, .actions::before { margin-right: auto; }
    .actions form { margin: 2px 0 2px 6px; }

    /* Größere Touch-Flächen */
    .btn { padding: 10px 16px; }
    .btn-small { padding: 8px 12px; font-size: 13px; }
    .inline-form input[type="password"] { width: 140px; }

    /* Formulare: Felder untereinander */
    .form-row { flex-direction: column; gap: 0; }
    .form-row > div { min-width: 0; }
    .form-card { padding: 16px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; text-align: center; }

    .login-box { margin-top: 4vh; padding: 22px 20px 26px; }
}
