/* === Talkey CRM — vizuální refresh vnitřních stránek (krok 2) ===
   Re-skin chrome (sidebar + topbar) a obecných komponent. Vše scopováno pod
   body.crm-app, aby se nepralo s loginem. Načítá se jako poslední stylesheet,
   takže přebíjí backend.css / backend-theme.css / bootstrap.css.
   Barvy z design tokenů (:root v site.css) + hodnoty z handoffu. */

body.crm-app {
    background: #f5f6f8;
    color: #3a4252;
}

/* ---------- Shell ---------- */
body.crm-app #app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

body.crm-app #main-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- Sidebar ---------- */
body.crm-app #apps {
    width: 180px;
    flex-shrink: 0;
    background: var(--navy-1);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

body.crm-app #apps-brand {
    padding: 22px 20px 18px;
}

body.crm-app #apps-brand img {
    height: 34px;
    width: auto;
    display: block;
}

body.crm-app #apps-items {
    flex: 1;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

body.crm-app #apps-items > a {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 13px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #9fa9c2;
    text-decoration: none;
    background: transparent;
    text-align: left;
    transition: background .13s, color .13s, box-shadow .13s;
}

body.crm-app #apps-items > a > i {
    width: 18px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

body.crm-app #apps-items > a:hover {
    background: rgba(127, 135, 160, 0.12);
    color: #cdd3e1;
    border: none;
}

body.crm-app #apps-items > a.active {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 3px 0 0 var(--accent);
    border: none;
}

body.crm-app #apps-foot {
    padding: 16px 22px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- Topbar ---------- */
body.crm-app #topbar {
    height: 64px;
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #e8eaef;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 28px;
}

body.crm-app #topbar-warning {
    font-size: 13px;
    color: var(--error);
    font-weight: 600;
}

body.crm-app .topbar-spacer {
    flex: 1;
}

body.crm-app .topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.crm-app .topbar-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e8eaef;
    background: #fff;
    color: #5b6478;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .13s, color .13s, border-color .13s;
}

body.crm-app .topbar-icon:hover {
    background: #f5f6f8;
    color: var(--navy-1);
}

body.crm-app .topbar-logout:hover {
    color: var(--error);
    border-color: var(--error);
}

body.crm-app .topbar-divider {
    width: 1px;
    height: 30px;
    background: #e8eaef;
}

body.crm-app .topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.crm-app .topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(47, 158, 128, 0.15);
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.crm-app .topbar-id {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

body.crm-app .topbar-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
}

body.crm-app .topbar-email {
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Mobilní menu (hamburger + off-canvas sidebar) ---------- */
body.crm-app #nav-toggle,
body.crm-app #nav-backdrop {
    display: none;
}

@media (max-width: 991px) {
    body.crm-app #nav-toggle {
        display: inline-flex;
        flex-shrink: 0;
        padding: 0;
        font-size: 17px;
    }

    body.crm-app #apps {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        max-width: 85vw;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: none;
    }

    body.crm-app.nav-open #apps {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    body.crm-app #nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(16, 22, 36, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .22s ease, visibility .22s;
    }

    body.crm-app.nav-open #nav-backdrop {
        opacity: 1;
        visibility: visible;
    }

    body.crm-app.nav-open {
        overflow: hidden;
    }

    /* větší dotykové plochy položek menu */
    body.crm-app #apps-items > a {
        padding: 12px 13px;
        font-size: 15px;
    }

    body.crm-app #topbar {
        height: 56px;
        gap: 10px;
        padding: 0 12px;
    }

    body.crm-app #topbar-warning {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    body.crm-app .topbar-user {
        gap: 8px;
    }

    body.crm-app .topbar-id,
    body.crm-app .topbar-divider {
        display: none;
    }
}

/* ---------- Content area ---------- */
body.crm-app #content {
    flex: 1;
    background: #f5f6f8;
}

body.crm-app #content .wrapper {
    padding: 22px 28px;
}

@media (max-width: 991px) {
    body.crm-app #content .wrapper {
        padding: 14px 12px;
    }
}

