/* style.css - DEMO version (Firebase removed) */
:root{
    --bg:#f5f7f8;
    --panel:#ffffff;
    --muted:#6b7280;
    --card-shadow: 0 6px 18px rgba(20,30,40,0.06);
    --gradient: linear-gradient(90deg, #8bc7c0, #6aada6);
    --tagesplan-bg: #f8fafc;
    --tagesplan-border: #cbd5e1;
    --nsi-color: #b91c1c;
    --wsi-color: #2563eb;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: var(--bg);
    color: #111827;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header{
    background: var(--gradient);
    padding: 16px 20px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
}
header h1{
    margin: 0;
    font-size: 28px;
    color: #454543;
    font-weight: 700;
}
.version-demo {
    font-size: 0.6em;
    opacity: 0.8;
    font-weight: 500;
    margin-left: 8px;
    position: relative;
    top: 2px;
    color: #4b5563;
}

#mainApp { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.main-container { flex: 1; display: flex; align-items: stretch; min-height: 0; }

#mainFooter {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f5f7f8;
    color: #666;
    padding: 1.8px 0;
    text-align: center;
    font-size: 12px;
    z-index: 999;
    border-top: 0px solid #ddd;
    flex-shrink: 0;
}

.main-container {
    display: flex;
    flex: 1;
    gap: 18px;
    padding: 16px 20px 20px 20px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
}

#userBox {
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

#userName {
    font-size: 14px;
    font-weight: 600;
    color: #58637a;
}

#userDate {
    font-size: 12px;
    color: #111827;
}

.left{
    width: 28%;
    min-width: 280px;
    background: var(--tagesplan-bg);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tagesplan-border);
    overflow: hidden;
    flex-shrink: 0;
    min-height: 82vh;
}
.tagesplan-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--tagesplan-border);
    background: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.section-title{
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.icon-btn:hover { background-color: rgba(0, 0, 0, 0.1); }
.icon-btn.save { color: #16a34a; }

.toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--tagesplan-border);
    background: #f8fafc;
    align-items: center;
    flex-wrap: wrap;
}
.toolbar-btn {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.toolbar-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.color-picker {
    display: grid;
    grid-template-columns: repeat(6, 22px);
    gap: 6px;
    padding-left: 8px;
}
.color-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}
.checkmark-btn {
    background: #ffffff;
    color: #16a34a;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.color-btn:hover { border-color: #111827; }

.tagesplan-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
}

.tagesplan-view {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow-y: auto;
    min-height: 650px;
    max-height: 650px;
    line-height: 1.5;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

#tagesplanEdit {
    width: 100%;
    flex: 1;
    min-height: 550px;
    max-height: 550px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 15px;
    line-height: 1.5;
    box-sizing: border-box;
    font-family: inherit;
    overflow-y: auto;
    white-space: pre-wrap;
    transition: all 0.2s ease;
}
#tagesplanEdit:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--panel);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    min-height: 82vh;
    max-height: 80vh;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
    justify-content: flex-start;
    align-items: center;
}
.tab{
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    white-space: nowrap;
}
.tab.active { background: #111827; color: #fff; }
.tab.nsi.active { background: var(--nsi-color); }
.tab.wsi.active { background: var(--wsi-color); }

.table-container-wrapper {
    flex: 1;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 0;
    display: block;
    min-height: 500px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
    min-width: 1000px;
}
th, td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef3f7;
    text-align: center;
    vertical-align: middle;
    height: 42px;
    box-sizing: border-box;
}
th {
    font-weight: 700;
    color: #374151;
    background-color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
    border-top: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}
th:last-child { border-right: none; }

col:nth-child(1) { width: 60px; }
col:nth-child(2) { width: 90px; }
col:nth-child(3) { width: 85px; }
col:nth-child(4) { width: 85px; }
col:nth-child(5) { width: 85px; }
col:nth-child(6) { width: 100px; }
col:nth-child(7) { width: 85px; }
col:nth-child(8) { width: 50px; }
col:nth-child(9) { width: 50px; }
col:nth-child(10) { width: 50px; }
col:nth-child(11) { width: 90px; }
col:nth-child(12) { width: 200px; }

td input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #e6eef6;
    background: #fff;
    font-size: 14px;
    text-align: center;
    font-family: inherit;
}
.small-input { width: 60px !important; }
td[data-field="bemerkungen"] input { text-align: left; padding: 6px 8px; }
td[data-field="bemerkungen"] { text-align: left !important; }

