/* Verkauf Admin – einheitliche Tab-Navigation & Zusatz-Panels */

.admin-topbar {
    background: rgba(44, 49, 58, 0.9);
    border: 2px solid #ff9800;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    backdrop-filter: blur(10px);
}

.admin-topbar h1 {
    color: #ff9800;
    font-size: 1.6em;
    margin: 0;
}

.admin-topbar-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.admin-topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.admin-dash-stats .dash-card {
    background: rgba(44, 49, 58, 0.75);
    border: 1px solid #444a57;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.admin-dash-stats .dash-value {
    font-size: 1.6em;
    font-weight: 700;
    color: #ff9800;
}

.admin-dash-stats .dash-label {
    color: #b0bec5;
    font-size: 0.8em;
    margin-top: 4px;
}

.admin-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 6px;
    background: rgba(30, 33, 40, 0.8);
    border-radius: 12px;
    border: 1px solid #444a57;
}

.admin-tab {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #b0bec5;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.admin-tab:hover {
    background: rgba(255, 152, 0, 0.15);
    color: #fff;
}

.admin-tab.active {
    background: #ff9800;
    color: #1e2128;
}

.admin-tab .tab-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #f44336;
    color: #fff;
    font-size: 0.65em;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.admin-tab .tab-badge.show {
    display: flex;
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.admin-section {
    background: rgba(44, 49, 58, 0.8);
    border: 2px solid #444a57;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-section-header h2 {
    color: #ff9800;
    font-size: 1.4em;
    margin: 0;
}

.admin-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.admin-filter-bar .filter-btn {
    padding: 8px 14px;
    border: 2px solid #444a57;
    border-radius: 8px;
    background: #1e2128;
    color: #b0bec5;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.admin-filter-bar .filter-btn.active,
.admin-filter-bar .filter-btn:hover {
    border-color: #ff9800;
    color: #ff9800;
}

/* User-Produkte Grid */
.up-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.up-product-card {
    background: #1e2128;
    border: 2px solid #444a57;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
    position: relative;
}

.up-product-delete-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(244, 67, 54, 0.92);
    color: #fff;
    font-size: 1.1em;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.up-product-delete-corner:hover {
    background: #f44336;
}

.up-product-card:hover {
    border-color: #ff9800;
}

.up-product-image-wrap {
    position: relative;
    cursor: pointer;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
}

.up-product-image-wrap:hover .up-preview-hint {
    opacity: 1;
}

.up-product-image-clickable {
    cursor: pointer;
}

.up-preview-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.75em;
    padding: 4px 10px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

/* Shop-Vorschau Modal */
.up-shop-preview-content {
    max-width: 960px !important;
    width: 100%;
}

.up-shop-preview-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin: 20px 0;
    align-items: start;
}

.up-shop-preview-label {
    color: #ff9800;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.up-shop-card-preview {
    background: rgba(44, 49, 58, 0.9);
    border: 2px solid #444a57;
    border-radius: 12px;
    overflow: hidden;
    max-width: 260px;
}

.up-shop-card-preview .shop-prev-image {
    height: 140px;
    background: #1e2128;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.up-shop-card-preview .shop-prev-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.up-shop-card-preview .shop-prev-body {
    padding: 12px;
}

.up-shop-card-preview .shop-prev-title {
    color: #fff;
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.up-shop-card-preview .shop-prev-price {
    color: #ff9800;
    font-size: 1.15em;
    font-weight: 700;
}

.up-shop-card-preview .shop-prev-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2196F3;
    color: #fff;
    font-size: 0.65em;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.up-shop-detail-preview {
    background: #1e2128;
    border: 2px solid #444a57;
    border-radius: 12px;
    padding: 16px;
    max-height: 420px;
    overflow-y: auto;
}

.up-shop-detail-preview .shop-prev-gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 4px;
}

.up-shop-detail-preview .shop-prev-gallery img {
    height: 120px;
    width: auto;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.up-shop-preview-notify {
    border-top: 2px solid #444a57;
    padding-top: 16px;
    margin-top: 8px;
}

.up-shop-preview-notify textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px;
    background: #1e2128;
    border: 2px solid #444a57;
    border-radius: 8px;
    color: #fff;
    margin: 10px 0 12px;
    box-sizing: border-box;
    font-family: inherit;
}

.up-shop-preview-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .up-shop-preview-layout {
        grid-template-columns: 1fr;
    }

    .up-shop-card-preview {
        max-width: 100%;
    }
}

.up-product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #2c313a;
    display: block;
}

.up-product-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: #2c313a;
}

.up-product-body {
    padding: 16px;
}

.up-product-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.up-product-price {
    color: #4CAF50;
    font-size: 1.2em;
    font-weight: 700;
    margin: 8px 0;
}

.up-product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Kaufanfragen */
.inquiries-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inquiry-card {
    background: #1e2128;
    border: 2px solid #444a57;
    border-radius: 12px;
    padding: 20px;
}

.inquiry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.inquiry-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.inquiry-info-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
}

.inquiry-info-label {
    color: #888;
    font-size: 0.8em;
    margin-bottom: 4px;
}

.inquiry-info-value {
    color: #f1f1f1;
}

.inquiry-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Benutzer-Tabelle */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #444a57;
}