/* Řádek s akčními tlačítky (Přidat / Export / Odstranit) –
   méně místa nad tlačítky, více pod nimi */
body.crm-app #content .wrapper .row > [class^="col-"]:has(> .pull-right) {
    padding-top: 4px;
    padding-bottom: 22px;
}

/* Nadpis stránky na jednom řádku s akčními tlačítky */
body.crm-app .page-head-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 4px;
    padding-bottom: 22px;
}

body.crm-app .page-head-row .page-header {
    margin: 0;
}

body.crm-app .page-head-row .pull-right {
    float: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto; /* akční tlačítka odsadit doprava */
}

/* ---------- Page header ---------- */
body.crm-app #content h1,
body.crm-app .page-header,
body.crm-app h2.page-header {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--navy-1);
    border: none;
    margin: 0 0 18px;
    padding: 0;
}

/* ---------- Buttons ---------- */
body.crm-app .btn,
body.crm-app .button {
    border-radius: 10px;
    font-weight: 600;
    transition: background .13s, color .13s, border-color .13s, filter .13s;
}

body.crm-app .btn-primary,
body.crm-app .button.btn-primary,
body.crm-app .btn-primary.button {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

body.crm-app .btn-primary:hover,
body.crm-app .btn-primary:focus,
body.crm-app .btn-primary:active,
body.crm-app .button.btn-primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    filter: brightness(0.93);
    color: #fff;
}

body.crm-app .btn-default {
    background: #fff;
    border: 1px solid var(--border-input);
    color: #3a4252;
}

body.crm-app .btn-default:hover,
body.crm-app .btn-default:focus {
    background: #f5f6f8;
    border-color: var(--border-input);
    color: var(--navy-1);
}

body.crm-app .btn-danger,
body.crm-app .btn-danger:hover,
body.crm-app .btn-danger:focus,
body.crm-app .btn-danger:active,
body.crm-app #content a.btn-danger,
body.crm-app #content a.btn-danger:hover,
body.crm-app #content a.btn-danger:focus,
body.crm-app #content a.btn-danger:active {
    color: #fff;
    background-color: #d9534f;
    border-color: #d43f3a;
}

body.crm-app #content a.btn-primary,
body.crm-app #content a.btn-primary:hover,
body.crm-app #content a.btn-primary:focus,
body.crm-app #content a.btn-primary:active {
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent);
}

body.crm-app #content a.btn-primary:hover,
body.crm-app #content a.btn-primary:active {
    filter: brightness(0.93);
}

body.crm-app #content a.btn-default,
body.crm-app #content a.btn-default:hover,
body.crm-app #content a.btn-default:focus {
    color: #3a4252;
    background: #fff;
    border: 1px solid var(--border-input);
}

body.crm-app #content a.btn-default:hover,
body.crm-app #content a.btn-default:focus {
    background: #f5f6f8;
    color: var(--navy-1);
}

body.crm-app #content a.btn-primary,
body.crm-app #content a.btn-default {
    display: inline-block;
    padding: 6px 14px;
    line-height: 1.42857143;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
}

body.crm-app .btn-danger:hover,
body.crm-app .btn-danger:active,
body.crm-app #content a.btn-danger:hover,
body.crm-app #content a.btn-danger:active {
    background-color: #c9302c;
    border-color: #ac2925;
}

/* Řádkové ikonové akce v tabulkách (btn-xs) → kompaktní ikonová tlačítka */
body.crm-app .btn-xs {
    min-width: 32px;
    height: 32px;
    line-height: 1;
    border-radius: 8px;
    border: 1px solid #e6e9ef;
    background: #fff;
    color: #6b7280;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.crm-app .btn-xs:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff;
}

/* ---------- Inputs / selects ---------- */
body.crm-app input[type="text"],
body.crm-app input[type="email"],
body.crm-app input[type="password"],
body.crm-app input[type="tel"],
body.crm-app input[type="number"],
body.crm-app input[type="date"],
body.crm-app input[type="search"],
body.crm-app textarea,
body.crm-app textarea.form-control,
body.crm-app select,
body.crm-app select.form-control,
body.crm-app .form-control {
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: 9px;
    color: var(--ink);
    box-shadow: none;
    transition: border-color .13s, box-shadow .13s, background .13s;
}

