/*
 * Gemeinsame Bausteine fuer Tabellen und Seitenwechsel in Verwaltungsseiten
 * (Leistungsverzeichnis, Einheiten, weitere Stammdatenlisten).
 *
 * Baut auf doc-overview-table* und doc-overview-pagination* aus timbertally.css auf.
 * Werte entsprechen den Design-Tokens aus REDESIGN.md. Klassen tragen das Praefix admin-,
 * damit sie nicht mit seiteneigenen Praefixen (lineitems-, units-, cust- ...) kollidieren.
 *
 * Markup-Muster:
 *   <div class="doc-overview-table-card admin-table-card">
 *     <div class="admin-table-card-head"><h2>Titel</h2><p>Beschreibung</p></div>
 *     <div class="responsive-table-patch doc-overview-table-wrap">
 *       <div class="doc-overview-table-scroll">
 *         <table class="doc-overview-table"> <thead>...</thead> <tbody> <td data-label="Spalte">...
 */

/* Tabellenkarte */
.admin-table-card,
.admin-table-card *,
.admin-table-card *::before,
.admin-table-card *::after {
    box-sizing: border-box;
}

.admin-table-card {
    margin: 0 0 16px 0;
    border: 1px solid #d9dce8;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    color: #1f2433;
}

.admin-table-card-head {
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid #e9eef5;
}

.admin-table-card-head h2,
.admin-table-card-head h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    line-height: 1.25;
}

.admin-table-card-head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #5d6475;
}

.admin-table-card .doc-overview-table-wrap {
    border-radius: 0;
}

/* Erste Spalte (Nummer) bleibt beim Scrollen nicht fixiert */
.admin-table-card .doc-overview-table thead th:first-child,
.admin-table-card .doc-overview-table tbody td:first-child {
    position: static;
    min-width: 0;
    box-shadow: none;
}

.admin-table-no {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #5d6475;
}

/* Hauptbezeichnung einer Zeile; bricht Woerter nur, wenn sie sonst nicht passen (ohne die Spalte einzuengen) */
.admin-table-title {
    font-weight: 700;
    line-height: 1.35;
    color: #172133;
    overflow-wrap: break-word;
}

.admin-table-longtext {
    display: block;
    max-width: 520px;
    font-size: 13px;
    line-height: 1.5;
    color: #4d5566;
    overflow-wrap: anywhere;
}

.admin-table-muted {
    font-size: 13px;
    color: #5d6475;
}

/* Kennzeichen (z. B. Typ) */
.admin-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid #d8dce8;
    border-radius: 999px;
    background: #f3f5fa;
    color: #324054;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* Zeilenaktionen */
.admin-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #ccd2e2;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2433;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-table-action:hover {
    border-color: #bcc4da;
    background: #fdfdff;
    box-shadow: 0 6px 18px rgba(27, 39, 94, 0.08);
}

.admin-table-action .material-icons {
    font-size: 16px;
}

.admin-table-action--danger {
    border-color: #f0c9ce;
    background: #fff7f7;
    color: #a31d31;
}

.admin-table-action--danger:hover {
    border-color: #e7aab2;
    background: #fdebed;
}

.admin-table-card a:focus-visible,
.admin-table-card button:focus-visible,
.admin-pagination a:focus-visible {
    outline: 3px solid #6376ff;
    outline-offset: 2px;
}

/* Seitenwechsel (Ergaenzung zu doc-overview-pagination) */
.admin-pagination,
.admin-pagination * {
    box-sizing: border-box;
}

@media (min-width: 981px) {
    .admin-table-card .doc-overview-table {
        min-width: 760px;
    }

    .admin-table-card .doc-overview-table--wide {
        min-width: 900px;
    }

    .admin-table-card .admin-table-actions {
        flex-wrap: nowrap;
    }
}

@media (max-width: 980px) {
    .admin-table-longtext {
        max-width: none;
    }

    /* ueberstimmt die alte Regel .responsive-table-patch .text-align-right-cols in der Kartenansicht */
    .admin-table-card .doc-overview-table .text-align-right-cols {
        text-align: left;
    }
}

@media (max-width: 720px) {
    .admin-table-action {
        min-height: 44px;
    }

    .admin-pagination .doc-overview-pagination-link {
        min-width: 44px;
        min-height: 44px;
    }
}
