/* ============================================
   GLOBALE STILE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.logo-img {
    height: 30px;
    width: auto;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-list a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-list a:hover {
    color: #3498db;
}

/* ============================================
   TABS
   ============================================ */
.tabs-container {
    width: fit-content;
    display: flex;
    overflow: hidden;
    background-color: #cfcfcf;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.modesw-container {
    border-radius: 0.5rem 0.5rem 0 0;
    margin-left: 5px;
}

.tab-button, .tab-modesw {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    transition: background-color 0.2s;
    font-size: clamp(10px, 1.5vw, 16px);
}

.tab-button+.tab-button, .tab-modesw+.tab-modesw {
    border-left: 1px solid #e5e7eb;
}

.tab-button:hover, .tab-modesw:hover {
    background-color: #f3f4f6;
}

.tab-button.active, .tab-modesw.active {
    background-color: #3b82f6;
    color: white;
}

.tab-content {
    display: none;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.importmode {
    display: none;
}

.importmode.active {
    display: block;
}

.rawtext-input {
    width: 100%;
    height: 100%;
    max-height: 219.98px;
    padding: 12px;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    margin-bottom: 20px;
    outline: none;
}

.rawtext-input:focus {
    border: 2px solid #27ae60;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   DRAG & DROP
   ============================================ */
.drag-drop-box {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #ecf7ff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.drag-drop-box:hover {
    border-color: #2980b9;
    background-color: #ddefff;
}

.drag-drop-box.drag-over {
    border-color: #27ae60;
    background-color: #e8f8f5;
    transform: scale(1.02);
}

.upload-icon {
    width: 50px;
    height: 50px;
    color: #3498db;
    margin-bottom: 15px;
}

.drag-drop-box h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.drag-drop-box p {
    color: #7f8c8d;
    font-size: 14px;
}

.file-input {
    display: none;
}

.process-button {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.process-button:hover {
    background-color: #229954;
}

.process-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    font-size: 22px;
    color: #2c3e50;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

.modal-info {
    color: #555;
    margin-bottom: 20px;
    font-size: 14px;
}

.skip-rows-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 20px;
}

.skip-rows-section label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    min-width: 200px;
}

.skip-rows-section input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
}

.skip-rows-section input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

#mapping-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mapping-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.mapping-item.last_item {
    margin-top: 15px;
}

.mapping-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
    font-size: 14px;
}

.mapping-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.mapping-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background-color: #ecf0f1;
    color: #333;
}

.btn-cancel:hover {
    background-color: #d5dbdb;
}

.btn-confirm {
    background-color: #3498db;
    color: white;
}

.btn-confirm:hover {
    background-color: #2980b9;
}

.customer-name-section{
    --width-of-input: 200px;
    --border-height: 1px;
    --border-before-color: rgba(221, 221, 221, 0.39);
    --border-after-color: #5891ff;
    --input-hovered-color: #4985e01f;
    margin-top: 10px;
    position: relative;
    width: var(--width-of-input);
}

#customer_name {
    color: #000000;
    font-size: 0.9rem;
    background-color: transparent;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: var(--border-height) solid var(--border-before-color);
}

.input-border {
    position: absolute;
    background: var(--border-after-color);
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    transition: 0.3s;
}

input:hover {
    background: var(--input-hovered-color);
}

input:focus {
    outline: none;
}

input:focus ~ .input-border {
    width: 100%;
}

/* ============================================
   HAUPTINHALT
   ============================================ */
.main-content {
    max-width: 2000px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
}

.section {
    background-color: #fff;
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.section h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.section p {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer p {
    color: #ecf0f1;
}

/* ============================================
   ANFRAGEN TABELLE
   ============================================ */
.table-loading {
    padding: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.table-error {
    padding: 12px 16px;
    background-color: #fdecea;
    color: #c0392b;
    border-radius: 5px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.matches-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.matches-header h2 {
    margin: 0;
}

.btn-recalc {
    padding: 6px 14px;
    border: 1px solid #bdc3c7;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-recalc:hover:not(:disabled) {
    background-color: #ecf0f1;
}

.btn-recalc:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.recalc-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: opacity 0.3s;
}

.recalc-toast--info    { background: #2c3e50; color: #fff; }
.recalc-toast--success { background: #27ae60; color: #fff; }
.recalc-toast--error   { background: #e74c3c; color: #fff; }

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-bar select {
    padding: 6px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
    cursor: pointer;
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 13px;
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-info {
    font-size: 13px;
    color: #7f8c8d;
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    padding: 6px 14px;
    border: 1px solid #bdc3c7;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #ecf0f1;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 13px;
    color: #555;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background-color: #2c3e50;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.data-table th:hover {
    background-color: #34495e;
}

.data-table th .sort-arrow {
    margin-left: 6px;
    opacity: 0.4;
    font-size: 11px;
}

.data-table th.sort-asc .sort-arrow::after {
    content: '▲';
    opacity: 1;
}

.data-table th.sort-desc .sort-arrow::after {
    content: '▼';
    opacity: 1;
}

.data-table th:not(.sort-asc):not(.sort-desc) .sort-arrow::after {
    content: '⇅';
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ecf0f1;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tbody tr:hover {
    background-color: #eaf4fb;
}

.btn-delete {
    padding: 6px 16px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.copy-btn {
    margin-left: 5px;
    padding: 1px 5px;
    font-size: 11px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f5f5f5;
    cursor: pointer;
    color: #555;
    vertical-align: middle;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #e0e0e0;
    border-color: #aaa;
    transition: all 0.3s ease;
}

.copied {
    background: #37ff8b;
    border-color: #37ff8b;
    color: rgb(5, 54, 0);
    transition: all 0.3s ease;
}

.copied:hover {
    background: #37ff8b;
    border-color: #37ff8b;
    color: rgb(5, 54, 0);
    transition: all 0.3s ease;
}

.expand-toggle {
    text-align: center;
    color: #3498db;
    font-size: 11px;
    width: 24px;
    user-select: none;
}

.detail-row td {
    padding: 0 10px !important;
    background-color: #f0f7ff;
    border-bottom: 2px solid #3498db;
}

.detail-panel {
    padding: 14px 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-col strong {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 13px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.detail-table th {
    background-color: #34495e;
    color: #fff;
    padding: 6px 10px;
    text-align: left;
    cursor: default;
}

.detail-table th:hover {
    background-color: #34495e;
}

.detail-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #dce1e7;
    white-space: nowrap;
    max-width: none;
}

/* ============================================
   RESPONSIVES DESIGN
   ============================================ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }

    .tab-button {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .nav-list {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .section {
        padding: 20px;
    }

    .section h1 {
        font-size: 24px;
    }

    .section h2 {
        font-size: 20px;
    }
}