/* ================= RESET & BASE ================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #333;
}

/* ================= HEADER ================= */
.page-header {
    background: #c3cfe8;
    padding: 14px 20px;
    margin-bottom: 18px;
    border-radius: 8px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: #1a1f36;
    text-align: center;
}

/* ================= MACHINE BAR ================= */
.machine-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.machine {
    padding: 7px 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e3e6eb;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.machine:hover {
    background: #f4f7fb;
}

.machine.active {
    background: #2c7be5;
    color: #fff;
    border-color: transparent;
}

/* ================= TITLES & TABS ================= */
.machine-title {
    text-align: center;
    font-size: 1.35em;
    font-weight: 600;
    margin: 14px 0;
    color: #1a1f36;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.tabs button {
    padding: 8px 22px;
    border-radius: 10px 10px 0 0;
    border: none;
    background: #e6e9ef;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    color: #4b5563;
}

.tabs button.active {
    background: #ffffff;
    color: #2c7be5;
    box-shadow: inset 0 -2px 0 #2c7be5;
}

/* ================= MAIN CONTAINER ================= */
.container {
    background: #ffffff;
    border-radius: 10px;
    padding: 22px;
    max-width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    transform: translateX(-6vw);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* ================= GRID ================= */
.main-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 26px;
}

/* ================= FORM ================= */
.row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.field {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.82em;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

input,
select,
textarea {
    padding: 7px 10px;
    border: 1px solid #d7dbe1;
    border-radius: 6px;
    font-size: 0.9em;
    background: #ffffff;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2c7be5;
    box-shadow: 0 0 0 2px rgba(44,123,229,0.12);
}

.field.duration {
    max-width: 70px;
}

/* ================= CHECKLIST ================= */
.checklist {
    margin-top: 14px;
    padding: 10px 10px 6px;
    border-radius: 10px;
    background: #fafbfc;
}

.check-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.check-text {
    font-size: 0.85em;
    color: #4b5563;
    flex: 1;
}

.radio-options {
    display: flex;
    background: #eef1f5;
    padding: 3px;
    border-radius: 8px;
}

.radio-options label {
    cursor: pointer;
    margin: 0;
}

.radio-options input {
    display: none;
}

.radio-options span {
    padding: 4px 12px;
    font-size: 1em;
    border-radius: 6px;
    transition: all 0.2s;
}

.radio-options input:checked + span.ja {
    background: #10b981;
    color: #fff;
    font-weight: 600;
}

.radio-options input:checked + span.nein {
    background: #ef4444;
    color: #fff;
    font-weight: 600;
}

.check-note {
    margin-bottom: 8px;
}

.check-note input {
    width: 100%;
    font-size: 0.85em;
}

/* ================= TABLES ================= */
.prod-header,
.stoerungen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
	font-size: 1em;
    font-weight: 600;
    color: #333;
}

.section-title {
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

th {
    background: #f6f8fb;
    color: #64748b;
    font-weight: 600;
    padding: 8px 6px;
    text-align: left;
}

td {
    padding: 6px;
}

tbody tr:not(:last-child) td {
    border-bottom: 1px solid #edf0f4;
}

table input {
    width: 100%;
    padding: 5px 6px;
    border-radius: 5px;
    border: 1px solid #d7dbe1;
    background: #fbfcfe;
    font-size: 0.85em;
}

.total-row {
    background: #f1f5f9;
    font-weight: 600;
}

/* ================= BUTTONS ================= */
.button-group {
    display: flex;
    gap: 6px;
}

.add-btn {
    background: #eef4ff;
    color: #2c7be5;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
}

.delete-btn {
    background: #feecec;
    color: #e53e3e;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
}

.primary {
    background: #2c7be5;
    color: white;
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
	margin-top: 15px;
}

.stoer-delete-btn {
    background: none;
    border: none;
    color: #e53e3e;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    padding: 0 6px;
}

.stoer-delete-btn:hover {
    color: #b91c1c;
}

/* ================= TEXTAREA ================= */
.bemerkungen-container {
    margin-top: 22px;
}

/* titlu "Bemerkungen" */
.bemerkungen-container > label {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1em;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

/* caseta text */
.bemerkungen-textarea {
    width: 100%;
    height: 160px;
    padding: 10px;
    border: 1px solid #d7dbe1;
    border-radius: 6px;
    font-size: 1.1em;
    line-height: 1.5;
    resize: none;
    background: #ffffff;
}

/* ================= MODAL ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
	backdrop-filter: blur(0.7px);
    display: none;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.modal input {
    width: 100%;
    margin-bottom: 10px;
}

.modal h3 {
    text-align: center;
}

#deleteConfirmModal h3 {
    text-align: center;
}

#deleteConfirmModal .modal-actions {
    display: flex;
    justify-content: center;
    gap: 24px;           /* mai mult spațiu între Ja / Nein */
    margin-top: 18px;
}

#deleteConfirmModal .modal-actions button {
    min-width: 80px;
    text-align: center;
}
.problem-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.problem-list li {
    padding: 8px 10px;
    cursor: pointer;
}

.problem-list li:hover {
    background: #f3f4f6;
}

/* ================= REMOVE ================= */
.remove-row {
    font-weight: bold;
    color: #e53e3e;
    cursor: pointer;
}

/* ================= FOOTER ================= */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f5f7f8;
    color: #666;
    padding: 2px 0;
    font-size: 12px;
    text-align: center;
}

