/* ETIM Portal — Gemeinsames Stylesheet v2 */
:root {
    --primary: #1a56db;
    --primary-light: #e8effd;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
}

/* ─── Launcher ─── */
.launcher {
    max-width: 800px;
    margin: 80px auto;
    text-align: center;
    padding: 0 20px;
}
.launcher h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.launcher .subtitle { color: var(--gray-500); margin-bottom: 2rem; }
.launch-cards { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    max-width: 400px;
}
.card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(26,86,219,0.15); }
.card.small { padding: 1.25rem; max-width: 220px; }
.card-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.card h2 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.card h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.card p { color: var(--gray-500); font-size: 0.85rem; }

/* ─── Fenster-Layout ─── */
.window-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.window-header h1 { font-size: 1rem; font-weight: 600; white-space: nowrap; }
.window-header .badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.search-box { flex: 1; }
.search-box input {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    outline: none;
}
.search-box input:focus { border-color: var(--primary); }

/* ─── Filter-Leiste ─── */
.filter-bar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-bar select {
    padding: 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
    max-width: 220px;
}
.batch-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.batch-actions span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
}

/* ─── Buttons ─── */
.btn-small {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    border: 1px solid var(--gray-300);
    background: white;
    white-space: nowrap;
}
.btn-small:hover { background: var(--gray-100); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: #1e40af; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #047857; }
.btn-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
.btn-outline { background: white; }
.btn-tiny {
    padding: 2px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    background: white;
    white-space: nowrap;
}
.btn-tiny:hover { background: var(--gray-100); }
.btn-next { margin-left: auto; color: var(--primary); border-color: var(--primary); }
.btn-next:hover { background: var(--primary-light); }

/* ─── Fortschritts-Panel ─── */
.progress-toggle-bar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 4px 16px;
    font-size: 0.75rem;
    color: var(--primary);
    cursor: pointer;
    text-align: center;
}
.progress-toggle-bar:hover { background: var(--primary-light); }
.progress-panel {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    max-height: 250px;
    overflow-y: auto;
}
.progress-header {
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
}
.progress-content { padding: 4px 16px; }
.progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    cursor: pointer;
    font-size: 0.8rem;
}
.progress-row:hover { background: var(--gray-50); }
.progress-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-label small { color: var(--gray-500); }
.progress-bar-wrap {
    width: 80px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.progress-bar-fill {
    height: 100%;
    background: var(--warning);
    border-radius: 4px;
    transition: width 0.3s;
}
.progress-bar-fill.complete { background: var(--success); }
.progress-pct {
    font-size: 0.75rem;
    color: var(--gray-500);
    min-width: 40px;
    text-align: right;
}

/* ─── Produkt-Liste ─── */
.product-list {
    padding: 4px 8px;
    max-height: 220px;
    overflow-y: auto;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}
.product-item {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    gap: 8px;
    font-size: 0.8rem;
    border-left: 3px solid transparent;
}
.product-item:hover { background: var(--gray-100); }
.product-item.active { background: var(--primary-light); border-left-color: var(--primary); font-weight: 500; }

/* Status-Farben */
.product-item.status-complete { border-left-color: var(--success); }
.product-item.status-all-controlled { border-left-color: #34d399; }
.product-item.status-partial { border-left-color: var(--warning); }
.product-item.status-none { border-left-color: var(--danger); }
.product-item.status-unclassified { border-left-color: var(--gray-300); }

.product-item .complete-icon {
    color: var(--success);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.product-item .sku { font-family: monospace; min-width: 72px; flex-shrink: 0; }
.product-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-item .class-badge {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--gray-500);
    flex-shrink: 0;
}
.product-item .select-cb { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }

/* Mini-Fortschrittsbalken in Liste */
.mini-progress {
    width: 40px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.mini-bar {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    display: block;
}

/* ─── Feature-Editor ─── */
.feature-editor { padding: 10px 16px; }
.feature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}
.feature-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.feature-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.feature-header h2 { font-size: 0.95rem; }
.class-link {
    color: var(--primary);
    cursor: pointer;
    font-family: monospace;
    font-size: 0.85rem;
    text-decoration: underline;
}
.class-link:hover { color: #1e40af; }

/* Fertig-Toggle */
.complete-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.complete-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--success);
}
.complete-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}

/* Feature-Toolbar */
.feature-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 0;
}
.toolbar-info {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: 8px;
}