body.crm-app input[type="text"]:hover,
body.crm-app input[type="email"]:hover,
body.crm-app input[type="password"]:hover,
body.crm-app select:hover,
body.crm-app textarea:hover {
    background: #fff;
}

body.crm-app input:focus,
body.crm-app select:focus,
body.crm-app textarea:focus,
body.crm-app .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #fff;
    outline: none;
}

body.crm-app label {
    color: var(--muted);
    font-weight: 600;
}

/* ---------- Cards / panels / filter boxes ---------- */
body.crm-app .panel,
body.crm-app .card {
    background: #fff;
    border: 1px solid #e8eaef;
    border-radius: 14px;
    box-shadow: none;
}

body.crm-app .panel-heading,
body.crm-app .card .card-header {
    background: #fff;
    color: var(--navy-1);
    border-bottom: 1px solid #eceef2;
    font-weight: 700;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

body.crm-app .card .card-body {
    background: #fff;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

body.crm-app .form-styled {
    background: #fff;
    border: 1px solid #e8eaef;
    border-radius: 14px;
    padding: 18px 20px;
}

/* ---------- Filtry nad seznamy – mobil ----------
   Filtr = .form-styled s tlačítkem SearchStart; skript v _Layout mu přidá
   .list-filter a před něj tlačítko .list-filter-toggle (na desktopu skryté). */
body.crm-app .list-filter-toggle {
    display: none;
}

@media (max-width: 991px) {
    body.crm-app .list-filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        height: 44px;
        margin-bottom: 10px;
        padding: 0 16px;
        background: #fff;
        border: 1px solid #e8eaef;
        border-radius: 12px;
        color: var(--navy-1);
        font-size: 14px;
        font-weight: 600;
        text-align: left;
    }

    body.crm-app .list-filter-toggle .list-filter-caret {
        margin-left: auto;
        color: var(--muted);
        transition: transform .18s;
    }

    body.crm-app .list-filter-toggle.is-open .list-filter-caret {
        transform: rotate(180deg);
    }

    /* aktivní vyhledávání – zelená tečka */
    body.crm-app .list-filter-toggle.is-active::after {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
        order: 1;
    }

    body.crm-app .list-filter-toggle.is-active .list-filter-caret {
        order: 2;
    }

    body.crm-app .form-styled.list-filter {
        display: none;
        margin-bottom: 14px;
        padding: 12px 14px;
    }

    body.crm-app .form-styled.list-filter.is-open {
        display: block;
    }

    /* vedlejší buňka s tlačítky (uložené filtry) jen v šířce obsahu */
    body.crm-app .form-styled.list-filter > table:not(.table):not(.tableList) > tbody > tr > td + td {
        flex: 0 0 auto;
    }

    body.crm-app .form-styled.list-filter > table:not(.table):not(.tableList) > tbody > tr > td + td > div {
        width: auto !important;
    }

    body.crm-app .list-filter input[type="text"],
    body.crm-app .list-filter input[type="email"],
    body.crm-app .list-filter input[type="number"],
    body.crm-app .list-filter select {
        width: 100% !important;
    }

    /* rozsah datumů (od – do) vedle sebe */
    body.crm-app .list-filter input[type="date"] {
        width: calc(50% - 12px) !important;
        min-width: 0;
    }

    /* tlačítka Hledat / Zrušit hledání */
    body.crm-app .list-filter .form-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 6px 0 0;
    }

    body.crm-app .list-filter .form-group .div_line {
        padding: 0;
    }
}

/* ---------- Formuláře (Upravit / Detail / filtry) – mobil ----------
   .form-styled > table s řádky th (popisek) + td (pole/hodnota) → popisek nad polem.
   Datové tabulky (.table, .tableList) se nepřeskládávají – ty se posouvají. */
