@CHARSET "UTF-8";
/*
 * xAdmin Modern Theme - Inhalt (Karten, Datagrid, Paginator)
 *
 * Orientiert sich an den UI-Bausteinen von tmo-admin: .tmo-card /
 * .tmo-card-header / .tmo-card-body aus styles/app.css sowie den
 * Bootstrap-5-Klassen, die dort fuer Tabellen und Buttons benutzt werden
 * (table table-striped table-hover, btn, form-control).
 */

/* -------------------------------------------------------------- tmo-card */

body.xtheme-modern .x-main > div,
body.xtheme-modern .x-content-card {
    display: flex;
    flex-direction: column;
    background: var(--tmo-surface);
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius);
    overflow: hidden;
}

body.xtheme-modern .x-main > #footer {
    display: flex;
    flex-direction: row;
    background: transparent;
    border: 0;
    border-radius: 0;
}

body.xtheme-modern .content {
    min-width: 0;
    overflow-x: auto;
}

/*
 * Legacy blendet die Seitenueberschrift aus. Im modernen Layout ist sie der
 * Kartenkopf - Werte aus .tmo-card-header.
 */
body.xtheme-modern div.content h2 {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    padding: .65rem 1rem;
    background: var(--tmo-surface-active);
    border-bottom: 1px solid var(--x-border);
    color: var(--tmo-strong);
    font-size: .875rem;
    font-weight: 600;
}

/* --------------------------------------------------------------- Datagrid */

body.xtheme-modern table.datagrid {
    border: 0;
    border-spacing: 0;
    font-size: .875rem;
}

body.xtheme-modern table.datagrid thead tr {
    background: transparent;
    text-shadow: none;
}

body.xtheme-modern table.datagrid thead tr th,
body.xtheme-modern table.datagrid thead tr td {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--tmo-surface);
    border-bottom: 2px solid var(--x-border);
    color: var(--tmo-strong);
    font-weight: 600;
    text-align: left;
    text-transform: none;
    padding: .5rem;
}

/*
 * Zebra.
 *
 * datagrid.css faerbt gerade Zeilen mit ".datagrid tbody tr:nth-child(2n)
 * :not(:first-of-type)". Wer das ueberschreiben will, braucht mehr
 * Spezifitaet als diese Regel - deshalb traegt auch die Regel fuer die
 * ungeraden Zeilen hier ein :not(). Ohne das gewinnt die Weiss-Regel gegen
 * die Zebra-Regel und das Muster verschwindet.
 *
 * Zeilen mit eigener Farbe aus dem Datagrid (rowColors, Inline-Style)
 * bleiben unberuehrt - die Farbe traegt dort eine Bedeutung.
 */
body.xtheme-modern table.datagrid tbody tr:nth-child(odd):not(.sumrow) {
    background: var(--tmo-surface);
}

body.xtheme-modern table.datagrid tbody tr:nth-child(even):not(.sumrow),
body.xtheme-modern table.datagrid tbody tr:nth-child(2n):not(:first-of-type):not(.sumrow) {
    background: var(--tmo-surface-active);
}

/* table-hover */
body.xtheme-modern table.datagrid tbody tr.hover,
body.xtheme-modern table.datagrid tbody tr:hover {
    background: var(--x-accent-soft);
}

body.xtheme-modern table.datagrid tbody td {
    border-top: 0;
    border-bottom: 1px solid var(--x-border);
    padding: .4rem .5rem;
}

body.xtheme-modern table.datagrid tr.sumrow {
    background: var(--tmo-surface-active);
}

body.xtheme-modern table.datagrid tr.sumrow td {
    border-top: 2px solid var(--x-border-strong);
}

body.xtheme-modern table.datagrid td.edithover {
    background: var(--x-ok-soft);
}

body.xtheme-modern table.datagrid td.filter {
    padding: .25rem .5rem;
    background: var(--tmo-surface);
}

