/* Schrauberwerk Planer – Ergänzungen zu style.css */

.badge { background: #ff4444; color: white; border-radius: 50%; padding: 2px 6px; font-size: 11px; font-weight: bold; position: absolute; top: -5px; right: -5px; }
.inquiry-card { background: #111; border: 1px solid var(--gold); border-radius: 8px; padding: 15px; margin-bottom: 15px; transition: 0.3s; }
.inquiry-card:hover { border-color: #fff; }
.inquiry-card strong { color: var(--gold); }
.btn-small { padding: 5px 10px; font-size: 11px; background: #333; color: white; border: 1px solid #555; border-radius: 4px; cursor: pointer; margin-top: 5px; transition:0.2s;}
.btn-small:hover { background: var(--gold) !important; color: black !important; border-color: var(--gold) !important; }
.btn-reject { background: #ff4444; color: white; border-color: #ff4444;}

.btn-arrow:hover { background: var(--gold) !important; color: black !important; border-color: var(--gold) !important; }

.btn-cancel { transition: 0.2s; cursor: pointer; border: 1px solid #555; background: #333; color: white; }
.btn-cancel:hover { background: var(--danger, #ff4444) !important; color: white !important; border-color: var(--danger, #ff4444) !important; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Kopfbereich */
.nav-block { display: flex; flex-direction: column; align-items: center; }
.nav-label { font-size: 10px; font-weight: bold; color: var(--gold); margin-bottom: 3px; letter-spacing: 1px; text-transform: uppercase; text-align: center; }
.nav-btn { position: relative; width: auto; padding: 8px 14px; border-radius: 8px; background: #111; border: 1px solid var(--gold); transition: 0.3s; color: #fff; cursor: pointer; font-size: 15px; white-space: nowrap; }
.top-nav-controls { flex-wrap: wrap; justify-content: flex-end; row-gap: 12px; }
.sprache { text-decoration: none; opacity: 0.4; display: flex; align-items: center; gap: 5px; color: #fff; font-weight: bold; }
.sprache.aktiv { opacity: 1; }
.sprache img { border-radius: 2px; width: 20px; height: auto; }
.admin-warnung { background: rgba(255,68,68,0.15); border: 1px solid var(--danger); color: #ffb3b3; padding: 10px 15px; border-radius: 8px; margin: 0 0 20px; font-weight: bold; font-size: 13px; text-align: center; }

.stat-zahlart { font-size: 11px; color: #888; margin-top: 8px; display: flex; justify-content: space-between; border-top: 1px solid #333; padding-top: 5px; }
.stat-zahlart b { color: #aaa; }

/* Fenster */
.modal-close { cursor: pointer; color: var(--gold); white-space: nowrap; }
.feld-label { font-size: 11px; font-weight: 800; color: var(--gold); }
.extras-titel { color: var(--gold); font-size: 12px; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }

.q-table { width: 100%; border-collapse: collapse; margin-bottom: 15px; color: #fff; font-size: 13px; }
.q-table th { background: #222; padding: 8px; text-align: left; border-bottom: 1px solid var(--gold); }
.q-table td { padding: 8px; border-bottom: 1px solid #333; }
.q-table input[type="number"], .q-table input[type="text"], .q-table input[type="date"] { width: 100%; padding: 5px; background: #111; border: 1px solid #555; color: #fff; text-align: center; }
.q-table input[type="text"].text-left { text-align: left; }

/* Quittungen: stornierte Einträge */
.q-storniert { opacity: 0.6; border-color: var(--danger) !important; }
.q-storniert .q-betrag { text-decoration: line-through; }
.storno-badge { display: inline-block; background: var(--danger); color: #fff; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 3px; margin-left: 6px; letter-spacing: 1px; }
.p-storno { border: 3px solid #c00; color: #c00; text-align: center; font-weight: bold; font-family: Arial, sans-serif; padding: 10px; margin-bottom: 30px; font-size: 14px; }
.p-storno b { font-size: 22px; letter-spacing: 4px; display: block; }

/* Vorschläge früherer Kunden im Termin-Fenster */
.vorschlag-box { position: absolute; z-index: 50; background: #0d0d0d; border: 1px solid var(--gold); border-radius: 6px; box-shadow: 0 8px 25px rgba(0,0,0,0.8); overflow: hidden; }
.vorschlag-titel { font-size: 10px; font-weight: bold; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; padding: 6px 10px; border-bottom: 1px solid #222; }
.vorschlag { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #1c1c1c; font-size: 13px; }
.vorschlag:last-child { border-bottom: none; }
.vorschlag:hover, .vorschlag:active { background: #1f1f1f; }
.vorschlag small { color: #888; display: block; }

/* Kundensuche */
.kunde-karte { background: #111; border: 1px solid #333; border-radius: 8px; padding: 12px 15px; margin-bottom: 10px; }
.kunde-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; cursor: pointer; }
.kunde-name { font-weight: bold; font-size: 15px; color: #fff; }
.kunde-kontakt { font-size: 12px; color: #aaa; margin-top: 3px; word-break: break-word; }
.kunde-kontakt a { color: #aaa; }
.kunde-meta { text-align: right; font-size: 12px; color: #888; white-space: nowrap; }
.kunde-offen { color: var(--danger); font-weight: bold; }
.kunde-termine { margin-top: 10px; border-top: 1px solid #222; padding-top: 6px; }
.kunde-termin { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #222; font-size: 13px; }
.kunde-termin:last-child { border-bottom: none; }
.kunde-termin .btns { display: flex; gap: 6px; flex-shrink: 0; }

/* Protokoll */
.prot-eintrag { border-bottom: 1px solid #222; padding: 8px 4px; font-size: 13px; color: #ddd; }
.prot-kopf { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prot-aktion { font-weight: bold; color: var(--gold); }
.prot-aktion.warnung { color: var(--danger); }
.prot-zeit { color: #888; font-size: 12px; white-space: nowrap; }
.prot-details { color: #bbb; margin-top: 3px; word-break: break-word; }

#print-area { display: none; }

/* Zeiten außerhalb der Öffnungszeiten (siehe OEFFNUNGSZEITEN in config.php) */
.slot.slot-closed { background: repeating-linear-gradient(135deg, #0c0c0c 0, #0c0c0c 8px, #141414 8px, #141414 16px); }
.slot.slot-closed:hover { background: #1a1a1a; }

@media print {
    @page { margin: 0; }
    body > *:not(#print-area) { display: none !important; }
    body { background: white; margin: 0; padding: 0; color: black; }
    #print-area { display: block !important; width: 100%; padding: 20mm; box-sizing: border-box; }
}

/* --- SCHÖNERES LAYOUT FÜR DIE VORSCHAU & DEN DRUCK --- */
.p-wrapper { font-family: 'Cambria', Georgia, serif; color: black; font-size: 14px; line-height: 1.5; }
.p-header { display: flex; justify-content: space-between; margin-bottom: 50px; }
.p-logo h1 { margin: 0; font-size: 26px; color: #000; font-family: Arial, sans-serif; font-weight: bold; }
.p-logo p { margin: 2px 0; font-size: 13px; color: #555; font-family: Arial, sans-serif; }
.p-address { text-align: right; font-size: 12px; line-height: 1.5; color: #000; }
.p-address strong { font-size: 13px; }

.p-title { text-align: center; font-size: 22px; font-weight: bold; margin: 50px 0; letter-spacing: 2px; text-decoration: underline; }

.p-info { display: flex; justify-content: space-between; margin-bottom: 40px; font-size: 13px; }
.p-info-left strong { display: block; margin-bottom: 8px; font-size: 14px; }

.p-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; font-size: 13px; }
.p-table th, .p-table td { border: 1px solid #000; padding: 10px 12px; }
.p-table th { background-color: #f2f2f2; font-weight: bold; text-align: center; color: black !important; }
.p-table td:nth-child(1), .p-table td:nth-child(3), .p-table td:nth-child(4), .p-table td:nth-child(5) { text-align: center; }
.p-table td:nth-child(2) { text-align: left; }
.p-table .t-sum { font-weight: bold; text-align: right; border: none; padding-top: 15px; font-size: 15px;}
.p-table .t-sum-val { font-weight: bold; border: 1px solid #000; font-size: 15px; }

.p-footer-text { font-size: 12px; margin-top: 60px; line-height: 1.6; font-weight: bold; }
.p-signatures { display: flex; justify-content: space-between; margin-top: 80px; font-size: 12px; }
.p-sig-line { border-top: 1px solid #000; width: 40%; text-align: center; padding-top: 8px; }

/* --- MOBILE OPTIMIERUNG FÜR IPHONE & CO --- */
@media (max-width: 768px) {
    html { -webkit-text-size-adjust: 100%; }
    body { padding: 10px; }

    /* Kopfbereich */
    .top-nav { flex-direction: column; text-align: center; padding: 10px 0; gap: 15px; margin-bottom: 15px; }
    .top-nav > div { flex-direction: column; width: 100%; gap: 15px; }
    .main-logo { height: 70px; }
    .page-title { font-size: 24px; letter-spacing: 0; }
    .top-nav-controls { flex-direction: row !important; flex-wrap: wrap; justify-content: center; gap:10px !important; width: 100%; }
    .top-nav-controls > div { border-right: none !important; margin: 0 !important; padding: 5px !important; width: calc(50% - 5px); justify-content: flex-end; }
    .top-nav-controls > div:first-child, .top-nav-controls > div:last-child { width: 100% !important; } /* Sprache und Datum über die volle Breite, die Knöpfe paarweise */
    .date-controls { width: 100%; }
    .date-controls .date-picker { flex: 1; width: auto; min-width: 0; font-size: 18px !important; padding: 10px 4px; text-align: center; }
    .date-controls .date-picker::-webkit-date-and-time-value { text-align: center; }
    .date-controls .btn-arrow { padding: 12px 20px !important; font-size: 20px !important; }

    .stats-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }
    .stat-card { padding: 18px; }
    .stat-card .val { font-size: 28px; }

    /* Kalender: beide Bühnen nebeneinander, kompaktere Zeilen */
    .calendar-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; margin-bottom:20px; }
    .calendar-container { min-width: 0; }
    .grid-header, .grid-row { grid-template-columns: 48px 1fr 1fr; }
    .grid-header div { padding: 10px 4px; font-size: 12px; }
    .grid-row { height: 64px; }
    .time-label { padding-top: 4px; font-size: 12px; }
    .slot { -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2); }
    .booking { left: 2px; right: 2px; padding: 4px 6px; font-size: 11px; line-height: 1.3; border-radius: 4px; border-left-width: 4px !important; }
    .booking-title { font-size: 11px; flex-wrap: wrap; gap: 0 4px; margin-bottom: 2px; padding-bottom: 2px; }
    .booking-title small { font-size: 9px; }
    .booking-name, .booking-desc, .booking-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .alert-icon { font-size: 12px; }

    /* Formulare */
    .responsive-flex { flex-direction: column !important; gap: 10px !important; align-items: stretch !important; }
    .responsive-flex > div, .responsive-flex > input, .responsive-flex > select, .responsive-flex > button { width: 100% !important; margin: 0 !important; }

    input, select, textarea { font-size: 16px !important; } /* Verhindert iOS Zoom */

    /* iPhone: Datums-/Uhrzeitfelder sonst zentriert, mit eigener Höhe und verrutscht */
    input[type="date"], input[type="datetime-local"], input[type="time"] {
        -webkit-appearance: none; appearance: none;
        display: block; min-height: 50px; line-height: 1.2; text-align: left;
    }
    input[type="date"]::-webkit-date-and-time-value,
    input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }

    /* Fenster (Dialoge) */
    dialog { width: 96vw !important; max-width: 96vw !important; padding: 0 !important; margin: auto !important; max-height: 92vh; max-height: 92dvh; }
    .modal-header { padding: 15px; font-size: 14px; gap: 10px; align-items: center; }
    .modal-body { padding: 15px; }
    .extras-section { padding: 12px; }
    .extra-item { gap: 10px; font-size: 13px; }
    .extra-item input[type="number"] { flex-shrink: 0; width: 70px; }

    #global-warning { flex-direction: column; text-align: center; gap: 10px; margin-top: 10px !important; margin-bottom:10px !important; }

    .q-table { display: block; overflow-x: auto; white-space: nowrap; }
    .q-table td:first-child { white-space: normal; min-width: 150px; }
    .q-table input[type="number"] { min-width: 60px; }
    #preview-render-area { padding: 20px 15px !important; }
    #preview-render-area .p-header, #preview-render-area .p-info { flex-direction: column; gap: 15px; }
    #preview-render-area .p-address { text-align: left; }
    #preview-render-area .p-title { margin: 25px 0; }
    #preview-render-area .p-header, #preview-render-area .p-info { margin-bottom: 25px; }
    #preview-render-area .p-table { font-size: 11px; }
    #preview-render-area .p-table th, #preview-render-area .p-table td { padding: 6px 4px; }
    #preview-render-area .p-table .t-sum, #preview-render-area .p-table .t-sum-val { font-size: 12px; }
    #modal-quittung-preview .modal-body { padding: 10px !important; }

    .btn-small, .btn-arrow, .btn-save, .btn-cancel, .btn-del { padding: 12px 15px !important; font-size: 13px !important; }

    .modal-body .total-display { text-align: center !important; font-size: 24px !important; }
    .mobile-hide { display: none; }

    .kunde-kopf { flex-direction: column; }
    .kunde-meta { text-align: left; }
    .kunde-termin { flex-direction: column; align-items: flex-start; }
}
