/* ==========================================================================
   Design „modern“ (Nastavení → Vzhled) — stránky obalené .md-page.
   Sekce Realizace (Projekty vč. detailu, Plánovač, Servisní protokoly, Výkazy),
   Obchod (seznamy i detaily), Další (Úkoly, AI asistent, Reporty, Nastavení), okna a sdílené
   prvky, novinky, log odeslání a systémové stránky — podle návrhů v examples/.
   Přihlášení (.md-login) je mimo app-shell, a proto bez prefixu .md-page.

   Vše je zanořené pod .app-shell.design-modern .md-page, takže klasický vzhled
   (a stránky bez obalu .md-page) zůstávají beze změny. Prefix .app-shell záměrně
   zvyšuje specificitu nad pravidla z app.css (např. modré záhlaví seznamu).
   Načítá se po app.css a radzen-lasice.css (viz App.razor).
   ========================================================================== */

/* ---------- Rytmus stránky ---------- */
.app-shell.design-modern .md-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #55565A;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.app-shell.design-modern .md-page > * {
    min-width: 0;
}

.app-shell.design-modern .md-page .page-panel {
    margin: 0;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
    box-shadow: none;
}

.app-shell.design-modern .md-page .page-panel > .panel-header {
    margin: 0 0 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.app-shell.design-modern .md-page .page-panel > .panel-header > div:has(> h2) {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.app-shell.design-modern .md-page .page-panel > .panel-header h2,
.app-shell.design-modern .md-page .page-panel > .panel-header h3 {
    font-size: 18px;
    line-height: 1.3;
    color: #002D62;
    margin: 0;
}

.app-shell.design-modern .md-page .page-panel > .panel-header > span,
.app-shell.design-modern .md-page .page-panel > .panel-header > div > span,
.app-shell.design-modern .md-page .page-panel > .panel-header .muted {
    font-size: 13px;
    color: #55565A;
}

/* Eyebrow nad nadpisem karty („Přehled“, „Graf“…) návrh nemá — zůstává jen v záhlaví stránky a v modalech. */
.app-shell.design-modern .md-page .page-panel > .panel-header .section-eyebrow {
    display: none;
}

.app-shell.design-modern .md-page .muted {
    color: #8A8C91;
}

.app-shell.design-modern .md-page .empty-state {
    padding: 28px 24px;
    background: #FFFFFF;
    border: 1px dashed #C9CCD1;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    color: #55565A;
}

.app-shell.design-modern .md-page .button-row {
    gap: 10px;
    margin-top: 12px;
}

.app-shell.design-modern .md-page .action-message {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    background: #E6EAF0;
    border: 0;
    color: #002D62;
    font-size: 13px;
}

/* ---------- Tlačítka ---------- */
.app-shell.design-modern .md-page .primary-button,
.app-shell.design-modern .md-page button.primary-button,
.app-shell.design-modern .md-page .secondary-button,
.app-shell.design-modern .md-page .ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
    backdrop-filter: none;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.app-shell.design-modern .md-page .primary-button,
.app-shell.design-modern .md-page button.primary-button {
    background: #002D62;
    color: #FFFFFF;
    border: 1.5px solid #002D62;
}

.app-shell.design-modern .md-page .primary-button:hover,
.app-shell.design-modern .md-page button.primary-button:hover {
    background: #001F47;
    border-color: #001F47;
    color: #FFFFFF;
    text-decoration: none;
}

.app-shell.design-modern .md-page .secondary-button {
    background: #FFFFFF;
    color: #002D62;
    border: 1.5px solid #002D62;
}

.app-shell.design-modern .md-page .secondary-button:hover {
    background: #002D62;
    color: #FFFFFF;
    border-color: #002D62;
    text-decoration: none;
}

.app-shell.design-modern .md-page .secondary-button.danger,
.app-shell.design-modern .md-page .secondary-button.danger-button {
    color: #C5221F;
    border-color: #C5221F;
}

.app-shell.design-modern .md-page .secondary-button.danger:hover,
.app-shell.design-modern .md-page .secondary-button.danger-button:hover {
    background: #C5221F;
    border-color: #C5221F;
    color: #FFFFFF;
}

.app-shell.design-modern .md-page .primary-button:disabled,
.app-shell.design-modern .md-page .secondary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Ghost = textová akce (Nápověda, Smazat, Zrušit). */
.app-shell.design-modern .md-page .ghost-button {
    padding: 0 8px;
    background: transparent;
    color: #55565A;
    border: 0;
}

.app-shell.design-modern .md-page .ghost-button:hover {
    background: transparent;
    color: #002D62;
    text-decoration: underline;
}

.app-shell.design-modern .md-page .ghost-button.danger-outline,
.app-shell.design-modern .md-page .ghost-button.danger-button-outline,
.app-shell.design-modern .md-page .ghost-button.hero-action-danger {
    color: #C5221F;
}

/* „Aktivní filtry“ (ResetFiltersButton) — oranžová zůstává, ať je zapamatovaný stav tabulky vidět. */
.app-shell.design-modern .md-page .ghost-button.is-active {
    padding: 0 14px;
    background: #f59e0b;
    color: #002D62;
}

.app-shell.design-modern .md-page .ghost-button.is-active:hover {
    background: #d97706;
    color: #002D62;
}

.app-shell.design-modern .md-page .mini-button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #002D62;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.app-shell.design-modern .md-page .mini-button:hover {
    text-decoration: underline;
}

.app-shell.design-modern .md-page .mini-button.danger {
    color: #C5221F;
}

/* ---------- Formulářové prvky ---------- */
.app-shell.design-modern .md-page label {
    font-size: 13px;
    font-weight: 700;
    color: #002D62;
}

.app-shell.design-modern .md-page .form-control,
.app-shell.design-modern .md-page .form-select {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #C9CCD1;
    border-radius: 4px;
    background-color: #FFFFFF;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .form-select {
    padding-right: 32px;
}

.app-shell.design-modern .md-page textarea.form-control {
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.5;
}

.app-shell.design-modern .md-page .form-control:focus,
.app-shell.design-modern .md-page .form-select:focus {
    outline: none;
    border-color: #002D62;
    box-shadow: 0 0 0 2px #FFC40C;
}

/* Stavy z app.css (chyba validace, povinné prázdné, import) musí přebít moderní základ výše. */
.app-shell.design-modern .md-page .form-control.invalid,
.app-shell.design-modern .md-page .form-select.invalid,
.app-shell.design-modern .md-page .input-validation-error,
.app-shell.design-modern .md-page .form-control.required-empty,
.app-shell.design-modern .md-page .form-select.required-empty,
.app-shell.design-modern .md-page input[aria-invalid="true"],
.app-shell.design-modern .md-page select[aria-invalid="true"],
.app-shell.design-modern .md-page textarea[aria-invalid="true"] {
    border-color: #dc2626;
    background-color: #fdecec;
}

.app-shell.design-modern .md-page .form-control.imported-field,
.app-shell.design-modern .md-page .form-select.imported-field {
    border-color: rgba(16, 185, 129, 0.5);
    background-color: rgba(236, 253, 245, 0.96);
}

/* ---------- Záhlaví seznamu (ModuleListHeader, záhlaví Plánovače) ---------- */
.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header {
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: 0;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header .section-eyebrow {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    color: #002D62;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header h1 + .muted {
    margin-top: 6px;
    font-size: 15px;
    color: #55565A;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header .inline-actions {
    align-items: flex-end;
    gap: 10px;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header .primary-button,
.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header .secondary-button {
    min-height: 44px;
}

.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header .ghost-button {
    min-height: 44px;
}

/* Návrh nemá u akcí v záhlaví a v liště nad tabulkou ikony. */
.app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header .btn-icon,
.app-shell.design-modern .md-page .md-toolbar .btn-icon {
    display: none;
}

/* ---------- KPI pás (MetricGrid) ----------
   Karty mají .metric-grid v selektoru záměrně: klasické pravidlo
   „.page-panel:has(> .panel-header h1) > .metric-grid .metric-card“ (0,4,1) by jinak vyhrálo
   a vykreslilo bílé karty se žlutým rámečkem. */
.app-shell.design-modern .md-page .metric-grid {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px 28px;
    margin: 0;
    padding: 24px 28px 22px;
    background: #002D62;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .metric-grid::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    background: #FFC40C;
}

.app-shell.design-modern .md-page .metric-grid .metric-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.app-shell.design-modern .md-page .metric-grid .metric-card span {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    color: #C9D3E0;
}

.app-shell.design-modern .md-page .metric-grid .metric-card strong {
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .metric-grid .metric-card .muted {
    font-size: 12px;
    color: #C9D3E0;
}

.app-shell.design-modern .md-page .metric-grid .metric-card.metric-accent strong {
    color: #FFC40C;
}

/* ---------- Karta s tabulkou: lišta (hledání, rychlé filtry) + grid ---------- */
.app-shell.design-modern .md-page .page-panel.md-table-card {
    padding: 0;
    overflow: hidden;
}

.app-shell.design-modern .md-page .page-panel.md-table-card > .panel-header {
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .page-panel.md-table-card > .table-shell {
    margin: 0;
    padding: 0;
    border: 0;
}

.app-shell.design-modern .md-page .page-panel.md-table-card > .active-filter-row,
.app-shell.design-modern .md-page .page-panel.md-table-card > .muted {
    margin: 0;
    padding: 12px 20px 0;
}

.app-shell.design-modern .md-page .page-panel.md-table-card > .empty-state {
    margin: 20px;
}

.app-shell.design-modern .md-page .md-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .md-toolbar-filters,
.app-shell.design-modern .md-page .md-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-shell.design-modern .md-page .md-toolbar .secondary-button,
.app-shell.design-modern .md-page .md-toolbar .ghost-button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.app-shell.design-modern .md-page .md-search {
    width: 300px;
    max-width: 100%;
    min-height: 38px;
    height: 38px;
}

.app-shell.design-modern .md-page .filter-chip {
    height: 34px;
    padding: 0 12px;
    border: 1px solid #C9CCD1;
    border-radius: 4px;
    background: #FFFFFF;
    color: #002D62;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.app-shell.design-modern .md-page .filter-chip:hover {
    border-color: #002D62;
}

.app-shell.design-modern .md-page .filter-chip.active {
    background: #002D62;
    border-color: #002D62;
    color: #FFFFFF;
}

/* ---------- Tabulky (LasiceDataGrid) ---------- */
.app-shell.design-modern .md-page .lasice-grid {
    --rz-grid-header-background-color: #F4F5F7;
    --rz-grid-header-cell-border-bottom: 1px solid #E3E5E8;
    --rz-grid-header-cell-padding: 10px 16px 10px 0;
    --rz-grid-header-color: #55565A;
    --rz-grid-header-font-size: 12px;
    --rz-grid-header-font-weight: 700;
    --rz-grid-cell-padding: 12px 16px 12px 0;
    --rz-grid-cell-border: 1px solid #E3E5E8;
    --rz-grid-cell-color: #55565A;
    --rz-grid-cell-font-size: 14px;
    --rz-grid-cell-line-height: 1.35;
    --rz-grid-hover-background-color: #F8F9FA;
    --rz-grid-selected-background-color: #F8F9FA;
    --rz-pager-padding: 12px 20px;
    --rz-pager-summary-color: #55565A;
    --rz-pager-summary-font-size: 13px;
    --rz-pager-button-border-radius: 4px;
    --rz-pager-numeric-button-min-width: 32px;
    --rz-pager-numeric-button-color: #002D62;
    --rz-pager-numeric-button-border: 1px solid #E3E5E8;
    --rz-pager-numeric-button-selected-border: 1px solid #002D62;
    --rz-pager-numeric-button-selected-background-color: #002D62;
    --rz-pager-numeric-button-selected-color: #FFFFFF;
}

.app-shell.design-modern .md-page .lasice-grid .rz-grid-table thead th:first-child,
.app-shell.design-modern .md-page .lasice-grid .rz-grid-table tbody td:first-child {
    padding-inline-start: 20px;
}

.app-shell.design-modern .md-page .lasice-grid .rz-grid-table thead th:last-child,
.app-shell.design-modern .md-page .lasice-grid .rz-grid-table tbody td:last-child {
    padding-inline-end: 20px;
}

.app-shell.design-modern .md-page .lasice-grid .rz-cell-data strong {
    color: #002D62;
}

.app-shell.design-modern .md-page .lasice-grid .rz-cell-data .muted {
    font-size: 12px;
    color: #8A8C91;
}

/* ---------- Štítky ---------- */
.app-shell.design-modern .md-page .status-pill {
    padding: 4px 8px;
    border-radius: 4px;
    background: #E6EAF0;
    color: #002D62;
    font-size: 12px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .health-pill,
.app-shell.design-modern .md-page .margin-pill {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .delay-badge {
    min-width: 0;
    margin-top: 3px;
    padding: 2px 6px;
    font-size: 11px;
}

.app-shell.design-modern .md-page .out-of-scope-badge {
    margin: 0;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
}

/* Odhad / výkaz s pruhem (seznam projektů). */
.app-shell.design-modern .md-page .md-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.app-shell.design-modern .md-page .md-progress > span {
    font-size: 13px;
    color: #002D62;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .md-progress-track {
    height: 6px;
    background: #F4F5F7;
    border-radius: 2px;
    overflow: hidden;
}

.app-shell.design-modern .md-page .md-progress-fill {
    height: 100%;
    background: #002D62;
}

.app-shell.design-modern .md-page .md-progress-fill.md-progress-over {
    background: #C5221F;
}

.app-shell.design-modern .md-page .bar-track {
    height: 6px;
    background: #F4F5F7;
    border-radius: 2px;
}

.app-shell.design-modern .md-page .bar-fill {
    border-radius: 0;
    background: #C9CCD1;
}

.app-shell.design-modern .md-page .bar-fill.alt {
    background: #002D62;
}

/* ==========================================================================
   Detail projektu
   ========================================================================== */
.app-shell.design-modern .md-page.content-grid {
    display: flex;
}

.app-shell.design-modern .md-page .md-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .md-breadcrumb-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 700;
    color: #55565A;
    cursor: pointer;
}

.app-shell.design-modern .md-page .md-breadcrumb-link:hover {
    color: #002D62;
    text-decoration: underline;
}

.app-shell.design-modern .md-page .md-breadcrumb-current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #002D62;
}

/* DetailHero: nadpis volně na stránce, metriky + fáze v modrém pásu. */
.app-shell.design-modern .md-page .page-panel.detail-hero {
    padding: 0;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .detail-hero-head {
    margin: 0 0 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}

.app-shell.design-modern .md-page .detail-hero-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

.app-shell.design-modern .md-page .detail-hero-copy .section-eyebrow {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .detail-hero-copy h1 {
    flex-basis: 100%;
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    color: #002D62;
    text-wrap: balance;
}

.app-shell.design-modern .md-page .detail-hero-copy .muted {
    font-size: 15px;
    color: #55565A;
}

.app-shell.design-modern .md-page .detail-hero-copy .muted + .muted::before {
    content: "|";
    margin-right: 10px;
    color: #C9CCD1;
}

.app-shell.design-modern .md-page .detail-hero .hero-command-bar {
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.app-shell.design-modern .md-page .detail-hero .hero-action-button {
    min-height: 44px;
}

.app-shell.design-modern .md-page .detail-hero .metric-grid:has(+ .detail-stage-strip) {
    padding-bottom: 20px;
    border-radius: 8px 8px 0 0;
}

.app-shell.design-modern .md-page .detail-hero .metric-card strong {
    font-size: 28px;
}

.app-shell.design-modern .md-page .detail-stage-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 18px 28px 22px;
    border-radius: 0 0 8px 8px;
    /* Dělicí linka nad fázemi jen v šířce obsahu (jako v návrhu). */
    background: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)) 28px 0 / calc(100% - 56px) 1px no-repeat #002D62;
}

.app-shell.design-modern .md-page .detail-stage-node {
    gap: 8px;
}

.app-shell.design-modern .md-page .detail-stage-bar,
.app-shell.design-modern .md-page .detail-stage-node.current .detail-stage-bar {
    height: 6px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: none;
    transform: none;
}

.app-shell.design-modern .md-page .detail-stage-node.active .detail-stage-bar,
.app-shell.design-modern .md-page .detail-stage-node.current .detail-stage-bar {
    background: #FFC40C;
}

.app-shell.design-modern .md-page .detail-stage-label {
    font-size: 12px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
}

.app-shell.design-modern .md-page .detail-stage-node.active .detail-stage-label {
    color: #C9D3E0;
}

.app-shell.design-modern .md-page .detail-stage-node.current .detail-stage-label {
    color: #FFFFFF;
}

/* Záložky — žluté podtržení aktivní. Linka je stín (ne border), aby ji overflow-x nepřekryl. */
.app-shell.design-modern .md-page .tabs-bar {
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    box-shadow: inset 0 -1px 0 #E3E5E8;
    overflow-x: auto;
}

.app-shell.design-modern .md-page .tab-button {
    padding: 12px 14px;
    border-bottom: 3px solid transparent;
    color: #55565A;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .tab-button:hover {
    color: #002D62;
}

.app-shell.design-modern .md-page .tab-button-active {
    color: #002D62;
    border-bottom-color: #FFC40C;
}

.app-shell.design-modern .md-page .tab-count,
.app-shell.design-modern .md-page .tab-button-active .tab-count {
    min-width: 0;
    height: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: #E3E5E8;
    color: #55565A;
    font-size: 12px;
}

/* Přehled: karta „Detail projektu“ (nadpis + formulář) vlevo, Navázané CR vpravo.
   Mřížka jde přes .detail-two-column (display: contents), aby nadpis i formulář tvořily jednu kartu. */
.app-shell.design-modern .md-page .page-panel.detail-workspace.module-projects {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 0 20px;
    align-items: start;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .detail-workspace.module-projects > .panel-header {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    padding: 22px 24px 0;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-two-column {
    display: contents;
}

.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-two-column > form {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 18px 24px 22px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-side-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.app-shell.design-modern .md-page .detail-section-title-row h2 {
    font-size: 18px;
    color: #002D62;
}

.app-shell.design-modern .md-page .detail-section-origin {
    font-size: 13px;
    font-weight: 400;
    color: #55565A;
}

.app-shell.design-modern .md-page .detail-section-origin a {
    font-weight: 700;
    text-decoration: none;
}

.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-field-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

/* Název, Navázaná příležitost a Popis přes celou šířku (pořadí polí viz ProjectDetail.razor). */
.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-field-stack > div:nth-child(1),
.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-field-stack > div:nth-child(6),
.app-shell.design-modern .md-page .detail-workspace.module-projects .detail-field-stack > div:nth-child(7) {
    grid-column: 1 / -1;
}

.app-shell.design-modern .md-page .detail-side-card {
    gap: 12px;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
    box-shadow: none;
}

.app-shell.design-modern .md-page .detail-side-card .panel-header {
    margin: 0;
    align-items: center;
}

.app-shell.design-modern .md-page .detail-side-card h3 {
    font-size: 18px;
    color: #002D62;
}

.app-shell.design-modern .md-page .detail-side-card .secondary-button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.app-shell.design-modern .md-page .detail-side-card .list-row,
.app-shell.design-modern .md-page .detail-side-card .list-row:first-of-type {
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #E3E5E8;
    background: transparent;
    font-weight: 400;
}

.app-shell.design-modern .md-page .detail-side-card .list-row:hover {
    background: #F8F9FA;
}

.app-shell.design-modern .md-page .detail-side-card .list-row strong {
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .detail-side-card .list-row .muted {
    font-size: 12px;
}

/* Úkoly a Položky prodeje: skupiny přes celou šířku karty, řádky jako tabulka. */
.app-shell.design-modern .md-page .page-panel.panel-theme-estimate,
.app-shell.design-modern .md-page .page-panel.panel-theme-sales {
    padding: 0;
    overflow: hidden;
}

.app-shell.design-modern .md-page .page-panel.panel-theme-estimate > .panel-header,
.app-shell.design-modern .md-page .page-panel.panel-theme-sales > .panel-header {
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .page-panel.panel-theme-estimate > .empty-state,
.app-shell.design-modern .md-page .page-panel.panel-theme-sales > .empty-state {
    margin: 20px 24px;
}

.app-shell.design-modern .md-page .nested-group {
    margin: 0;
    padding: 0;
    border-top: 0;
}

.app-shell.design-modern .md-page .nested-group-header {
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 24px;
    background: #F4F5F7;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .nested-group-header > strong {
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #002D62;
}

.app-shell.design-modern .md-page .nested-group-header .inline-actions {
    gap: 10px;
}

.app-shell.design-modern .md-page .nested-group-header .inline-actions > span:not(.margin-pill) {
    font-size: 13px;
    font-weight: 700;
    color: #002D62;
}

.app-shell.design-modern .md-page .task-row,
.app-shell.design-modern .md-page .task-row-out-of-scope {
    margin: 0;
    padding: 10px 24px;
    background: #FFFFFF;
    border: 0;
    border-bottom: 1px solid #E3E5E8;
    border-radius: 0;
    box-shadow: none;
}

.app-shell.design-modern .md-page .task-row:hover {
    background: #F8F9FA;
    box-shadow: none;
}

.app-shell.design-modern .md-page .task-cells {
    grid-template-columns: 16px minmax(200px, 2fr) 180px minmax(180px, 1.6fr) 200px;
    gap: 16px;
}

/* Úchyt pro přetažení (řádek je draggable) — oblast je už v záhlaví skupiny. */
.app-shell.design-modern .md-page .task-cells::before {
    content: "";
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23C9CCD1'%3E%3Ccircle cx='9' cy='6' r='1.6'/%3E%3Ccircle cx='15' cy='6' r='1.6'/%3E%3Ccircle cx='9' cy='12' r='1.6'/%3E%3Ccircle cx='15' cy='12' r='1.6'/%3E%3Ccircle cx='9' cy='18' r='1.6'/%3E%3Ccircle cx='15' cy='18' r='1.6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.app-shell.design-modern .md-page .task-cell-area {
    display: none;
}

.app-shell.design-modern .md-page .task-cell-name {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    font-size: 14px;
}

.app-shell.design-modern .md-page .task-cell-name .task-row-title-link {
    max-width: 100%;
    font-weight: 700;
    color: #002D62;
}

.app-shell.design-modern .md-page .task-cell-sub {
    flex-basis: 100%;
    font-size: 12px;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .task-assign-select {
    width: 100%;
    min-height: 34px;
    height: 34px;
    padding: 0 28px 0 8px;
    font-size: 13px;
}

.app-shell.design-modern .md-page .dep-chip {
    gap: 4px;
    padding: 3px 4px 3px 8px;
    background: #E6EAF0;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
    color: #002D62;
    white-space: nowrap;
}

/* „+ předchůdce“ jako textový odkaz s malou šipkou. */
.app-shell.design-modern .md-page .task-dep-select {
    width: auto;
    max-width: 160px;
    min-height: 0;
    height: auto;
    padding: 2px 18px 2px 0;
    border: 0;
    background-color: transparent;
    background-position: right center;
    background-size: 10px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #55565A;
    cursor: pointer;
}

.app-shell.design-modern .md-page .task-dep-select:focus {
    box-shadow: none;
    text-decoration: underline;
}

.app-shell.design-modern .md-page .task-cell-progress {
    flex-wrap: wrap;
    gap: 5px 12px;
}

.app-shell.design-modern .md-page .task-cell-progress .bar-track {
    flex: 1 1 100%;
    height: 6px;
    border-radius: 2px;
    background: #F4F5F7;
}

.app-shell.design-modern .md-page .task-cell-progress .bar-fill {
    border-radius: 0;
}

.app-shell.design-modern .md-page .task-cell-hours {
    order: -1;
    flex-basis: 100%;
    font-size: 13px;
    color: #002D62;
}

.app-shell.design-modern .md-page .panel-theme-sales .list-row {
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    border-top: 0;
    border-bottom: 1px solid #E3E5E8;
    font-size: 14px;
}

.app-shell.design-modern .md-page .panel-theme-sales .list-row:hover {
    background: #F8F9FA;
}

.app-shell.design-modern .md-page .panel-theme-sales .list-row strong {
    color: #002D62;
}

.app-shell.design-modern .md-page .panel-theme-sales .list-row .muted {
    font-size: 12px;
}

.app-shell.design-modern .md-page .panel-theme-sales .list-row .inline-actions {
    justify-content: flex-end;
    gap: 12px;
}

.app-shell.design-modern .md-page .panel-theme-sales .list-row .inline-actions > span:first-child {
    min-width: 120px;
    text-align: right;
    font-weight: 700;
    color: #002D62;
}

/* Štítky typů nad tabulkou výkazů */
.app-shell.design-modern .md-page .md-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-shell.design-modern .md-page .md-type-chips .filter-chip {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

/* Tým */
.app-shell.design-modern .md-page .member-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.app-shell.design-modern .md-page .member-pill {
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .md-member-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.app-shell.design-modern .md-page .md-member-text strong {
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-member-text span {
    font-size: 12px;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .member-pill .mini-button {
    font-size: 12px;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: #E6EAF0;
    color: #002D62;
    font-size: 14px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .team-select {
    min-width: 200px;
    width: auto;
}

/* Poznámky, aktivity (ThreadList i ruční vlákno) */
.app-shell.design-modern .md-page .thread-item {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 14px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid #E3E5E8;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.5;
}

.app-shell.design-modern .md-page .thread-item strong {
    color: #002D62;
}

.app-shell.design-modern .md-page .thread-meta {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0;
    color: #8A8C91;
}

/* ==========================================================================
   Plánovač
   ========================================================================== */
.app-shell.design-modern .md-page .page-panel.module-planner:has(.planner-toolbar) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .planner-toolbar {
    margin: 0;
    padding: 16px 20px;
    gap: 14px;
    align-items: flex-end;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .planner-toolbar-group {
    gap: 5px;
}

.app-shell.design-modern .md-page .planner-toolbar-group > label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #55565A;
}

.app-shell.design-modern .md-page .planner-toolbar .form-select,
.app-shell.design-modern .md-page .planner-toolbar .form-control,
.app-shell.design-modern .md-page .planner-toolbar .proj-filter-btn {
    width: auto;
    min-width: 150px;
    height: 38px;
    min-height: 38px;
    border: 1px solid #C9CCD1;
    border-radius: 4px;
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .planner-toolbar .form-select {
    padding-right: 32px;
}

.app-shell.design-modern .md-page .planner-toolbar .primary-button,
.app-shell.design-modern .md-page .planner-toolbar .secondary-button {
    height: 38px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 13px;
}

.app-shell.design-modern .md-page .proj-panel {
    border-color: #E3E5E8;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 45, 98, 0.12);
}

.app-shell.design-modern .md-page .proj-panel-item {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-segmented {
    display: flex;
    height: 38px;
    border: 1px solid #C9CCD1;
    border-radius: 4px;
    overflow: hidden;
}

.app-shell.design-modern .md-page .md-segmented button {
    padding: 0 14px;
    border: 0;
    background: #FFFFFF;
    color: #002D62;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.app-shell.design-modern .md-page .md-segmented button.active {
    background: #002D62;
    color: #FFFFFF;
}

.app-shell.design-modern .md-page .planner-confirm {
    margin: 0;
}

.app-shell.design-modern .md-page .resource-timeline {
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .md-gantt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .md-gantt-head h2 {
    margin: 0;
    font-size: 18px;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.app-shell.design-modern .md-page .md-gantt-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-gantt-legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.app-shell.design-modern .md-page .rtl-names {
    flex-basis: 180px;
    background: #FFFFFF;
    border-right-color: #E3E5E8;
}

.app-shell.design-modern .md-page .rtl-corner,
.app-shell.design-modern .md-page .rtl-axis {
    height: 36px;
    background: #F4F5F7;
    border-bottom-color: #E3E5E8;
}

.app-shell.design-modern .md-page .rtl-corner {
    padding: 0 16px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #55565A;
}

.app-shell.design-modern .md-page .rtl-name {
    padding: 0 16px;
    border-bottom-color: #E3E5E8;
    font-size: 14px;
    font-weight: 700;
    color: #002D62;
}

.app-shell.design-modern .md-page .rtl-tick {
    font-size: 11px;
    color: #55565A;
}

.app-shell.design-modern .md-page .rtl-tick.rtl-tick-strong {
    color: #002D62;
}

.app-shell.design-modern .md-page .rtl-tick.rtl-tick-weeknow {
    color: #002D62;
    border-left-color: #FFC40C;
}

.app-shell.design-modern .md-page .rtl-tick.rtl-tick-today {
    background: #FFC40C;
    color: #002D62;
    border-left-color: #FFC40C;
}

.app-shell.design-modern .md-page .rtl-row {
    border-bottom-color: #E3E5E8;
}

.app-shell.design-modern .md-page .rtl-weeknow {
    background: rgba(0, 45, 98, 0.025);
    border-color: transparent;
}

.app-shell.design-modern .md-page .rtl-todaycol {
    background: rgba(255, 196, 12, 0.1);
}

.app-shell.design-modern .md-page .rtl-today {
    background: #FFC40C;
}

.app-shell.design-modern .md-page .rtl-bar {
    border-radius: 4px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .rtl-bar .rtl-bar-progress {
    background: rgba(255, 255, 255, 0.55);
    border-bottom-left-radius: 4px;
}

/* Kapacitní matice (výjimka z LasiceDataGrid, viz CLAUDE.md) */
.app-shell.design-modern .md-page .data-table th {
    padding: 10px 12px;
    background: #F4F5F7;
    border-bottom: 1px solid #E3E5E8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #55565A;
}

.app-shell.design-modern .md-page .data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #E3E5E8;
    font-size: 14px;
}

.app-shell.design-modern .md-page .data-table td strong {
    color: #002D62;
}

/* ==========================================================================
   Servisní protokoly — podpis / odeslání v řádku
   ========================================================================== */
.app-shell.design-modern .md-page .signsend {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.app-shell.design-modern .md-page .signsend .ss-icon {
    font-size: 15px;
}

.app-shell.design-modern .md-page .signsend .ss-icon.ss-signed {
    color: #1E8E3E;
}

.app-shell.design-modern .md-page .signsend .ss-icon.ss-sent {
    color: #002D62;
}

.app-shell.design-modern .md-page .signsend .ss-time {
    font-size: 13px;
    color: #002D62;
}

.app-shell.design-modern .md-page .signsend-button {
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
}

.app-shell.design-modern .md-page .signsend-button.send-waiting {
    background: rgba(245, 158, 11, 0.16);
}

.app-shell.design-modern .md-page .signsend-button.send-failed {
    background: rgba(220, 38, 38, 0.14);
}

.app-shell.design-modern .md-page .signsend-button:hover {
    filter: brightness(0.96);
}

.app-shell.design-modern .md-page .signsend-button .ss-icon.ss-notsent {
    font-size: 14px;
}

.app-shell.design-modern .md-page .signsend-button .ss-time.ss-notsent-label {
    font-size: 12px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .signsend-button.send-waiting .ss-icon.ss-notsent,
.app-shell.design-modern .md-page .signsend-button.send-waiting .ss-time.ss-notsent-label {
    color: #b45309;
}

.app-shell.design-modern .md-page .signsend-button.send-waiting .ss-icon.ss-notsent::after {
    background: #b45309;
}

.app-shell.design-modern .md-page .signsend-button.send-failed .ss-icon.ss-notsent,
.app-shell.design-modern .md-page .signsend-button.send-failed .ss-time.ss-notsent-label {
    color: #b91c1c;
}

.app-shell.design-modern .md-page .checkbox-row {
    font-weight: 400;
    color: #55565A;
}

/* ==========================================================================
   Výkazy — filtry v záhlaví, graf, akce v řádku
   ========================================================================== */
.app-shell.design-modern .md-page .md-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.app-shell.design-modern .md-page .md-field > label {
    margin: 0;
    font-size: 12px;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-field .form-control,
.app-shell.design-modern .md-page .md-field .form-select {
    min-width: 150px;
    height: 38px;
    min-height: 38px;
}

.app-shell.design-modern .md-page .md-chart-card > .panel-header {
    align-items: baseline;
}

.app-shell.design-modern .md-page .md-hours-chart {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
}

.app-shell.design-modern .md-page .md-hours-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    font-size: 11px;
    line-height: 1;
    color: #8A8C91;
    text-align: right;
}

.app-shell.design-modern .md-page .md-hours-plot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.app-shell.design-modern .md-page .md-hours-cols {
    display: grid;
    align-items: end;
    gap: 4px;
    height: 160px;
    border-bottom: 1px solid #E3E5E8;
    background: linear-gradient(#E3E5E8, #E3E5E8) 0 50% / 100% 1px no-repeat;
}

.app-shell.design-modern .md-page .md-hours-col {
    min-height: 0;
    background: #002D62;
    border-radius: 2px 2px 0 0;
}

.app-shell.design-modern .md-page .md-hours-col.md-hours-col-today {
    background: #FFC40C;
}

.app-shell.design-modern .md-page .md-hours-ticks {
    display: grid;
    gap: 4px;
}

.app-shell.design-modern .md-page .md-hours-ticks span {
    font-size: 11px;
    color: #8A8C91;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .timesheet-row-actions {
    flex-wrap: nowrap;
    gap: 12px;
}

.app-shell.design-modern .md-page .timesheet-row-actions .secondary-button,
.app-shell.design-modern .md-page .timesheet-row-actions .ghost-button {
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 13px;
    color: #002D62;
}

.app-shell.design-modern .md-page .timesheet-row-actions .secondary-button:hover,
.app-shell.design-modern .md-page .timesheet-row-actions .ghost-button:hover {
    background: transparent;
    color: #002D62;
    text-decoration: underline;
}

.app-shell.design-modern .md-page .timesheet-row-actions .danger-button-outline,
.app-shell.design-modern .md-page .timesheet-row-actions .danger-button-outline:hover {
    color: #C5221F;
}

/* ==========================================================================
   Obchod — detaily (zákazník, kontakt, lead, případ, příležitost, smlouva, aktivita)
   podle examples/Lasička Obchod detail.html. Rozložení přehledu: sekce formuláře
   i boční panely jako samostatné karty (detail-side-card, fieldset), mřížka 2 : 1.
   ========================================================================== */

/* Drobečková navigace (DetailBreadcrumb) se vykresluje vždy — klasický vzhled ji skrývá. */
.md-breadcrumb {
    display: none;
}

/* „Zpět na seznam“ v záhlaví nahrazuje v moderním vzhledu drobečková navigace. */
.app-shell.design-modern .md-page .ghost-button.hero-back-button {
    display: none;
}

/* Pořadí akcí v záhlaví jako v návrhu: smazat (text) · vedlejší akce · uložit. */
.app-shell.design-modern .md-page .hero-command-bar > .action-message {
    order: -2;
}

.app-shell.design-modern .md-page .hero-command-bar > .hero-action-danger,
.app-shell.design-modern .md-page .hero-command-bar > .danger-button {
    order: -1;
}

.app-shell.design-modern .md-page .hero-command-bar > .primary-button {
    order: 10;
}

.app-shell.design-modern .md-page .detail-hero .danger-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    background: transparent;
    border: 0;
    color: #C5221F;
    font-size: 14px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .detail-hero .danger-button:hover,
.app-shell.design-modern .md-page .detail-hero .hero-action-danger:hover {
    background: transparent;
    color: #9B1916;
    text-decoration: underline;
}

.app-shell.design-modern .md-page .detail-hero .danger-button .btn-icon,
.app-shell.design-modern .md-page .detail-hero .hero-action-danger .btn-icon {
    display: none;
}

/* Dlaždice s ikonou modulu vlevo od nadpisu (barvy a ikony jako v menu, viz NavIcons). */
.app-shell.design-modern .md-page .detail-hero.module-customers .detail-hero-head::before,
.app-shell.design-modern .md-page .detail-hero.module-contacts .detail-hero-head::before,
.app-shell.design-modern .md-page .detail-hero.module-leads .detail-hero-head::before,
.app-shell.design-modern .md-page .detail-hero.module-business-cases .detail-hero-head::before,
.app-shell.design-modern .md-page .detail-hero.module-opportunities .detail-hero-head::before,
.app-shell.design-modern .md-page .detail-hero.module-contracts .detail-hero-head::before,
.app-shell.design-modern .md-page .detail-hero.module-activities .detail-hero-head::before {
    content: "";
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    align-self: flex-start;
    margin-top: 2px;
    border-radius: 6px;
    background-position: center;
    background-size: 26px 26px;
    background-repeat: no-repeat;
}

.app-shell.design-modern .md-page .detail-hero.module-customers .detail-hero-head::before {
    background-color: rgba(15, 93, 110, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f5d6e'%3E%3Cpath d='M9 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm6 2a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm-6 1c-3.3 0-6 1.7-6 4v2h12v-2c0-2.3-2.7-4-6-4zm6 1c-.7 0-1.4.1-2 .3 1.2.9 2 2.2 2 3.7v1h6v-2c0-2-2.5-3-6-3z'/%3E%3C/svg%3E");
}

.app-shell.design-modern .md-page .detail-hero.module-contacts .detail-hero-head::before {
    background-color: rgba(13, 148, 136, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230d9488'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0 2c-4.4 0-8 2.2-8 5v3h16v-3c0-2.8-3.6-5-8-5zm6-9a2 2 0 0 0-2 2v2h2V5z'/%3E%3C/svg%3E");
}

.app-shell.design-modern .md-page .detail-hero.module-leads .detail-hero-head::before {
    background-color: rgba(77, 124, 15, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234d7c0f'%3E%3Cpath d='M12 3a6 6 0 0 0-4 10.5V16h8v-2.5A6 6 0 0 0 12 3zm-3 15h6v2H9zm1-9h4v2h-4z'/%3E%3C/svg%3E");
}

.app-shell.design-modern .md-page .detail-hero.module-business-cases .detail-hero-head::before {
    background-color: rgba(190, 24, 93, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23be185d'%3E%3Cpath d='M4 6h16v12H4zm2 2v8h5v-3h2v3h5V8zm2 1h2v2H8zm6 0h2v2h-2z'/%3E%3C/svg%3E");
}

.app-shell.design-modern .md-page .detail-hero.module-opportunities .detail-hero-head::before {
    background-color: rgba(194, 65, 12, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c2410c'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9h-2a7 7 0 1 1-7-7V3zm1 0v8h8A8 8 0 0 0 13 3z'/%3E%3C/svg%3E");
}

.app-shell.design-modern .md-page .detail-hero.module-contracts .detail-hero-head::before {
    background-color: rgba(15, 118, 110, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f766e'%3E%3Cpath d='M5 6h14v12H5zm2 2v8h10V8zm2 2h6v2H9zm0 3h4v2H9z'/%3E%3C/svg%3E");
}

.app-shell.design-modern .md-page .detail-hero.module-activities .detail-hero-head::before {
    background-color: rgba(2, 132, 199, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230284c7'%3E%3Cpath d='M4 5h16v12H4zm2 2v8h12V7zm2 2h5v2H8zm0 3h8v2H8zm-1 5h10v2H7z'/%3E%3C/svg%3E");
}

/* Metriky obchodních detailů jsou často texty (jména, data) — menší písmo a zalamování. */
.app-shell.design-modern .md-page .detail-hero:not(.module-projects) .metric-grid .metric-card strong {
    font-size: 22px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

.app-shell.design-modern .md-page .metric-grid .metric-card strong a {
    color: inherit;
    text-decoration: none;
}

.app-shell.design-modern .md-page .metric-grid .metric-card strong a:hover {
    text-decoration: underline;
}

/* Fáze: ztracená příležitost / neúspěšný výsledek leadu černě (jako v klasickém vzhledu i návrhu). */
.app-shell.design-modern .md-page .detail-stage-node.lost .detail-stage-bar {
    background: #000000;
}

.app-shell.design-modern .md-page .detail-stage-strip-clickable .detail-stage-node:hover .detail-stage-label {
    color: #FFFFFF;
}

/* Pracovní plocha detailu: bez vlastní karty, karty tvoří jednotlivé sekce. */
.app-shell.design-modern .md-page .page-panel.detail-workspace:not(.module-projects) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) > .panel-header {
    margin: 0;
}

.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) .detail-two-column {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
}

.app-shell.design-modern .md-page .detail-workspace.module-opportunities .detail-two-column {
    grid-template-columns: minmax(0, 1fr);
}

.app-shell.design-modern .md-page .opportunity-overview-split {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
}

.app-shell.design-modern .md-page .opportunity-side-panel,
.app-shell.design-modern .md-page .detail-side-panel {
    gap: 20px;
}

.app-shell.design-modern .md-page .opportunity-scope-bottom {
    margin-top: 0;
}

.app-shell.design-modern .md-page form > .detail-field-stack,
.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) > .detail-field-stack,
.app-shell.design-modern .md-page .detail-main,
.app-shell.design-modern .md-page .activity-form-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-shell.design-modern .md-page .detail-side-card .panel-header.small {
    margin: 0 0 4px;
}

.app-shell.design-modern .md-page .form-grid {
    gap: 16px 20px;
}

.app-shell.design-modern .md-page .form-readonly {
    min-height: 40px;
    padding: 9px 12px;
    background: #F8F9FA;
    border: 1px solid #E3E5E8;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    color: #002D62;
}

/* Sekce formuláře jako fieldset (Kontakt, Aktivita) → karta s nadpisem. */
.app-shell.design-modern .md-page fieldset.form-group,
.app-shell.design-modern .md-page fieldset.activity-form-panel {
    min-width: 0;
    margin: 0;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page fieldset.form-group > legend,
.app-shell.design-modern .md-page fieldset.activity-form-panel > legend {
    float: left;
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: #002D62;
}

.app-shell.design-modern .md-page fieldset.form-group > legend + *,
.app-shell.design-modern .md-page fieldset.activity-form-panel > legend + * {
    clear: both;
}

.app-shell.design-modern .md-page .activity-form-panel-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px 20px;
    margin-top: 0;
}

.app-shell.design-modern .md-page .activity-form-panel-grid label {
    font-size: 13px;
    font-weight: 700;
    color: #002D62;
}

.app-shell.design-modern .md-page .activity-form-panel-grid .form-control-sm,
.app-shell.design-modern .md-page .activity-form-panel-grid .form-select-sm {
    min-height: 40px;
    height: auto;
    padding: 0 12px;
    font-size: 14px;
}

.app-shell.design-modern .md-page .activity-form-panel-grid .form-select-sm {
    padding-right: 32px;
}

/* Metriky uvnitř karet (např. Vykázaný čas u smlouvy) — světlá varianta, ne modrý pás. */
.app-shell.design-modern .md-page .detail-side-card .metric-grid,
.app-shell.design-modern .md-page .md-tab-body .metric-grid {
    padding: 16px 20px;
    background: #F4F5F7;
}

.app-shell.design-modern .md-page .detail-side-card .metric-grid::before,
.app-shell.design-modern .md-page .md-tab-body .metric-grid::before {
    display: none;
}

.app-shell.design-modern .md-page .detail-side-card .metric-grid .metric-card span,
.app-shell.design-modern .md-page .md-tab-body .metric-grid .metric-card span {
    color: #55565A;
}

.app-shell.design-modern .md-page .detail-side-card .metric-grid .metric-card strong,
.app-shell.design-modern .md-page .md-tab-body .metric-grid .metric-card strong {
    font-size: 22px;
    color: #002D62;
}

/* Karty s tabulkou (např. Příležitosti v případu) — tabulka přes celou šířku karty. */
.app-shell.design-modern .md-page .page-panel:has(> .table-shell):not(.md-table-card) {
    padding: 0;
    overflow: hidden;
}

.app-shell.design-modern .md-page .page-panel:has(> .table-shell):not(.md-table-card) > .panel-header {
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid #E3E5E8;
}

/* Zákazník: záložky nad kartou s obsahem; Přehled = karta údajů + boční karta. */
.app-shell.design-modern .md-page .page-panel.module-customers:has(> .tabs-bar) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .md-tab-body {
    min-width: 0;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .md-tab-body:has(> .overview-grid) {
    padding: 0;
    background: transparent;
    border: 0;
}

.app-shell.design-modern .md-page .overview-grid {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}

.app-shell.design-modern .md-page .overview-grid > div {
    min-width: 0;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .overview-grid h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #002D62;
}

.app-shell.design-modern .md-page .overview-grid h3:not(:first-child) {
    margin-top: 24px;
}

.app-shell.design-modern .md-page .kv-list {
    column-gap: 24px;
    row-gap: 0;
    font-size: 14px;
}

.app-shell.design-modern .md-page .kv-list dt,
.app-shell.design-modern .md-page .kv-list dd {
    padding: 10px 0;
    border-top: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .kv-list dt {
    font-weight: 400;
    color: #55565A;
}

.app-shell.design-modern .md-page .kv-list dd {
    font-weight: 700;
    color: #002D62;
}

.app-shell.design-modern .md-page .contact-card {
    margin: 0;
    padding: 10px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid #E3E5E8;
    border-radius: 0;
}

.app-shell.design-modern .md-page .contact-card strong {
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .contact-card .muted {
    font-size: 12px;
}

@media (max-width: 1100px) {
    .app-shell.design-modern .md-page .detail-workspace:not(.module-projects) .detail-two-column,
    .app-shell.design-modern .md-page .opportunity-overview-split,
    .app-shell.design-modern .md-page .overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   Obchod — seznamy podle examples/Lasička Obchod.html (kostra jako Projekty:
   záhlaví, KPI pás, lišta s hledáním a rychlými filtry, tabulka).
   ========================================================================== */

/* Rychlé filtry zákazníků (pill-button) v liště vypadají jako ostatní štítky filtrů. */
.app-shell.design-modern .md-page .md-toolbar .pill-button {
    height: 34px;
    padding: 0 12px;
    border: 1px solid #C9CCD1;
    border-radius: 4px;
    background: #FFFFFF;
    color: #002D62;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .md-toolbar .pill-button:hover {
    border-color: #002D62;
    background: #FFFFFF;
}

.app-shell.design-modern .md-page .md-toolbar .pill-button.pill-button-active {
    background: #002D62;
    border-color: #002D62;
    color: #FFFFFF;
}

/* Minipruh stavu (příležitosti, leady): tenké segmenty, dosažené modře, ztracené černě. */
.app-shell.design-modern .md-page .status-track {
    gap: 2px;
    margin-bottom: 5px;
}

.app-shell.design-modern .md-page .status-step {
    height: 6px;
    border-radius: 1px;
    background: #E3E5E8;
}

.app-shell.design-modern .md-page .status-step.active {
    background: #002D62;
}

.app-shell.design-modern .md-page .status-step.active.lost {
    background: #1B1C1E;
}

.app-shell.design-modern .md-page .status-inline-label {
    font-size: 12px;
    font-weight: 700;
    color: #002D62;
    white-space: nowrap;
}

/* Štítky v řádcích tabulek — jednotná velikost (barvy zůstávají z app.css). */
.app-shell.design-modern .md-page .lasice-grid .tag-pill,
.app-shell.design-modern .md-page .lasice-grid .health-badge,
.app-shell.design-modern .md-page .lasice-grid .qual-band,
.app-shell.design-modern .md-page .lasice-grid .prob-band {
    padding: 4px 8px;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .lasice-grid .tag-pill.tag-pill-secondary,
.app-shell.design-modern .md-page .lasice-grid .tag-pill.tag-pill-business-case {
    padding: 2px 6px;
    font-size: 11px;
}

.app-shell.design-modern .md-page .status-chip {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #E6EAF0;
    color: #002D62;
    font-size: 11px;
    font-weight: 700;
}

/* Leady: zóna „Lead z e-mailu“ jako samostatná dlaždice vedle modrého pásu (v DOM je v mřížce metrik). */
.app-shell.design-modern .md-page .metric-grid:has(> .metric-card-dropzone) {
    isolation: isolate;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) 220px;
    padding: 22px 0 22px 28px;
    background: transparent;
}

.app-shell.design-modern .md-page .metric-grid:has(> .metric-card-dropzone)::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 236px;
    z-index: -1;
    background: #002D62;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .metric-grid:has(> .metric-card-dropzone)::before {
    width: calc(100% - 236px);
    border-radius: 8px 8px 0 0;
}

.app-shell.design-modern .md-page .metric-grid .metric-card.metric-card-dropzone {
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: -22px 0;
    padding: 16px;
    background: #FFFFFF;
    border: 2px dashed #C9CCD1;
    border-radius: 8px;
    text-align: center;
}

.app-shell.design-modern .md-page .metric-grid .metric-card.metric-card-dropzone.drag-over {
    border-color: #4d7c0f;
    background: rgba(77, 124, 15, 0.06);
}

.app-shell.design-modern .md-page .metric-grid .metric-card.metric-card-dropzone span {
    font-size: 13px;
    color: #55565A;
}

.app-shell.design-modern .md-page .metric-grid .metric-card.metric-card-dropzone strong.dropzone-hint {
    font-size: 14px;
    white-space: normal;
    color: #4d7c0f;
}

.app-shell.design-modern .md-page .lead-email-import-message {
    margin: 0;
}

@media (max-width: 820px) {
    .app-shell.design-modern .md-page .metric-grid:has(> .metric-card-dropzone) {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        padding: 20px;
        background: #002D62;
    }

    .app-shell.design-modern .md-page .metric-grid:has(> .metric-card-dropzone)::after {
        display: none;
    }

    .app-shell.design-modern .md-page .metric-grid:has(> .metric-card-dropzone)::before {
        width: 100%;
    }

    .app-shell.design-modern .md-page .metric-grid .metric-card.metric-card-dropzone {
        margin: 0;
    }
}

/* ==========================================================================
   Další — Úkoly, AI asistent, Reporty, Nastavení a detail uživatele
   podle examples/Lasicka Dalsi.html.
   ========================================================================== */

/* Panel se záložkami (Zákazník, Nastavení): záložky nad kartou s obsahem (.md-tab-body). */
.app-shell.design-modern .md-page .page-panel:has(> .tabs-bar) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

/* Přepínač pohledů v seznamu úkolů (Přehled / Já zadavatel / …) jako záložky v kartě. */
.app-shell.design-modern .md-page .page-panel.md-table-card > .route-switch {
    gap: 4px;
    margin: 0;
    padding: 0 20px;
    box-shadow: inset 0 -1px 0 #E3E5E8;
}

.app-shell.design-modern .md-page .route-switch .route-tab {
    padding: 12px 14px;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: #55565A;
    font-size: 14px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .route-switch .route-tab:hover {
    color: #002D62;
    text-decoration: none;
}

.app-shell.design-modern .md-page .route-switch .route-tab.active {
    background: transparent;
    color: #002D62;
    border-bottom-color: #FFC40C;
}

/* Detail úkolu: formulář bez vlastních sekcí je jedna karta s polem ve dvou sloupcích. */
.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) form:not(:has(.detail-side-card)):not(:has(fieldset)) {
    min-width: 0;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) form:not(:has(.detail-side-card)):not(:has(fieldset)) > .detail-field-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) form:not(:has(.detail-side-card)):not(:has(fieldset)) > .detail-field-stack > div:first-child,
.app-shell.design-modern .md-page .detail-workspace:not(.module-projects) form:not(:has(.detail-side-card)):not(:has(fieldset)) > .detail-field-stack > .full-span {
    grid-column: 1 / -1;
}

/* Dlaždice údajů (meta-card) — v reportech jako malé karty, v bočním panelu jako řádky „klíč · hodnota“. */
.app-shell.design-modern .md-page .meta-card {
    padding: 12px 14px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 6px;
}

.app-shell.design-modern .md-page .meta-card span {
    font-size: 12px;
    color: #55565A;
}

.app-shell.design-modern .md-page .meta-card strong {
    font-size: 20px;
    color: #002D62;
}

.app-shell.design-modern .md-page .detail-side-card .meta-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.app-shell.design-modern .md-page .detail-side-card .meta-card {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid #E3E5E8;
    border-radius: 0;
}

.app-shell.design-modern .md-page .detail-side-card .meta-card span {
    margin: 0;
    font-size: 14px;
}

.app-shell.design-modern .md-page .detail-side-card .meta-card strong {
    font-size: 14px;
    text-align: right;
}

/* Detail uživatele */
.app-shell.design-modern .md-page .user-detail-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
}

.app-shell.design-modern .md-page .user-detail-main,
.app-shell.design-modern .md-page .user-detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ---------- AI asistent: vlákna vlevo, konverzace + rychlé otázky + vstup jako jedna karta ---------- */
.app-shell.design-modern .md-page .page-panel:has(> .assistant-layout) {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0 20px;
    align-items: start;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .assistant-layout {
    display: contents;
}

.app-shell.design-modern .md-page .assistant-thread-list {
    grid-column: 1;
    grid-row: 1 / span 3;
    gap: 6px;
    padding: 18px 16px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .assistant-thread-list-head {
    padding: 0 4px 8px;
}

.app-shell.design-modern .md-page .assistant-side-title {
    font-size: 16px;
    letter-spacing: 0;
    text-transform: none;
    color: #002D62;
}

.app-shell.design-modern .md-page .assistant-thread-new {
    padding: 0;
    background: transparent;
    border: 0;
    color: #002D62;
    font-size: 13px;
    font-weight: 700;
}

.app-shell.design-modern .md-page .assistant-thread-new:hover {
    text-decoration: underline;
}

.app-shell.design-modern .md-page .assistant-thread-item {
    gap: 3px;
    padding: 10px;
    background: transparent;
    border: 0;
    border-radius: 4px;
}

.app-shell.design-modern .md-page .assistant-thread-item:hover {
    background: #F8F9FA;
}

.app-shell.design-modern .md-page .assistant-thread-item strong {
    font-size: 14px;
    font-weight: 400;
    color: #002D62;
}

.app-shell.design-modern .md-page .assistant-thread-item span {
    font-size: 12px;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .assistant-thread-item.assistant-thread-active {
    background: #E6EAF0;
}

.app-shell.design-modern .md-page .assistant-thread-item.assistant-thread-active strong {
    font-weight: 700;
}

.app-shell.design-modern .md-page .assistant-chat {
    grid-column: 2;
    grid-row: 1;
    gap: 20px;
    min-height: 480px;
    padding: 24px 28px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.app-shell.design-modern .md-page .assistant-message,
.app-shell.design-modern .md-page .assistant-message-user,
.app-shell.design-modern .md-page .assistant-message-assistant {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.app-shell.design-modern .md-page .assistant-message-user {
    align-items: flex-end;
}

.app-shell.design-modern .md-page .assistant-message-label {
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .assistant-message-text {
    max-width: 720px;
    margin: 0;
    padding: 14px 16px;
    background: #F4F5F7;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #002D62;
}

.app-shell.design-modern .md-page .assistant-message-user .assistant-message-text {
    background: #002D62;
    color: #FFFFFF;
}

.app-shell.design-modern .md-page .assistant-chart {
    max-width: 720px;
    padding: 14px 16px;
    background: #F4F5F7;
    border: 0;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .assistant-chart-label {
    font-size: 13px;
    font-weight: 400;
    color: #002D62;
}

.app-shell.design-modern .md-page .assistant-chart-track {
    height: 10px;
    background: #FFFFFF;
    border-radius: 2px;
}

.app-shell.design-modern .md-page .assistant-chart-bar {
    background: #002D62;
    border-radius: 2px;
}

.app-shell.design-modern .md-page .assistant-side {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 28px 0;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-bottom: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .assistant-side .assistant-side-title {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .assistant-suggestions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.app-shell.design-modern .md-page .assistant-suggestion {
    height: 32px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #C9CCD1;
    border-radius: 999px;
    color: #002D62;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

.app-shell.design-modern .md-page .assistant-suggestion:hover:not(:disabled) {
    background: #E6EAF0;
    border-color: #C9CCD1;
    color: #002D62;
}

.app-shell.design-modern .md-page .assistant-input-panel {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
    padding: 12px 28px 22px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.app-shell.design-modern .md-page .assistant-input {
    flex: 1 1 auto;
    min-height: 64px;
    font-size: 15px;
}

.app-shell.design-modern .md-page .assistant-send {
    min-height: 44px;
}

/* ---------- Reporty: výběr oblasti a reportu vlevo, filtr a report vpravo ---------- */
.app-shell.design-modern .md-page .md-report-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.app-shell.design-modern .md-page .md-report-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.app-shell.design-modern .md-page .md-report-nav {
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .md-report-areas {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .md-report-areas a {
    padding: 12px 4px;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    color: #55565A;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.app-shell.design-modern .md-page .md-report-areas a:hover {
    color: #002D62;
}

.app-shell.design-modern .md-page .md-report-areas a.active {
    color: #002D62;
    border-bottom-color: #FFC40C;
}

.app-shell.design-modern .md-page .md-report-area-desc {
    margin: 0;
    padding: 14px 18px 6px;
    font-size: 13px;
    line-height: 1.45;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-report-list {
    display: flex;
    flex-direction: column;
    padding: 6px 8px 10px;
}

.app-shell.design-modern .md-page .md-report-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
}

.app-shell.design-modern .md-page .md-report-item:hover {
    background: #F8F9FA;
    text-decoration: none;
}

.app-shell.design-modern .md-page .md-report-item.active {
    background: #E6EAF0;
}

.app-shell.design-modern .md-page .md-report-code {
    padding: 3px 0;
    background: #F4F5F7;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #002D62;
    text-align: center;
}

.app-shell.design-modern .md-page .md-report-item.active .md-report-code {
    background: #FFC40C;
}

.app-shell.design-modern .md-page .md-report-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-shell.design-modern .md-page .md-report-text strong {
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-report-text span {
    font-size: 12px;
    line-height: 1.35;
    color: #8A8C91;
}

/* ---------- Nastavení ---------- */
/* Aplikace: řádky „nadpis + popis | přepínač“ (inline styly v markupu, proto !important). */
.app-shell.design-modern .md-page .md-tab-body:has(> .panel-subsection) {
    padding: 6px 24px;
}

.app-shell.design-modern .md-page .md-tab-body > .panel-subsection {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 20px;
    row-gap: 4px;
    margin: 0 !important;
    padding: 20px 0;
    border-top: 0;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .md-tab-body > .panel-subsection:last-child {
    border-bottom: 0;
}

.app-shell.design-modern .md-page .md-tab-body > .panel-subsection > .panel-header {
    margin: 0;
}

.app-shell.design-modern .md-page .md-tab-body > .panel-subsection > .panel-header h3 {
    font-size: 16px;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-tab-body > .panel-subsection > .muted {
    grid-column: 1;
    margin: 0 !important;
    font-size: 13px;
    line-height: 1.45;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-segmented-links {
    grid-column: 2;
    grid-row: 1 / span 2;
    gap: 0 !important;
    height: 38px;
    overflow: hidden;
    border: 1px solid #C9CCD1;
    border-radius: 4px;
}

.app-shell.design-modern .md-page .md-segmented-links > .primary-button,
.app-shell.design-modern .md-page .md-segmented-links > .secondary-button {
    min-height: 0;
    height: 100%;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    font-size: 13px;
}

.app-shell.design-modern .md-page .md-segmented-links > .secondary-button {
    background: #FFFFFF;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-segmented-links > .secondary-button:hover {
    background: #E6EAF0;
    color: #002D62;
}

/* Organizace: hierarchie uživatelů přes celou šířku karty. */
.app-shell.design-modern .md-page .md-tab-body:has(> .org-hierarchy) {
    padding: 0;
    overflow: hidden;
}

.app-shell.design-modern .md-page .md-tab-body:has(> .org-hierarchy) > .toolbar-actions {
    margin: 0;
    padding: 16px 20px 8px;
}

.app-shell.design-modern .md-page .md-tab-body:has(> .org-hierarchy) > .muted {
    margin: 0 !important;
    padding: 0 20px 16px;
    border-bottom: 1px solid #E3E5E8;
    font-size: 14px;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-tab-body:has(> .org-hierarchy) > .inline-message,
.app-shell.design-modern .md-page .md-tab-body:has(> .org-hierarchy) > .table-shell {
    margin: 0 20px 16px !important;
}

.app-shell.design-modern .md-page .org-hierarchy {
    border: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page .org-hier-row {
    padding-top: 10px;
    padding-right: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .org-hier-row:hover {
    background: #F8F9FA;
}

.app-shell.design-modern .md-page .org-hier-main strong {
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .org-hier-meta {
    font-size: 12px;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .entra-badge {
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.16);
    border: 0;
    border-radius: 4px;
    color: #b45309;
    font-size: 11px;
    font-weight: 700;
}

/* Okruhy činností: kategorie a okruhy jako dvě karty. */
.app-shell.design-modern .md-page .md-tab-body:has(> .settings-scope-layout) {
    padding: 0;
    background: transparent;
    border: 0;
}

.app-shell.design-modern .md-page .settings-scope-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
}

.app-shell.design-modern .md-page .scope-categories-panel,
.app-shell.design-modern .md-page .scope-items-panel {
    padding: 20px 22px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .scope-category-item {
    padding: 10px;
    border-radius: 4px;
}

.app-shell.design-modern .md-page .scope-category-item:hover {
    background: #F8F9FA;
}

.app-shell.design-modern .md-page .scope-category-item.scope-category-active {
    background: #E6EAF0;
}

.app-shell.design-modern .md-page .scope-category-name {
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .scope-category-active .scope-category-name {
    font-weight: 700;
}

.app-shell.design-modern .md-page .scope-category-count {
    padding: 0;
    background: transparent;
    font-size: 12px;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .scope-items-panel .list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px 80px auto;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .scope-add-row {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .icon-button.danger-button {
    background: transparent;
    color: #C5221F;
}

@media (max-width: 1100px) {
    .app-shell.design-modern .md-page .page-panel:has(> .assistant-layout),
    .app-shell.design-modern .md-page .md-report-layout,
    .app-shell.design-modern .md-page .settings-scope-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-shell.design-modern .md-page .assistant-thread-list {
        grid-row: auto;
        margin-bottom: 20px;
    }

    .app-shell.design-modern .md-page .assistant-chat,
    .app-shell.design-modern .md-page .assistant-side,
    .app-shell.design-modern .md-page .assistant-input-panel {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ==========================================================================
   Okna a sdílené prvky, Novinky, Log odeslání, Nový zákazník, systémové stránky
   podle examples/Lasicka Okna a prvky.html, Novinky a log.html, Prihlaseni.html.
   ========================================================================== */

/* Nadpis stránky fokusuje po navigaci FocusOnNavigate (Routes.razor) — rámeček fokusu u něj jen ruší. */
.app-shell.design-modern .md-page h1:focus {
    outline: none;
}

/* Prvky jen pro moderní vzhled (vykreslují se vždy, klasika je skryje) a naopak. */
.md-only {
    display: none;
}

.app-shell.design-modern .md-page .md-hide {
    display: none;
}

/* ---------- Modální okna ---------- */
.app-shell.design-modern .md-page .modal-backdrop {
    background: rgba(0, 45, 98, 0.45);
    backdrop-filter: none;
}

.app-shell.design-modern .md-page .modal-panel {
    position: relative;
    width: min(720px, calc(100vw - 2rem));
    padding: 26px 26px 0;
    background: #FFFFFF;
    border: 0;
    border-top: 4px solid #FFC40C;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 45, 98, 0.18);
}

.app-shell.design-modern .md-page .modal-panel.modal-panel-compact {
    width: min(520px, calc(100vw - 2rem));
}

.app-shell.design-modern .md-page .modal-panel > .panel-header {
    align-items: flex-start;
    margin: 0 0 20px;
}

.app-shell.design-modern .md-page .modal-panel > .panel-header .section-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .modal-panel > .panel-header h2 {
    font-size: 22px;
    line-height: 1.25;
    color: #002D62;
}

.app-shell.design-modern .md-page .modal-panel > .panel-header .muted {
    margin-top: 6px;
    font-size: 14px;
    color: #55565A;
}

/* Zavírací tlačítko v hlavičce okna jako ikona ✕ — text „Zavřít“ zůstává v DOM, jen má nulovou velikost písma. */
.app-shell.design-modern .md-page .modal-panel > .panel-header > .ghost-button:last-child {
    flex: 0 0 32px;
    width: 32px;
    min-height: 32px;
    height: 32px;
    padding: 0;
    border-radius: 4px;
    font-size: 0;
    color: #55565A;
}

.app-shell.design-modern .md-page .modal-panel > .panel-header > .ghost-button:last-child::before {
    content: "✕";
    font-size: 18px;
    line-height: 1;
}

.app-shell.design-modern .md-page .modal-panel > .panel-header > .ghost-button:last-child:hover {
    background: #F4F5F7;
    text-decoration: none;
}

.app-shell.design-modern .md-page .modal-panel > p {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #55565A;
}

.app-shell.design-modern .md-page .modal-panel > p strong {
    color: #002D62;
}

.app-shell.design-modern .md-page .modal-panel .empty-state {
    padding: 10px 12px;
    background: #F4F5F7;
    border: 0;
    border-radius: 4px;
    font-size: 13px;
    text-align: left;
}

/* Patička okna: šedý pruh s akcemi, primární akce vpravo. */
.app-shell.design-modern .md-page .modal-panel > .button-row:last-child,
.app-shell.design-modern .md-page .modal-panel > form:last-child > .button-row:last-child,
.app-shell.design-modern .md-page .modal-panel > .detail-command-bar:last-child {
    position: sticky;
    bottom: 0;
    z-index: 1;
    gap: 10px;
    margin: 22px -26px 0;
    padding: 14px 26px;
    background: #F8F9FA;
    border-top: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .modal-panel > .button-row:last-child,
.app-shell.design-modern .md-page .modal-panel > form:last-child > .button-row:last-child {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.app-shell.design-modern .md-page .modal-panel > .detail-command-bar:last-child {
    justify-content: flex-end;
}

/* Filtry: „Vymazat filtry“ vlevo, „Použít a zavřít“ vpravo; rychlé filtry oddělené linkou. */
.app-shell.design-modern .md-page .modal-panel.filter-modal > .button-row:last-child > .ghost-button:last-child {
    margin-right: auto;
    padding-left: 0;
}

.app-shell.design-modern .md-page .modal-panel.filter-modal .toolbar-actions {
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .modal-panel .primary-button.danger-button {
    background: #C5221F;
    border-color: #C5221F;
}

.app-shell.design-modern .md-page .modal-panel .primary-button.danger-button:hover {
    background: #9B1916;
    border-color: #9B1916;
}

/* Nápověda modulu */
.app-shell.design-modern .md-page .modal-panel.help-modal {
    width: min(720px, calc(100vw - 2rem));
    padding: 0;
}

.app-shell.design-modern .md-page .modal-panel.help-modal > .help-modal-header {
    margin: 0;
    padding: 22px 26px 16px;
    border-bottom: 1px solid #E3E5E8;
}

.app-shell.design-modern .md-page .help-modal-body {
    padding: 20px 26px 22px;
    font-size: 14px;
    line-height: 1.5;
    color: #55565A;
}

/* ---------- Našeptávač, bublinová nápověda, průvodce ---------- */
.app-shell.design-modern .md-page .typeahead-list {
    top: calc(100% + 4px);
    padding: 6px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 45, 98, 0.12);
}

.app-shell.design-modern .md-page .typeahead-list li {
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .typeahead-list li:hover {
    background: #E6EAF0;
}

.app-shell.design-modern .md-page .typeahead-list li.typeahead-empty {
    padding: 12px;
    font-size: 13px;
    font-style: normal;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .typeahead-clear {
    color: #55565A;
    border-radius: 0 4px 4px 0;
}

.app-shell.design-modern .md-page .typeahead-clear:hover {
    color: #C5221F;
}

.app-shell.design-modern .md-page .help-tip-trigger {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #002D62;
    color: #FFFFFF;
    font-size: 11px;
}

.app-shell.design-modern .md-page .help-tip-bubble {
    padding: 12px 14px;
    background: #002D62;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 45, 98, 0.18);
    font-size: 13px;
    line-height: 1.45;
}

.app-shell.design-modern .md-page .help-tip-bubble strong {
    margin-bottom: 4px;
    font-size: 13px;
    color: #FFC40C;
}

.app-shell.design-modern .md-page .guide-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 20px 22px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .guide-panel .section-eyebrow {
    display: block;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .guide-panel-header h3 {
    font-size: 17px;
    color: #002D62;
}

.app-shell.design-modern .md-page .guide-panel-header .status-pill {
    background: #FFC40C;
    color: #002D62;
}

.app-shell.design-modern .md-page .guide-panel p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.app-shell.design-modern .md-page .guide-list {
    gap: 0;
    margin: 0;
}

.app-shell.design-modern .md-page .guide-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #E3E5E8;
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .guide-item > span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #002D62;
    color: #FFFFFF;
    font-size: 13px;
}

/* Barevné štítky výsledku (log odeslání) — moderní .status-pill by je jinak přebarvil. */
.app-shell.design-modern .md-page .status-pill.pill-ok {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.app-shell.design-modern .md-page .status-pill.pill-warn {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.app-shell.design-modern .md-page .status-pill.pill-error {
    background: rgba(220, 38, 38, 0.14);
    color: #b91c1c;
}

/* ---------- Novinky ---------- */
.app-shell.design-modern .md-page.md-news {
    max-width: 920px;
}

.app-shell.design-modern .md-page.md-news > .page-panel {
    gap: 0;
}

.app-shell.design-modern .md-page.md-news > .page-panel > .panel-header {
    margin-bottom: 20px;
}

.app-shell.design-modern .md-page.md-news .thread-item {
    display: block;
    margin: 0;
    padding: 0;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-top: 0;
    border-radius: 0;
}

.app-shell.design-modern .md-page.md-news .panel-header + .thread-item {
    border-top: 1px solid #E3E5E8;
    border-radius: 8px 8px 0 0;
}

.app-shell.design-modern .md-page.md-news .thread-item:last-child {
    border-radius: 0 0 8px 8px;
}

.app-shell.design-modern .md-page.md-news .panel-header + .thread-item:last-child {
    border-radius: 8px;
}

.app-shell.design-modern .md-page.md-news .release-toggle {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 24px 6px;
    cursor: pointer;
}

.app-shell.design-modern .md-page.md-news .release-open .release-toggle,
.app-shell.design-modern .md-page.md-news .release-open .release-summary {
    background: #F8F9FA;
}

.app-shell.design-modern .md-page.md-news .release-dot {
    display: block;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: #C9CCD1;
}

.app-shell.design-modern .md-page.md-news .release-current .release-dot {
    background: #FFC40C;
}

.app-shell.design-modern .md-page.md-news .release-toggle strong {
    font-size: 16px;
    color: #002D62;
}

.app-shell.design-modern .md-page.md-news .release-current-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 6px;
    background: #FFC40C;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #002D62;
    vertical-align: 2px;
}

.app-shell.design-modern .md-page.md-news .release-toggle .muted {
    margin-top: 6px;
    font-size: 13px;
}

.app-shell.design-modern .md-page.md-news .release-summary {
    margin: 0;
    padding: 0 24px 18px 52px;
    font-size: 14px;
    line-height: 1.5;
    color: #55565A;
}

.app-shell.design-modern .md-page.md-news .release-details {
    margin: 0;
    padding: 0 24px 18px 52px;
    background: #F8F9FA;
}

.app-shell.design-modern .md-page.md-news .release-details .list-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    padding: 8px 0;
    border-top: 1px solid #E3E5E8;
    font-size: 14px;
    line-height: 1.5;
}

.app-shell.design-modern .md-page.md-news .release-details .list-row::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: #FFC40C;
}

/* ---------- Nový zákazník ---------- */
.app-shell.design-modern .md-page .md-new-customer-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: start;
}

.app-shell.design-modern .md-page .md-new-customer-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.app-shell.design-modern .md-page .md-new-customer .toolbar {
    align-items: flex-end;
    gap: 12px;
    margin: 0;
}

.app-shell.design-modern .md-page .md-new-customer .toolbar .narrow-input {
    max-width: 220px;
}

.app-shell.design-modern .md-page .md-new-customer-main > .button-row {
    justify-content: flex-end;
    margin: 0;
}

.app-shell.design-modern .md-page .md-steps ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: md-step;
}

.app-shell.design-modern .md-page .md-steps li {
    counter-increment: md-step;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #E3E5E8;
    font-size: 14px;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-steps li::before {
    content: counter(md-step);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: #E6EAF0;
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Systémové stránky (odepřený přístup, zablokovaný účet, chyba) ---------- */
.app-shell.design-modern .md-page.md-system-page {
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

.app-shell.design-modern .md-page .md-system-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 560px;
    padding: 40px 44px;
    background: #FFFFFF;
    border: 1px solid #E3E5E8;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .md-system-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 8px;
}

.app-shell.design-modern .md-page .md-system-icon-danger {
    background: rgba(197, 34, 31, 0.1);
    color: #C5221F;
}

.app-shell.design-modern .md-page .md-system-icon-warn {
    background: rgba(255, 196, 12, 0.2);
    color: #7a5a00;
}

.app-shell.design-modern .md-page .md-system-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-shell.design-modern .md-page .md-system-copy .section-eyebrow {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: #8A8C91;
}

.app-shell.design-modern .md-page .md-system-copy h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    color: #002D62;
}

.app-shell.design-modern .md-page .md-system-copy p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-system-detail {
    padding: 10px 12px;
    background: #F4F5F7;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #55565A;
}

.app-shell.design-modern .md-page .md-system-actions {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

@media (max-width: 1100px) {
    .app-shell.design-modern .md-page .md-new-customer-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Přihlášení (LoginLayout — mimo app-shell, proto vlastní prefix .md-auth) ---------- */
.md-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: #FFFFFF;
    color: #55565A;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

/* Lišta prostředí (vývoj/test) je nad stránkou — přihlášení pak vyplní jen zbytek výšky. */
.environment-banner ~ .md-login {
    min-height: calc(100vh - var(--env-banner-height));
}

/* Blazor po načtení fokusuje h1 (FocusOnNavigate) — rámeček fokusu by u nadpisu jen rušil. */
.md-login h1:focus {
    outline: none;
}

.md-login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    background: #002D62 url("img/login-background.jpg") center / cover no-repeat;
}

.md-login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 45, 98, 0.55) 0%, rgba(0, 45, 98, 0.92) 100%);
}

.md-login-hero > * {
    position: relative;
}

.md-login-logo {
    align-self: flex-start;
    width: auto;
    height: 40px;
}

.md-login-claim {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.md-login-bar {
    width: 56px;
    height: 4px;
    background: #FFC40C;
}

.md-login-claim h2 {
    margin: 0;
    font-size: 48px;
    line-height: 1.1;
    font-weight: 700;
    color: #FFFFFF;
}

.md-login-claim p {
    max-width: 420px;
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    color: #E6EAF0;
}

/* Přihlášení svisle na středu panelu (horní a dolní oblast mají stejnou výšku), lasička na středu
   horní oblasti — mezi horním okrajem a nadpisem. Patička je mimo tok, aby centrování neposouvala. */
.md-login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 56px;
}

.md-login-mascot-area,
.md-login-spacer {
    flex: 1 1 0;
    min-height: 0;
}

.md-login-mascot-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.md-login-panel > .md-login-foot {
    position: absolute;
    left: 56px;
    right: 56px;
    bottom: 32px;
}

.md-login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 400px;
    align-self: center;
}

/* Lasička nad nadpisem — zmenšená oproti klasickému přihlášení (tam až 480 px). Obrázek (1421 × 736)
   má dole nápis „Lasička 2.0“: poměr stran 1421 : 559 s object-fit/position ho ořízne a nechá jen zvíře.
   Obrázek má vlastní světle šedé pozadí; maska změkčí okraje, aby na bílém panelu nebyl vidět obdélník. */
.md-login-mascot {
    display: block;
    align-self: center;
    width: min(400px, 100%);
    height: auto;
    aspect-ratio: 1421 / 559;
    object-fit: cover;
    object-position: 50% 0;
    -webkit-mask-image: radial-gradient(ellipse 50% 56% at 50% 50%, #000 65%, transparent 100%);
    mask-image: radial-gradient(ellipse 50% 56% at 50% 50%, #000 65%, transparent 100%);
}

.md-login-heading {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.md-login-heading h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
    color: #002D62;
}

.md-login-heading p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #55565A;
}

.md-login-msg,
.md-auth .alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.45;
}

.md-login-msg svg {
    flex: 0 0 18px;
    margin-top: 1px;
}

.md-login-msg-warn {
    background: rgba(255, 196, 12, 0.18);
    color: #7a5a00;
}

.md-auth .alert-danger {
    background: rgba(197, 34, 31, 0.1);
    color: #C5221F;
}

.md-auth .alert-success {
    background: #E6EAF0;
    color: #002D62;
}

.md-login-ms-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 4px;
    background: #002D62;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.md-login-ms-button:hover {
    background: #001F47;
}

.md-login-ms-button:focus-visible {
    outline: 2px solid #FFC40C;
    outline-offset: 2px;
}

.md-login-ms-logo {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: #FFFFFF;
    border-radius: 2px;
}

.md-login-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #8A8C91;
}

@media (max-width: 820px) {
    .md-login {
        grid-template-columns: 1fr;
    }

    .md-login-hero {
        min-height: 240px;
        padding: 28px 24px;
    }

    .md-login-claim h2 {
        font-size: 36px;
    }

    .md-login-panel {
        padding: 8px 24px 72px;
    }

    .md-login-spacer {
        display: none;
    }

    .md-login-panel > .md-login-foot {
        left: 24px;
        right: 24px;
        bottom: 24px;
    }
}

/* ==========================================================================
   Menší obrazovky
   ========================================================================== */
@media (max-width: 1100px) {
    .app-shell.design-modern .md-page .page-panel.detail-workspace.module-projects {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .app-shell.design-modern .md-page .detail-workspace.module-projects .detail-side-panel {
        grid-column: 1;
        grid-row: 3;
        margin-top: 20px;
    }
}

@media (max-width: 1000px) {
    .app-shell.design-modern .md-page .task-cells {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .app-shell.design-modern .md-page .task-cells::before {
        display: none;
    }
}

@media (max-width: 820px) {
    .app-shell.design-modern .md-page .page-panel:has(> .panel-header h1) > .panel-header h1,
    .app-shell.design-modern .md-page .detail-hero-copy h1 {
        font-size: 26px;
    }

    .app-shell.design-modern .md-page .metric-grid {
        padding: 20px;
        gap: 16px 20px;
    }

    .app-shell.design-modern .md-page .metric-grid .metric-card strong {
        font-size: 24px;
    }

    .app-shell.design-modern .md-page .detail-stage-strip {
        padding: 16px 20px 20px;
    }

    .app-shell.design-modern .md-page .md-search {
        width: 100%;
    }

    .app-shell.design-modern .md-page .detail-workspace.module-projects .detail-field-stack {
        grid-template-columns: minmax(0, 1fr);
    }
}