.status-col { width: 50px; }
.status-icon { width: 20px; height: 20px; display: inline-block; color: #64748b; }

tr.erledigt { background: #a7f3d0; }
tr.gestoppt { background: #fef9c3; }
tr.storniert { background: #fecaca; }
tr.inbearbeitung td { color: #16a34a; font-weight: 600; }

.stopp-note-inline { display: inline-block; margin-left: 4px; }
.stopp-input { width: 50px; font-size: 12px; padding: 2px 4px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }
.hidden { display: none !important; }

.controls {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.controls button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 34px;
}
.controls button.delete-selected {
    background-color: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    padding: 6px;
    width: 34px;
    height: 34px;
    gap: 0;
}
.controls button.edit { background: #facc15; color: #000; }
.controls button.save { background: #16a34a; color: #fff; }
.controls button.add { background: #2563eb; color: #fff; }
.controls button.clean { background: #94a3b8; color: #fff; }
.controls button.hidden { display: none; }
.controls button.delete-selected:hover { background-color: #fecaca; color: #b91c1c; border-color: #b91c1c; }
.controls button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

.table-container-wrapper::-webkit-scrollbar { width: 12px; height: 12px; }
.table-container-wrapper::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 0 8px 8px 0; }
.table-container-wrapper::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 8px; border: 2px solid #f1f1f1; }
.table-container-wrapper::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

.table-container td:first-child { text-align: center; width: 40px; }
.table-container td:first-child input[type="checkbox"] { width: 16px; height: 16px; margin: 0; vertical-align: middle; }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 350px;
    text-align: center;
}
.modal-content h3 { margin: 0 0 12px 0; color: #1e293b; font-size: 18px; }
.modal-content p { margin: 8px 0; color: #64748b; }
.modal-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.modal-buttons button { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; min-width: 80px; }
#modalCancel { background: #e2e8f0; color: #475569; }
#modalConfirm { background: #ef4444; color: white; }
#modalCancel:hover { background: #cbd5e1; }
#modalConfirm:hover { background: #dc2626; }

.tagesplan-view ul { list-style-type: disc; margin-left: 20px; padding-left: 0; }
.tagesplan-view li { margin-bottom: 4px; }
.toolbar { min-height: 40px; }
.toolbar-btn { min-width: 36px; height: 36px; }

.table-container { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; }
.table-container.active { display: table; width: 100%; table-layout: fixed; }

.editing .section-title { color: #dc2626; font-style: italic; }

.tab.info-btn {
    margin-left: auto;
    padding: 8px 10px;
    background: #facc15;
    color: #000;
    font-size: 16px;
    font-weight: 700;
}
.tab.info-btn:hover { background: #f59e0b; transform: translateY(-1px); }

.invalid-length-warning { font-weight: bold; color: #f59e0b !important; }

tr.erledigt td.status-col { position: relative !important; }
tr.erledigt input[type="radio"] { opacity: 0.03 !important; position: relative !important; width: 14px !important; height: 14px !important; margin: 0 auto !important; cursor: pointer !important; z-index: 2 !important; display: block !important; }
tr.erledigt td.status-col:hover input[type="radio"] { opacity: 0.7 !important; }
tr.erledigt td.status-col::after { content: "✓" !important; position: absolute !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; color: #16a34a !important; font-weight: bold !important; font-size: 14px !important; z-index: 1 !important; pointer-events: none !important; }
tr.erledigt .status-icon { display: none !important; }

tr.storniert td.status-col { position: relative !important; }
tr.storniert input[type="radio"] { opacity: 0.03 !important; position: relative !important; width: 14px !important; height: 14px !important; margin: 0 auto !important; cursor: pointer !important; z-index: 2 !important; display: block !important; }
tr.storniert td.status-col:hover input[type="radio"] { opacity: 0.7 !important; }
tr.storniert td.status-col::after { content: "✕" !important; position: absolute !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; color: #dc2626 !important; font-weight: bold !important; font-size: 14px !important; z-index: 1 !important; pointer-events: none !important; }
tr.storniert .status-icon { display: none !important; }

.tagesplan-timestamps {
    margin-top: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}
.timestamp-current { display: grid; grid-template-columns: 90px 1fr; gap: 8px; line-height: 1.4; font-weight: bold !important; }
.timestamp-previous { display: grid; grid-template-columns: 90px 1fr; gap: 8px; line-height: 1.4; margin-top: 2px; }
.table-current-timestamp {
    text-align: left;
    padding: 4px 0;
    font-size: 12px;
    color: #4b5563;
    background: transparent;
    margin-top: 6px !important;
    width: 100%;
    height: 16px !important;
    line-height: 1.2;
}

.save-reminder {
    margin: 16px auto;
    padding: 8px 12px;
    background: #b687e8;
    border: 1px solid #171514;
    border-radius: 8px;
    color: #171514;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.save-reminder.hidden { display: none; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(0.7px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.demo-info-text {
    text-align: left;
    font-size: 14.5px;
    line-height: 1.5;
    color: #374151;
}

.demo-info-text p {
    margin-bottom: 12px;
}

.info-icon {
    cursor: pointer;
    font-size: 18px;
    color: #6c757d;
    margin-left: 3px;
    transition: 0.2s;
}

.info-icon:hover {
    color: #007bff;
    transform: scale(1.1);
}

.modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.modal-actions button {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    background: #111827;
    color: white;
    cursor: pointer;
	font-size: 11px;
}

.modal-actions button:hover {
    background: #374151;
}