/* ================= APP LAYOUT ================= */

.app-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    align-items: flex-start;
}

/* ================= REPORT SIDEBAR ================= */

.report-sidebar {
    padding-top: 10px;
}

.report-sidebar-title {
    font-size: 1em;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.report-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-list li {
    padding: 6px 8px;
    font-size: 0.85em;
    border-radius: 6px;
    cursor: pointer;
    color: #333;
}

.report-list li:hover {
    background: #e9edf3;
}

.report-list li.active {
    background: #dbe7ff;
    color: #1a3fa8;
    font-weight: 600;
}

/* ===== REMOVE NUMBER INPUT ARROWS ===== */

/* Chrome, Edge, Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

/* pop-up confirmare Schicht abschließen */
.modal-overlay-flex {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 10px;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.modal-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-text {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}
button.secondary {
    background: #e5e7eb;
    color: #374151;
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
	margin-top: 15px;
	width: 100px;
}

button.secondary:hover {
    background-color: #d1d5db;
}

.archive-delete-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 12px;   /* mai mic */
    margin-right: 6px;
    padding: 0;
}

.archive-delete-btn:hover {
    color: red;
}

.bericht-item {
    cursor: pointer; /* Schimbă cursorul în deget (pointer) */
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none; /* Previne selectarea textului la click-uri rapide */
}

.bericht-item:hover {
    background: #e9edf3;
}

.bericht-item.active {
    background: #dbe7ff;
    color: #1a3fa8;
    font-weight: 600;
}

/* Asigură-te că și butonul "Aktuell" are pointer */
#aktuellItem {
    cursor: pointer;
    padding: 8px 10px;
    margin-bottom: 5px;
    border-radius: 6px;
}

.page-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-box {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.85em;
}

.user-name {
    font-weight: 600;
    color: #1a1f36;
}

.user-meta {
    font-size: 0.95em;
    color: #6b7280;
}

.logout-btn {
    right: 80px;
    top: 25%;
    transform: translateY(-20%);
    font-size: 18px;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.2s ease;
}
.logout-btn svg {
    width: 22px;
    height: 22px;
}

.logout-btn:hover {
    color: #e53e3e;
    transform: translateY(-30%) scale(1.1);
}

/* ================= READ-ONLY MODE ================= */
.read-only input:not([type="radio"]),
.read-only textarea,
.read-only select,
.read-only .add-btn,
.read-only .delete-btn,
.read-only .stoer-delete-btn,
.read-only .archive-delete-btn,
.read-only [onclick*="addRow"],
.read-only [onclick*="deleteEmptyRows"],
.read-only [onclick*="openStoerungModal"] {
    pointer-events: none !important;
    opacity: 0.7 !important;
    background-color: #f9fafb !important;
    border-color: #e5e7eb !important;
}

.read-only .radio-options span {
    opacity: 0.8;
}

.read-only .radio-options input:checked + span.ja,
.read-only .radio-options input:checked + span.nein {
    opacity: 0.9;
}

.read-only .machine,
.read-only .tabs button,
.read-only .bericht-item,
.read-only .logout-btn {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Stil pentru butonul de Print */
#printReportBtn {
    background: #4b5563;
}

#printReportBtn:hover {
    background: #374151;
}

/* Stil pentru butonul de Edit în arhivă */
#editArchiveBtn {
    background: #8b5cf6;
}

#editArchiveBtn:hover {
    background: #7c3aed;
}

/* Stil pentru butonul de Save în modul editare arhivă */
#editSaveBtn {
    background: #10b981;
}

#editSaveBtn:hover {
    background: #059669;
}

.statistik-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
#statistikContainer {
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 10px 20px;
}

.refresh-btn {
    background: none;
    border: none;
    color: #2c7be5;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.refresh-btn:hover {
    transform: rotate(90deg);
    color: #1a5edb;
}

.fade-update {
    animation: fadeSlideIn 0.35s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-error {
    border: 0.8px solid #ef4444 !important;
    background-color: #fff8f8 !important;
}

.version-demo {
    font-size: 0.6em;
    color: #4b5563;
    margin-left: 6px;
}

.info-icon {
    cursor: pointer;
    font-size: 18px;
    color: #6c757d;
    margin-left: 6px;
    transition: 0.2s;
}

.info-icon:hover {
    color: #007bff;
    transform: scale(1.1);
}

.demo-info-text {
    text-align: left;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.demo-info-text p {
    margin-bottom: 12px;
}

.demo-info-text strong {
    color: #222;
}
