/* Shared CSS for the prices app.
   Loaded by base.html so all list templates get consistent table / pagination / copy styling.
   Colors reference the --pz-* variables defined in theme.css. */

.table-layout {
    width: 100%;
    border-collapse: collapse;
}

.table-layout th, .table-layout td {
    padding: 6px;
    border: 1px solid var(--pz-border, #ddd);
}

.table-layout th {
    text-align: left;
    position: sticky;
    top: 0;
    background-color: var(--pz-head-bg, #f8f9fa);
    z-index: 9;
}

.table-layout th a {
    color: inherit;
    text-decoration: none;
}

.table-layout th a:hover {
    text-decoration: underline;
}

.sort-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    margin-left: 5px;
    vertical-align: middle;
}

.sort-asc {
    border-bottom: 5px solid black;
}

.sort-desc {
    border-top: 5px solid black;
}

.sort-order {
    font-size: 0.7em;
    font-weight: bold;
    color: var(--pz-text-muted, #555);
    margin-left: 4px;
    vertical-align: super;
    background-color: var(--pz-border, #eee);
    padding: 1px 4px;
    border-radius: 4px;
}

.table-layout .filter-row input,
.table-layout .filter-row textarea {
    width: 95%;
    box-sizing: border-box;
    resize: none;
    overflow-y: hidden;
    vertical-align: middle;
}

.table-layout .filter-row textarea {
    min-height: 28px;
}

/* Copy-to-clipboard cells */
.copy-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.copy-icon {
    cursor: pointer;
    margin-left: 8px;
    color: var(--pz-primary, #0d6efd);
    display: inline-block;
}

.copy-tooltip {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--pz-success, #198754);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    display: none;
}

/* Shared pagination (used in pagination.html include) */
.pagination-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.pagination {
    display: flex;
    align-items: center;
    width: 450px;
    margin: 20px 0;
}

.pagination-prev, .pagination-next {
    flex: 0 0 auto;
}

.pagination-pages {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.pagination a, .pagination .current-page, .pagination .dots {
    padding: 8px 12px;
    border: 1px solid var(--pz-border, #ddd);
    border-radius: 4px;
    text-decoration: none;
    color: var(--pz-primary, #0d6efd);
}

.pagination .dots.disabled {
    color: var(--pz-border-strong, #ccc);
    cursor: default;
}

.pagination a:hover {
    background-color: var(--pz-bg, #f0f0f0);
}

.pagination .current-page {
    background-color: var(--pz-primary, #0d6efd);
    color: white;
    border-color: var(--pz-primary, #0d6efd);
    font-weight: bold;
}

/* Inline-edit fields (Preis 1 / Preis 2 / Artikel-Nr.) */
.inline-edit-field {
    padding: 4px;
    border-radius: 4px;
    border: 1px solid var(--pz-border-strong, #ccc);
    box-sizing: border-box;
}

.inline-edit-field.different-artikelnr {
    background-color: var(--bs-warning-bg-subtle, #fff3cd) !important;
    border-color: var(--bs-warning-border-subtle, #ffeeba) !important;
    padding-right: 25px;
    position: relative;
}

.inline-edit-field.different-artikelnr::after {
    content: "⚠️";
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
}

/* Saved-success flash */
td.saved-success {
    background-color: var(--bs-success-bg-subtle, #d4edda) !important;
    transition: background-color 0.5s ease-out;
}