@media (max-width: 991px) {
    body.crm-app .form-styled {
        padding: 12px 14px;
    }

    /* sloupce col-md-* jsou pod sebou – mezera mezi nimi */
    body.crm-app #content .row > [class*="col-md-"] + [class*="col-md-"] {
        margin-top: 14px;
    }

    body.crm-app .form-styled > table:not(.table):not(.tableList),
    body.crm-app .form-styled > table:not(.table):not(.tableList) > tbody {
        display: block;
        width: 100%;
    }

    body.crm-app .form-styled > table:not(.table):not(.tableList) > tbody > tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
        padding: 5px 0;
    }

    body.crm-app .form-styled > table:not(.table):not(.tableList) > tbody > tr > th {
        flex: 0 0 100%;
        width: auto;
        padding: 0;
        font-size: 12.5px;
    }

    body.crm-app .form-styled > table:not(.table):not(.tableList) > tbody > tr > td {
        flex: 1 1 0;
        min-width: 0;
        padding: 0;
        overflow-wrap: anywhere;
    }

    body.crm-app .form-styled > table:not(.table):not(.tableList) > tbody > tr > th:empty,
    body.crm-app .form-styled > table:not(.table):not(.tableList) > tbody > tr > td:empty {
        display: none;
    }

    /* pole: nic nesmí přetéct; 16px písmo = iOS při focusu nezoomuje */
    body.crm-app #content input[type="text"],
    body.crm-app #content input[type="email"],
    body.crm-app #content input[type="password"],
    body.crm-app #content input[type="tel"],
    body.crm-app #content input[type="number"],
    body.crm-app #content input[type="date"],
    body.crm-app #content input[type="search"],
    body.crm-app #content select,
    body.crm-app #content textarea {
        max-width: 100%;
        font-size: 16px;
    }

    body.crm-app #content input[type="text"],
    body.crm-app #content input[type="email"],
    body.crm-app #content input[type="password"],
    body.crm-app #content input[type="tel"],
    body.crm-app #content input[type="number"],
    body.crm-app #content input[type="date"],
    body.crm-app #content select {
        height: 40px;
        line-height: 38px;
    }

    body.crm-app #content .select2-container {
        width: 100% !important;
        max-width: 100%;
    }

    /* Uložit / Uložit a zavřít – lišta přilepená ke spodku obrazovky */
    body.crm-app #content form .form-group:has(> button[name="SaveChanges"]) {
        position: sticky;
        bottom: 0;
        z-index: 20;
        display: flex;
        gap: 8px;
        margin: 14px -12px 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: rgba(245, 246, 248, 0.96);
        border-top: 1px solid #e8eaef;
    }

    body.crm-app #content form .form-group:has(> button[name="SaveChanges"]) > button {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* hlavička stránky (Zpět + nadpis + akce) */
    body.crm-app .page-head-row {
        padding-bottom: 14px;
    }

    body.crm-app .page-header,
    body.crm-app h2.page-header {
        font-size: 20px;
    }
}

/* ---------- Modální okna – mobil ----------
   .crm-modal = vlastní překryv (inline styly ve views → nutné !important):
   > div je okno, jeho přímé děti hlavička / obsah / seznam / patička.
   Okno nikdy nepřesáhne výšku displeje; seznam (overflow-y:auto) vyplní zbytek,
   jinak se posouvá celé okno. Bootstrap modály (.modal-dialog) zvlášť. */