.feature-row {
    display: grid;
    grid-template-columns: 180px 1fr 40px 28px;
    gap: 6px;
    align-items: center;
    padding: 5px 4px;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 3px;
}
.feature-row:hover { background: var(--gray-50); }
.feature-row.row-controlled { background: #f0fdf4; }
.feature-name { font-size: 0.8rem; color: var(--gray-700); }
.feature-type {
    font-size: 0.6rem;
    color: var(--gray-500);
    text-transform: uppercase;
}
.feature-type em { color: var(--primary); text-transform: none; }
.feature-input input,
.feature-input select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.8rem;
}
.feature-input input:focus, .feature-input select:focus {
    border-color: var(--primary);
    outline: none;
}
.feature-input input.error { border-color: var(--danger); background: #fef2f2; }
.feature-input input.prefilled,
.feature-input select.prefilled { border-color: var(--success); background: var(--success-light); }
.feature-input input.copied,
.feature-input select.copied { border-color: #818cf8; background: #eef2ff; }
.feature-unit { font-size: 0.75rem; color: var(--gray-500); }
.feature-check {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--success);
}

/* Status-Leiste */
.status-bar {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--gray-500);
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 100;
}
.status-bar .fill-rate { color: var(--success); font-weight: 600; }

/* ─── ETIM Modell ─── */
.class-detail { padding: 16px; }
.class-header { margin-bottom: 16px; }
.class-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.class-header .code { font-family: monospace; color: var(--primary); }
.class-header .group { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }

.etim-feature {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 8px;
}
.etim-feature-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.etim-feature-name .code { font-family: monospace; font-size: 0.75rem; color: var(--gray-500); }
.etim-feature-name .type-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.type-badge.alpha { background: #ede9fe; color: #7c3aed; }
.type-badge.numeric { background: #dbeafe; color: #2563eb; }
.type-badge.logical { background: #fef3c7; color: #d97706; }
.type-badge.range { background: #e0e7ff; color: #4338ca; }

.etim-values { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.etim-value-chip {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray-700);
}

/* ─── Produktdetails ─── */
.product-detail { padding: 16px; }
.product-detail h2 { font-size: 1.1rem; margin-bottom: 4px; }
.product-detail .sku { font-family: monospace; color: var(--gray-500); }
.product-detail .description {
    margin: 12px 0;
    padding: 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.6;
}
.specs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}
.specs-table th, .specs-table td {
    text-align: left;
    padding: 6px 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}
.specs-table th { background: var(--gray-50); font-weight: 500; }
.specs-table tr:hover { background: var(--gray-50); }

.source-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}
.source-link:hover { text-decoration: underline; }

/* ─── Modals ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-wide { max-width: 800px; }
.modal h3 { margin-bottom: 12px; font-size: 1rem; }
.modal input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.modal-hint { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 12px; }
.modal-result {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.modal-result:hover { background: var(--primary-light); }
.modal-result .code { font-family: monospace; color: var(--primary); }
.modal-close {
    background: var(--gray-200);
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 12px;
    font-size: 0.85rem;
}
.modal-close:hover { background: var(--gray-300); }

/* Vergleichstabelle */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 8px;
}
.compare-table th, .compare-table td {
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    text-align: left;
}
.compare-table th { background: var(--gray-50); font-weight: 500; }
.compare-table tr.diff { background: #fef3c7; }
.compare-table select {
    width: 100%;
    padding: 4px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Historie-Tabelle */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.history-table th, .history-table td {
    padding: 4px 6px;
    border: 1px solid var(--gray-200);
    text-align: left;
}
.history-table th { background: var(--gray-50); font-weight: 500; }

/* ─── Leer-Zustand ─── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ─── Excel-Merkmale Fenster ─── */
.excel-badge {
    background: #059669;
    color: white;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.sheet-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    padding: 8px 0 4px;
    border-bottom: 2px solid var(--gray-200);
    margin-top: 12px;
    margin-bottom: 4px;
}
.excel-value {
    display: inline-block;
    padding: 4px 8px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 0.8rem;
    min-width: 60px;
}
.excel-empty {
    color: var(--gray-300);
    font-size: 0.8rem;
    padding: 4px 8px;
}
.excel-dash {
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 4px 8px;
}
.feature-check-display {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--gray-300);
    border: 1px solid var(--gray-300);
    border-radius: 3px;
}
.feature-check-display.checked {
    color: var(--success);
    border-color: var(--success);
    background: var(--success-light);
}

/* Synonym-Hinweis */
.synonym-hint { color: #8b5cf6; font-style: italic; }

/* Popup-Hinweis Overlay */
.popup-hint {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.popup-hint-content {
    background: #fff; border-radius: 12px; padding: 28px 36px;
    max-width: 480px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.popup-hint-content code {
    background: var(--gray-100); padding: 2px 6px; border-radius: 4px; font-size: 0.9rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