.admin-table th {
    background: #1e2128;
    color: #ff9800;
    font-weight: 600;
}

.admin-table td {
    color: #b0bec5;
}

/* Einstellungen */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.settings-card {
    border-radius: 12px;
    padding: 22px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid;
}

.settings-card:hover {
    transform: translateY(-4px);
}

/* System */
.api-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.api-status-card {
    background: #1e2128;
    border: 2px solid #444a57;
    border-radius: 12px;
    padding: 18px;
}

.api-status-card.status-ok { border-color: #4CAF50; }
.api-status-card.status-error { border-color: #f44336; }

.api-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.api-status-header h3 {
    color: #ff9800;
    font-size: 1em;
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.status-pending { background: #ff9800; color: #fff; }
.status-approved, .status-active, .status-completed { background: #4CAF50; color: #fff; }
.status-rejected, .status-blocked, .status-cancelled { background: #f44336; color: #fff; }
.status-processing { background: #2196F3; color: #fff; }

.visibility-published { background: #4CAF50; color: #fff; }
.visibility-draft { background: #607D8B; color: #fff; }

.status-badge, .visibility-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
}

@media (max-width: 768px) {
    .admin-tabs,
    .admin-tab,
    .admin-tabs-wrap {
        max-width: none;
    }

    .admin-tabs {
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-bottom: 12px;
        scrollbar-width: none;
    }

    .admin-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-tab {
        padding: 10px 14px;
        font-size: 0.82em;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .admin-dash-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .admin-filter-bar {
        gap: 6px;
    }

    .admin-filter-bar .filter-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
        padding: 10px 8px;
        font-size: 0.82em;
    }

    .admin-filter-bar .seo-toggle {
        flex: 1 1 100%;
        margin-left: 0 !important;
    }

    .up-products-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .up-product-actions {
        flex-direction: column;
    }

    .up-product-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .inquiry-info-grid {
        grid-template-columns: 1fr !important;
    }

    .inquiry-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .inquiry-actions .btn,
    .inquiry-actions select {
        width: 100%;
    }

    .inquiry-card {
        padding: 14px;
    }

    .admin-section {
        padding: 12px;
    }

    .admin-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .seo-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .seo-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .seo-period-btns {
        width: 100%;
        justify-content: center;
    }

    .seo-period-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 0.85em;
    }

    .seo-chart-wrap {
        overflow-x: auto;
    }

    .users-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dash-card {
        padding: 12px;
    }

    .dash-value {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .admin-dash-stats,
    .seo-kpi-grid {
        grid-template-columns: 1fr;
    }

    .admin-filter-bar .filter-btn {
        min-width: 100%;
    }

    .tab-badge {
        font-size: 0.7em;
    }
}

/* SEO & Analytics Tab */
.seo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.seo-kpi-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #444a57;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.seo-kpi-card .value {
    font-size: 1.8em;
    font-weight: 700;
    color: #E91E63;
    margin-bottom: 4px;
}

.seo-kpi-card .label {
    color: #b0bec5;
    font-size: 0.85em;
}

.seo-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid #444a57;
}

.seo-period-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.seo-period-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #444a57;
    background: transparent;
    color: #b0bec5;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seo-period-btn:hover {
    border-color: #E91E63;
    color: #fff;
}

.seo-period-btn.active {
    background: #E91E63;
    border-color: #E91E63;
    color: #fff;
}

.seo-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b0bec5;
    font-size: 0.9em;
    cursor: pointer;
}

.seo-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #E91E63;
}

.seo-chart-block {
    margin-bottom: 28px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid #444a57;
}

.seo-chart-block h3 {
    color: #E91E63;
    margin: 0 0 16px;
    font-size: 1.1em;
}

.seo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.seo-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #b0bec5;
    font-size: 0.85em;
}

.seo-legend-item i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.seo-chart {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 180px;
}

.seo-bar-group {
    flex: 1;
    min-width: 36px;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.seo-bar-stack {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 140px;
    width: 100%;
    justify-content: center;
}

.seo-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    max-width: 14px;
}

.seo-bar-value {
    font-size: 0.65em;
    color: #78909C;
    margin-bottom: 2px;
    min-height: 14px;
}

.seo-bar-fill {
    width: 100%;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.seo-bar-label {
    margin-top: 8px;
    font-size: 0.7em;
    color: #78909C;
    text-align: center;
    word-break: break-word;
}

.seo-activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.seo-activity-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border-left: 3px solid #4CAF50;
}

.seo-activity-card .value {
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
}

.seo-activity-card .label {
    font-size: 0.75em;
    color: #b0bec5;
    margin-top: 4px;
}

.seo-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #444a57;
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.seo-table th,
.seo-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #333;
}

.seo-table th:first-child,
.seo-table td:first-child {
    text-align: left;
}

.seo-table th {
    background: rgba(233, 30, 99, 0.15);
    color: #E91E63;
    font-weight: 600;
}

.seo-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.seo-meta {
    color: #78909C;
    font-size: 0.85em;
    margin-top: 12px;
}

.seo-empty {
    text-align: center;
    color: #888;
    padding: 24px;
}

.seo-loading {
    text-align: center;
    padding: 48px;
    color: #b0bec5;
}

.seo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