@media (max-width: 991px) {
    body.crm-app .crm-modal {
        align-items: flex-start !important;
        padding: 12px !important;
    }

    body.crm-app .crm-modal > div {
        display: flex !important;
        flex-direction: column;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }

    body.crm-app .crm-modal > div > * {
        flex-shrink: 0;
    }

    body.crm-app .crm-modal > div > [style*="overflow-y:auto"] {
        flex-shrink: 1;
        min-height: 120px;
        max-height: none !important;
    }

    /* inline 14px by na iOS při focusu zoomovalo */
    body.crm-app .crm-modal input[type="text"],
    body.crm-app .crm-modal input[type="date"],
    body.crm-app .crm-modal input[type="time"],
    body.crm-app .crm-modal select,
    body.crm-app .crm-modal textarea {
        font-size: 16px !important;
    }

    /* větší dotykové plochy: zavírací × a tlačítka v patičce */
    body.crm-app .crm-modal > div > :first-child > span[onclick] {
        padding: 6px 8px;
        margin: -6px -8px -6px 0;
    }

    body.crm-app .crm-modal > div > :last-child > span[onclick] {
        padding-top: 11px !important;
        padding-bottom: 11px !important;
    }

    /* Bootstrap modály (uložení filtru, detail audit logu) – pevná šířka 400px pryč */
    body.crm-app .modal-dialog.my-modal-content {
        width: auto !important;
        margin: 12px !important;
    }

    body.crm-app .modal .modal-dialog {
        margin: 12px;
    }

    body.crm-app .modal .modal-body {
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
        overflow-y: auto;
    }

    body.crm-app .modal-footer {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }

    body.crm-app .modal-footer > * {
        margin: 0 !important;
    }
}

/* ---------- Tables ---------- */
body.crm-app .table {
    border-collapse: collapse;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

body.crm-app .table > thead > tr > th,
body.crm-app .table-striped > thead > tr > th {
    padding: 5px 18px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fafbfc;
    border: none;
    border-bottom: 1px solid #eceef2;
    vertical-align: middle;
}

body.crm-app .table > tbody > tr > td,
body.crm-app .table-striped > tbody > tr > td {
    padding: 4px 18px;
    font-size: 14px;
    color: #3a4252;
    border: none;
    border-bottom: 1px solid #f1f2f5;
    vertical-align: middle;
}

body.crm-app .table > tbody > tr > td:first-child {
    font-weight: 600;
    color: var(--navy-1);
}

/* Vypnout tmavé zebra pruhy z backend.css — čistý bílý podklad */
body.crm-app .table-striped > tbody > tr:nth-of-type(odd),
body.crm-app .table-striped > tbody > tr:nth-of-type(even) {
    background: transparent;
}

body.crm-app .table-hover > tbody > tr:hover,
body.crm-app .table-striped > tbody > tr:hover {
    background: #f8faf9;
}

/* Kompaktní akční tlačítka v buňkách seznamů (Detail / Upravit / …)
   → nižší výška tlačítek = nižší řádky */
body.crm-app .table > tbody > tr > td .btn,
body.crm-app .table > tbody > tr > td .button {
    height: auto;
    padding: 2px 9px;
    font-size: 12px;
    line-height: 1.45;
    border-radius: 7px;
    vertical-align: middle;
}

body.crm-app .table > tbody > tr > td .btn .fa,
body.crm-app .table > tbody > tr > td .button .fa {
    font-size: 11px;
}

/* Minulé / neaktivní řádky (webináře po datu konání) */
body.crm-app .table > tbody > tr.row-past > td,
body.crm-app .table-striped > tbody > tr.row-past > td {
    color: #aab0be;
    font-style: italic;
}

/* ---------- Vodorovné posouvání tabulek ----------
   DataTables (bootstrap dom) mají tabulku v `.row > .col-sm-12` – posouvá se
   jen tento sloupec, info/paginace zůstávají na místě. Ostatní tabulky
   (.table, .tableList) obaluje skript v _Layout do `.table-scroll`. */
body.crm-app .dataTables_wrapper > .row > .col-sm-12,
body.crm-app .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
    /* bez zalamování se sloupce nesmačkají do nečitelných proužků –
       tabulka je širší a posouvá se */
    body.crm-app .dataTables_wrapper table.dataTable th,
    body.crm-app .dataTables_wrapper table.dataTable td,
    body.crm-app .table-scroll > table th,
    body.crm-app .table-scroll > table td {
        white-space: nowrap;
    }

    body.crm-app .table > thead > tr > th,
    body.crm-app .table-striped > thead > tr > th {
        padding: 5px 10px;
    }

    body.crm-app .table > tbody > tr > td,
    body.crm-app .table-striped > tbody > tr > td {
        padding: 6px 10px;
    }

    /* info / paginace / počet řádků pod sebou a na střed */
    body.crm-app .dataTables_wrapper .dataTables_info,
    body.crm-app .dataTables_wrapper .dataTables_paginate,
    body.crm-app .dataTables_wrapper .dataTables_length,
    body.crm-app .dataTables_wrapper .text-right {
        text-align: center;
        float: none;
    }

    body.crm-app .dataTables_wrapper .dataTables_paginate .pagination {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
    }
}