body.xtheme-modern table.datagrid td.filter div input {
    background: var(--tmo-surface) !important;
    border: 1px solid var(--x-border) !important;
    border-radius: 4px;
    height: 26px;
    padding: .25rem .5rem !important;
    font-size: .8125rem;
    width: 100%;
}

body.xtheme-modern table.datagrid td.filter div.filtered input {
    background: var(--x-accent-soft) !important;
    border-color: var(--x-accent-line) !important;
}

body.xtheme-modern table.datagrid td.filter div img {
    display: none;
}

/* Legacy-Statusfarben auf die tmo-Palette mappen */
body.xtheme-modern .light  { background-color: var(--tmo-surface-active); }
body.xtheme-modern .dark   { background-color: var(--tmo-surface-active); }
body.xtheme-modern .lime   { background-color: var(--x-ok-soft); }
body.xtheme-modern .yellow { background-color: var(--x-warn-soft); }
body.xtheme-modern .red    { background-color: var(--x-danger-soft); }
body.xtheme-modern .green  { background-color: var(--x-ok-soft); }
body.xtheme-modern .highlite,
body.xtheme-modern .price  { background-color: var(--x-info-soft); }

body.xtheme-modern th,
body.xtheme-modern .thead,
body.xtheme-modern div.th {
    background-color: var(--tmo-surface-active);
    color: var(--tmo-strong);
}

/* ----------------------------------------------------- Toolbars / Filter  */

body.xtheme-modern .buttons,
body.xtheme-modern #filter,
body.xtheme-modern #legend,
body.xtheme-modern #pager,
body.xtheme-modern #info {
    background: var(--tmo-surface);
    border-bottom: 1px solid var(--x-border);
    padding: .75rem 1rem;
}

body.xtheme-modern .buttons ul li {
    background: none;
}

/* .btn .btn-outline-secondary */
body.xtheme-modern .buttons ul li a {
    background: transparent;
    border: 1px solid var(--x-border-strong);
    border-radius: var(--x-radius-sm);
    color: var(--x-text);
    font-size: .875rem;
    font-weight: 400;
    margin-left: .5rem;
    padding: .375rem .75rem;
}

body.xtheme-modern .buttons ul li a:hover {
    background: var(--tmo-secondary);
    border-color: var(--tmo-secondary);
    color: var(--tmo-on-primary);
}

body.xtheme-modern .buttons ul li:first-child a {
    margin-left: 0;
}

/* -------------------------------------------------------------- Paginator */

body.xtheme-modern div.paginator {
    background: var(--tmo-surface) !important;
    border-top: 1px solid var(--x-border);
    padding: .625rem 1rem;
}

body.xtheme-modern div.paginator ul li {
    padding: 0 2px;
}

body.xtheme-modern div.paginator a {
    background: transparent;
    border: 1px solid var(--x-border-strong);
    border-radius: var(--x-radius-sm);
    color: var(--x-text);
    padding: .25rem .5rem;
}

body.xtheme-modern div.paginator a:hover {
    background: var(--x-accent-soft);
    border-color: var(--x-accent-line);
    color: var(--x-accent);
}

body.xtheme-modern div.paginator li span.current {
    background: var(--x-accent);
    border: 1px solid var(--x-accent);
    border-radius: var(--x-radius-sm);
    color: var(--tmo-on-primary);
    padding: .25rem .5rem;
}

body.xtheme-modern div.paginator li.disabled {
    background: var(--tmo-surface-active);
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius-sm);
    color: var(--x-text-muted);
}

body.xtheme-modern .code {
    font-family: var(--x-font-mono);
    background: var(--tmo-code-bg);
}

body.xtheme-modern .panel {
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius);
}

/* Zebra auch fuer die eingebetteten Tabellen. */
body.xtheme-modern table.inlinegrid tbody tr:nth-child(even) td,
body.xtheme-modern table.inlinegrid tbody tr:nth-child(even) td:first-child {
    background: var(--tmo-surface-active);
}

body.xtheme-modern table.inlinegrid tbody tr:hover td,
body.xtheme-modern table.inlinegrid tbody tr:hover td:first-child {
    background: var(--x-accent-soft);
}
