/* ============================================================
   KIPG PDF Labor – Frontend CSS v3.3.2
   ============================================================ */

.kipg-fe-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1f2937;
    max-width: 100%;
}

/* ── Login-Hinweis ── */
.kipg-fe-login-notice {
    background: #f0f6fc;
    border: 1px solid #c7d9ed;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #374151;
}
.kipg-fe-lock { font-size: 28px; display: block; margin-bottom: 8px; }

/* ── Suchleiste ── */
.kipg-fe-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.kipg-fe-search-input-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.kipg-fe-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}
.kipg-fe-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s;
}
.kipg-fe-search-input:focus { border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,.15); }
.kipg-fe-type-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

/* ── Ergebnis-Info ── */
.kipg-fe-results-info {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

/* ── Tabelle / Zeilen ── */
.kipg-fe-results {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.kipg-fe-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.kipg-fe-row:last-child { border-bottom: none; }
.kipg-fe-row--even { background: #f9fafb; }
.kipg-fe-row:hover { background: #eff6ff; }

.kipg-fe-row-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}
.kipg-fe-row-body {
    flex: 1;
    min-width: 0;
}
.kipg-fe-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}
.kipg-fe-row-title {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
}
.kipg-fe-row-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6b7280;
}
.kipg-fe-pno { font-family: monospace; }
.kipg-fe-snippet {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kipg-fe-snippet mark { background: #fef08a; color: inherit; border-radius: 2px; }
.kipg-fe-row-title mark { background: #fef08a; color: inherit; }

/* ── Typ-Badge ── */
.kipg-fe-row-type {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    background: #dbeafe;
    color: #1e40af;
}
.kipg-fe-type--din-norm, .kipg-fe-type--din_norm { background: #fee2e2; color: #991b1b; }
.kipg-fe-type--datenblatt { background: #d1fae5; color: #065f46; }
.kipg-fe-type--betriebsanleitung { background: #fef3c7; color: #92400e; }
.kipg-fe-type--wartungsanleitung { background: #ede9fe; color: #4c1d95; }
.kipg-fe-type--zertifikat { background: #e0f2fe; color: #0c4a6e; }

/* ── Konfidenz ── */
.kipg-fe-conf { font-weight: 700; font-size: 11px; }
.kipg-fe-conf--high { color: #15803d; }
.kipg-fe-conf--mid  { color: #b45309; }
.kipg-fe-conf--low  { color: #dc2626; }

/* ── Aktions-Buttons ── */
.kipg-fe-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.kipg-fe-dl-btn,
.kipg-fe-json-btn {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background .15s;
    white-space: nowrap;
}
.kipg-fe-dl-btn {
    background: #2271b1;
    color: #fff !important;
}
.kipg-fe-dl-btn:hover { background: #135e96; }
.kipg-fe-json-btn {
    background: #f3f4f6;
    color: #374151;
    font-family: monospace;
    font-size: 13px;
}
.kipg-fe-json-btn:hover { background: #e5e7eb; }

/* ── Leer-Zustand ── */
.kipg-fe-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}
.kipg-fe-empty span { font-size: 32px; display: block; margin-bottom: 8px; }

/* ── Loading ── */
.kipg-fe-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 13px;
}
.kipg-fe-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: kipg-spin .7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes kipg-spin { to { transform: rotate(360deg); } }

/* ── JSON Modal ── */
.kipg-fe-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.kipg-fe-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 760px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.kipg-fe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.kipg-fe-modal-header h3 { margin: 0; font-size: 15px; }
.kipg-fe-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    padding: 0 4px;
}
.kipg-fe-modal-body {
    overflow-y: auto;
    padding: 16px 20px;
}
.kipg-fe-json-pre {
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: #1f2937;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .kipg-fe-row { flex-wrap: wrap; }
    .kipg-fe-row-actions { width: 100%; justify-content: flex-end; }
    .kipg-fe-search-bar { flex-direction: column; }
}