/* ---------- DataTables texty (info / length / filter) ---------- */
body.crm-app .dataTables_wrapper .dataTables_info,
body.crm-app .dataTables_wrapper .dataTables_length,
body.crm-app .dataTables_wrapper .dataTables_filter {
    color: var(--muted);
    font-size: 13px;
}

/* ---------- Paginace ----------
   DataTables (bootstrap varianta) i běžný Bootstrap renderují
   ul.pagination > li > a. `.paginate_button` je na <li>, NE na <a> —
   proto stylujeme jen <a>/<span>, ať nevznikají prázdné „pilulky". */
body.crm-app .dataTables_wrapper .dataTables_paginate .pagination {
    margin: 6px 0 0;
}

body.crm-app .pagination > li > a,
body.crm-app .pagination > li > span {
    float: left;
    min-width: 34px;
    height: 34px;
    line-height: 22px;
    margin: 0 3px;
    padding: 6px 10px;
    text-align: center;
    color: #3a4252;
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-weight: 600;
}

body.crm-app .pagination > li > a:hover,
body.crm-app .pagination > li > a:focus {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff;
}

body.crm-app .pagination > .active > a,
body.crm-app .pagination > .active > span,
body.crm-app .pagination > .active > a:hover,
body.crm-app .pagination > .active > a:focus,
body.crm-app .pagination > .active > span:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

body.crm-app .pagination > .disabled > a,
body.crm-app .pagination > .disabled > span,
body.crm-app .pagination > .disabled > a:hover {
    color: #9aa1b1;
    background: #fff;
    border-color: var(--border-input);
    cursor: not-allowed;
}

/* Fallback pro VÝCHOZÍ DataTables renderer (bez ul.pagination):
   tlačítka jsou <a class="paginate_button">, aktivní má .current.
   Element-kvalifikátor `a.paginate_button` nezasáhne bootstrap <li class="paginate_button">. */
body.crm-app .dataTables_paginate a.paginate_button {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    line-height: 22px;
    margin: 0 3px;
    padding: 6px 10px;
    text-align: center;
    color: #3a4252;
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-weight: 600;
}

body.crm-app .dataTables_paginate a.paginate_button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

body.crm-app .dataTables_paginate a.paginate_button.current,
body.crm-app .dataTables_paginate a.paginate_button.current:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

body.crm-app .dataTables_paginate a.paginate_button.disabled,
body.crm-app .dataTables_paginate a.paginate_button.disabled:hover {
    color: #9aa1b1;
    border-color: var(--border-input);
    cursor: not-allowed;
}

/* ---------- Badges / labels / count badge ---------- */
body.crm-app .badge {
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(47, 158, 128, 0.12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

body.crm-app .label {
    border-radius: 999px;
    padding: 0.3em 0.8em;
    font-weight: 600;
}

/* ---------- Category checkbox accent ---------- */
body.crm-app input[type="checkbox"]:hover ~ .pretty-checkbox,
body.crm-app input[type="checkbox"]:checked ~ .pretty-checkbox {
    border-color: var(--accent);
}

body.crm-app input[type="checkbox"]:checked ~ .pretty-checkbox:after,
body.crm-app input[type="checkbox"]:checked ~ .pretty-checkbox:before {
    background-color: var(--accent);
}

/* ---------- Links ---------- */
body.crm-app #content a {
    color: var(--accent);
}

body.crm-app #content a:hover {
    color: var(--accent);
    filter: brightness(0.9);
}
