/**
 * CropSaga — compact layout for phone / tablet (viewport ≤1023px), app shell only.
 * Loaded only from app.html. Rules for large screens: none (desktop unchanged).
 */

@media (min-width: 1024px) {
    /* Hartă fermă desktop: fără placeholder backdrop / buton X din varianta mobilă */
    body.app-shell .harta-ferma-rail-backdrop {
        display: none !important;
    }

    body.app-shell .harta-ferma-rail-close-btn {
        display: none !important;
    }

    /* Salarii: pe desktop acțiunile rămân în bară, fără FAB mobil */
    body.app-shell .pe-salarii-page .pe-salarii-controale-fab {
        display: none !important;
    }

    .app-compact-only {
        display: none !important;
    }

    /* Agent AI: bottom sheet doar pe mobil (toolbar „Conversații / Nou” e în .ai-chat-modebar) */
    body.app-shell .ai-conversations-sheet {
        display: none !important;
    }

    /* Sezon + grup: pe desktop rămân două selectoare în linie (fără panou mobil) */
    body.app-shell .topbar-context-backdrop {
        display: none !important;
    }

    body.app-shell .topbar-context-cluster {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    body.app-shell .topbar-context-panel {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        z-index: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
    }

    /* Detaliu lucrare — tabel Parcele desktop: clamp pe inputuri/utilaje */
    body.app-shell[data-router-module="task-detail"] .td-parcels-table .td-parcel-clamp {
        max-width: 280px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.35;
    }

    /* Detaliu lucrare — tabel Parcele desktop: scroll orizontal + coloana „Editează” mereu vizibilă */
    body.app-shell[data-router-module="task-detail"] .td-parcels-card-content {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-right: 6px;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table {
        width: max-content;
        min-width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table thead th:last-child,
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody td.td-parcel-actions,
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot tr.td-parcels-footer > td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: var(--color-card-bg, var(--surface, var(--color-bg-primary, #fff)));
        box-shadow: -10px 0 14px -12px rgba(0, 0, 0, 0.28);
        white-space: nowrap;
        min-width: 8.75rem;
        width: 1%;
        padding-left: 12px;
        vertical-align: middle;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table thead th:last-child {
        z-index: 3;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table .td-parcel-edit-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Localizare GPS: FAB doar pe mobil */
    body.app-shell #mapContainer .map-mobile-locate-fab {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    body.app-shell {
        /* !important: bate main.css (768px) și alte fișiere încărcate înainte */
        /* Top bar real (padding + rând) poate depăși 52px — evită conținut „sub” header */
        --topbar-height: 58px !important;
        /*
         * Rezerva jos = ce pune syncChromeOffsets() pe :root (înălțime dock + offset bottom).
         * Nu forța 168px (era pentru 2 rânduri + context) — altfel rămâne gol gri mare deasupra dock-ului.
         * inherit = ia valoarea de pe html, nu 80px din main.css body.app-shell.
         */
        --bottombar-height: inherit;
        --page-gap: 18px;
        --page-pad-x: 16px;
        --page-header-pad-x: 16px;
        --page-header-pad-y: 8px;
        /* Alias la theme-claude (aceeași cromatică / fonturi ca webul pe desktop) */
        --organic-bg: var(--bg);
        --organic-band: var(--surface-2);
        --organic-border: var(--border-strong);
        --organic-muted: var(--text-muted);
        --organic-text: var(--text);
        --font-organic-heading: var(--font-title);
        --font-organic-body: var(--font-body);
        /* Densitate UI mobil (referință Cropwise); dock / drawer au reguli separate */
        --m-btn-height: 36px;
        --m-btn-height-modal: 40px;
        --m-btn-pad-y: 8px;
        --m-btn-pad-x: 14px;
        --m-btn-font: 14px;
        --m-btn-height-sm: 32px;
        --m-pill-radius: 999px;
    }

    /*
     * Top bar mobil: doar pe Tablou de bord (= buton Acasă în dock).
     * În rest: fără antet; .main-container începe sub safe area.
     */
    body.app-shell:not([data-router-module="dashboard"]) {
        --topbar-height: 0px !important;
        --topbar-offset: 0px !important;
    }

    body.app-shell:not([data-router-module="dashboard"]) .main-container {
        padding-top: env(safe-area-inset-top, 0px);
        box-sizing: border-box;
    }

    /* Tablou de bord: bară mai joasă în layout (logo neschimbat — doar mai puțin padding) */
    body.app-shell[data-router-module="dashboard"] {
        --topbar-height: 78px !important;
    }

    body.app-shell:not([data-router-module="dashboard"]) .top-bar {
        display: none !important;
    }

    /* Tablou de bord: în stânga logo, nu titlul modulului */
    body.app-shell[data-router-module="dashboard"] .topbar-page-title.app-compact-only {
        display: none !important;
    }

    /*
     * Tablou de bord (Acasă) — doar mobil: logo mai mare; sezon + grup vizibile în bară (nu doar chip).
     * Desktop ≥1024: această media query nu se aplică.
     */
    body.app-shell[data-router-module="dashboard"] .top-bar .logo-image {
        height: 72px !important;
        max-height: 72px !important;
        width: auto;
        object-fit: contain;
    }

    /*
     * Tablou de bord: chip „Sezon · Grup” + panou tip sheet (ca pe restul modulelor).
     * Fostul layout cu două select-uri inline a fost ascuns de Phase 2 (.topbar-cluster { display: none }).
     */
    body.app-shell[data-router-module="dashboard"] .top-bar .topbar-cluster {
        margin-left: 0 !important;
        max-width: none !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        justify-content: center;
    }

    body.app-shell[data-router-module="dashboard"] .topbar-context-chip.app-compact-only {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        min-height: 28px;
        padding: 4px 8px;
        font-size: 11px;
        font-weight: 600;
    }

    /* ---- Top bar: o linie — logo stânga | sezon+grup lipite de Reîncarcă + acțiuni ---- */
    body.app-shell .top-bar {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 3px;
        height: auto;
        min-height: 0;
        padding: 2px 6px 3px;
        padding-left: max(4px, env(safe-area-inset-left, 0px));
        padding-right: max(4px, env(safe-area-inset-right, 0px));
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    }

    body.app-shell .top-bar .topbar-left {
        display: contents;
    }

    body.app-shell .top-bar .logo {
        flex: 0 0 auto;
        align-self: center;
    }

    body.app-shell .top-bar .topbar-right {
        flex: 0 0 auto;
        align-self: center;
        flex-shrink: 0;
        min-width: 0;
    }

    body.app-shell .top-bar .topbar-cluster {
        flex: 0 1 auto;
        min-width: 0;
        /* spațiu pentru logo + grupul de iconițe; evită înghesuirea a 2× custom select (min-width în temă) */
        max-width: min(300px, calc(100vw - 176px));
        margin-left: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
    }

    /* Un singur buton pe mobil: deschide panou cu sezon + grup */
    body.app-shell .topbar-context-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        min-height: 28px;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: color-mix(in srgb, var(--topbar-control-bg) 85%, transparent);
        color: var(--topbar-control-text);
        font-size: 10px;
        font-weight: 600;
        line-height: 1.2;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
    }

    html[data-theme="light"] body.app-shell .topbar-context-chip {
        border-color: rgba(0, 0, 0, 0.12);
    }

    body.app-shell .topbar-context-chip__text {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
    }

    body.app-shell .topbar-context-chip__caret {
        font-size: 10px;
        opacity: 0.85;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-chip__caret {
        transform: rotate(180deg);
    }

    body.app-shell .topbar-context-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10031;
        background: rgba(0, 0, 0, 0.35);
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-backdrop {
        display: block;
    }

    body.app-shell .topbar-context-cluster .topbar-context-panel {
        position: fixed;
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        top: calc(var(--topbar-height, 48px) + 10px);
        z-index: 10040;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
        margin: 0;
        background: var(--color-bg-table, #1a221c);
        border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
        border-radius: 14px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
        /* Spațiu clar sub header + deasupra dock-ului; fără comprimare flex a copiilor */
        max-height: min(
            82vh,
            calc(100vh - var(--topbar-height, 48px) - var(--bottombar-height, 168px) - 28px)
        );
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    }

    html[data-theme="light"] body.app-shell .topbar-context-cluster .topbar-context-panel {
        background: var(--color-bg-elevated, #fff);
        border-color: var(--color-border, rgba(0, 0, 0, 0.1));
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Grid: rând 1 = icon + etichetă; rând 2 = select / custom-select pe toată lățimea (fără suprapuneri) */
    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .topbar-group {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 10px 12px;
        align-items: center;
        width: 100%;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        min-height: auto !important;
        height: auto !important;
        padding: 12px 12px;
        overflow: visible;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .topbar-group > i {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 22px;
        grid-column: 1;
        grid-row: 1;
        margin: 0;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .topbar-group .topbar-label {
        display: block !important;
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        line-height: 1.25;
        text-align: left;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .topbar-group > select.topbar-control {
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: stretch;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .topbar-group > .custom-select-claude {
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: stretch;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        min-height: 0;
    }

    body.app-shell .topbar-context-cluster.is-open .topbar-context-panel select.topbar-control {
        height: 44px !important;
        min-height: 44px !important;
        max-height: none !important;
        font-size: 15px !important;
        padding: 0 36px 0 12px !important;
        background-position: right 10px center;
        background-size: 10px;
    }

    /* Bate regulile .top-bar .custom-select-claude__trigger { max-height: 24px } din același fișier */
    html[data-theme="theme-claude"] body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .custom-select-claude {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    html[data-theme="theme-claude"] body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .custom-select-claude__trigger {
        min-height: 44px !important;
        max-height: none !important;
        height: auto !important;
        width: 100% !important;
        box-sizing: border-box;
        font-size: 15px !important;
        line-height: 1.25 !important;
        padding: 10px 12px !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
    }

    html[data-theme="theme-claude"] body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .custom-select-claude__list {
        z-index: 10055;
        max-height: min(50vh, 280px);
    }

    /*
     * Pe telefon: butonul + panoul sezon/grup doar pe Tablou de bord.
     * Desktop (≥1024): .app-compact-only ascuns; panoul rămâne în linie — aceste reguli nu se aplică acolo.
     */
    body.app-shell:not([data-router-module="dashboard"]) .topbar-context-chip.app-compact-only {
        display: none !important;
    }

    body.app-shell:not([data-router-module="dashboard"]) .topbar-context-cluster.is-open .topbar-context-backdrop.app-compact-only,
    body.app-shell:not([data-router-module="dashboard"]) .topbar-context-backdrop.app-compact-only {
        display: none !important;
    }

    body.app-shell:not([data-router-module="dashboard"]) .topbar-context-cluster .topbar-context-panel {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }

    body.app-shell:not([data-router-module="dashboard"]) .topbar-context-cluster.is-open .topbar-context-panel {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }

    /* Custom select (tema Claude): fără min-width 120px în top bar — altfel se suprapun anul și grupul */
    html[data-theme="theme-claude"] body.app-shell .top-bar .custom-select-claude {
        min-width: 0 !important;
        flex: 1 1 0;
        width: auto;
        max-width: 100%;
        min-height: 0;
    }

    html[data-theme="theme-claude"] body.app-shell .top-bar .custom-select-claude__trigger {
        min-width: 0;
        padding: 3px 7px !important;
        font-size: 10px !important;
        line-height: 1.2;
        min-height: 24px;
        max-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html[data-theme="theme-claude"] body.app-shell .top-bar .custom-select-claude__list {
        z-index: 10060;
        min-width: min(100%, 220px);
    }

    body.app-shell .topbar-group .topbar-label {
        display: none !important;
    }

    body.app-shell .topbar-group {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: auto;
        min-height: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        gap: 0;
        padding: 1px 3px;
        border-radius: 8px;
        background: color-mix(in srgb, var(--topbar-control-bg) 72%, transparent);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Iconițele calendar/straturi ascunse — câștig pe verticală și lățime pentru select */
    body.app-shell .topbar-group > i {
        display: none !important;
    }

    /* Sezon + grup: mici, lângă reîncarcă (telefon) */
    body.app-shell .topbar-group select.topbar-control {
        flex: 1 1 auto;
        min-width: 0 !important;
        width: 100%;
        max-width: none;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px;
        padding: 0 15px 0 5px !important;
        font-size: 10px !important;
        font-weight: 600;
        line-height: 1.1;
        border-radius: 6px;
        box-sizing: border-box;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-position: right 4px center;
        background-size: 8px;
    }

    body.app-shell .topbar-group .year-selector {
        min-width: 0 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23eae8db' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        color: var(--topbar-control-text);
    }

    body.app-shell .topbar-group #groupSelector.topbar-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23eae8db' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
    }

    /* main.css #groupSelector { max-width: 140px } taie grupul pe mobil */
    body.app-shell #groupSelector {
        max-width: none !important;
        width: 100%;
    }

    html[data-theme="light"] body.app-shell .topbar-group .year-selector,
    html[data-theme="light"] body.app-shell .topbar-group #groupSelector.topbar-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23213121' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    body.app-shell .topbar-divider {
        display: none;
    }

    body.app-shell .top-controls {
        flex-wrap: nowrap;
        gap: 3px;
        padding: 2px 3px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--topbar-control-bg) 78%, transparent);
    }

    body.app-shell .logo-image {
        height: 56px;
        width: auto;
        max-height: 56px;
        object-fit: contain;
    }

    body.app-shell .topbar-icon-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        font-size: 11px;
        border-radius: 9px;
    }

    body.app-shell .topbar-avatar {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    body.app-shell .content-center {
        padding: 18px 14px calc(var(--bottombar-height, 80px) + 22px);
        background: var(--bg) !important;
        color: var(--text);
        font-family: var(--font-body);
    }

    body.app-shell main#routerView {
        font-family: var(--font-body);
        color: var(--text);
        -webkit-font-smoothing: antialiased;
        touch-action: manipulation;
    }

    body.app-shell .module-content {
        padding-left: 0;
        padding-right: 0;
    }

    body.app-shell .module-header {
        margin-bottom: 14px;
        padding-left: 2px;
        padding-right: 2px;
    }

    body.app-shell .module-header h1 {
        font-family: var(--font-title);
        font-size: clamp(22px, 5vw, 30px);
        line-height: 1.12;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--text);
    }

    body.app-shell .module-header p,
    body.app-shell .module-header .module-subtitle {
        font-family: var(--font-body);
        font-size: 13px;
        line-height: 1.6;
        max-width: 34ch;
        color: var(--text-muted);
    }

    body.app-shell main#routerView .card {
        background: var(--card);
        border-color: var(--border-strong);
        box-shadow: var(--shadow-sm);
    }

    /* Widget dashboard: regula de mai sus lovește și .card-ul interior — un singur fundal pe .widget-card */
    body.app-shell main#routerView .widgets-grid .widget-card > .card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
    }

    body.app-shell main#routerView .widgets-grid .widget-card > .card .card-header,
    body.app-shell main#routerView .widgets-grid .widget-card > .card .card-content {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    body.app-shell main#routerView .widgets-grid .widget-card > .card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    body.app-shell main#routerView .card-header .card-title {
        font-family: var(--font-title);
        font-weight: 600;
        color: var(--text);
    }

    body.app-shell main#routerView textarea.form-input,
    body.app-shell main#routerView input.form-input:not([type="checkbox"]):not([type="radio"]),
    body.app-shell main#routerView select.form-select {
        font-family: var(--font-body);
        border-color: var(--border-strong);
        background: var(--surface);
        color: var(--text);
    }

    /* ---- Butoane & controale (mobil): fără scale la tap (tema Claude), fără „salt” la hover ---- */
    body.app-shell .btn-primary:active,
    body.app-shell .btn-secondary:active,
    body.app-shell .btn-outline:active,
    body.app-shell .btn-outline-danger:active,
    body.app-shell .btn-action:active,
    body.app-shell .btn-icon:active,
    body.app-shell .btn-sm-icon:active {
        transform: none !important;
    }

    body.app-shell .btn-primary:hover,
    body.app-shell .btn-secondary:hover,
    body.app-shell .btn-outline:hover {
        transform: none !important;
    }

    body.app-shell .topbar-icon-btn:active,
    body.app-shell .topbar-btn:active,
    body.app-shell .topbar-avatar:active {
        transform: none !important;
    }

    body.app-shell .map-btn:active,
    body.app-shell .map-control-btn:active {
        transform: none !important;
    }

    body.app-shell .dock-panel__item:active,
    body.app-shell .dock-panel__close:active {
        transform: none !important;
    }

    body.app-shell .tab-btn:active,
    body.app-shell .tab:active {
        transform: none !important;
    }

    body.app-shell .custom-select-claude__trigger:active,
    body.app-shell .custom-select-claude__item:active {
        transform: none !important;
    }

    body.app-shell .chat-send-btn:active {
        transform: none !important;
    }

    body.app-shell .module-header {
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        min-width: 0;
    }

    body.app-shell .card-header {
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
        min-width: 0;
    }

    body.app-shell .card-header .card-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Butoane modul: compacte; culorile din theme-claude */
    body.app-shell main#routerView .btn-primary,
    body.app-shell main#routerView .btn-secondary,
    body.app-shell main#routerView .btn-outline,
    body.app-shell main#routerView .btn-outline-danger,
    body.app-shell main#routerView .btn-action {
        border-radius: var(--radius-lg, 12px);
        min-height: var(--m-btn-height);
        padding: var(--m-btn-pad-y) var(--m-btn-pad-x);
        font-size: var(--m-btn-font);
        box-sizing: border-box;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell main#routerView .btn-sm {
        min-height: var(--m-btn-height-sm);
        padding: 6px 12px;
        font-size: var(--m-text-sm);
        border-radius: var(--m-radius-sm);
    }

    body.app-shell .modal-footer .btn-primary,
    body.app-shell .modal-footer .btn-secondary,
    body.app-shell .modal-footer .btn-outline,
    body.app-shell .modal-footer .btn-outline-danger {
        border-radius: var(--radius-lg, 12px);
        min-height: var(--m-btn-height-modal);
        padding: var(--m-btn-pad-y) var(--m-btn-pad-x);
        font-size: var(--m-btn-font);
        box-sizing: border-box;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }

    /* ---- Liste / tabele: fără scroll orizontal (încadrare pe lățime, text wrap) ---- */
    body.app-shell main#routerView .table-wrapper,
    body.app-shell main#routerView .table-responsive {
        overflow-x: visible;
        overflow-y: visible;
        max-width: 100%;
    }

    body.app-shell main#routerView .table-wrapper table,
    body.app-shell main#routerView .table-responsive table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
        table-layout: fixed;
    }

    body.app-shell main#routerView .table-wrapper th,
    body.app-shell main#routerView .table-wrapper td,
    body.app-shell main#routerView .table-responsive th,
    body.app-shell main#routerView .table-responsive td {
        word-break: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    body.app-shell main#routerView .module-content .card > .card-content:has(> table.data-table),
    body.app-shell main#routerView .module-content .card > .card-content:has(table.data-table) {
        overflow-x: visible;
        max-width: 100%;
    }

    body.app-shell main#routerView table.data-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
    }

    body.app-shell main#routerView table.data-table th,
    body.app-shell main#routerView table.data-table td {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    body.app-shell .dashboard-crops-table-scroll {
        overflow-x: visible;
    }

    body.app-shell .dashboard-crops-table {
        min-width: 0;
        table-layout: fixed;
    }

    body.app-shell .dashboard-crops-table th,
    body.app-shell .dashboard-crops-table td {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    body.app-shell .crops-container .card-content:has(.crops-list-table-scroll) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell .crops-container .crops-list-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell .crops-container .crops-list-table-scroll .crops-list-table {
        width: auto !important;
        min-width: 720px !important;
        max-width: none;
        table-layout: auto !important;
    }

    body.app-shell .crops-container .crops-list-table-scroll .crops-list-table th,
    body.app-shell .crops-container .crops-list-table-scroll .crops-list-table td {
        word-break: normal !important;
        overflow-wrap: break-word;
        hyphens: manual;
        white-space: normal;
    }

    /* Salarii: tabel lat — scroll orizontal, fără coloane „1 caracter” */
    body.app-shell .pe-salarii-page .pe-salarii-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell main#routerView .pe-salarii-page .pe-salarii-table-scroll table.data-table.pe-salarii-data-table {
        width: auto !important;
        min-width: 680px !important;
        max-width: none;
        table-layout: auto !important;
    }

    body.app-shell main#routerView .pe-salarii-page .pe-salarii-table-scroll table.data-table.pe-salarii-data-table th,
    body.app-shell main#routerView .pe-salarii-page .pe-salarii-table-scroll table.data-table.pe-salarii-data-table td {
        word-break: normal !important;
        overflow-wrap: break-word;
        white-space: normal;
    }

    body.app-shell main#routerView .pe-salarii-page .pe-salarii-table-scroll table.data-table.pe-salarii-data-table td:nth-child(3),
    body.app-shell main#routerView .pe-salarii-page .pe-salarii-table-scroll table.data-table.pe-salarii-data-table td:nth-child(4),
    body.app-shell main#routerView .pe-salarii-page .pe-salarii-table-scroll table.data-table.pe-salarii-data-table td:nth-child(6) {
        white-space: nowrap;
    }

    /* Activare fișă tehnologică: listă / hartă + grid o coloană */
    body.app-shell main#routerView .tech-activate-view-toggle {
        display: flex;
        flex-direction: row;
        gap: 8px;
        padding: 10px 12px 0;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    body.app-shell main#routerView .tech-activate-view-btn {
        flex: 1;
        min-height: 44px;
        padding: 0 12px;
        border-radius: 10px;
        border: 1px solid var(--color-border, #ccc);
        background: var(--color-bg-secondary, #f5f5f5);
        color: var(--color-text-primary);
        font-size: 14px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell main#routerView .tech-activate-view-btn.active {
        background: var(--color-accent-green, #5a8f3a);
        color: #fff;
        border-color: transparent;
    }

    body.app-shell main#routerView .tech-activate-sheet-page .tech-activate-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0;
        min-height: 0;
    }

    body.app-shell main#routerView .tech-activate-sheet-page .tech-activate-aside {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    body.app-shell main#routerView .tech-activate-sheet-page .tech-activate-map-wrap {
        position: relative;
        min-height: 42vh;
        min-width: 0;
    }

    body.app-shell main#routerView .tech-activate-sheet-page .tech-activate-map-wrap #actMap {
        position: absolute !important;
        inset: 0 !important;
        min-height: 40vh;
        height: 100% !important;
        border-left: none !important;
    }

    body.app-shell main#routerView .tech-activate-list-wrap table.data-table.data-table-compact {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
        table-layout: auto !important;
    }

    body.app-shell main#routerView .tech-activate-list-wrap table.data-table.data-table-compact th,
    body.app-shell main#routerView .tech-activate-list-wrap table.data-table.data-table-compact td {
        word-break: normal !important;
        overflow-wrap: break-word;
    }

    body.app-shell main#routerView .tech-activate-cost-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell main#routerView .tech-activate-cost-table {
        min-width: 520px;
        table-layout: auto !important;
    }

    body.app-shell main#routerView .tech-activate-cost-table th,
    body.app-shell main#routerView .tech-activate-cost-table td {
        word-break: normal !important;
        overflow-wrap: break-word;
        white-space: normal;
    }

    body.app-shell main#routerView .tech-activate-sheet-page .tech-activate-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell main#routerView .tech-activate-sheet-page .tech-activate-header .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell .weather-module .weather-trends-table-scroll {
        overflow-x: visible;
    }

    body.app-shell .weather-module .weather-trends-table {
        table-layout: fixed;
    }

    body.app-shell .weather-module .weather-trends-table th,
    body.app-shell .weather-module .weather-trends-table td {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Excepții: UI care trebuie să deruleze orizontal */
    body.app-shell main#routerView .timeline-scroll-x,
    body.app-shell main#routerView #tlScrollBody {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell main#routerView .gantt-container .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell .analiza-ndvi-page .ndvi-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-content {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Modale: aceleași liste fără scroll orizontal (în afara main#routerView) */
    body.app-shell #modalContainer .table-wrapper {
        overflow-x: visible;
        max-width: 100%;
    }

    body.app-shell #modalContainer .table-wrapper table,
    body.app-shell #modalContainer table.data-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
    }

    body.app-shell #modalContainer .table-wrapper th,
    body.app-shell #modalContainer .table-wrapper td,
    body.app-shell #modalContainer table.data-table th,
    body.app-shell #modalContainer table.data-table td {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    body.app-shell main#routerView table .btn-primary,
    body.app-shell main#routerView table .btn-secondary,
    body.app-shell main#routerView table .btn-icon,
    body.app-shell main#routerView table .btn-sm,
    body.app-shell main#routerView table .btn-sm-icon {
        min-height: 0;
    }

    /* În tabele: păstrăm stilul compact din temă (nu bandă olive) */
    body.app-shell main#routerView table .btn-secondary {
        background: rgba(230, 239, 215, 0.08);
        color: var(--color-text-primary);
        border: 1px solid rgba(198, 224, 168, 0.22);
        border-radius: 4px;
        box-shadow: none;
    }

    body.app-shell main#routerView table .btn-secondary:hover {
        background: rgba(230, 239, 215, 0.12);
        color: var(--color-text-primary);
    }

    body.app-shell main#routerView table .btn-outline {
        background: var(--surface, transparent);
        color: var(--color-text-primary);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md, 8px);
        box-shadow: none;
    }

    body.app-shell main#routerView table .btn-outline:hover {
        background: var(--accent-secondary-soft, rgba(67, 97, 6, 0.12));
        color: var(--accent-secondary, var(--color-accent-green));
        border-color: var(--accent-secondary, var(--color-accent-green));
    }

    /* Tab-uri: păstrăm suprafața din temă (nu bandă olive) */
    body.app-shell main#routerView .costs-config-tab-bar .btn-secondary,
    body.app-shell main#routerView .maint-tabs .btn-secondary,
    body.app-shell main#routerView .maint-tabs .maint-tab {
        background: var(--surface, #fff);
        color: var(--text, var(--color-text-primary));
        border: 1px solid var(--border, var(--color-border));
        border-radius: var(--radius-md, 8px);
        box-shadow: none;
    }

    body.app-shell main#routerView .costs-config-tab-bar .btn-secondary:hover,
    body.app-shell main#routerView .maint-tabs .btn-secondary:hover,
    body.app-shell main#routerView .maint-tabs .maint-tab:hover {
        background: var(--accent-secondary-soft, rgba(67, 97, 6, 0.12));
        color: var(--accent-secondary, var(--color-accent-green));
        border-color: var(--accent-secondary, var(--color-accent-green));
    }

    body.app-shell .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell .modal-footer .footer-right {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    body.app-shell .modal-footer .footer-right .btn-primary,
    body.app-shell .modal-footer .footer-right .btn-secondary,
    body.app-shell .modal-footer .btn-primary,
    body.app-shell .modal-footer .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: var(--m-btn-height-modal);
        box-sizing: border-box;
    }

    body.app-shell .modal-footer .footer-left {
        width: 100%;
    }

    /* ---- Continuare mobil: meniu lateral, drawer, AI, hartă, contabilitate ---- */
    body.app-shell .menu-item:active,
    body.app-shell .submenu-item:active {
        transform: none !important;
    }

    body.app-shell .nav-drawer__item:active {
        transform: none !important;
    }

    body.app-shell .conversation-item:active {
        transform: none !important;
    }

    body.app-shell .chat-send-btn:hover,
    body.app-shell #sendMessageBtn.chat-send-btn:hover {
        transform: none !important;
    }

    body.app-shell .ai-mobile-toolbar-btn:active {
        transform: none !important;
    }

    /* Antete / bare de acțiuni în module (generic) */
    body.app-shell main#routerView .table-controls,
    body.app-shell main#routerView .table-controls-left,
    body.app-shell main#routerView .table-controls-right {
        flex-wrap: wrap;
        gap: 8px 10px;
        align-items: center;
        min-width: 0;
    }

    body.app-shell main#routerView .page-header {
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
        min-width: 0;
    }

    body.app-shell main#routerView .page-header-left,
    body.app-shell main#routerView .page-header-right {
        flex-wrap: wrap;
        gap: 8px;
        min-width: 0;
    }

    body.app-shell main#routerView .header-actions {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
        min-width: 0;
    }

    /* Contabilitate: filtre pe lățimi medii (app shell 1023px) */
    body.app-shell .acct-docs-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell .asset-form-actions {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    body.app-shell .asset-form-actions .btn-primary,
    body.app-shell .asset-form-actions .btn-secondary {
        flex: 1 1 auto;
        min-width: min(100%, 140px);
        justify-content: center;
    }

    /* Leaflet: controale puțin mai mari la atingere */
    body.app-shell .leaflet-bar a {
        min-width: 40px;
        min-height: 40px;
        line-height: 40px;
    }

    /* Carduri „ridicate” la hover: pe touch rămân stabile */
    body.app-shell .pe-card:hover {
        transform: none;
    }

    body.app-shell .forza-card:hover {
        transform: none;
    }

    /* Detaliu parcelă / histograme: tab-uri fără scale la tap */
    body.app-shell .tab-nav-btn:active,
    body.app-shell .histogram-tab-btn:active {
        transform: none !important;
    }

    body.app-shell .parcel-detail-header .dropdown-btn:active {
        transform: none !important;
    }

    /* Paginare & acțiuni sub carduri (costuri, liste) */
    body.app-shell main#routerView .card-footer {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        align-items: center;
        padding: 12px 10px;
        box-sizing: border-box;
    }

    /* Imagini satelit: bandă scene — scroll orizontal fără bară vizibilă */
    body.app-shell.sat-full .sat-list {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell.sat-full .sat-list::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
        background: transparent;
    }

    /* Leaflet Draw (dacă e activ): ținte tactilă */
    body.app-shell .leaflet-draw-toolbar a,
    body.app-shell .leaflet-draw-actions a {
        min-width: 40px;
        min-height: 40px;
        line-height: 40px;
    }

    /* Modal: antet cu închidere mai ușor de atins */
    body.app-shell .modal-header {
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
        min-width: 0;
    }

    body.app-shell .modal-close,
    body.app-shell .modal-header .modal-close {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    /* ---- Calendar: filtre pe coloană + corp timeline fără bară scroll orizontală ---- */
    body.app-shell .calendar-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell .calendar-filters .form-select,
    body.app-shell .calendar-filters select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none;
    }

    body.app-shell #tlScrollBody {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell #tlScrollBody::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
        background: transparent;
    }

    /* ---- Calendar: scroll vertical unic + timeline stivuit (fără două bare) ---- */
    body.app-shell[data-router-module="calendar"] .calendar-module-content .calendar-content {
        min-height: 0 !important;
        overflow: visible;
    }

    body.app-shell[data-router-module="calendar"] .calendar-module-content #tlWrap {
        min-height: auto !important;
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="calendar"] .timeline-body {
        min-height: 0;
        flex: 1 1 auto;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap > aside {
        height: auto !important;
        max-height: min(42vh, 320px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap aside .form-input#tlSearch {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    /* ---- Notițe & Tasks (layout Keep): coloană, etichete wrap, ținte tactilă ---- */
    body.app-shell .notes-keep-layout {
        flex-direction: column;
        min-height: auto;
    }

    body.app-shell .notes-keep-sidebar {
        width: 100%;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
        padding: 12px 14px;
    }

    body.app-shell .notes-keep-main {
        padding: 14px 12px;
        min-width: 0;
    }

    body.app-shell .notes-keep-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body.app-shell .notes-keep-labels-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    body.app-shell .notes-keep-label-item {
        flex: 0 1 auto;
        padding: 8px 10px;
    }

    body.app-shell .notes-keep-new {
        min-height: 46px;
    }

    body.app-shell .notes-keep-label-add {
        min-width: 44px;
        min-height: 44px;
        width: auto;
        height: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        box-sizing: border-box;
    }

    body.app-shell .notes-keep-btn-icon {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell .notes-keep-label-item:active,
    body.app-shell .notes-keep-btn-icon:active,
    body.app-shell .notes-keep-new:active,
    body.app-shell .notes-keep-label-add:active {
        transform: none !important;
    }

    /* ---- Setări: acordeon + antet card ---- */
    body.app-shell .settings-accordion-summary {
        min-height: 48px;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .settings-accordion-summary:active {
        transform: none !important;
    }

    body.app-shell .settings-card-header {
        flex-wrap: wrap;
        align-items: flex-start;
        min-width: 0;
    }

    body.app-shell .notif-settings-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* ---- Configurări costuri: bară tab-uri (grid 2 col, touch) ---- */
    body.app-shell .costs-config-tab-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }

    body.app-shell .costs-config-tab-bar .btn-secondary {
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
        padding: 10px 8px;
        font-size: 12px;
        line-height: 1.25;
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
        gap: 6px;
        white-space: normal;
        word-break: break-word;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .costs-config-tab-bar .btn-secondary i {
        flex-shrink: 0;
    }

    /* ---- Dock panel (Financiar etc.): o coloană, fără celule înguste; „Configurări Costuri” lizibil ---- */
    body.app-shell #dockPanel .dock-panel__content {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    body.app-shell #dockPanel .dock-panel__item {
        align-items: center;
        min-height: 48px;
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.app-shell #dockPanel .dock-panel__item span {
        flex: 1;
        min-width: 0;
    }

    /* ---- Personal / Salarii & Costuri: carduri + toolbar + tabel pe telefon ---- */
    body.app-shell .pe-container {
        padding: 8px 0 12px;
        box-sizing: border-box;
    }

    body.app-shell .pe-container .telematica-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }

    body.app-shell .pe-container .tele-stat-card {
        padding: 12px 10px;
    }

    body.app-shell .pe-container .tele-stat-card i {
        font-size: 20px;
        margin-bottom: 6px;
    }

    body.app-shell .pe-container .tele-stat-card .tele-stat-value {
        font-size: clamp(17px, 4.8vw, 24px);
    }

    body.app-shell .pe-container .tele-stat-card .tele-stat-label {
        font-size: 11px;
        line-height: 1.3;
    }

    body.app-shell .pe-container .telematica-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    /* Lista personal: butoane direct în .telematica-actions */
    body.app-shell .pe-container .telematica-actions > .btn-primary,
    body.app-shell .pe-container .telematica-actions > .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    /* Salarii: primul rând = lună, al doilea = acțiuni în grid */
    body.app-shell .pe-container .telematica-actions > div {
        width: 100%;
        min-width: 0;
    }

    body.app-shell .pe-container .telematica-actions > div:first-of-type {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    body.app-shell .pe-container .telematica-actions > div:first-of-type .btn-secondary {
        min-width: 44px;
        min-height: 44px;
    }

    body.app-shell .pe-container .telematica-actions > div:first-of-type span {
        min-width: 0;
        font-size: 15px;
    }

    body.app-shell .pe-container .telematica-actions > div:last-of-type:not(:first-of-type) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    body.app-shell .pe-container .telematica-actions > div:last-of-type:not(:first-of-type) .btn-primary {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 46px;
        justify-content: center;
    }

    body.app-shell .pe-container .telematica-actions > div:last-of-type:not(:first-of-type) .btn-secondary {
        min-height: 44px;
        justify-content: center;
        font-size: 12px;
        padding-left: 8px;
        padding-right: 8px;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    body.app-shell .pe-salarii-page .card .card-content {
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell .pe-salarii-page .data-table {
        font-size: 11px;
    }

    body.app-shell .pe-salarii-page .data-table th,
    body.app-shell .pe-salarii-page .data-table td {
        padding: 6px 6px !important;
    }

    body.app-shell .pe-salarii-page .data-table tfoot td {
        font-size: 12px !important;
    }

    /* Salarii: FAB + panou acțiuni (export / CSV / listă) — pattern hartă utilaje */
    body.app-shell .pe-salarii-page {
        padding-bottom: calc(var(--bottombar-height, 84px) + 56px + max(12px, env(safe-area-inset-bottom, 0px)));
    }

    body.app-shell .pe-salarii-page .pe-salarii-controale-fab {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--bottombar-height, 84px) + 8px + env(safe-area-inset-bottom, 0px));
        z-index: 55;
        margin: 0;
        padding: 12px 18px;
        min-height: 48px;
        box-sizing: border-box;
        border-radius: 999px;
        border: 1px solid var(--border-strong, rgba(67, 97, 6, 0.22));
        background: var(--surface, var(--color-card-bg, #fff));
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
        font-size: 14px;
        font-weight: 600;
        color: var(--text, var(--color-text-primary));
        cursor: pointer;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .pe-salarii-page .pe-salarii-controale-fab:active {
        transform: scale(0.98);
    }

    body.app-shell .pe-salarii-page .pe-salarii-controale-fab[aria-expanded="true"] {
        background: var(--accent, #94c973);
        color: var(--text-inverse, #1e2a1d);
        border-color: transparent;
    }

    body.app-shell .pe-salarii-page .pe-salarii-secondary-actions {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        position: fixed;
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--bottombar-height, 84px) + 64px + env(safe-area-inset-bottom, 0px));
        z-index: 54;
        margin: 0 !important;
        padding: 14px;
        max-height: min(52vh, 420px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--surface-2, var(--color-bg-secondary));
        border: 1px solid var(--border-strong, rgba(67, 97, 6, 0.18));
        border-radius: 16px;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
        transform: translateY(calc(100% + 120px));
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease, visibility 0.2s;
    }

    body.app-shell .pe-salarii-page.pe-salarii-toolbar-open .pe-salarii-secondary-actions {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.app-shell .pe-salarii-page .pe-salarii-secondary-actions .btn-primary,
    body.app-shell .pe-salarii-page .pe-salarii-secondary-actions .btn-secondary {
        width: 100% !important;
        min-height: 46px;
        justify-content: center;
        box-sizing: border-box;
    }

    /* ---- Listă Parcele (doar telefon app shell): tabel încadrat, fără coloane tăiate ---- */
    /* Fără padding-bottom duplicat (main.content-center are deja bottombar + safe area) */
    body.app-shell main#routerView .lista-parcele-container {
        padding: 10px 8px max(10px, env(safe-area-inset-bottom, 0px));
        max-width: none;
        margin: 0;
        box-sizing: border-box;
    }

    body.app-shell main#routerView .lista-parcele-container .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    body.app-shell main#routerView .lista-parcele-container .page-header-left {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    body.app-shell main#routerView .lista-parcele-container .search-box-inline {
        min-width: 0 !important;
        width: 100%;
    }

    body.app-shell main#routerView .lista-parcele-container .search-box-inline input {
        padding: 9px 10px 9px 36px;
        font-size: 16px;
    }

    body.app-shell main#routerView .lista-parcele-container .total-area-badge {
        align-self: flex-start;
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Specificitate cu main#routerView: bate regula generică .page-header-right din același fișier */
    body.app-shell main#routerView .lista-parcele-container .page-header-right #exportParcelsBtn,
    body.app-shell main#routerView .lista-parcele-container .page-header-right #importParcelsBtn {
        display: none !important;
    }

    body.app-shell main#routerView .lista-parcele-container .page-header-right {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        flex-wrap: unset !important;
        gap: 8px 10px !important;
        align-items: stretch !important;
        width: 100%;
    }

    body.app-shell main#routerView .lista-parcele-container .page-header-right .btn-primary,
    body.app-shell main#routerView .lista-parcele-container .page-header-right .btn-secondary {
        font-size: var(--m-btn-font);
        padding: var(--m-btn-pad-y) var(--m-btn-pad-x);
        width: 100%;
        min-width: 0 !important;
        flex: none;
        min-height: var(--m-btn-height);
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell main#routerView .lista-parcele-container .page-header-right #addParcelComboBtn {
        grid-column: 1 / -1;
    }

    body.app-shell main#routerView .lista-parcele-container .page-header-right .lista-parcele-sat-btn {
        border-color: rgba(148, 201, 115, 0.55);
        background: rgba(148, 201, 115, 0.14);
        font-weight: 600;
    }

    body.app-shell main#routerView .lista-parcele-container .table-controls {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 10px;
        padding: 10px 10px;
        margin-bottom: 10px;
    }

    body.app-shell main#routerView .lista-parcele-container .table-controls-left {
        flex: 1 1 100%;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 14px;
        min-width: 0;
    }

    body.app-shell main#routerView .lista-parcele-container .checkbox-label {
        font-size: 13px;
        gap: 6px;
    }

    body.app-shell main#routerView .lista-parcele-container .checkbox-label span {
        line-height: 1.3;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-count {
        font-size: 12px;
        font-weight: 600;
        color: var(--color-text-primary);
        margin-left: auto;
        white-space: nowrap;
    }

    body.app-shell main#routerView .lista-parcele-container .table-controls-right {
        flex: 0 0 auto;
        margin-left: auto;
    }

    body.app-shell main#routerView .lista-parcele-container .table-wrapper {
        margin: 0;
        border-radius: 10px;
        overflow-x: visible;
        max-width: 100%;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table {
        table-layout: fixed;
        width: 100%;
        min-width: 0;
        font-size: 13px;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table th,
    body.app-shell main#routerView .lista-parcele-container .parcels-table td {
        padding: 8px 6px;
        vertical-align: middle;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table th {
        font-size: 11px;
        line-height: 1.25;
        white-space: normal;
        word-break: break-word;
        hyphens: auto;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="name"],
    body.app-shell main#routerView .lista-parcele-container .parcels-table td.parcel-name {
        width: 48%;
        min-width: 0;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="area"] {
        width: 20%;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="crop"] {
        width: 32%;
    }

    /* Grup / An: ascuns pe telefon (filtrul din topbar deja limitează grupul) */
    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="year"],
    body.app-shell main#routerView .lista-parcele-container .parcels-table td[data-column="year"] {
        display: none !important;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="actions"],
    body.app-shell main#routerView .lista-parcele-container .parcels-table td.actions-cell {
        width: 48px;
        padding-left: 4px;
        padding-right: 4px;
        text-align: center;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table td.parcel-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table td.parcel-name strong {
        font-weight: 600;
        font-size: 13px;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table .crop-badge {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
        padding: 3px 8px;
        font-size: 11px;
        box-sizing: border-box;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table td:not(.parcel-name):not(.actions-cell) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table .group-header td {
        padding: 8px 6px;
        font-size: 12px;
    }

    body.app-shell main#routerView .lista-parcele-container .parcels-table .btn-delete {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }

    /* Coloane extra (dacă sunt afișate din „Gestionează coloane”): scroll orizontal rămâne disponibil */
    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="plantingDate"],
    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="harvestDate"],
    body.app-shell main#routerView .lista-parcele-container .parcels-table th[data-column="workType"] {
        width: 88px;
        font-size: 10px;
    }

    @media (max-width: 420px) {
        body.app-shell main#routerView .lista-parcele-container .parcels-table th,
        body.app-shell main#routerView .lista-parcele-container .parcels-table td {
            padding: 6px 4px;
        }

        body.app-shell main#routerView .lista-parcele-container .parcels-table {
            font-size: 12px;
        }

    }

    /* ---- Culturi: ascunde coloana Sezon pe telefon (sezonul e în topbar) ---- */
    body.app-shell .crops-container .crops-list-table th[data-column="season"],
    body.app-shell .crops-container .crops-list-table td[data-column="season"] {
        display: none !important;
    }

    body.app-shell .crops-container .card-content {
        min-width: 0;
    }

    body.app-shell .crops-container .card-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
    }

    /* ---- Fișe tehnologice: lista pe telefon (butoane fără overflow orizontal) ---- */
    body.app-shell .tech-sheets-list {
        min-width: 0;
        max-width: 100%;
    }

    body.app-shell .tech-sheets-list .tech-sheet-item {
        padding: 10px;
        min-width: 0;
        box-sizing: border-box;
    }

    body.app-shell .tech-sheets-list .tech-sheet-subitem {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 10px !important;
        box-sizing: border-box;
    }

    body.app-shell .tech-sheets-list .tech-sheet-subitem > div:first-of-type {
        min-width: 0;
        width: 100%;
    }

    body.app-shell .tech-sheets-list .tech-sheet-subitem > div:first-of-type > div:first-of-type {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: 6px 8px !important;
    }

    body.app-shell .tech-sheets-list .tech-sheet-subitem > div:last-of-type {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100% !important;
    }

    body.app-shell .tech-sheets-list .tech-sheet-subitem > div:last-of-type .btn-sm {
        width: 100%;
        min-height: var(--m-btn-height);
        box-sizing: border-box;
        justify-content: center;
        padding-left: 8px;
        padding-right: 8px;
        font-size: var(--m-text-sm);
    }

    /* 3 sau 5 butoane: ultimul pe tot rândul */
    body.app-shell .tech-sheets-list .tech-sheet-subitem > div:last-of-type > button:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    body.app-shell #techSheetsListCard .card-content {
        overflow-x: hidden;
        min-width: 0;
    }

    /* Ecrane înguste: rând 1 = logo + iconițe, rând 2 = sezon + grup pe toată lățimea (zero suprapuneri) */
    @media (max-width: 520px) {
        body.app-shell {
            --topbar-height: 80px !important;
        }

        /* Două rânduri: logo (neschimbat) + chip — rezervă reală, dar mai compactă ca 86px */
        body.app-shell[data-router-module="dashboard"] {
            --topbar-height: 98px !important;
        }

        body.app-shell .top-bar {
            flex-wrap: wrap;
            row-gap: 2px;
            align-content: flex-start;
            padding-top: 2px;
            padding-bottom: 2px;
        }

        body.app-shell .top-bar .logo {
            order: 1;
        }

        body.app-shell .top-bar .topbar-right {
            order: 2;
            margin-left: auto;
        }

        body.app-shell .top-bar .topbar-cluster {
            order: 3;
            flex: 1 1 100%;
            width: 100%;
            min-width: 0;
            max-width: none !important;
            margin-left: 0 !important;
        }
    }

    @media (max-width: 400px) {
        body.app-shell {
            --topbar-height: 78px !important;
        }

        body.app-shell[data-router-module="dashboard"] {
            --topbar-height: 94px !important;
        }

        body.app-shell .top-bar .topbar-cluster {
            gap: 3px;
        }

        body.app-shell .topbar-group select.topbar-control {
            font-size: 9px !important;
            height: 22px !important;
            min-height: 22px !important;
            max-height: 22px;
            padding: 0 13px 0 4px !important;
            background-position: right 3px center;
            background-size: 7px;
        }

        /* Panou sezon+grup deschis: nu micșora selectul (bate regula de mai sus) */
        body.app-shell .topbar-context-cluster.is-open .topbar-context-panel .topbar-group select.topbar-control {
            font-size: 15px !important;
            height: 44px !important;
            min-height: 44px !important;
            max-height: none !important;
            padding: 0 36px 0 12px !important;
            background-position: right 10px center;
            background-size: 10px;
        }

        body.app-shell .logo-image {
            height: 50px;
            max-height: 50px;
        }

        body.app-shell[data-router-module="dashboard"] .top-bar .logo-image {
            height: 64px !important;
            max-height: 64px !important;
        }

        body.app-shell .topbar-icon-btn {
            width: 30px;
            min-width: 30px;
            height: 30px;
            font-size: 11px;
        }

        body.app-shell #notificationsBtn.topbar-icon-btn {
            width: 48px;
            min-width: 48px;
            height: 48px;
            font-size: 18px;
        }

        body.app-shell .topbar-avatar {
            width: 30px;
            height: 30px;
            min-width: 30px;
        }
    }

    /* ---- Notificări: panou fix în viewport (nu se taie pe stânga pe telefon) ---- */
    body.app-shell .notif-dropdown {
        position: fixed;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        top: calc(var(--topbar-height, 48px) + 6px);
        width: auto !important;
        max-height: min(72vh, calc(100vh - var(--topbar-height, 48px) - var(--bottombar-height, 168px) - 20px));
        z-index: 10050;
        border-radius: 14px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    }

    body.app-shell .notif-body {
        -webkit-overflow-scrolling: touch;
        padding: 8px 10px 12px;
    }

    body.app-shell .notif-header {
        padding: 12px 14px;
        flex-shrink: 0;
    }

    body.app-shell .notif-clear {
        min-height: 36px;
        padding: 6px 10px;
    }

    /* Notificări: buton mai mare la atingere */
    body.app-shell #notificationsBtn.topbar-icon-btn {
        width: 48px;
        min-width: 48px;
        height: 48px;
        font-size: 18px;
        border-radius: 14px;
    }

    /* Meniu Ajutor: aceeași problemă (absolute + lățime fixă) */
    body.app-shell .help-dropdown-menu.show {
        position: fixed;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        top: calc(var(--topbar-height, 48px) + 6px);
        width: auto !important;
        min-width: 0 !important;
        max-width: none;
        margin-top: 0;
        max-height: min(65vh, calc(100vh - var(--topbar-height, 48px) - var(--bottombar-height, 168px) - 24px));
        overflow-y: auto;
        z-index: 10050;
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
    }

    /* Agent AI: #routerView trebuie să transmită înălțimea până la .ai-assistant-full (flex coloană) */
    body.app-shell.ai-assistant-active main#routerView.content-center {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* ---- Agent AI: sidebar ascuns; bottom sheet + toggle Conversații / Nou în modebar ---- */
    body.app-shell.ai-assistant-active .ai-assistant-full {
        flex-direction: row;
        min-height: 0;
        overflow: hidden;
    }

    body.app-shell.ai-assistant-active .conversations-sidebar {
        display: none !important;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet {
        position: fixed;
        inset: 0;
        z-index: 3500;
        pointer-events: none;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet.open {
        pointer-events: auto;
        visibility: visible;
        opacity: 1;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.42);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: min(85vh, calc(100vh - env(safe-area-inset-top, 0px) - var(--topbar-height, 56px)));
        background: var(--color-bg-table);
        border: 1px solid var(--color-border);
        border-bottom: none;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 16px 18px 14px;
        border-bottom: 1px solid var(--color-border);
        flex-shrink: 0;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__title {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--color-text-primary);
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: none;
        border-radius: 12px;
        background: color-mix(in srgb, var(--color-border) 35%, transparent);
        color: var(--color-text-secondary);
        font-size: 20px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__body {
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        padding: 12px 12px 16px;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet .conversation-item {
        padding: 12px 14px;
        margin-bottom: 8px;
        border-radius: 14px;
        border: 1px solid transparent;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet .conversation-item.active {
        background: color-mix(in srgb, var(--color-accent-green, #436106) 14%, var(--color-bg-table));
        border-color: color-mix(in srgb, var(--color-accent-green) 35%, var(--color-border));
    }

    body.app-shell.ai-assistant-active .conv-title {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
    }

    body.app-shell.ai-assistant-active .conv-meta {
        font-size: 11px;
        opacity: 0.88;
        margin-top: 2px;
    }

    /* Fără zone invizibile care „fură” primul tap (butoanele erau opacity:0 dar încă clickable) */
    body.app-shell.ai-assistant-active .ai-conversations-sheet .conv-actions {
        opacity: 1;
    }

    /* Fără text helper sub bara de scriere pe mobil */
    body.app-shell.ai-assistant-active .chat-input-hint,
    body.app-shell.ai-assistant-active .chat-input-context {
        display: none !important;
    }

    body.app-shell.ai-assistant-active .ai-assistant-full .ai-assistant-container {
        flex: 1 1 auto;
        min-height: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }

    /* ---- Agent AI: chat tip mesagerie mobil ---- */
    body.app-shell.ai-assistant-active .ai-mode-switch--segments {
        width: 100%;
        justify-content: stretch;
        box-sizing: border-box;
    }

    body.app-shell.ai-assistant-active .ai-mode-switch--segments .ai-mode-switch__btn {
        flex: 1;
        min-height: 44px;
        justify-content: center;
    }

    /* Agent AI: fără titlu/subtitlu pe mobil — toolbar compact într-un singur cadru */
    body.app-shell.ai-assistant-active .ai-chat-modebar--compact {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 12px 10px;
        background: var(--color-bg-primary);
    }

    body.app-shell.ai-assistant-active .ai-chat-modebar__toolbar {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 10px;
        background: var(--color-bg-table);
        border: 1px solid var(--color-border);
        border-radius: 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
        box-sizing: border-box;
    }

    body.app-shell.ai-assistant-active .ai-chat-modebar--compact .ai-mode-mini-switch {
        margin-top: 0;
        width: 100%;
        justify-content: stretch;
        box-sizing: border-box;
        padding: 2px;
        gap: 3px;
    }

    body.app-shell.ai-assistant-active .ai-chat-modebar--compact .ai-mode-mini-switch__btn {
        flex: 1;
        min-height: 36px;
        padding: 6px 8px;
        font-size: 12px;
    }

    body.app-shell.ai-assistant-active .ai-chat-modebar--compact .ai-mode-switch--segments {
        padding: 2px;
        gap: 3px;
    }

    body.app-shell.ai-assistant-active .ai-chat-modebar--compact .ai-mode-switch--segments .ai-mode-switch__btn {
        min-height: 36px;
        padding: 6px 8px;
        font-size: 12px;
    }

    body.app-shell.ai-assistant-active .ai-chat-modebar--compact .ai-mode-switch--segments .ai-mode-switch__btn i {
        margin-right: 4px;
        font-size: 11px;
    }

    body.app-shell.ai-assistant-active .chat-container {
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body.app-shell.ai-assistant-active .chat-messages {
        padding: 16px 14px 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
        gap: 16px;
        background: color-mix(in srgb, var(--color-bg-secondary, #1a1f1a) 88%, var(--color-bg-primary, #0f140f) 12%);
    }

    html[data-theme="light"] body.app-shell.ai-assistant-active .chat-messages {
        background: linear-gradient(180deg, var(--bg, #f4f3ee) 0%, color-mix(in srgb, var(--surface-2, #ddd9ce) 28%, var(--bg, #f4f3ee) 72%) 45%, var(--bg, #f4f3ee) 100%);
    }

    body.app-shell.ai-assistant-active .chat-message,
    body.app-shell.ai-assistant-active .welcome-message {
        gap: 12px;
        align-items: flex-end;
    }

    body.app-shell.ai-assistant-active .welcome-message {
        display: flex;
        flex-direction: row;
    }

    body.app-shell.ai-assistant-active .assistant-avatar,
    body.app-shell.ai-assistant-active .user-avatar,
    body.app-shell.ai-assistant-active .error-avatar {
        width: 38px;
        height: 38px;
        font-size: 14px;
        flex-shrink: 0;
    }

    body.app-shell.ai-assistant-active .message-content {
        max-width: min(92%, 560px);
        padding: 14px 16px;
        border-radius: 22px;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    body.app-shell.ai-assistant-active .assistant-message .message-content,
    body.app-shell.ai-assistant-active .welcome-message .message-content,
    body.app-shell.ai-assistant-active .typing-message .message-content {
        border-radius: 22px 22px 22px 8px;
        background: var(--color-bg-table, rgba(255, 255, 255, 0.06));
        border: 1px solid color-mix(in srgb, var(--color-border) 65%, transparent);
    }

    html[data-theme="light"] body.app-shell.ai-assistant-active .assistant-message .message-content,
    html[data-theme="light"] body.app-shell.ai-assistant-active .welcome-message .message-content {
        background: #fff;
        border-color: rgba(0, 0, 0, 0.07);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }

    body.app-shell.ai-assistant-active .user-message .message-content {
        border-radius: 22px 22px 8px 22px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        color: #fff;
    }

    body.app-shell.ai-assistant-active .user-message .message-content .message-text,
    body.app-shell.ai-assistant-active .user-content .message-text {
        color: #fff;
    }

    body.app-shell.ai-assistant-active .user-message .message-content .message-time,
    body.app-shell.ai-assistant-active .user-content .message-time {
        color: rgba(255, 255, 255, 0.85);
    }

    body.app-shell.ai-assistant-active .user-message .message-content .message-header strong,
    body.app-shell.ai-assistant-active .user-content .message-header strong {
        color: rgba(255, 255, 255, 0.95);
    }

    body.app-shell.ai-assistant-active .message-header {
        margin-bottom: 8px;
        gap: 8px;
    }

    body.app-shell.ai-assistant-active .message-header strong {
        font-family: var(--font-title, inherit);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.02em;
    }

    body.app-shell.ai-assistant-active .message-time {
        font-size: 11px;
        opacity: 0.82;
    }

    body.app-shell.ai-assistant-active .message-text {
        font-size: 16px;
        line-height: 1.55;
        letter-spacing: 0.01em;
    }

    body.app-shell.ai-assistant-active .message-text ul {
        margin: 10px 0;
        padding-left: 20px;
    }

    body.app-shell.ai-assistant-active .message-text li {
        margin: 6px 0;
    }

    body.app-shell.ai-assistant-active .typing-indicator {
        padding: 12px 16px;
        border-radius: 22px;
    }

    body.app-shell.ai-assistant-active .chat-input-container {
        padding: 12px 14px;
        padding-bottom: max(14px, calc(12px + env(safe-area-inset-bottom, 0px)));
        background: var(--color-bg-primary, #0f140f);
        border-top: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.1);
    }

    html[data-theme="light"] body.app-shell.ai-assistant-active .chat-input-container {
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.05);
    }

    body.app-shell.ai-assistant-active .chat-input-wrapper {
        gap: 10px;
        align-items: center;
    }

    body.app-shell.ai-assistant-active .chat-attachments-preview {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }

    body.app-shell.ai-assistant-active .chat-pending-attachment {
        grid-template-columns: 82px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: 10px 42px 10px 10px;
    }

    body.app-shell.ai-assistant-active .chat-pending-attachment__image {
        height: 82px;
    }

    body.app-shell.ai-assistant-active .chat-pending-attachment__remove {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
    }

    body.app-shell.ai-assistant-active .chat-message-attachments {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.app-shell.ai-assistant-active .chat-attachment-card__image {
        height: 104px;
    }

    body.app-shell.ai-assistant-active .chat-input {
        font-size: 16px;
        line-height: 1.45;
        min-height: 46px;
        max-height: 132px;
        padding: 12px 18px;
        border-radius: 24px;
        border: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
        background: var(--color-bg-table, rgba(255, 255, 255, 0.04));
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell.ai-assistant-active .chat-input::-webkit-scrollbar {
        -webkit-appearance: none;
        appearance: none;
        width: 0 !important;
        height: 0 !important;
        display: none;
    }

    body.app-shell.ai-assistant-active .chat-send-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    body.app-shell.ai-assistant-active #chatFileInput + .chat-send-btn {
        margin-right: 0 !important;
        background: transparent;
        color: var(--color-accent-green, #94c973);
        border: 1.5px solid color-mix(in srgb, var(--color-accent-green) 55%, var(--color-border));
        box-shadow: none;
    }

    body.app-shell.ai-assistant-active #chatFileInput + .chat-send-btn:hover {
        transform: none;
        background: color-mix(in srgb, var(--color-accent-green) 12%, transparent);
    }

    body.app-shell.ai-assistant-active #sendMessageBtn.chat-send-btn {
        background: var(--color-accent-green, #436106);
        border: none;
        color: var(--color-bg-primary, #fff);
    }

    body.app-shell.ai-assistant-active #sendMessageBtn.chat-send-btn:hover {
        transform: scale(1.03);
    }

    /* ---- AI Builder: ascuns pe mobil (dock + panou + meniu lateral dacă există) ---- */
    body.app-shell .dock-panel__item[data-nav-module="ai-builder"],
    body.app-shell .nav-dock__item[data-nav-module="ai-builder"],
    body.app-shell .menu-item[data-module="ai-builder"],
    body.app-shell .submenu-item[data-module="ai-builder"] {
        display: none !important;
    }

    /* Bottom dock: Phase 1 (al doilea @media ≤1023px) — bară jos full width. */

    body.app-shell #dockContext,
    body.app-shell .dock-left {
        display: none !important;
    }

    body.app-shell .dock-right {
        flex-shrink: 0;
        width: 100%;
        justify-content: flex-end;
    }

    /* ---- Dashboard: rail + table scroll ---- */
    body.app-shell .dashboard-split {
        min-width: 0;
    }

    body.app-shell .dashboard-right-rail {
        min-width: 0;
        max-width: 100%;
    }

    body.app-shell .dashboard-crops-table-scroll {
        overflow-x: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell .dashboard-crops-table {
        min-width: 0;
        table-layout: fixed;
    }

    body.app-shell .dashboard-module-content.module-content,
    body.app-shell .module-content {
        max-width: 100%;
        box-sizing: border-box;
    }

    body.app-shell .widgets-grid {
        max-width: 100%;
        overflow-x: visible;
    }

    /* ---- Detaliu parcelă: full-bleed față de padding routerView, header compact, tab-uri scroll ---- */
    body.app-shell .parcel-detail-container {
        margin-left: -14px;
        margin-right: -14px;
        width: calc(100% + 28px);
        max-width: none;
        box-sizing: border-box;
        border-radius: 12px;
    }

    body.app-shell .parcel-detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    body.app-shell .parcel-detail-header .header-left {
        width: 100%;
        min-width: 0;
    }

    body.app-shell .parcel-detail-header .header-center {
        display: none;
    }

    body.app-shell .parcel-detail-header h1 {
        font-size: clamp(16px, 4.2vw, 21px);
        line-height: 1.25;
        word-break: break-word;
    }

    body.app-shell .parcel-detail-header .header-right {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell .parcel-detail-header .header-right::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell .parcel-detail-header .header-right .btn-sm,
    body.app-shell .parcel-detail-header .header-right .btn-secondary {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12px;
    }

    body.app-shell .parcel-detail-header .dropdown-btn {
        flex: 0 0 auto;
    }

    /* Export dropdown: nu se taie în dreapta pe ecran îngust */
    body.app-shell .parcel-detail-header .dropdown-menu {
        position: fixed;
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        top: calc(var(--topbar-height, 48px) + min(120px, 32vw));
        width: auto;
        min-width: 0;
        max-height: min(50vh, 320px);
        overflow-y: auto;
        margin-top: 0;
        z-index: 10045;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell .parcel-detail-container .tabs-navigation {
        padding: 0 6px;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    body.app-shell .parcel-detail-container .tab-nav-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 12px 6px;
        font-size: 10px;
        gap: 4px;
        line-height: 1.2;
    }

    body.app-shell .parcel-detail-container .tab-nav-btn i {
        font-size: 14px;
        flex-shrink: 0;
    }

    body.app-shell .parcel-detail-container .tab-content-area {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        scrollbar-width: thin;
        padding: 12px 12px max(20px, env(safe-area-inset-bottom, 0px));
    }

    body.app-shell .parcel-detail-container .monitoring-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    body.app-shell .parcel-detail-container .monitoring-column:last-child {
        grid-column: auto;
    }

    /* Detaliu parcelă pe telefon: fără harta mini din Monitorizare (rămâne harta mare în tab Imagini) */
    body.app-shell .parcel-detail-container .satellite-card {
        display: none !important;
    }

    body.app-shell .parcel-detail-container .ndvi-metrics {
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 12px;
    }

    body.app-shell .parcel-detail-container .value-large {
        font-size: clamp(22px, 7vw, 30px);
    }

    body.app-shell .parcel-detail-container .weather-current {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    body.app-shell .parcel-detail-container .temp-large {
        font-size: clamp(26px, 8vw, 34px);
    }

    body.app-shell .parcel-detail-container .weather-icon {
        font-size: 40px;
    }

    body.app-shell .parcel-detail-container .hourly-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.app-shell .parcel-detail-container .forecast-grid {
        grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
        gap: 8px;
    }

    body.app-shell .parcel-detail-container .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    body.app-shell .parcel-detail-container .chart-container {
        height: min(220px, 52vw);
        max-height: 260px;
    }

    body.app-shell .parcel-detail-container .parcel-works-subtitle {
        max-width: none;
        font-size: 12px;
    }

    body.app-shell .parcel-detail-container .parcel-works-block {
        overflow-x: visible;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
    }

    body.app-shell .parcel-detail-container .parcel-works-table {
        min-width: 0 !important;
        width: 100%;
        table-layout: fixed;
    }

    body.app-shell .parcel-detail-container .parcel-works-table th,
    body.app-shell .parcel-detail-container .parcel-works-table td {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    body.app-shell .parcel-detail-container .data-table {
        font-size: 12px;
    }

    body.app-shell .parcel-detail-container .data-table th,
    body.app-shell .parcel-detail-container .data-table td {
        padding: 10px 8px;
    }

    body.app-shell .parcel-detail-container .images-layout-v2 {
        grid-template-columns: 1fr !important;
        min-height: 0;
    }

    body.app-shell .parcel-detail-container .images-sidebar-v2 {
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    body.app-shell .parcel-detail-container .images-map-container {
        min-height: min(52vh, 400px);
    }

    body.app-shell .parcel-detail-container .parcel-satellite-map {
        min-height: 260px;
    }

    body.app-shell .parcel-detail-container .images-map-header {
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
    }

    body.app-shell .parcel-detail-container .satellite-image {
        height: min(240px, 45vh);
    }

    body.app-shell .parcel-detail-container .info-row {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    body.app-shell .parcel-detail-container .info-value {
        text-align: right;
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Tablou de bord: fără hartă pe telefon (hartă rămâne la modulul Harta fermă) */
    body.app-shell.dashboard-active:not(.harta-ferma-active) .dashboard-page.dashboard-cropwise .dashboard-map-pane {
        display: none !important;
    }

    body.app-shell.dashboard-active:not(.harta-ferma-active) .dashboard-page.dashboard-cropwise > .dashboard-split {
        min-height: 0 !important;
    }

    body.app-shell.dashboard-active:not(.harta-ferma-active) .dashboard-page.dashboard-cropwise .dashboard-right-rail {
        border-top: none !important;
    }

    /* ---- Hartă tablou / hartă fermă: zonă mai înaltă pe mobil ---- */
    /* Tablou (hartă ascunsă pe mobil); nu forța min-height pe harta fermă — umplere flex mai jos */
    body.app-shell.dashboard-active:not(.harta-ferma-active) .dashboard-page.dashboard-cropwise .dashboard-map-pane .dashboard-map-hero,
    body.app-shell.dashboard-active:not(.harta-ferma-active) .dashboard-map-hero {
        min-height: clamp(275px, min(58vh, 580px), 620px) !important;
    }

    /* Harta fermă mobil: panoul culturi = foaie de jos (slide up), deschis din „Culturi & parcele” */
    body.app-shell.harta-ferma-active .harta-ferma-rail-backdrop {
        position: fixed;
        inset: 0;
        z-index: 615;
        background: rgba(15, 22, 14, 0.48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.26s ease, visibility 0.26s;
    }

    body.app-shell.harta-ferma-active.harta-ferma-rail-sheet-open .harta-ferma-rail-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.app-shell.harta-ferma-active .harta-ferma-with-rail .dashboard-right-rail {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: min(78vh, 640px) !important;
        min-height: 0 !important;
        z-index: 620 !important;
        margin: 0 !important;
        border-radius: 18px 18px 0 0 !important;
        border: 1px solid var(--organic-border, var(--color-border));
        border-bottom: none !important;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22) !important;
        transform: translateY(calc(100% + 24px));
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: hidden;
    }

    body.app-shell.harta-ferma-active.harta-ferma-rail-sheet-open .harta-ferma-with-rail .dashboard-right-rail {
        transform: translateY(0);
    }

    body.app-shell.harta-ferma-active .harta-ferma-with-rail .dashboard-right-rail .dashboard-crops-table-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    body.app-shell.harta-ferma-active .harta-ferma-rail-close-btn {
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--organic-bg, var(--color-bg-secondary));
        color: var(--organic-text, var(--color-text-primary));
        font-size: 16px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell.harta-ferma-active .harta-ferma-rail-close-btn:active {
        opacity: 0.88;
        transform: scale(0.96);
    }

    /* Panou parcelă pe hartă (telefon): aceleași date ca hover/popup desktop, layout tip card + CTA */
    body.app-shell .parcel-mobile-sheet-root {
        position: fixed;
        inset: 0;
        z-index: 44;
        pointer-events: none;
    }

    body.app-shell .parcel-mobile-sheet-root:not(.hidden) {
        pointer-events: auto;
    }

    /* Foi pe body peste Leaflet */
    body.app-shell #parcelMobileSheetRoot.parcel-mobile-sheet-root,
    body.app-shell #equipmentMobileSheetRoot.parcel-mobile-sheet-root {
        z-index: 1300;
    }

    body.app-shell #equipmentMobileSheetRoot .eq-mobile-sheet-thumb {
        width: 72px;
        height: 72px;
        object-fit: cover;
        border-radius: 12px;
        flex-shrink: 0;
    }

    body.app-shell #equipmentMobileSheetRoot .eq-mobile-sheet-thumb--ph {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 72px;
        height: 72px;
        border-radius: 12px;
        flex-shrink: 0;
        background: var(--color-bg-secondary, rgba(0, 0, 0, 0.06));
        color: var(--color-text-secondary);
        font-size: 1.5rem;
    }

    body.app-shell .parcel-mobile-sheet-backdrop {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: calc(var(--bottombar-height, 80px) + env(safe-area-inset-bottom, 0px));
        background: rgba(8, 12, 8, 0.45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    body.app-shell .parcel-mobile-sheet {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: calc(var(--bottombar-height, 80px) + 10px + env(safe-area-inset-bottom, 0px));
        max-height: min(56vh, 440px);
        display: flex;
        flex-direction: column;
        font-family: var(--font-body, 'Inter', system-ui, -apple-system, sans-serif);
        background: var(--organic-bg, var(--color-bg-primary));
        color: var(--organic-text, var(--color-text-primary));
        border-radius: 18px;
        border: 1px solid var(--organic-border, var(--color-border));
        border-left: 4px solid var(--pms-accent, var(--color-accent-green));
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .parcel-mobile-sheet__top {
        padding: 14px 14px 4px;
        overflow-y: auto;
        flex: 1 1 auto;
        min-height: 0;
    }

    body.app-shell .parcel-mobile-sheet__head-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 4px;
    }

    body.app-shell .parcel-mobile-sheet__title {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 700;
        line-height: 1.28;
        letter-spacing: -0.02em;
        flex: 1 1 auto;
        min-width: 0;
        word-break: break-word;
    }

    body.app-shell .parcel-mobile-sheet__close {
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--organic-bg-elevated, var(--color-bg-secondary));
        color: var(--organic-text, var(--color-text-primary));
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .parcel-mobile-sheet__close:active {
        opacity: 0.9;
        transform: scale(0.96);
    }

    body.app-shell .parcel-mobile-sheet__body {
        padding-bottom: 6px;
    }

    body.app-shell .parcel-mobile-sheet__row {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 0;
        border-bottom: 1px solid color-mix(in srgb, var(--organic-border, var(--color-border)) 85%, transparent);
    }

    body.app-shell .parcel-mobile-sheet__row:last-child {
        border-bottom: none;
        padding-bottom: 4px;
    }

    body.app-shell .parcel-mobile-sheet__icon {
        flex-shrink: 0;
        width: 2.5rem;
        height: 2.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: color-mix(in srgb, var(--pms-accent, var(--color-accent-green)) 22%, transparent);
        color: var(--pms-accent, var(--color-accent-green));
        font-size: 1rem;
    }

    body.app-shell .parcel-mobile-sheet__row-text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        flex: 1 1 auto;
        font-size: 1rem;
        line-height: 1.35;
    }

    body.app-shell .parcel-mobile-sheet__label {
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--text-muted, var(--color-text-secondary));
    }

    body.app-shell .parcel-mobile-sheet__row-text strong {
        font-weight: 700;
        font-size: 1.05rem;
    }

    body.app-shell .parcel-mobile-sheet__sub {
        font-weight: 500;
        color: var(--text-muted, var(--color-text-secondary));
    }

    body.app-shell .parcel-mobile-sheet__actions {
        padding: 12px 14px 14px;
        border-top: 1px solid var(--organic-border, var(--color-border));
        flex-shrink: 0;
        background: color-mix(in srgb, var(--organic-bg, var(--color-bg-primary)) 94%, var(--pms-accent, var(--color-accent-green)) 6%);
    }

    body.app-shell .parcel-mobile-sheet__btn-primary {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        border: none;
        border-radius: 14px;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        background: var(--color-accent-green, #436106);
        color: #fff;
        box-shadow: 0 4px 14px color-mix(in srgb, var(--color-accent-green, #436106) 45%, transparent);
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .parcel-mobile-sheet__btn-primary:active {
        transform: scale(0.98);
        opacity: 0.95;
    }

    html[data-theme="light"] body.app-shell .parcel-mobile-sheet__btn-primary {
        color: #f8faf3;
    }

    /* Panou parcelă pe hartă (telefon): conținut extins — înălțime + blocuri */
    body.app-shell #parcelMobileSheetRoot .parcel-mobile-sheet {
        max-height: min(82vh, 580px);
    }

    body.app-shell #parcelMobileSheetRoot .pms-block {
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid color-mix(in srgb, var(--organic-border, var(--color-border)) 80%, transparent);
    }

    body.app-shell #parcelMobileSheetRoot .pms-block:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 4px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-block__title {
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted, var(--color-text-secondary));
        margin: 0 0 10px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-hint {
        font-size: 0.78rem;
        line-height: 1.35;
        color: var(--text-muted, var(--color-text-secondary));
        margin: 0 0 10px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-loading,
    body.app-shell #parcelMobileSheetRoot .pms-muted {
        font-size: 0.9rem;
        color: var(--text-muted, var(--color-text-secondary));
        padding: 8px 0;
    }

    body.app-shell #parcelMobileSheetRoot .pms-gdd-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-gdd-cell {
        border-radius: 12px;
        padding: 10px 10px;
        background: color-mix(in srgb, var(--organic-bg-elevated, var(--color-bg-secondary)) 92%, var(--pms-accent, var(--color-accent-green)) 8%);
        border: 1px solid color-mix(in srgb, var(--organic-border, var(--color-border)) 75%, transparent);
        min-width: 0;
    }

    body.app-shell #parcelMobileSheetRoot .pms-gdd-cell__label {
        font-size: 0.65rem;
        font-weight: 700;
        line-height: 1.25;
        color: var(--text-muted, var(--color-text-secondary));
        margin-bottom: 4px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-gdd-cell__val {
        font-size: 1rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    body.app-shell #parcelMobileSheetRoot .pms-gdd-meta {
        font-size: 0.72rem;
        line-height: 1.35;
        color: var(--text-muted, var(--color-text-secondary));
        margin: 10px 0 0;
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-host {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-main {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-icon {
        font-size: 2.25rem;
        color: var(--pms-accent, var(--color-accent-green));
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-temp {
        font-size: 1.85rem;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-meta {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 0.88rem;
        color: var(--organic-text, var(--color-text-primary));
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-meta span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    body.app-shell #parcelMobileSheetRoot .pms-weather-meta i {
        width: 1.1rem;
        text-align: center;
        color: var(--pms-accent, var(--color-accent-green));
    }

    body.app-shell.harta-ferma-active .harta-ferma-with-rail > .dashboard-split {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
    }

    body.app-shell.harta-ferma-active.map-full .harta-ferma-with-rail.dashboard-page.dashboard-cropwise {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
    }

    body.app-shell.harta-ferma-active .harta-ferma-with-rail .dashboard-map-pane {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: none;
    }

    body.app-shell.harta-ferma-active .harta-ferma-with-rail .harta-ferma-map-hero.dashboard-map-hero {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: none !important;
    }

    /* ---- Farm map (#mapContainer): toggle + controale compacte pe telefon ---- */
    body.app-shell #mapContainer .map-view-toggle {
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 16px);
        z-index: 600;
        padding: 2px;
        gap: 2px;
        border-radius: 10px;
        background: color-mix(in srgb, var(--organic-bg, #fff) 88%, transparent);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
    }

    body.app-shell #mapContainer .mvt-btn {
        padding: 5px 8px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        border-radius: 8px;
        min-height: 0;
    }

    body.app-shell #mapContainer .map-controls {
        top: auto !important;
        bottom: calc(var(--bottombar-height, 56px) + 8px + env(safe-area-inset-bottom, 0px));
        right: 6px;
        left: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-content: flex-end;
        max-width: min(calc(100% - 12px), 168px);
        gap: 4px;
        padding: 4px;
        z-index: 600;
        background: color-mix(in srgb, var(--organic-bg, #fff) 82%, transparent);
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    body.app-shell #mapContainer .map-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        border-radius: 10px;
        font-size: 0;
    }

    body.app-shell #mapContainer .map-btn i {
        font-size: 13px;
    }

    /* Localizare pe hartă (FAB), deasupra clusterului de controale din dreapta */
    body.app-shell #mapContainer .map-mobile-locate-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 10px;
        bottom: calc(var(--bottombar-height, 56px) + 86px + env(safe-area-inset-bottom, 0px));
        z-index: 610;
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        padding: 0;
        margin: 0;
        border: none;
        border-radius: 50%;
        background: var(--accent, #94c973);
        color: var(--accent-contrast, #14210f);
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.app-shell #mapContainer .map-mobile-locate-fab i {
        font-size: 19px;
    }

    body.app-shell #mapContainer .map-mobile-locate-fab:active {
        transform: scale(0.96);
        opacity: 0.94;
    }

    body.app-shell #mapContainer .map-controls #locateMeBtn {
        display: none !important;
    }

    /* Hartă fermă: chip-uri mai mici, aliniate cu dock-ul (fără gol mare sub ele) */
    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-row {
        display: flex;
        position: absolute;
        bottom: calc(var(--bottombar-height, 56px) + 8px + env(safe-area-inset-bottom, 0px));
        left: 6px;
        right: auto;
        top: auto;
        z-index: 600;
        pointer-events: auto;
        /* Lasă loc clusterului de map-btn în dreapta (jos) */
        max-width: min(200px, calc(50vw - 10px));
    }

    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-stack {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 10px;
        min-height: 0;
        min-width: 0;
        border-radius: 10px;
        border: 1px solid color-mix(in srgb, var(--accent, #94c973) 40%, transparent);
        background: var(--accent, #94c973);
        color: var(--accent-contrast, #14210f);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        cursor: pointer;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip:active {
        opacity: 0.92;
        transform: scale(0.98);
    }

    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip i {
        font-size: 12px;
        flex-shrink: 0;
    }

    @media (max-width: 380px) {
        body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip span {
            display: none;
        }

        body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip {
            padding: 7px;
            border-radius: 12px;
            justify-content: center;
        }
    }

    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip--secondary {
        background: var(--organic-bg, rgba(255, 255, 255, 0.94));
        color: var(--organic-text, var(--color-text-primary));
        border: 1px solid var(--organic-border, rgba(67, 97, 6, 0.28));
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    body.app-shell.harta-ferma-active #mapContainer .map-add-parcel-chip--secondary.active {
        border-color: var(--accent, #94c973);
        box-shadow: 0 0 0 2px rgba(148, 201, 115, 0.35);
    }

    body.app-shell #mapContainer .ndvi-legend {
        bottom: calc(var(--bottombar-height, 56px) + 80px + env(safe-area-inset-bottom, 0px));
        left: 8px;
        max-width: min(210px, 46vw);
        max-height: min(30vh, 200px);
        z-index: 550;
    }

    body.app-shell.harta-ferma-active #mapContainer .ndvi-legend {
        bottom: calc(var(--bottombar-height, 72px) + 120px + env(safe-area-inset-bottom, 0px));
    }

    /* ---- Animale hartă ---- */
    body.app-shell .map-container-animals .map-controls {
        top: auto;
        bottom: calc(var(--bottombar-height, 56px) + 12px + env(safe-area-inset-bottom, 0px));
        right: 8px;
        left: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: min(calc(100% - 16px), 240px);
        gap: 6px;
        padding: 8px;
        z-index: 600;
    }

    body.app-shell .map-container-animals .map-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    body.app-shell .map-container-animals .map-btn i {
        font-size: 15px;
    }

    /* ---- Observații hartă (overlay full-screen; fără dock) ---- */
    body.app-shell .obs-map-overlay .obs-map-controls {
        top: auto !important;
        left: auto !important;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        right: max(8px, env(safe-area-inset-right, 0px)) !important;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: min(calc(100% - 16px), 200px);
        gap: 6px;
        padding: 8px;
        z-index: 1001;
    }

    body.app-shell .obs-map-overlay .obs-map-controls .map-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    /* ---- Utilaje: bară sus + map-btn ---- */
    body.app-shell .telematics-top-controls {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        row-gap: 8px;
        max-width: 100%;
        padding: 8px;
        box-sizing: border-box;
    }

    body.app-shell.map-full .map-ctrl-inline {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        justify-content: flex-end;
    }

    body.app-shell.map-full .map-ctrl-inline .map-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    body.app-shell .map-container-utilaje {
        min-width: 0;
    }

    /*
     * Hartă utilaje: z-index peste restul din zonă; coloană pe telefon (hartă sus, listă jos).
     */
    body.app-shell.map-full .utilaje-harta-full {
        z-index: 40;
        flex-direction: column !important;
        min-height: 0;
    }

    body.app-shell.map-full .utilaje-harta-full .telematics-sidebar {
        order: 2;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0;
        max-height: min(22vh, 200px);
        flex-shrink: 0;
        flex-grow: 0;
        border-right: none;
        border-top: 1px solid var(--color-border);
    }

    body.app-shell.map-full .utilaje-harta-full .sidebar-equipment-list {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    /* Hartă ia tot spațiul rămas între bare și banda listă (flex, nu min-height fix) */
    body.app-shell.map-full .utilaje-harta-full .telematics-main {
        order: 1;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        min-width: 0 !important;
    }

    body.app-shell.map-full .utilaje-harta-full .telematics-main .map-container-utilaje {
        flex: 1 1 auto;
        min-height: 0;
    }

    /* Hartă utilaje mobil: fără filtru avansat și fără selectare în masă (rămân checkbox-urile pe rând) */
    body.app-shell.map-full .utilaje-harta-full .sidebar-filter-toggle {
        display: none !important;
    }

    body.app-shell.map-full .utilaje-harta-full .sidebar-select-controls {
        display: none !important;
    }

    /* Hartă utilaje mobil: fără bară de căutare în lista de jos (spațiu + fără tastatură accidentală) */
    body.app-shell.map-full .utilaje-harta-full .sidebar-search {
        display: none !important;
    }

    /* Hartă utilaje: bară control — mică, fără scroll pe tot panoul (tap la dată nu mai e „mâncat” de scroll) */
    body.app-shell.map-full .telematics-top-controls {
        left: 8px;
        right: 8px;
        top: 8px;
        width: auto;
        max-width: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 4px 6px;
        z-index: 8000;
        max-height: none;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell.map-full .telematics-top-controls__primary {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 4px;
        align-items: center;
    }

    /* Doar rândul cu hartă/ceas derulează dacă e nevoie */
    body.app-shell.map-full .telematics-top-controls__secondary {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px;
        max-height: min(22vh, 120px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell.map-full .telematics-top-controls__secondary .map-ctrl-inline {
        width: 100%;
        justify-content: flex-end;
    }

    /* Hartă utilaje: panoul LIVE/dată ascuns implicit pe telefon; buton „Controale” îl afișează */
    body.app-shell.map-full .map-container-utilaje.telematics-panel-collapsed .telematics-top-controls {
        display: none !important;
    }

    body.app-shell.map-full .telematics-controls-fab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: absolute;
        left: max(10px, env(safe-area-inset-left, 0px));
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        top: auto;
        right: auto;
        z-index: 8100;
        padding: 10px 16px;
        min-height: 44px;
        box-sizing: border-box;
        border-radius: 999px;
        border: 1px solid var(--color-border);
        background: var(--color-card-bg, #fff);
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
        font-size: 13px;
        font-weight: 600;
        color: var(--color-text-primary);
        cursor: pointer;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell.map-full .telematics-controls-fab:active {
        transform: scale(0.98);
    }

    /* Legendă viteză: compactă, deasupra marginii hărții (hartă mai joasă pe mobil) */
    body.app-shell.map-full .utilaje-track-legend {
        bottom: 12px;
        right: 8px;
        left: auto;
        padding: 7px 9px;
        font-size: 9px;
        max-width: min(200px, calc(100vw - 32px));
        border-radius: 6px;
    }

    body.app-shell.map-full .utilaje-track-legend__title {
        font-size: 10px;
        margin-bottom: 4px;
    }

    body.app-shell.map-full .utilaje-track-legend__rows {
        gap: 2px;
    }

    body.app-shell.map-full .utilaje-track-legend__swatch {
        width: 14px;
        margin-right: 4px;
    }

    body.app-shell.map-full .telematics-top-controls .ctrl-btn,
    body.app-shell.map-full .telematics-top-controls .ctrl-date {
        min-height: 36px;
        min-width: 36px;
        box-sizing: border-box;
        font-size: 10px;
        padding: 3px 6px;
        gap: 3px;
    }

    body.app-shell.map-full .telematics-top-controls .ctrl-date {
        min-width: auto;
        padding: 0 6px;
    }

    body.app-shell.map-full .telematics-top-controls .ctrl-live {
        font-size: 10px;
        padding: 3px 8px;
    }

    body.app-shell.map-full .telematics-top-controls .ctrl-clock,
    body.app-shell.map-full .telematics-top-controls .ctrl-speed {
        font-size: 10px;
        line-height: 1.2;
    }

    /* Tap clar pe câmpul dată (Flatpickr altInput) */
    body.app-shell.map-full .telematics-top-controls .flatpickr-alt-input,
    body.app-shell.map-full .telematics-top-controls input.ctrl-date {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell.map-full .telematics-top-controls .map-ctrl-inline .map-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        font-size: 13px;
    }

    /* Flatpickr în body — peste Leaflet și peste shell */
    body.app-shell.map-full .flatpickr-calendar,
    body.app-shell.map-full .flatpickr-calendar.open {
        z-index: 200000 !important;
    }

    /* ---- Imagini satelit (tablet 769–1023): hartă sus, listă jos ---- */
    body.app-shell.sat-full .content-center,
    body.app-shell.sat-full #routerView {
        min-width: 0;
    }

    body.app-shell.sat-full .sat-page {
        flex-direction: column;
        min-height: 0;
    }

    /* Hartă ia tot spațiul rămas; panoul scene rămâte doar cât banda orizontală (fără gol alb) */
    body.app-shell.sat-full .sat-map-area {
        flex: 1 1 auto;
        min-height: min(280px, 46vh);
        min-width: 0 !important;
    }

    body.app-shell.sat-full .sat-panel {
        flex: 0 0 auto;
        min-height: 0;
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
        max-width: none !important;
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

    body.app-shell.sat-full .sat-toolbar-top {
        top: 10px;
        left: 10px;
    }

    body.app-shell.sat-full .sat-bottom-dock {
        left: 8px;
        max-width: calc(100% - 16px);
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    /* ---- Imagini satelit: scene în slider orizontal, carduri mici (nu full-width 16:9) ---- */
    body.app-shell.sat-full .sat-panel {
        justify-content: flex-start;
    }

    /* Fără etichetă + dropdown „Afișare scene” pe telefon (economie spațiu; rămâne implicit cele mai noi) */
    body.app-shell.sat-full .sat-panel-sort {
        display: none !important;
    }

    body.app-shell.sat-full .sat-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        flex: 0 0 auto;
        min-height: 0;
        max-height: 138px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        padding: 6px 12px 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        touch-action: pan-x;
        scrollbar-width: thin;
    }

    /* Mesaj încărcare / gol: ocupă tot rândul, nu îngust în slider */
    body.app-shell.sat-full .sat-list > :only-child {
        flex: 1 1 auto;
        min-width: 100%;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    body.app-shell.sat-full .sat-list::-webkit-scrollbar {
        height: 5px;
    }

    body.app-shell.sat-full .sat-list::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.22);
        border-radius: 4px;
    }

    body.app-shell.sat-full .sat-card {
        flex: 0 0 auto;
        width: min(118px, 34vw);
        max-width: 130px;
        margin-bottom: 0;
        scroll-snap-align: start;
        border-radius: 10px;
    }

    body.app-shell.sat-full .sat-card-preview {
        width: 100%;
        aspect-ratio: 1;
        min-height: 0;
        max-height: 86px;
    }

    body.app-shell.sat-full .sat-card-overlay {
        padding: 10px 6px 6px;
    }

    body.app-shell.sat-full .sat-card-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    body.app-shell.sat-full .sat-card-date {
        font-size: 11px;
        line-height: 1.15;
    }

    body.app-shell.sat-full .sat-card-sat {
        display: none;
    }

    body.app-shell.sat-full .sat-card-cloud {
        font-size: 10px;
        margin-left: 0;
    }

    body.app-shell.sat-full .sat-card-cloud i {
        font-size: 9px;
    }

    body.app-shell.sat-full .sat-card-preview-placeholder {
        font-size: 22px;
    }

    /* Pe touch nu există hover — butoanele trebuie vizibile; inset ≥ radius card ca să nu taie colțul */
    body.app-shell.sat-full .sat-card .sat-card-buttons {
        opacity: 1;
        top: 8px;
        right: 8px;
        gap: 5px;
    }

    body.app-shell.sat-full .sat-card-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
        border-radius: 8px;
    }

    body.app-shell.sat-full .sat-card:hover {
        transform: none;
    }

    /* ---- Analiză NDVI: scroll orizontal, coloane lipite + buton „Grafic” vizibil ---- */
    body.app-shell .analiza-ndvi-page .ndvi-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    body.app-shell .analiza-ndvi-page .ndvi-table-modern {
        min-width: 0;
    }

    body.app-shell .analiza-ndvi-page .ndvi-table-modern th,
    body.app-shell .analiza-ndvi-page .ndvi-table-modern td {
        padding: 10px 8px;
        font-size: 12px;
    }

    body.app-shell .analiza-ndvi-page .col-parcel {
        position: sticky;
        left: 0;
        z-index: 2;
        min-width: 96px;
        max-width: 38vw;
        box-shadow: 4px 0 10px -6px rgba(0, 0, 0, 0.18);
        background: var(--card, var(--color-bg-primary));
    }

    body.app-shell .analiza-ndvi-page thead .col-parcel {
        z-index: 4;
        background: var(--bg2, var(--color-bg-table));
    }

    body.app-shell .analiza-ndvi-page .ndvi-table-modern tbody tr:hover .col-parcel {
        background: var(--color-hover-bg, rgba(0, 0, 0, 0.05));
    }

    body.app-shell .analiza-ndvi-page .col-sparkline {
        position: sticky;
        right: 0;
        z-index: 2;
        min-width: 104px;
        width: 104px;
        max-width: 28vw;
        box-shadow: -4px 0 10px -6px rgba(0, 0, 0, 0.18);
        background: var(--card, var(--color-bg-primary));
        vertical-align: middle;
    }

    body.app-shell .analiza-ndvi-page thead .col-sparkline {
        z-index: 4;
        background: var(--bg2, var(--color-bg-table));
    }

    body.app-shell .analiza-ndvi-page .ndvi-table-modern tbody tr:hover .col-sparkline {
        background: var(--color-hover-bg, rgba(0, 0, 0, 0.05));
    }

    body.app-shell .ndvi-sparkline-cell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    body.app-shell .analiza-ndvi-page .sparkline-wrapper {
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.app-shell .ndvi-mobile-chart-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        min-height: 42px;
        padding: 6px 8px;
        box-sizing: border-box;
        border: none;
        border-radius: 8px;
        background: var(--color-accent-green, #436106);
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .ndvi-mobile-chart-btn-text {
        white-space: nowrap;
    }

    body.app-shell .analiza-ndvi-page .col-ndvi-avg,
    body.app-shell .analiza-ndvi-page .col-delta,
    body.app-shell .analiza-ndvi-page .col-variability,
    body.app-shell .analiza-ndvi-page .col-distribution,
    body.app-shell .analiza-ndvi-page .col-status {
        display: none !important;
    }

    body.app-shell .analiza-ndvi-page .ndvi-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.app-shell .analiza-ndvi-page .summary-card {
        padding: 12px 14px;
    }

    body.app-shell .analiza-ndvi-page .summary-value {
        font-size: 20px;
    }

    body.app-shell .analiza-ndvi-page .ndvi-scene-select {
        min-width: 0;
        flex: 1 1 auto;
        max-width: 100%;
    }

    body.app-shell .analiza-ndvi-page .ndvi-scene-picker {
        width: 100%;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-toolbar-modern {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-scene-picker {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-filter-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-filters-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-filters-bar .filter-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .filter-select {
        width: 100%;
        min-width: 0 !important;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .filter-apply-btn,
    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .filter-reset-btn {
        width: 100%;
        min-height: 44px;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .crop-stats-cards {
        flex-direction: column;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .crop-stats-card {
        width: 100%;
        min-width: 0 !important;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-table-container {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="analiza-ndvi"] .analiza-ndvi-page .ndvi-table-container::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* ---- Lucrări (works): listă compactă mobil — grilă 2×3, fără scroll orizontal ---- */
    body.app-shell .works-list-page.module-content {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    body.app-shell .works-list-page .works-list-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px !important;
    }

    body.app-shell .works-list-page .works-list-header h1 {
        flex: 1 1 120px;
        min-width: 0;
        margin: 0;
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
        font-weight: 700;
    }

    body.app-shell .works-list-page .works-list-header .btn-primary {
        width: auto;
        flex: 0 0 auto;
        min-height: 36px;
        padding: 6px 11px;
        font-size: 12px;
        gap: 6px;
    }

    body.app-shell .works-list-page .works-list-table-card .card-content,
    body.app-shell .works-list-page .works-list-filters-card .card-content {
        padding: 8px 8px 10px;
    }

    body.app-shell .works-list-page .works-filters-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 8px;
    }

    body.app-shell .works-list-page .works-filters-grid > div:last-child {
        grid-column: 1 / -1;
    }

    @media (max-width: 380px) {
        body.app-shell .works-list-page .works-filters-grid {
            grid-template-columns: 1fr;
        }
    }

    body.app-shell .works-list-page .works-filters-grid .form-label {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 2px;
        color: var(--text-muted, var(--color-text-secondary));
    }

    body.app-shell .works-list-page .w-works-table-wrap {
        overflow-x: visible !important;
        overflow-y: visible;
    }

    body.app-shell .works-list-page .w-works-table {
        min-width: 0 !important;
        width: 100%;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    body.app-shell .works-list-page .w-works-table thead {
        display: none;
    }

    body.app-shell .works-list-page .w-works-table tbody,
    body.app-shell .works-list-page .w-works-table tfoot {
        display: block;
        width: 100%;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_header {
        display: block;
        margin-top: 10px;
        background: color-mix(in srgb, var(--color-bg-table) 88%, transparent);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_header:first-child {
        margin-top: 0;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_header td {
        display: block;
        width: 100% !important;
        padding: 7px 10px !important;
        border: none !important;
        font-size: 12px;
        font-weight: 700;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_header td i {
        font-size: 11px;
        margin-right: 6px !important;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 8px;
        row-gap: 2px;
        margin: 5px 0 0;
        padding: 7px 9px;
        border: 1px solid var(--color-border);
        border-radius: 9px;
        background: var(--color-bg-primary, var(--color-bg-secondary));
        box-sizing: border-box;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_item td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        padding: 3px 0 !important;
        border: none !important;
        width: auto !important;
        min-width: 0;
        vertical-align: top;
        text-align: left !important;
    }

    body.app-shell .works-list-page .w-works-table tbody tr.w_group_item td::before {
        content: attr(data-label);
        font-size: 8px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-text-secondary);
        line-height: 1.2;
    }

    body.app-shell .works-list-page .w-works-table .w-cell-val {
        font-size: 12px;
        line-height: 1.3;
        color: var(--color-text-primary);
        word-break: break-word;
        overflow-wrap: anywhere;
        min-width: 0;
        text-align: left;
        width: 100%;
    }

    body.app-shell .works-list-page .w-works-table .w-cell-val--badge {
        align-self: flex-start;
    }

    body.app-shell .works-list-page .w-works-table .w-cell-val--badge .status-badge {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 3px;
        max-width: 100%;
        white-space: normal;
        font-size: 10px;
        padding: 3px 7px;
    }

    body.app-shell .works-list-page .w-works-table .w-cell-val--badge .status-badge i {
        font-size: 10px;
    }

    body.app-shell .works-list-page .w-works-table .w-cell-val--cost {
        font-variant-numeric: tabular-nums;
        font-size: 11px;
    }

    /* ---- Modal „Adaugă lucrare nouă”: tabel 1280px → stivă etichetă + câmp (doar telefon) ---- */
    body.app-shell #addWorkModal.modal-overlay {
        padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px))
            max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
        align-items: stretch;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: min(92vh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px)) !important;
        margin: 0 auto;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal__body {
        padding: 12px !important;
    }

    body.app-shell #addWorkModal .add-work-modal__meta {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    body.app-shell #addWorkModal .add-work-modal__meta > div {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.app-shell #addWorkModal .add-work-modal__meta .form-select,
    body.app-shell #addWorkModal .add-work-modal__meta #awCrop,
    body.app-shell #addWorkModal .add-work-modal__meta #awSeason,
    body.app-shell #addWorkModal .add-work-modal__meta .season-picker,
    body.app-shell #addWorkModal .add-work-modal__meta .season-picker-trigger {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal__meta .custom-select-claude {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    body.app-shell #addWorkModal .add-work-modal__meta .custom-select-claude__trigger {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal__scroll {
        overflow: visible !important;
        max-height: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    body.app-shell #addWorkModal .add-work-modal__table {
        min-width: 0 !important;
        width: 100%;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    body.app-shell #addWorkModal .add-work-modal__table thead {
        display: none;
    }

    body.app-shell #addWorkModal .add-work-modal__table tbody {
        display: block;
        width: 100%;
    }

    body.app-shell #addWorkModal .add-work-modal__table tbody tr.add-work-modal__row {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 14px;
        border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
        border-radius: 12px;
        background: var(--color-bg-card, var(--color-bg-primary, #fff));
        margin: 0;
    }

    body.app-shell #addWorkModal .add-work-modal__table td {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 10px 0 !important;
        border: none !important;
        border-bottom: 1px solid color-mix(in srgb, var(--color-border, #ccc) 85%, transparent) !important;
        vertical-align: top !important;
        text-align: left !important;
        white-space: normal !important;
        word-break: normal;
        overflow-wrap: anywhere;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal__table td.add-work-modal__col-spacer {
        display: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    body.app-shell #addWorkModal .add-work-modal__table tbody tr.add-work-modal__row > td:nth-last-child(2) {
        border-bottom: none !important;
        padding-bottom: 2px !important;
    }

    body.app-shell #addWorkModal .add-work-modal__table td[data-label]::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-text-secondary, rgba(0, 0, 0, 0.55));
        line-height: 1.3;
    }

    body.app-shell #addWorkModal .add-work-modal__table .form-input,
    body.app-shell #addWorkModal .add-work-modal__table .form-select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .tech-sheet-intervention-picker {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body.app-shell #addWorkModal .tech-sheet-intervention-trigger {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
        white-space: normal !important;
        text-align: left;
        line-height: 1.35;
        padding-top: 10px;
        padding-bottom: 10px;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal__table .btn-sm {
        width: 100%;
        justify-content: center;
        white-space: normal !important;
        min-height: 42px;
        line-height: 1.25;
        gap: 8px;
        box-sizing: border-box;
    }

    body.app-shell #addWorkModal .add-work-modal__harvest-row {
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
    }

    body.app-shell #addWorkModal .add-work-modal__table #awHarvestBlock .form-input,
    body.app-shell #addWorkModal .add-work-modal__table #awHarvestBlock .form-select {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.app-shell #addWorkModal .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell #addWorkModal .modal-footer .btn-primary,
    body.app-shell #addWorkModal .modal-footer .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell #addWorkModal .modal-header {
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
    }

    body.app-shell #addWorkModal .modal-header .modal-title {
        font-size: 1rem;
        line-height: 1.3;
        padding-right: 8px;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.app-shell .works-list-page #w_table tfoot {
        margin-top: 8px;
        padding-top: 4px;
        border-top: 1px solid var(--color-border);
    }

    body.app-shell .works-list-page #w_table tfoot tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: baseline;
        gap: 4px 10px;
        padding: 5px 0;
    }

    body.app-shell .works-list-page #w_table tfoot tr:not(:last-child) {
        border-bottom: 1px solid rgba(180, 176, 160, 0.12);
    }

    body.app-shell .works-list-page #w_table tfoot th {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        padding: 2px 0 !important;
        border: none !important;
        font-size: 11px;
        font-weight: 600;
        text-align: left !important;
        white-space: normal;
    }

    body.app-shell .works-list-page #w_table tfoot th:last-child {
        flex: 0 0 auto;
        text-align: right !important;
        font-variant-numeric: tabular-nums;
        font-size: 11px;
    }

    body.app-shell .works-list-page #w_table tfoot tr td[colspan] {
        display: block;
        width: 100%;
        padding: 8px 4px !important;
        text-align: center;
        border: none !important;
        font-size: 11px;
        color: var(--color-text-secondary);
    }
}

/* Aliniat la app shell ≤1023px (înainte era 768px — tableta nu primea dashboard / module de mai jos) */
@media (max-width: 1023px) {
    body.dashboard-active.app-shell .content-center {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-left: 14px;
        padding-right: 14px;
        padding-top: 10px;
        /* Bate padding-ul generic body.app-shell .content-center (bottombar+22px) — fără dublare */
        padding-bottom: calc(var(--bottombar-height, 72px) + max(10px, env(safe-area-inset-bottom, 0px))) !important;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.dashboard-active.app-shell .content-center::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    body.dashboard-active.app-shell main#routerView.content-center {
        flex: 1 1 auto;
        min-height: 0;
    }

    body.dashboard-active.app-shell .content-center > .dashboard-page.dashboard-cropwise {
        flex: 1 1 auto;
        min-height: 0;
    }

    body.app-shell .dashboard-page.dashboard-cropwise {
        gap: 10px;
    }

    body.app-shell .dashboard-page.dashboard-cropwise > .dashboard-split {
        display: grid;
        flex: 1 1 auto;
        min-height: 0;
        gap: 14px;
        border: none;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    body.app-shell .dashboard-page.dashboard-cropwise .dashboard-map-pane,
    body.app-shell .dashboard-page.dashboard-cropwise .dashboard-right-rail {
        border: 1px solid var(--organic-border);
        border-radius: 16px;
        overflow: hidden;
        background: var(--organic-bg);
        box-shadow: 0 8px 22px rgba(32, 32, 32, 0.06);
    }

    /* Harta fermă pe telefon: fără colțuri rotunjite pe zona hărții */
    body.app-shell.harta-ferma-active .harta-ferma-with-rail .dashboard-map-pane {
        border-radius: 0 !important;
    }

    body.app-shell .dashboard-page.dashboard-cropwise .dashboard-right-rail {
        border-top: 1px solid var(--organic-border);
    }

    /* min-height hartă: definit mai sus în același fișier (primul @media ≤1023px) — nu rescrie cu 38vh */

    body.app-shell .dashboard-rail-header {
        padding: 14px 16px 12px;
        border-bottom: 1px solid var(--organic-border);
        background: var(--organic-bg);
    }

    body.app-shell .dashboard-rail-title {
        font-family: var(--font-organic-heading);
        font-size: 1.05rem;
        font-weight: 600;
        color: var(--organic-text);
    }

    body.app-shell .dashboard-rail-total {
        margin-top: 6px;
        font-size: 0.85rem;
        line-height: 1.45;
        color: var(--organic-muted);
    }

    body.app-shell .dashboard-rail-total-value {
        color: var(--organic-text);
        font-variant-numeric: tabular-nums;
    }

    body.app-shell .dashboard-rail-parcel-count {
        color: var(--organic-muted);
    }

    body.app-shell .dashboard-crops-table {
        font-size: 13px;
        border-collapse: collapse;
        border-spacing: 0;
    }

    body.app-shell .dashboard-crops-table thead th {
        background: var(--organic-bg);
        border-bottom: 1px solid var(--organic-border);
        border-left: none;
        border-right: none;
        color: var(--organic-text);
        font-family: var(--font-organic-heading);
        font-weight: 600;
        font-size: 11px;
        letter-spacing: 0.02em;
        text-transform: none;
        line-height: 1.35;
    }

    body.app-shell .dashboard-crops-table thead th.num {
        font-family: var(--font-organic-heading);
        color: var(--organic-muted);
        font-weight: 600;
    }

    body.app-shell .dashboard-crops-table tbody td {
        border-bottom: 1px solid var(--organic-border);
        border-left: none;
        border-right: none;
        vertical-align: middle;
        line-height: 1.45;
    }

    body.app-shell .dashboard-crops-table tbody td:not(.num) {
        font-family: var(--font-organic-body);
        color: var(--organic-text);
    }

    body.app-shell .dashboard-crops-table tbody td.num {
        font-family: var(--font-organic-body);
        font-variant-numeric: tabular-nums;
        color: var(--organic-text);
        font-weight: 600;
    }

    body.app-shell .dashboard-crop-row-all td {
        background: var(--organic-band);
        color: var(--organic-text);
        font-family: var(--font-organic-heading);
        font-weight: 600;
    }

    body.app-shell .dashboard-crop-row-all td.num {
        font-weight: 700;
    }

    body.app-shell .dashboard-crop-row.selected td {
        background: color-mix(in srgb, var(--organic-band) 45%, var(--organic-bg) 55%);
    }

    body.app-shell .dashboard-crop-swatch {
        width: 12px;
        height: 12px;
        border-radius: 4px;
        box-shadow: inset 0 0 0 1px rgba(26, 26, 24, 0.08);
    }

    body.app-shell .dashboard-crops-table thead th,
    body.app-shell .dashboard-crops-table tbody td {
        padding: 12px 12px;
    }

    body.app-shell .dashboard-crops-empty {
        font-family: var(--font-organic-body);
        color: var(--organic-muted);
    }

    body.app-shell .dashboard-module-content.module-content.dashboard-widgets-section {
        margin-top: 0;
        padding: 0;
        background: transparent;
        border: none;
    }

    body.app-shell .widgets-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        min-height: 0 !important;
        overflow: visible;
    }

    body.app-shell .widgets-grid .widget-card {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 16px 16px 18px;
        border-radius: 18px;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    }

    body.app-shell .widgets-grid .widget-card > .card .card-header {
        margin-bottom: 12px;
    }

    body.app-shell .widgets-grid .widget-card > .card .card-title {
        font-size: 15px;
    }

    body.app-shell main#routerView .widgets-grid .widget-card > .card,
    body.app-shell main#routerView .widgets-grid .widget-card > .stat-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    body.app-shell main#routerView .widgets-grid .widget-card > .card .card-header {
        margin-bottom: 10px;
        padding-bottom: 0;
    }

    body.app-shell main#routerView .widgets-grid .widget-card > .card .card-content {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    body.app-shell .widgets-grid .widget-card {
        background: var(--card) !important;
        border: 1px solid var(--border-strong) !important;
        box-shadow: var(--shadow-sm) !important;
        overflow: visible !important;
    }

    body.app-shell .widgets-grid .widget-card .card-content ul {
        padding-left: 18px;
        line-height: 1.7;
    }

    body.app-shell .widgets-grid .widget-card.widget-sm .stat-value {
        font-size: 24px;
    }

    body.app-shell .dashboard-quick-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    body.app-shell .widget-card[data-widget-type="quick_links"] .dashboard-quick-link-btn {
        min-height: var(--m-btn-height) !important;
        padding: var(--m-btn-pad-y) var(--m-btn-pad-x) !important;
        font-size: var(--m-btn-font) !important;
        width: 100%;
        justify-content: center;
    }

    body.app-shell .widget-card[data-widget-type="market"] .data-table th,
    body.app-shell .widget-card[data-widget-type="market"] .data-table td {
        padding: 7px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    body.app-shell .widget-card[data-widget-type="news_feed"] li {
        margin-bottom: 10px !important;
    }

    body.app-shell .widget-card[data-widget-type="weather_current"] .card-content > div,
    body.app-shell .widget-card[data-widget-type="gdd_widget"] .card-content > div {
        border-radius: 0;
        padding: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    body.app-shell .widgets-grid .dashboard-gdd-cell {
        background: transparent;
        border: none;
        padding: 4px 2px;
    }

    body.app-shell .widgets-grid .dashboard-quick-link-btn {
        background: color-mix(in srgb, var(--surface-2) 40%, var(--card) 60%) !important;
        border: 1px solid var(--border-strong) !important;
        color: var(--text) !important;
        box-shadow: none !important;
    }

    /* Dialog delogare: bottom sheet + butoane mari (UX telefon) */
    body.app-shell .logout-confirm-modal {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        padding: 0;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.app-shell .logout-confirm-modal__grip {
        display: block;
        width: 40px;
        height: 5px;
        border-radius: 999px;
        background: var(--color-border, var(--border));
        margin: 0 auto 6px;
        flex-shrink: 0;
        opacity: 0.85;
    }

    body.app-shell .logout-confirm-modal__panel {
        width: 100%;
        max-width: none;
        border-radius: 22px 22px 0 0;
        margin: 0;
        padding: 10px 20px 22px;
        border-bottom: none;
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22);
    }

    body.app-shell .logout-confirm-modal__title {
        font-size: 20px;
        text-align: center;
        margin-bottom: 8px;
    }

    body.app-shell .logout-confirm-modal__text {
        font-size: 15px;
        line-height: 1.55;
        text-align: center;
        margin-bottom: 22px;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    body.app-shell .logout-confirm-modal__actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    body.app-shell .logout-confirm-modal__actions .btn-secondary,
    body.app-shell .logout-confirm-modal__actions .btn-primary {
        width: 100%;
        min-height: 50px;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    /* Delogare = acțiune distructivă, clară pe ecran mic */
    body.app-shell .logout-confirm-modal__btn-ok.btn-primary {
        background: var(--color-error-red);
        color: #fff;
        border: none;
        box-shadow: none;
    }

    body.app-shell .logout-confirm-modal__btn-ok.btn-primary:hover,
    body.app-shell .logout-confirm-modal__btn-ok.btn-primary:active {
        background: var(--color-error-red);
        filter: brightness(1.07);
        transform: none;
        box-shadow: 0 2px 12px rgba(192, 57, 43, 0.35);
    }

    /* Depozit inputuri — rând butoane + card depozit + tabel lat */
    body.app-shell[data-router-module="inputs"] .module-content > div[style*="margin: 4px"] {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    body.app-shell[data-router-module="inputs"] .module-content > div[style*="margin: 4px"] .btn-secondary {
        width: 100%;
        justify-content: center;
        margin-left: 0 !important;
    }

    body.app-shell[data-router-module="inputs"] .module-content .card .card-content[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="inputs"] #warehouseSelect {
        min-width: 0 !important;
        width: 100%;
        max-width: none;
    }

    body.app-shell[data-router-module="inputs"] .module-content .card .card-content[style*="display:flex"] .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    body.app-shell[data-router-module="inputs"] .module-content .card > .card-content:has(> table.data-table) {
        overflow-x: visible;
    }

    /* Recepție / Expediere — toolbar + depozit + paginare */
    body.app-shell[data-router-module="inputs-reception"] .module-header,
    body.app-shell[data-router-module="inputs-dispatch"] .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="inputs-reception"] .module-header > div[style*="display:flex"],
    body.app-shell[data-router-module="inputs-dispatch"] .module-header > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="inputs-reception"] .module-header .form-group,
    body.app-shell[data-router-module="inputs-dispatch"] .module-header .form-group {
        width: 100%;
        max-width: none;
    }

    body.app-shell[data-router-module="inputs-reception"] #receiptSearchInput,
    body.app-shell[data-router-module="inputs-dispatch"] #dispatchSearchInput {
        min-width: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="inputs-reception"] .module-header .btn-primary,
    body.app-shell[data-router-module="inputs-reception"] .module-header .btn-secondary,
    body.app-shell[data-router-module="inputs-dispatch"] .module-header .btn-primary,
    body.app-shell[data-router-module="inputs-dispatch"] .module-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="inputs-reception"] .module-content .card .card-content[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="inputs-reception"] #receptionWarehouseSelect {
        min-width: 0 !important;
        width: 100%;
        max-width: none;
    }

    body.app-shell[data-router-module="inputs-reception"] .module-content .card .card-content[style*="display:flex"] .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    body.app-shell[data-router-module="inputs-reception"] .module-content .card > .card-content:has(> table.data-table) {
        overflow-x: visible;
    }

    body.app-shell[data-router-module="inputs-dispatch"] .module-content .card .card-content > div[style*="overflow:auto"] {
        overflow-x: visible !important;
        max-width: 100%;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="inputs-dispatch"] .module-content .card .card-content > div[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="inputs-reception"] .card-content > div[style*="justify-content:space-between"],
    body.app-shell[data-router-module="inputs-dispatch"] .card-content > div[style*="justify-content:space-between"] {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell[data-router-module="inputs-reception"] .card-content > div[style*="justify-content:space-between"] > div:last-child,
    body.app-shell[data-router-module="inputs-dispatch"] .card-content > div[style*="justify-content:space-between"] > div:last-child {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Recepție / Expediere — modal detaliu: rânduri articole mai compacte + scroll pe listă */
    body.app-shell #receiptViewModal .modal-body > .card > .card-content,
    body.app-shell #dispatchViewModal .modal-body > .card > .card-content {
        max-height: min(42vh, 320px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    body.app-shell #receiptViewModal .data-table th,
    body.app-shell #receiptViewModal .data-table td,
    body.app-shell #dispatchViewModal .data-table th,
    body.app-shell #dispatchViewModal .data-table td {
        padding: 5px 7px;
        font-size: 12px;
        line-height: 1.3;
    }

    body.app-shell #receiptViewModal .data-table thead th,
    body.app-shell #dispatchViewModal .data-table thead th {
        font-size: 11px;
    }

    /* Analiză fermă — tabele financiare: scroll orizontal, fără rupere pe caractere la cifre/cuvinte */
    body.app-shell[data-router-module="analiza-ferma"] main#routerView .card-content,
    body.app-shell[data-router-module="analiza-ferma"] main#routerView div[style*="overflow:auto"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell[data-router-module="analiza-ferma"] main#routerView .af-crop-detail {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table {
        width: auto !important;
        min-width: 600px !important;
        max-width: none !important;
        table-layout: auto !important;
    }

    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table[style*="min-width:1100px"] {
        min-width: 1100px !important;
    }

    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table th,
    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table td {
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none !important;
    }

    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table th:first-child,
    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table td:first-child {
        white-space: normal !important;
        overflow-wrap: break-word !important;
        max-width: min(48vw, 220px);
    }

    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table th[style*="text-align:right"],
    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table td[style*="text-align:right"],
    body.app-shell[data-router-module="analiza-ferma"] main#routerView table.data-table tfoot td:not(:first-child) {
        white-space: nowrap !important;
    }

    /* Vreme — hero mai compact, scrollbar ascuns pe tabel tendințe */
    body.app-shell .weather-module .weather-hero {
        padding: 16px 14px;
    }

    body.app-shell .weather-module .weather-temp-value {
        font-size: clamp(2rem, 12vw, 4.25rem);
        letter-spacing: -0.02em;
    }

    body.app-shell .weather-module .weather-icon-large {
        font-size: clamp(2.5rem, 14vw, 4.5rem);
    }

    body.app-shell .weather-module .weather-condition {
        font-size: clamp(1rem, 4vw, 1.35rem);
    }

    body.app-shell .weather-module .weather-trends-table-scroll {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell .weather-module .weather-trends-table-scroll::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Vreme — antet cu picker pe coloană */
    body.app-shell[data-router-module="weather"] .weather-module > .module-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="weather"] .weather-module > .module-header > div:last-child {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    body.app-shell[data-router-module="weather"] #weatherDatePicker {
        width: 100% !important;
        max-width: none;
        box-sizing: border-box;
    }

    /* Costuri & venituri */
    body.app-shell[data-router-module="costs"] .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="costs"] .module-header > div {
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="costs"] .module-header .btn-primary,
    body.app-shell[data-router-module="costs"] .module-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="costs"] .card-header[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="costs"] .card-header[style*="display:flex"] > div[style*="display:flex"] {
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="costs"] .card-header .form-input,
    body.app-shell[data-router-module="costs"] .card-header .form-select {
        width: 100% !important;
        max-width: none;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="costs"] .card-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="costs"] .card > .card-content[style*="overflow:auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="costs"] .card > .card-content[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Arendă */
    body.app-shell[data-router-module="rent"] .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="rent"] .module-header .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="rent"] .card > .card-content[style*="overflow:auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="rent"] .card > .card-content[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Bilanț economic / energetic */
    body.app-shell[data-router-module="bilant-economic"] .module-header,
    body.app-shell[data-router-module="bilant-energetic"] .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="bilant-economic"] .module-header > div,
    body.app-shell[data-router-module="bilant-energetic"] .module-header > div {
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="bilant-economic"] .module-header .btn-secondary,
    body.app-shell[data-router-module="bilant-economic"] .module-header .btn-primary,
    body.app-shell[data-router-module="bilant-energetic"] .module-header .btn-secondary,
    body.app-shell[data-router-module="bilant-energetic"] .module-header .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="bilant-economic"] .card-content > div[style*="overflow:auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="bilant-economic"] .card-content > div[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="bilant-economic"] .card-footer[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="bilant-economic"] .card-footer .btn-primary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="bilant-energetic"] .card-content .btn-secondary,
    body.app-shell[data-router-module="bilant-energetic"] .card-content .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="bilant-energetic"] .module-content > .card .card-content {
        overflow-x: visible;
    }

    body.app-shell[data-router-module="bilant-energetic"] .card-header[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="bilant-energetic"] .card-header[style*="display:flex"] .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="bilant-energetic"] .card-footer[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="bilant-energetic"] .card-footer .btn-primary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    /* Culturi agricole */
    body.app-shell[data-router-module="crops"] .crops-container > .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="crops"] .crops-container > .module-header > div {
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="crops"] .crops-container > .module-header .btn-primary,
    body.app-shell[data-router-module="crops"] .crops-container > .module-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="crops"] .crops-container .card-header[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="crops"] .crops-container .card-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Economie */
    body.app-shell[data-router-module="economy"] .economy-container > .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="economy"] .economy-container > .module-header .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="economy"] .economy-container .card > .card-content:has(> table.data-table) {
        overflow-x: visible;
    }

    /* Observații */
    body.app-shell[data-router-module="observations"] .observations-container > .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="observations"] .observations-container > .module-header > div {
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="observations"] .observations-container > .module-header .btn-primary,
    body.app-shell[data-router-module="observations"] .observations-container > .module-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="observations"] .observations-container .card .card-content > div[style*="display: flex"],
    body.app-shell[data-router-module="observations"] .observations-container .card .card-content > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="observations"] .observations-container .card .card-content .form-input,
    body.app-shell[data-router-module="observations"] .observations-container .card .card-content .form-select {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    /* Rapoarte — grilă un singur rând pe lățime */
    body.app-shell[data-router-module="reports"] .reports-container .card-content > div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        padding: 12px !important;
    }

    body.app-shell[data-router-module="reports"] .reports-container .card-content .btn-primary {
        width: 100%;
        min-height: 46px;
        justify-content: center;
    }

    /* Fișe tehnologice (hub) */
    body.app-shell[data-router-module="fise-tehnologice"] .card-content > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="fise-tehnologice"] .card-content .btn-primary,
    body.app-shell[data-router-module="fise-tehnologice"] .card-content .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="fise-tehnologice"] #techSheetsListHost > div[style*="justify-content:space-between"] {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    body.app-shell[data-router-module="fise-tehnologice"] #techSheetsListHost .btn-sm {
        width: 100%;
        min-height: 42px;
        justify-content: center;
    }

    /* Fișă tehnologică — vizualizare / creare */
    body.app-shell[data-router-module="tech-sheet-view"] .module-header,
    body.app-shell[data-router-module="tech-sheet-create"] .module-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="tech-sheet-view"] .module-header > div[style*="margin-left:auto"],
    body.app-shell[data-router-module="tech-sheet-create"] .module-header > div[style*="margin-left:auto"] {
        margin-left: 0 !important;
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="tech-sheet-view"] .module-header .btn-primary,
    body.app-shell[data-router-module="tech-sheet-view"] .module-header .btn-secondary,
    body.app-shell[data-router-module="tech-sheet-view"] .module-header .btn-outline-danger,
    body.app-shell[data-router-module="tech-sheet-create"] .module-header .btn-primary,
    body.app-shell[data-router-module="tech-sheet-create"] .module-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="tech-sheet-create"] .module-content > .card:first-of-type .card-content > div[style*="flex-wrap:wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="tech-sheet-create"] .module-content > .card:first-of-type .form-select#tsCrop,
    body.app-shell[data-router-module="tech-sheet-create"] .module-content > .card:first-of-type .form-select#tsSeason {
        width: 100%;
        min-width: 0 !important;
    }

    body.app-shell[data-router-module="tech-sheet-create"] .card-header[style*="flex-wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="tech-sheet-create"] .card-header[style*="flex-wrap"] > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    body.app-shell[data-router-module="tech-sheet-create"] .card-header .form-input#tsAreaForCost {
        width: 100% !important;
        max-width: none;
    }

    body.app-shell[data-router-module="tech-sheet-view"] .card > .card-content[style*="overflow:auto"],
    body.app-shell[data-router-module="tech-sheet-create"] .card > .card-content[style*="overflow:auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="tech-sheet-view"] .card > .card-content[style*="overflow:auto"]::-webkit-scrollbar,
    body.app-shell[data-router-module="tech-sheet-create"] .card > .card-content[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Calendar — rând dată (de la / până la) pe coloană */
    body.app-shell[data-router-module="calendar"] .calendar-filters > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px;
        width: 100%;
    }

    body.app-shell[data-router-module="calendar"] .calendar-filters > div[style*="display:flex"] .form-input[type="date"] {
        width: 100%;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="calendar"] .calendar-filters > div[style*="display:flex"] .btn-secondary.btn-sm {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    /*
     * Calendar timeline: pe lățimi ~320–430px grila 320px + 1fr rupe layout-ul (bandă goală, dublu scroll,
     * buton restrângere la left:286px în afara ecranului). Stivuim lista parcele deasupra benzii Gantt.
     */
    body.app-shell[data-router-module="calendar"] .calendar-module-content .calendar-content {
        min-height: 0;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        min-height: 0 !important;
        gap: 12px !important;
    }

    /*
     * Calendar mobil: bară dedicată — listă parcele | ◀ an ▶ (aceleași acțiuni ca pe desktop).
     * Pe desktop markup-ul rămâne neschimbat (butoane absolute în header).
     */
    body.app-shell[data-router-module="calendar"] .tl-mobile-calendar-nav {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        margin: 0 0 10px;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--organic-bg, var(--color-bg-table));
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 20;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell[data-router-module="calendar"] .tl-mobile-cal-nav__collapse {
        flex-shrink: 0;
        width: 52px;
        min-width: 52px;
        min-height: 52px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-size: 1.1rem;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--organic-bg-elevated, var(--color-bg-secondary));
        color: var(--organic-text, var(--color-text-primary));
        cursor: pointer;
    }

    body.app-shell[data-router-module="calendar"] .tl-mobile-cal-nav__collapse:active {
        transform: scale(0.97);
        opacity: 0.92;
    }

    body.app-shell[data-router-module="calendar"] .tl-mobile-cal-nav__year-block {
        flex: 1 1 auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 0;
        padding: 2px 4px;
        border-radius: 12px;
        background: color-mix(in srgb, var(--organic-bg, var(--color-bg-primary)) 88%, var(--color-accent-green, #436106) 12%);
        border: 1px solid color-mix(in srgb, var(--organic-border, var(--color-border)) 80%, var(--color-accent-green, #436106) 20%);
    }

    body.app-shell[data-router-module="calendar"] .tl-mobile-cal-nav__year {
        flex: 0 1 auto;
        min-width: 4.5rem;
        text-align: center;
        font-size: 1.35rem;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
        letter-spacing: -0.02em;
        color: var(--organic-text, var(--color-text-primary));
        line-height: 1.2;
        padding: 0 6px;
    }

    body.app-shell[data-router-module="calendar"] .tl-mobile-cal-nav__arrow {
        flex-shrink: 0;
        width: 52px;
        min-width: 52px;
        min-height: 52px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-size: 1.35rem;
        line-height: 1;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--organic-bg-elevated, var(--color-bg-secondary));
        color: var(--organic-text, var(--color-text-primary));
        cursor: pointer;
    }

    body.app-shell[data-router-module="calendar"] .tl-mobile-cal-nav__arrow:active {
        transform: scale(0.96);
        opacity: 0.9;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap > aside {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: min(48vh, 380px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap aside #tlSearch {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap aside > div[style*="display:flex"] {
        min-width: 0;
    }

    body.app-shell[data-router-module="calendar"] #tlWrap > .timeline-container {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto;
        min-height: 240px;
    }

    body.app-shell[data-router-module="calendar"] .timeline-row-header {
        width: min(200px, 38vw) !important;
        min-width: 0;
        padding: 8px !important;
        font-size: 12px;
    }

    /*
     * Calendar app-shell: grilă lună + agendă (.cal-mo-*).
     * Doar în acest media query (≤1023px) — desktop ≥1024 nu încarcă aceste reguli.
     */
    body.app-shell[data-router-module="calendar"] .cal-mo-root {
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding-bottom: 8px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-nav {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-nav-arrow {
        flex-shrink: 0;
        width: 48px;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-nav-center {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 6px;
        border-radius: 12px;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--organic-bg, var(--color-bg-primary));
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-month-label {
        font-size: 1.15rem;
        font-weight: 800;
        font-family: var(--font-title);
        text-align: center;
        line-height: 1.2;
        color: var(--organic-text, var(--color-text-primary));
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-year-ctl {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-year-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-year-btn i {
        pointer-events: none;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-year-num {
        font-variant-numeric: tabular-nums;
        font-weight: 700;
        min-width: 3.5rem;
        text-align: center;
        color: var(--text-muted, var(--color-text-secondary));
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-grid-wrap {
        border-radius: 16px;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--surface, var(--color-card-bg));
        padding: 10px 8px 12px;
        overflow: hidden;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-weekdays {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        margin-bottom: 6px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-wd {
        text-align: center;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted, var(--color-text-secondary));
        padding: 4px 0;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-cell--pad {
        min-height: 0;
        pointer-events: none;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-day {
        position: relative;
        aspect-ratio: 1;
        max-height: 56px;
        margin: 0;
        padding: 0;
        border: 1px solid transparent;
        border-radius: 12px;
        background: var(--surface-2, color-mix(in srgb, var(--color-bg-table) 88%, transparent));
        color: var(--organic-text, var(--color-text-primary));
        font-size: 15px;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-day--today {
        border-color: var(--accent, var(--color-accent-green, #436106));
        box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent, var(--color-accent-green)) 35%, transparent);
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-day--selected {
        background: color-mix(in srgb, var(--accent, var(--color-accent-green)) 22%, var(--surface, var(--color-card-bg)));
        border-color: var(--accent, var(--color-accent-green));
        color: var(--organic-text, var(--color-text-primary));
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-day-num {
        line-height: 1;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-badge {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 999px;
        font-size: 10px;
        font-weight: 800;
        line-height: 18px;
        text-align: center;
        background: var(--accent, var(--color-accent-green));
        color: #fff;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda {
        border-radius: 16px;
        border: 1px solid var(--organic-border, var(--color-border));
        background: var(--surface, var(--color-card-bg));
        padding: 14px 12px 16px;
        min-width: 0;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-head {
        margin: 0 0 12px;
        font-size: 1rem;
        font-weight: 700;
        font-family: var(--font-title);
        color: var(--organic-text, var(--color-text-primary));
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-item {
        width: 100%;
        text-align: left;
        padding: 12px 14px;
        border-radius: 12px;
        border: 1px solid var(--organic-border, var(--color-border));
        border-left-width: 4px;
        border-left-color: var(--cal-mo-accent, var(--accent, var(--color-accent-green)));
        background: var(--surface-2, var(--color-bg-table));
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        font-family: var(--font-body);
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-item:active {
        opacity: 0.92;
        transform: scale(0.99);
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--organic-text, var(--color-text-primary));
        line-height: 1.3;
        word-break: break-word;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-meta {
        font-size: 13px;
        color: var(--text-muted, var(--color-text-secondary));
        line-height: 1.35;
        word-break: break-word;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-empty {
        text-align: center;
        padding: 28px 16px;
        color: var(--text-muted, var(--color-text-secondary));
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-empty i {
        font-size: 2rem;
        opacity: 0.35;
        margin-bottom: 8px;
        display: block;
    }

    body.app-shell[data-router-module="calendar"] .cal-mo-agenda-empty p {
        margin: 0;
        font-size: 14px;
    }

    /* Modale globale (#modalContainer): corp scroll + zone late (Calendar, fișe, RO e-Factura) */
    body.app-shell #modalContainer .modal-overlay .modal-body[style*="overflow:auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell #modalContainer .modal-overlay .modal-body[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell #modalContainer .modal-overlay div[style*="overflow:auto"][style*="max-height"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell #modalContainer .modal-overlay div[style*="overflow:auto"][style*="max-height"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Editează lucrare — modal „Adaugă parcele”: hartă încape în viewport */
    body.app-shell #weParcelPickMapWrap {
        height: min(360px, 52vh) !important;
        min-height: 220px !important;
    }

    /* Animale — antet + tabel listă */
    body.app-shell[data-router-module="animals"] .animals-container > .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="animals"] .animals-container > .module-header > div {
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="animals"] .animals-container > .module-header .btn-primary,
    body.app-shell[data-router-module="animals"] .animals-container > .module-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="animals"] .animals-container .card > .card-content:has(> table) {
        overflow-x: visible;
    }

    /* Efective animale */
    body.app-shell[data-router-module="animals-efective"] .efective-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="animals-efective"] .efective-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="animals-efective"] .efective-actions .btn-primary,
    body.app-shell[data-router-module="animals-efective"] .efective-actions .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="animals-efective"] .efective-container .table-wrapper {
        overflow-x: visible;
    }

    /* Infrastructură */
    body.app-shell[data-router-module="infrastructure"] .infrastructure-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="infrastructure"] .infrastructure-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="infrastructure"] .infrastructure-actions .btn-primary,
    body.app-shell[data-router-module="infrastructure"] .infrastructure-actions .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="infrastructure"] .infrastructure-actions .toggle-switch-container {
        width: 100%;
    }

    body.app-shell[data-router-module="infrastructure"] .infrastructure-container .table-wrapper {
        overflow-x: visible;
    }

    /* Întreținere utilaje */
    body.app-shell[data-router-module="utilaje-intretinere"] .intretinere-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .intretinere-header .header-actions {
        margin-left: 0 !important;
        flex-direction: column !important;
        width: 100%;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .intretinere-header .form-select#yearSelectMaint {
        width: 100%;
        min-width: 0 !important;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .maint-view-toggle {
        width: 100%;
        display: flex !important;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .maint-view-toggle .btn-secondary {
        flex: 1;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .intretinere-header .btn-primary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .maint-tabs {
        flex-direction: column !important;
        gap: 8px !important;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] .maint-tabs .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="utilaje-intretinere"] #maintListHost.table-wrapper {
        overflow-x: visible;
    }

    /* Flotă utilaje */
    body.app-shell[data-router-module="utilaje-flota"] .equipment-telematica-container .telematica-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="utilaje-flota"] .equipment-telematica-container .telematica-actions > .btn-primary,
    body.app-shell[data-router-module="utilaje-flota"] .equipment-telematica-container .telematica-actions > .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell[data-router-module="utilaje-flota"] .equipment-telematica-container .telematica-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Echipamente (atașamente) */
    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container .forza-stats-overview {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container .forza-stat-overview-card {
        width: 100%;
    }

    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container > div[style*="gap:8px"][style*="flex-wrap:wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container > div[style*="gap:8px"][style*="flex-wrap:wrap"] > div[style*="flex:1"] {
        display: none !important;
    }

    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container #btnAddImpl,
    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container #btnExportImpl {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="echipamente"] .equipment-telematica-container .search-box {
        max-width: none !important;
        width: 100%;
    }

    /* Hartă animale — hartă deasupra, panou status dedesubt */
    body.app-shell[data-router-module="animals-harta"] .animals-harta-full {
        left: 0 !important;
        flex-direction: column !important;
    }

    body.app-shell[data-router-module="animals-harta"] .map-container-animals {
        flex: 1 1 auto;
        min-height: min(48vh, 420px);
    }

    body.app-shell[data-router-module="animals-harta"] .animals-status-panel {
        width: 100% !important;
        max-width: none;
        max-height: min(42vh, 360px);
        border-left: none;
        border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
    }

    body.app-shell[data-router-module="animals-harta"] .animals-status-panel .panel-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="animals-harta"] .animals-status-panel .panel-content::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Plan pășunat (Gantt2) */
    body.app-shell[data-router-module="animals-plan"] .gantt2-layout {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.app-shell[data-router-module="animals-plan"] .gantt2-sidebar {
        height: auto !important;
        max-height: min(46vh, 420px);
    }

    body.app-shell[data-router-module="animals-plan"] .gantt2-main > div[style*="justify-content:space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="animals-plan"] .gantt2-main #yearSelectGantt {
        width: 100%;
        min-width: 0 !important;
    }

    body.app-shell[data-router-module="animals-plan"] .timeline-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px;
    }

    body.app-shell[data-router-module="animals-plan"] .timeline-row-header {
        width: 100%;
    }

    body.app-shell[data-router-module="animals-plan"] .timeline-months {
        width: 100%;
        min-width: 0;
    }

    /* Plan pășunat (modul simplu legacy, dacă e încărcat) */
    body.app-shell[data-router-module="animals-plan"] .plan-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="animals-plan"] .plan-header-right {
        flex-direction: column !important;
        width: 100%;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="animals-plan"] .plan-header-right .form-select,
    body.app-shell[data-router-module="animals-plan"] .plan-header-right .btn-primary,
    body.app-shell[data-router-module="animals-plan"] .plan-header-right .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="animals-plan"] .gantt-container .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="animals-plan"] .gantt-container .table-wrapper::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="animals-plan"] .plan-stats {
        flex-direction: column !important;
        gap: 10px;
    }

    /* Cover Crop Mix — wizard mobil */
    body.app-shell[data-router-module="cover-crop-mix"] .ccm-wizard {
        padding: 16px var(--page-pad-x, 16px);
        padding-bottom: max(24px, calc(16px + env(safe-area-inset-bottom, 0px)));
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-header .btn,
    body.app-shell[data-router-module="cover-crop-mix"] .ccm-header .btn-outline {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-progress-bar {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 14px 12px;
        margin-bottom: 20px;
        gap: 0;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-progress-bar::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-progress-bar .ccm-step {
        flex-shrink: 0;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-progress-bar .ccm-step-connector {
        flex-shrink: 0;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-nav-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-nav-buttons .ccm-nav-spacer {
        display: none;
    }

    body.app-shell[data-router-module="cover-crop-mix"] .ccm-nav-buttons .btn-secondary,
    body.app-shell[data-router-module="cover-crop-mix"] .ccm-nav-buttons .btn-primary,
    body.app-shell[data-router-module="cover-crop-mix"] .ccm-nav-buttons .btn,
    body.app-shell[data-router-module="cover-crop-mix"] .ccm-nav-buttons .btn-export-pdf {
        width: 100%;
        min-height: 46px;
        justify-content: center;
        box-sizing: border-box;
    }

    /* Conveier Verde — toolbar + scroll orizontal timeline */
    body.app-shell[data-router-module="conveier-verde"] .cv-container {
        padding: 16px var(--page-pad-x, 16px);
        padding-bottom: max(20px, calc(12px + env(safe-area-inset-bottom, 0px)));
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-edit-toggle {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-edit-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-filters-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-filter {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-filter-select {
        width: 100%;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-species-filter-btn {
        width: 100%;
        justify-content: space-between;
        min-height: 44px;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-toggles {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-toggle-label {
        width: 100%;
        justify-content: space-between;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-content::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="conveier-verde"] .cv-timeline {
        min-width: 720px;
    }

    /* Calculator carbon */
    body.app-shell[data-router-module="carbon"] .carbon-container .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="carbon"] .carbon-container .module-header .btn-primary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="carbon"] .carbon-container .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Calculator mix acoperire (legacy cover-mix) */
    body.app-shell[data-router-module="cover-mix"] .cover-mix-container > .grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row select,
    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row input[type="text"],
    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row input[type="number"],
    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row input[type="date"] {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row input[style*="flex:1"] {
        flex: none !important;
        width: 100% !important;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row .btn-primary,
    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .form-row .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .checkbox-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.app-shell[data-router-module="cover-mix"] .cover-mix-container .table-responsive {
        overflow-x: visible;
    }

    /* Detaliu cultură: rezumat + timeline derulabil fără bară vizibilă */
    body.app-shell[data-router-module="crop-detail"] .crop-detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="crop-detail"] .crop-detail-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.app-shell[data-router-module="crop-detail"] .crop-timeline-horizontal-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="crop-detail"] .crop-timeline-horizontal-wrap::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="crop-detail"] .crop-ht-svg-wrap {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="crop-detail"] .crop-ht-svg-wrap::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Suplimentar: carduri pe o coloană, fără ridicare la hover */
    body.app-shell[data-router-module="suplimentar"] .suplimentar-cards {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-left: var(--page-pad-x, 16px);
        padding-right: var(--page-pad-x, 16px);
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="suplimentar"] .suplimentar-container {
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="suplimentar"] .suplimentar-card:hover {
        transform: none;
    }

    /* Radar precipitații: pagină doar cu hartă — înălțime minimă când .sat-page e coloană */
    body.app-shell.sat-full .sat-page.wr-radar-page {
        flex: 1 1 auto;
        min-height: min(72vh, 620px);
        position: relative;
    }

    body.app-shell.sat-full .sat-page.wr-radar-page .wr-radar-mount {
        min-height: min(72vh, 620px);
    }

    /* Detaliu utilaj / echipament / personal — .ud-layout (în main.css coloană doar la ≤768px) */
    body.app-shell .ud-layout {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.app-shell .ud-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        flex-shrink: 0;
    }

    body.app-shell .ud-sidebar-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px 14px 12px;
        position: relative;
    }

    body.app-shell .ud-back-btn {
        position: static;
        align-self: flex-start;
        margin: 0 0 12px 0;
        min-height: 44px;
        padding: 8px 14px;
        box-sizing: border-box;
    }

    body.app-shell .ud-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding: 8px 10px;
        gap: 4px;
        flex: 0 0 auto;
        border-top: 1px solid var(--color-border);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell .ud-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell .ud-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 10px 14px;
        min-height: 44px;
        box-sizing: border-box;
        align-items: center;
    }

    body.app-shell .ud-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--color-accent-green);
    }

    body.app-shell .ud-content {
        flex: 1 1 auto;
        min-width: 0;
        padding: 14px var(--page-pad-x, 16px) max(20px, calc(12px + env(safe-area-inset-bottom, 0px)));
        overflow-x: hidden;
    }

    body.app-shell .ud-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.app-shell .ud-section-header .btn-secondary,
    body.app-shell .ud-section-header .btn-primary,
    body.app-shell .ud-section-header .btn-sm {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell .ud-dash-grid {
        grid-template-columns: 1fr;
    }

    body.app-shell .ud-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /*
     * Detaliu utilaj — tablou de bord: hartă mai înaltă pe telefon (header utilaj + tabs + top/bottom bar).
     * Înlocuiește 320px fix din main.css cu înălțime derivată din viewport.
     */
    body.app-shell[data-router-module="utilaj-detail"] .ud-dash-map {
        height: calc(
            100dvh - var(--topbar-height, 58px) - var(--bottombar-height, 72px) -
            env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 210px
        ) !important;
        min-height: 300px;
        margin-bottom: 12px;
    }

    body.app-shell .ud-content .card > .card-content {
        overflow-x: visible;
    }

    body.app-shell #editPersonnelModal .modal-body div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Lista personal — un card pe coloană */
    body.app-shell[data-router-module="personal-lista"] .fleet-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body.app-shell[data-router-module="personal-lista"] .forza-card:hover {
        transform: none;
    }

    body.app-shell[data-router-module="personal-lista"] .forza-group-header {
        grid-column: 1 / -1;
    }

    /* Personal detaliu — utilaje asociate: Phase 3 altfel comprimă coloanele (conținut „împins” la dreapta) */
    body.app-shell[data-router-module="personal-detail"] main#routerView .ud-content .card .card-content[style*="overflow:auto"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table {
        width: auto !important;
        min-width: 520px !important;
        max-width: none !important;
        table-layout: auto !important;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table th,
    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table td {
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: manual !important;
        vertical-align: middle;
        text-align: left !important;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table th:nth-child(3),
    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table th:nth-child(4),
    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table td:nth-child(3),
    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table td:nth-child(4) {
        text-align: center !important;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView table.pe-equip-table tbody tr {
        min-height: 0;
    }

    /* Personal detaliu — informații: rânduri stivuite (aceleași câmpuri ca tabelul desktop) */
    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-info-stack {
        padding: 4px 14px 12px;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-info-row-m {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 12px 0;
        border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-info-row-m:last-child {
        border-bottom: none;
        padding-bottom: 4px;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-info-row-m__label {
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--color-text-secondary, var(--text-muted, #64748b));
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-info-row-m__value {
        font-size: 1rem;
        line-height: 1.4;
        word-break: break-word;
    }

    /* Personal detaliu — utilaje: carduri în loc de tabel orizontal */
    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 0 0 4px;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-card {
        border: 1px solid var(--color-border);
        border-radius: 14px;
        padding: 14px;
        background: var(--color-card-bg, var(--color-bg-primary));
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-card__title {
        font-weight: 700;
        font-size: 1.05rem;
        line-height: 1.25;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-card__meta {
        font-size: 0.9rem;
        color: var(--color-text-secondary);
        margin-top: 2px;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-card__default {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
        cursor: pointer;
        user-select: none;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-card__default input {
        width: 1.15rem;
        height: 1.15rem;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-equip-card__unlink {
        align-self: flex-start;
        min-height: 44px;
    }

    /* Salarii: grilă mai densă pe lățimi mici */
    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-salary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.app-shell[data-router-module="personal-detail"] main#routerView .pe-salary-cell {
        min-height: 0;
        padding: 10px 8px;
    }

    /* Setări — Salvează și rânduri formular pe coloană de la tabletă */
    body.app-shell[data-router-module="settings"] .settings-page-v3 .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.app-shell[data-router-module="settings"] .settings-page-v3 .module-header .module-actions {
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        justify-content: stretch;
    }

    body.app-shell[data-router-module="settings"] .settings-page-v3 .module-header .module-actions .btn-primary {
        width: 100%;
        min-height: 46px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="settings"] .settings-page-v3 .form-row-2 {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="settings"] .settings-page-v3 .settings-form-v3 {
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    /* Hartă animale — ținte tactilă + panou straturi încadrat */
    body.app-shell[data-router-module="animals-harta"] .map-controls .map-btn {
        min-width: 44px;
        min-height: 44px;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="animals-harta"] .map-container-animals .layers-panel:not(.hidden) {
        left: 8px;
        right: 8px;
        width: auto;
        min-width: 0;
        max-height: min(46vh, 320px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Inventar: detaliu produs — antet și tabele */
    body.app-shell[data-router-module="fertilizer-detail"] .module-content > .module-header,
    body.app-shell[data-router-module="fertilizer-type-detail"] .module-content > .module-header,
    body.app-shell[data-router-module="pesticide-detail"] .module-content > .module-header,
    body.app-shell[data-router-module="product-detail"] .module-content > .module-header,
    body.app-shell[data-router-module="seed-detail"] .module-content > .module-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="fertilizer-detail"] .module-content > .module-header .btn-secondary,
    body.app-shell[data-router-module="fertilizer-detail"] .module-content > .module-header .btn-primary,
    body.app-shell[data-router-module="fertilizer-type-detail"] .module-content > .module-header .btn-secondary,
    body.app-shell[data-router-module="fertilizer-type-detail"] .module-content > .module-header .btn-primary,
    body.app-shell[data-router-module="pesticide-detail"] .module-content > .module-header .btn-secondary,
    body.app-shell[data-router-module="pesticide-detail"] .module-content > .module-header .btn-primary,
    body.app-shell[data-router-module="product-detail"] .module-content > .module-header .btn-secondary,
    body.app-shell[data-router-module="product-detail"] .module-content > .module-header .btn-primary,
    body.app-shell[data-router-module="seed-detail"] .module-content > .module-header .btn-secondary,
    body.app-shell[data-router-module="seed-detail"] .module-content > .module-header .btn-primary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="fertilizer-detail"] .module-content > .module-header h1,
    body.app-shell[data-router-module="fertilizer-type-detail"] .module-content > .module-header h1,
    body.app-shell[data-router-module="pesticide-detail"] .module-content > .module-header h1,
    body.app-shell[data-router-module="product-detail"] .module-content > .module-header h1,
    body.app-shell[data-router-module="seed-detail"] .module-content > .module-header h1 {
        flex: none !important;
        width: 100%;
        min-width: 0;
        font-size: clamp(1.05rem, 4vw, 1.35rem);
    }

    body.app-shell[data-router-module="fertilizer-detail"] .module-content .card .card-content[style*="overflow"],
    body.app-shell[data-router-module="fertilizer-type-detail"] .module-content .card .card-content[style*="overflow"],
    body.app-shell[data-router-module="pesticide-detail"] .module-content .card .card-content[style*="overflow"],
    body.app-shell[data-router-module="product-detail"] .module-content .card .card-content[style*="overflow"],
    body.app-shell[data-router-module="seed-detail"] .module-content .card .card-content[style*="overflow"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="fertilizer-detail"] .module-content .card .card-content[style*="overflow"]::-webkit-scrollbar,
    body.app-shell[data-router-module="fertilizer-type-detail"] .module-content .card .card-content[style*="overflow"]::-webkit-scrollbar,
    body.app-shell[data-router-module="pesticide-detail"] .module-content .card .card-content[style*="overflow"]::-webkit-scrollbar,
    body.app-shell[data-router-module="product-detail"] .module-content .card .card-content[style*="overflow"]::-webkit-scrollbar,
    body.app-shell[data-router-module="seed-detail"] .module-content .card .card-content[style*="overflow"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Configurări costuri / inventar (inputs-config, costs-config) */
    body.app-shell[data-router-module="inputs-config"] .inputs-config-split,
    body.app-shell[data-router-module="costs-config"] .inputs-config-split {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        grid-template-columns: unset !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-config-split > .card[style*="height:100%"],
    body.app-shell[data-router-module="costs-config"] .inputs-config-split > .card[style*="height:100%"] {
        height: auto !important;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-groups-list,
    body.app-shell[data-router-module="costs-config"] .inputs-groups-list {
        max-height: min(40vh, 300px) !important;
    }

    body.app-shell[data-router-module="inputs-config"] .costs-config-tab-bar,
    body.app-shell[data-router-module="costs-config"] .costs-config-tab-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        gap: 8px;
        margin-bottom: 12px !important;
        padding-bottom: 6px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="inputs-config"] .costs-config-tab-bar::-webkit-scrollbar,
    body.app-shell[data-router-module="costs-config"] .costs-config-tab-bar::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.app-shell[data-router-module="inputs-config"] .costs-config-tab-bar .btn-secondary,
    body.app-shell[data-router-module="costs-config"] .costs-config-tab-bar .btn-secondary {
        flex: 0 0 auto;
        min-height: 44px;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-config-split .card .card-header,
    body.app-shell[data-router-module="costs-config"] .inputs-config-split .card .card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-config-split .card .card-header div[style*="display:flex"],
    body.app-shell[data-router-module="costs-config"] .inputs-config-split .card .card-header div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-config-split .card .card-header div[style*="display:flex"] .btn-secondary,
    body.app-shell[data-router-module="costs-config"] .inputs-config-split .card .card-header div[style*="display:flex"] .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-inv-search-row,
    body.app-shell[data-router-module="costs-config"] .inputs-inv-search-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell[data-router-module="inputs-config"] .inputs-inv-search-row .form-input,
    body.app-shell[data-router-module="costs-config"] .inputs-inv-search-row .form-input {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="costs-config"] main#routerView .inputs-config-split > .card:last-child .card-content table.data-table {
        min-width: 0 !important;
        width: 100%;
        table-layout: fixed;
    }

    /* Inventar: #routerView în selector bate Phase 3 (main#routerView table.data-table), altfel rămâne fixed + min-width 0 */
    body.app-shell[data-router-module="inputs-config"] main#routerView .inputs-config-split > .card:last-child .card-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.app-shell[data-router-module="inputs-config"] main#routerView .inputs-config-split > .card:last-child .card-content table.inputs-inv-table {
        width: auto !important;
        min-width: 920px !important;
        max-width: none !important;
        table-layout: auto !important;
    }

    body.app-shell[data-router-module="inputs-config"] main#routerView .inputs-config-split > .card:last-child .card-content table.inputs-inv-table th,
    body.app-shell[data-router-module="inputs-config"] main#routerView .inputs-config-split > .card:last-child .card-content table.inputs-inv-table td {
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: manual !important;
        vertical-align: top;
    }

    body.app-shell[data-router-module="inputs-config"] main#routerView table.inputs-inv-table .product-chip {
        margin-top: 3px !important;
        margin-bottom: 3px !important;
    }

    body.app-shell[data-router-module="inputs-config"] main#routerView table.inputs-inv-table td div:has(.inputs-min-threshold-input) {
        margin-top: 2px !important;
        margin-bottom: 2px !important;
    }

    body.app-shell[data-router-module="inputs-config"] main#routerView table.inputs-inv-table .inputs-min-threshold-input {
        min-height: 36px !important;
        padding: 6px 10px !important;
        font-size: 15px !important;
        max-width: 120px;
        width: 100%;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="inputs-config"] main#routerView .inputs-inv-prag-hint {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin: -2px 0 8px !important;
    }

    /* Phase 9 pune min-height pe toate tr-urile; aici vrem rânduri compacte, nu „liste” */
    body.app-shell[data-router-module="inputs-config"] main#routerView table.inputs-inv-table tbody tr {
        min-height: 0;
    }

    body.app-shell[data-router-module="costs-config"] .inputs-config-split > .card:last-child .card-content {
        overflow-x: visible;
    }

    body.app-shell[data-router-module="inputs-config"] #btnManageInventory,
    body.app-shell[data-router-module="inputs-config"] #btnPartnersLeft,
    body.app-shell[data-router-module="inputs-config"] #btnDeleteGroup,
    body.app-shell[data-router-module="costs-config"] #btnManageInventory,
    body.app-shell[data-router-module="costs-config"] #btnPartnersLeft,
    body.app-shell[data-router-module="costs-config"] #btnDeleteGroup {
        width: 100%;
        min-height: 44px;
        justify-content: flex-start;
        box-sizing: border-box;
    }

    /* AI Builder — coloană, preview sub chat (bate regulile 900px din ai-assistant.css) */
    body.app-shell.ai-builder-active .ai-builder-full {
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    body.app-shell.ai-builder-active .ai-builder-full .conversations-sidebar {
        display: none !important;
    }

    body.app-shell.ai-builder-active .ai-builder-main {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }

    body.app-shell.ai-builder-active .ai-builder-topbar {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 8px;
    }

    body.app-shell.ai-builder-active .ai-builder-topbar-title {
        width: 100%;
        flex: none;
    }

    body.app-shell.ai-builder-active .ai-builder-topbar .ai-builder-toggle-preview,
    body.app-shell.ai-builder-active .ai-builder-topbar .btn-primary {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
        min-height: 44px;
    }

    body.app-shell.ai-builder-active .ai-builder-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    body.app-shell.ai-builder-active .ai-builder-model-select {
        width: 100%;
        max-width: none !important;
        min-height: 44px;
        box-sizing: border-box;
    }

    body.app-shell.ai-builder-active .ai-builder-input-row .chat-input-hint {
        flex: none !important;
        width: 100%;
        text-align: center;
    }

    body.app-shell.ai-builder-active .ai-builder-preview {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
        height: auto !important;
        max-height: min(50vh, 420px);
        flex: 0 0 auto;
        align-self: stretch;
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

    body.app-shell.ai-builder-active .ai-builder-preview.collapsed {
        width: 100% !important;
        max-height: 0 !important;
        min-height: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        opacity: 0;
        overflow: hidden !important;
        border: none !important;
        pointer-events: none;
    }

    body.app-shell.ai-builder-active .ai-builder-preview-body iframe {
        min-height: min(36vh, 280px);
    }

    /* Detaliu lucrare (din Calendar / Lucrări) */
    body.app-shell[data-router-module="task-detail"] .module-header[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    body.app-shell[data-router-module="task-detail"] .module-header > div[style*="margin-left:auto"] {
        margin-left: 0 !important;
        flex-direction: column !important;
        width: 100%;
        gap: 10px;
    }

    body.app-shell[data-router-module="task-detail"] .module-header .btn-primary,
    body.app-shell[data-router-module="task-detail"] .module-header .btn-secondary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.app-shell[data-router-module="task-detail"] #td_map {
        height: min(48vh, 320px) !important;
    }

    body.app-shell[data-router-module="task-detail"] .module-content .card .card-content .card .card-content[style*="display:flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    body.app-shell[data-router-module="task-detail"] .module-content .card .card-content[style*="overflow:auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell[data-router-module="task-detail"] .module-content .card .card-content[style*="overflow:auto"]::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Detaliu lucrare — card „Parcele”: grilă 2 col (Dată|Lucrare, Cultură|Parcelă, Stare|Cost), fără coloană îngustă */
    body.app-shell[data-router-module="task-detail"] .td-parcels-card-content {
        overflow-x: visible !important;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table {
        width: 100%;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table thead {
        display: none;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody,
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot {
        display: block;
        width: 100%;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 14px;
        padding: 14px 16px;
        margin-bottom: 12px;
        border: 1px solid var(--border, var(--color-border));
        border-radius: 12px;
        background: var(--surface, var(--color-card-bg, var(--color-bg-primary)));
        width: 100%;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 0 !important;
        border: none !important;
        min-width: 0;
        font-size: 15px;
        line-height: 1.35;
        vertical-align: top;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted, var(--color-text-secondary));
        line-height: 1.25;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td[data-label=""]::before,
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:not([data-label])::before {
        display: none;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(3) { grid-column: 1; grid-row: 1; }
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(4) { grid-column: 2; grid-row: 1; }
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(2) { grid-column: 1; grid-row: 2; }
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(1) { grid-column: 2; grid-row: 2; }
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(5) { grid-column: 1; grid-row: 3; }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(10) {
        grid-column: 2;
        grid-row: 3;
        text-align: right;
        align-items: flex-end;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(10)::before {
        align-self: flex-start;
        text-align: left;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(6),
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(7),
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(8),
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(9) {
        grid-column: 1 / -1;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(11),
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(12),
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(13),
    body.app-shell[data-router-module="task-detail"] .td-parcels-table tbody tr.td-parcel-row > td:nth-child(14) {
        grid-column: 1 / -1;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table .td-parcel-clamp {
        max-width: none !important;
        display: block;
        overflow: visible;
        white-space: normal;
        word-break: break-word;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table .td-parcel-edit-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border-radius: 12px;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot tr.td-parcels-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
        margin-top: 4px;
        border: 1px dashed var(--border, var(--color-border));
        border-radius: 12px;
        background: color-mix(in srgb, var(--surface-2, var(--color-bg-secondary)) 55%, transparent);
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot tr.td-parcels-footer > td {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        max-width: none !important;
        text-align: left !important;
        vertical-align: top;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot tr.td-parcels-footer > td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted, var(--color-text-secondary));
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot tr.td-parcels-footer > td[data-label=""]::before {
        display: none;
    }

    body.app-shell[data-router-module="task-detail"] .td-parcels-table tfoot tr.td-parcels-footer > td:empty {
        display: none !important;
    }
}

/* ------------------------------------------------------------------
   Mobil ≤1023px — formulare în tot shell-ul + dock activ + AI (tokeni theme-claude)
   ------------------------------------------------------------------ */
@media (max-width: 1023px) {
    body.app-shell .form-input,
    body.app-shell .form-select,
    body.app-shell textarea.form-input,
    body.app-shell .form-textarea,
    body.app-shell .search-box input,
    body.app-shell .search-box-inline input,
    body.app-shell .chat-input,
    body.app-shell .season-picker-trigger {
        font-family: var(--font-body);
        background: var(--surface);
        border: 1px solid var(--border-strong);
        color: var(--text);
        border-radius: var(--radius-lg, 10px);
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    body.app-shell textarea.form-input,
    body.app-shell .form-textarea {
        min-height: 5rem;
    }

    body.app-shell .form-input,
    body.app-shell .form-select,
    body.app-shell .search-box input,
    body.app-shell .search-box-inline input,
    body.app-shell .chat-input,
    body.app-shell .season-picker-trigger {
        font-size: 16px;
    }

    body.app-shell .form-input:focus,
    body.app-shell .form-select:focus,
    body.app-shell textarea.form-input:focus,
    body.app-shell .form-textarea:focus,
    body.app-shell .search-box input:focus,
    body.app-shell .search-box-inline input:focus,
    body.app-shell .chat-input:focus,
    body.app-shell .season-picker-trigger:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-secondary-soft, rgba(67, 97, 6, 0.15));
        outline: none;
    }

    body.app-shell .form-input::placeholder,
    body.app-shell .form-textarea::placeholder,
    body.app-shell .search-box input::placeholder,
    body.app-shell .search-box-inline input::placeholder,
    body.app-shell .chat-input::placeholder {
        color: var(--text-subtle, var(--text-muted));
    }

    /* Lucrări — filtre mai compacte (bate min-height 44px / font 16px din blocul de mai sus) */
    body.app-shell[data-router-module="works"] .works-list-filters-card .form-input,
    body.app-shell[data-router-module="works"] .works-list-filters-card .form-select {
        min-height: 38px;
        padding: 6px 10px;
        font-size: 14px;
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__panel {
        background: var(--surface);
        border-color: var(--border-strong);
        box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.14);
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__head {
        border-bottom-color: var(--border-strong);
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__title {
        font-family: var(--font-title);
        color: var(--text);
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet__close {
        background: var(--surface-2);
        color: var(--text-muted);
    }

    body.app-shell.ai-assistant-active .ai-conversations-sheet .conversation-item.active {
        background: var(--accent-secondary-soft, color-mix(in srgb, var(--primary) 12%, var(--surface)));
        border-color: var(--border-strong);
    }

    body.app-shell.ai-assistant-active .assistant-message .message-content,
    body.app-shell.ai-assistant-active .welcome-message .message-content,
    body.app-shell.ai-assistant-active .typing-message .message-content {
        background: var(--surface);
        border: 1px solid var(--border-strong);
        border-radius: 22px 22px 22px 8px;
        box-shadow: var(--shadow-sm);
    }

    body.app-shell.ai-assistant-active .user-message .message-content {
        background: var(--primary);
        color: #fff;
        border: 1px solid color-mix(in srgb, var(--primary) 88%, #000 12%);
        border-radius: 22px 22px 8px 22px;
        box-shadow: 0 2px 12px color-mix(in srgb, var(--primary) 28%, transparent);
    }

    body.app-shell.ai-assistant-active .message-time {
        color: var(--text-muted);
    }

    body.app-shell.ai-assistant-active .user-message .message-time,
    body.app-shell.ai-assistant-active .user-message .message-content .message-time {
        color: rgba(255, 255, 255, 0.88);
    }

    body.app-shell.ai-assistant-active .user-message .message-content .message-text,
    body.app-shell.ai-assistant-active .user-content .message-text {
        color: #fff;
    }

    body.app-shell.ai-assistant-active .user-message .message-content .message-header strong {
        color: rgba(255, 255, 255, 0.96);
    }

    body.app-shell.ai-assistant-active .message-text {
        font-family: var(--font-body);
        font-size: 16px;
        line-height: 1.55;
    }

    body.app-shell.ai-assistant-active .chat-messages {
        background: var(--bg);
    }

    html[data-theme="light"] body.app-shell.ai-assistant-active .chat-messages {
        background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--surface-2) 32%, var(--bg) 68%) 42%, var(--bg) 100%);
    }

    html[data-theme="theme-claude"] body.app-shell.ai-assistant-active .chat-messages,
    html[data-theme="theme-v1"] body.app-shell.ai-assistant-active .chat-messages,
    html[data-theme="theme-v2"] body.app-shell.ai-assistant-active .chat-messages {
        background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--surface-2) 30%, var(--bg) 70%) 40%, var(--bg) 100%);
    }

    body.app-shell.ai-assistant-active .chat-input-container {
        background: var(--bg2);
        border-top: 1px solid var(--border-strong);
    }

    body.app-shell.ai-assistant-active .chat-input {
        background: var(--surface);
        border-color: var(--border-strong);
        color: var(--text);
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell.ai-assistant-active .chat-input::-webkit-scrollbar {
        -webkit-appearance: none;
        appearance: none;
        width: 0 !important;
        height: 0 !important;
        display: none;
    }

    /* După override-urile pe temă: fără text sub bară (cache vechi / alte skin-uri) */
    body.app-shell.ai-assistant-active .chat-input-hint,
    body.app-shell.ai-assistant-active .chat-input-context {
        display: none !important;
    }

    body.app-shell.ai-assistant-active #chatFileInput + .chat-send-btn {
        background: var(--surface);
        color: var(--text-muted);
        border: 1px solid var(--border-strong);
    }

    body.app-shell main#routerView .widget-card[data-widget-type="quick_links"] .btn-primary {
        background: var(--surface-2);
        color: var(--text);
        border: 1px solid var(--border-strong);
    }

    /* ================================================================
       MOBILE REDESIGN — Phase 1-9
       All styles below target mobile only (≤1023px, inside this media query)
       ================================================================ */

    /* ---- Phase 1: Bottom tab bar (full width, ca înainte de insulă / override-uri temă) ---- */
    body.app-shell .bottom-dock {
        display: flex !important;
        flex-direction: row;
        justify-content: space-around;
        align-items: stretch;
        height: 76px;
        min-height: 76px;
        padding: 6px 0 0 0;
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0;
        background: rgba(30, 42, 29, 0.88);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid rgba(148, 201, 115, 0.12);
        border-left: none;
        border-right: none;
        border-bottom: none;
        box-shadow: none;
        grid-template-columns: unset;
        gap: 0;
    }

    html[data-theme="light"] body.app-shell .bottom-dock,
    html[data-theme="noon"] body.app-shell .bottom-dock {
        background: rgba(244, 245, 236, 0.92);
        border-top-color: rgba(30, 42, 29, 0.1);
    }

    html[data-theme="theme-claude"] body.app-shell .bottom-dock,
    html[data-theme="theme-v1"] body.app-shell .bottom-dock,
    html[data-theme="theme-v2"] body.app-shell .bottom-dock {
        background: color-mix(in srgb, var(--bg) 92%, rgba(30, 42, 29, 0.06) 8%);
        border-top-color: var(--border-strong);
    }

    body.app-shell .dock-left,
    body.app-shell .dock-right {
        display: none !important;
    }

    body.app-shell .dock-center {
        display: flex !important;
        flex-direction: row;
        justify-content: space-around;
        align-items: stretch;
        width: 100%;
        flex-wrap: nowrap;
        overflow: visible;
        gap: 0;
    }

    body.app-shell .nav-dock__item {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: auto;
        min-width: 0;
        height: auto;
        border-radius: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 6px 0 4px;
        color: var(--text-muted) !important;
        opacity: 0.7;
        transition: color 0.12s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.app-shell .nav-dock__item i {
        color: inherit !important;
        font-size: 22px;
        line-height: 1;
    }

    body.app-shell .nav-dock__item:hover {
        box-shadow: none !important;
    }

    body.app-shell .nav-dock__item:active {
        transform: none !important;
    }

    body.app-shell .nav-dock__label {
        display: block !important;
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.02em;
        clip: unset !important;
        clip-path: unset !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        white-space: nowrap;
        color: inherit !important;
    }

    body.app-shell .nav-dock__item.active {
        color: var(--accent, #94C973) !important;
        opacity: 1;
    }

    body.app-shell .nav-dock__item.active i {
        color: inherit !important;
    }

    body.app-shell .nav-dock__item.active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--accent, #94C973);
        bottom: auto;
    }

    /* ---- Phase 1b: Nav Drawer — populated, slide-up ---- */
    body.app-shell .nav-drawer {
        border-radius: 20px 20px 0 0;
        background: var(--bg, #1E2A1D);
        border: 1px solid var(--border, rgba(170,166,150,0.22));
        border-bottom: none;
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
    }

    html[data-theme="light"] body.app-shell .nav-drawer {
        background: var(--bg, #F4F5EC);
    }

    body.app-shell .nav-drawer.open {
        transform: translateY(0);
        opacity: 1;
    }

    body.app-shell .nav-drawer-backdrop.open {
        opacity: 1;
    }

    /* Bara „Caută module…” — doar mobil: verde CropSaga vizibil (nu gri/charcoal din body:not bug) */
    html[data-theme="theme-claude"] body.app-shell .nav-drawer__search {
        background: color-mix(in srgb, var(--accent) 14%, var(--surface));
        border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-strong));
        border-radius: 999px;
        box-shadow: 0 4px 16px rgba(30, 42, 29, 0.07);
    }

    html[data-theme="theme-claude"] body.app-shell .nav-drawer__search > i {
        color: var(--accent);
        opacity: 0.9;
    }

    html[data-theme="theme-claude"] body.app-shell .nav-drawer__search input {
        color: var(--text);
    }

    html[data-theme="theme-claude"] body.app-shell .nav-drawer__search input::placeholder {
        color: color-mix(in srgb, var(--accent) 38%, var(--text-muted));
    }

    body.app-shell .nav-drawer__section {
        padding: 0 8px;
        margin-bottom: 8px;
    }

    body.app-shell .nav-drawer__section-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 12px 6px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted, rgba(234,238,219,.5));
        font-family: var(--font-body, 'Inter', sans-serif);
    }

    body.app-shell .nav-drawer__section-header i {
        font-size: 12px;
        opacity: 0.6;
        width: 16px;
        text-align: center;
    }

    body.app-shell .nav-drawer__module-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        border: none;
        background: transparent;
        color: var(--text, #EAEEDB);
        font-size: 15px;
        font-weight: 500;
        font-family: var(--font-body, 'Inter', sans-serif);
        border-radius: 12px;
        cursor: pointer;
        transition: background 0.15s ease;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
    }

    body.app-shell .nav-drawer__module-item:active {
        background: rgba(148, 201, 115, 0.12);
    }

    body.app-shell .nav-drawer__module-item.active {
        background: rgba(148, 201, 115, 0.1);
        color: var(--accent, #94C973);
    }

    body.app-shell .nav-drawer__module-item i {
        font-size: 16px;
        width: 20px;
        text-align: center;
        opacity: 0.75;
    }

    body.app-shell .nav-drawer__module-item.active i {
        opacity: 1;
    }

    body.app-shell .nav-drawer__section--footer {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border, rgba(170,166,150,0.22));
    }

    /* ---- Phase 2: Top Bar Simplification (bară mai subțire; logo rămâne la dimensiunile din .logo-image) ---- */
    body.app-shell .top-bar {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 2px max(8px, env(safe-area-inset-left, 0px)) 2px max(8px, env(safe-area-inset-right, 0px)) !important;
        gap: 6px !important;
        background: var(--topbar-bg);
        box-sizing: border-box;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;
    }

    body.app-shell .topbar-page-title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 16px;
        font-weight: 600;
        font-family: var(--font-body, 'Inter', sans-serif);
        color: var(--text, #EAEEDB);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }

    /* Hide non-essential top bar elements on mobile */
    body.app-shell #reloadData,
    body.app-shell .help-dropdown,
    body.app-shell .topbar-logout,
    body.app-shell .topbar-context-chip,
    body.app-shell .topbar-divider {
        display: none !important;
    }

    body.app-shell .top-bar .topbar-cluster {
        display: none !important;
    }

    /* Tablou de bord: Phase 2 ascundea tot clusterul — fără asta dispar sezonul și grupul */
    body.app-shell[data-router-module="dashboard"] .top-bar .topbar-cluster {
        display: flex !important;
    }

    body.app-shell[data-router-module="dashboard"] .topbar-context-chip.app-compact-only {
        display: inline-flex !important;
    }

    body.app-shell .top-controls.topbar-actions {
        gap: 4px;
        padding: 0;
        background: transparent;
    }

    body.app-shell .topbar-icon-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    body.app-shell .topbar-avatar,
    body.app-shell .topbar-avatar-btn {
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
    }

    body.app-shell .logo-image {
        height: 56px;
        max-height: 56px;
        width: auto;
        object-fit: contain;
    }

    body.app-shell[data-router-module="dashboard"] .top-bar .logo-image {
        height: 72px !important;
        max-height: 72px !important;
    }

    /* ---- Phase 3: Typography & Spacing ---- */
    body.app-shell {
        --m-text-xs: 11px;
        --m-text-sm: 12px;
        --m-text-base: 14px;
        --m-text-lg: 16px;
        --m-text-xl: 19px;
        --m-text-2xl: 23px;
        --m-text-3xl: 27px;
        --m-radius-sm: 8px;
        --m-radius-md: 12px;
        --m-radius-lg: 16px;
        --m-radius-xl: 20px;
        --page-pad-x: 16px;
        --page-gap: 14px;
        font-size: 14px;
        line-height: 1.5;
        -webkit-text-size-adjust: 100%;
    }

    body.app-shell .content-center {
        padding: 16px var(--page-pad-x) calc(var(--bottombar-height, 72px) + 16px) !important;
    }

    /*
     * Hartă / map-full: Phase 3 de mai sus bate main.css (padding:0 pe .map-full).
     * Fără asta rămâne bandă goală (fundal --bg) între hartă și bottom dock.
     */
    body.app-shell.map-full main#routerView.content-center {
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    /* Imagini satelitare: același conflict Phase 3 / #routerView — bandă albă deasupra dock-ului */
    body.app-shell.sat-full main#routerView.content-center {
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    body.app-shell[data-router-module="utilaje-harta"].map-full main#routerView.content-center {
        overflow: visible !important;
    }

    /*
     * Parcelă nouă: fără padding-bottom pe #routerView — altfel se dublează rezerva pentru dock
     * (bandă goală între .parcel-new-mobile-bar și bottom deck). Rezerva e doar pe .parcel-new-mobile-bar.
     */
    body.app-shell[data-router-module="parcel-new"] main#routerView.content-center {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
        min-height: calc(100dvh - var(--topbar-height, 0px) - var(--topbar-offset, 0px) - var(--bottombar-height, 72px)) !important;
        max-height: none !important;
        overflow: hidden !important;
        padding: 0 max(8px, env(safe-area-inset-left, 0px)) 0 max(8px, env(safe-area-inset-right, 0px)) !important;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        gap: 0 !important;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Pas 1: hartă umple tot spațiul între header intern și bara mobilă (fără bandă goală deasupra dock) */
    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-map .parcel-new-map-wrap {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-map .parcel-new-main {
        display: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-map .parcel-new-form {
        flex: 0 0 auto !important;
        overflow: visible !important;
        max-height: none !important;
        padding: 8px 10px !important;
    }

    /* Adaugă parcelă: ascunde detectarea din satelit pe telefon — trebuie să bată #pnToolbar button { display:inline-flex } */
    body.app-shell[data-router-module="parcel-new"] #pnToolbar #autoDetectBtn {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-details .parcel-new-map-wrap {
        display: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-details .parcel-new-loc {
        display: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-details .parcel-new-form {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        padding: 10px 10px 6px !important;
        border-radius: 12px;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-page--step-details .parcel-new-main {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Butoanele Renunță/Salvează din form — pe mobil sunt în bara de jos */
    body.app-shell[data-router-module="parcel-new"] .parcel-new-form-actions {
        display: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-mobile-bar {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        width: 100%;
        box-sizing: border-box;
        padding: 8px 2px;
        /* main-container are deja bottom: bottombar — doar safe area */
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
        margin-top: auto;
        background: var(--surface, var(--bg, var(--color-bg-primary)));
        border-top: 1px solid var(--border, var(--color-border));
        border-radius: 12px 12px 0 0;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-mobile-bar .btn-secondary {
        flex: 0 0 auto;
        min-height: 44px;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-mobile-bar .btn-primary#pn_m_next,
    body.app-shell[data-router-module="parcel-new"] .parcel-new-mobile-bar .btn-primary#pn_m_save {
        flex: 1 1 140px;
        min-height: 44px;
        min-width: 0;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-map-wrap {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        position: relative !important;
        overflow: hidden !important;
        border-radius: 12px;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-map-wrap #map {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        z-index: 1;
    }

    /*
     * Toolbar: colț stânga-sus, compact — doar iconițe (fără text pe telefon), nu mai acoperă harta pe toată lățimea.
     */
    body.app-shell[data-router-module="parcel-new"] #pnToolbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        padding: 6px !important;
        top: 6px !important;
        left: 6px !important;
        right: auto !important;
        max-width: calc(100% - 12px) !important;
        width: auto !important;
        max-height: none !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch;
        z-index: 800;
        box-sizing: border-box;
        border-radius: 12px !important;
    }

    body.app-shell[data-router-module="parcel-new"] #pnToolbar button {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        gap: 0 !important;
        font-size: 0 !important;
        line-height: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        border-radius: 10px !important;
    }

    /* Icon vizibil; textul din HTML rămâne invizibil (font-size:0 pe buton) */
    body.app-shell[data-router-module="parcel-new"] #pnToolbar button i {
        font-size: 17px !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    body.app-shell[data-router-module="parcel-new"] #pnToolbar #drawBtn i {
        color: #333 !important;
    }

    body.app-shell[data-router-module="parcel-new"] #pnToolbar #drawUndoBtn i,
    body.app-shell[data-router-module="parcel-new"] #pnToolbar #measureBtn i,
    body.app-shell[data-router-module="parcel-new"] #pnToolbar #fitFarmBtn i {
        color: #fff !important;
    }

    body.app-shell[data-router-module="parcel-new"] #pnToolbar #pnToolbarStatus {
        display: none !important;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-map-wrap .leaflet-container {
        z-index: 1;
    }

    body.app-shell[data-router-module="parcel-new"] .parcel-new-form {
        flex: 1 1 42%;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 12px;
    }

    /*
     * Adaugă cultură pe hartă: hartă mare sus, formular bandă jos, overlay-uri compacte (doar app shell mobil).
     * Complementează <style> din crops.js (ordine flex + min-height).
     */
    body.app-shell[data-router-module="crops-add-map"] main#routerView.content-center {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 max(6px, env(safe-area-inset-left, 0px)) calc(var(--bottombar-height, 72px) + 6px)
            max(6px, env(safe-area-inset-right, 0px)) !important;
        box-sizing: border-box;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-page {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-header {
        padding: 8px 10px !important;
        gap: 8px !important;
        flex-wrap: wrap;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-header h1 {
        font-size: 1rem !important;
        line-height: 1.25;
        flex: 1 1 200px;
        min-width: 0;
        margin: 0 !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-header .btn-secondary {
        flex: 1 1 auto;
        min-width: min(100%, 200px);
        justify-content: center;
        min-height: 40px;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-layout {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-mapwrap {
        min-height: min(64dvh, 580px) !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-sidebar {
        max-height: min(32vh, 280px) !important;
        padding: 10px 12px !important;
        border-right: none !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-map-toolbar {
        top: 6px !important;
        left: 6px !important;
        right: 6px !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-map-toolbar > div:first-child {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-map-toolbar .info-box {
        flex: 0 0 auto !important;
        max-width: min(78vw, 260px) !important;
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-legend {
        margin-top: 4px !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-map-toolbar > div:last-child {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-top: 6px !important;
    }

    body.app-shell[data-router-module="crops-add-map"] .crops-add-map-map-toolbar .btn-sm {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        min-height: 40px;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Tablou de bord: încadrare + scrollbar ascuns (păstrează scroll dacă e nevoie, fără bară vizibilă) */
    body.dashboard-active.app-shell .content-center {
        padding: 10px 14px calc(var(--bottombar-height, 72px) + max(10px, env(safe-area-inset-bottom, 0px))) !important;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.dashboard-active.app-shell .content-center::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    /* Module headers */
    body.app-shell main#routerView h1,
    body.app-shell main#routerView .module-header h1 {
        font-size: var(--m-text-2xl) !important;
        line-height: 1.2;
        margin-bottom: 4px;
    }

    body.app-shell main#routerView .works-list-page .works-list-header h1 {
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0 !important;
    }

    body.app-shell main#routerView h2 {
        font-size: var(--m-text-xl);
        line-height: 1.25;
    }

    body.app-shell main#routerView h3 {
        font-size: var(--m-text-lg);
        line-height: 1.3;
    }

    body.app-shell main#routerView p,
    body.app-shell main#routerView li,
    body.app-shell main#routerView td {
        font-size: var(--m-text-base);
        line-height: 1.5;
    }

    body.app-shell main#routerView small,
    body.app-shell main#routerView .text-small,
    body.app-shell main#routerView .text-muted {
        font-size: var(--m-text-sm);
    }

    /* Butoanele .btn-* sunt deja compacte mai sus (--m-btn-*); fără override global pe toate <button> (lovește harta etc.) */

    /* ---- Phase 4: Cards & Tables ---- */
    body.app-shell main#routerView .card,
    body.app-shell main#routerView .widget-card {
        border-radius: var(--m-radius-lg) !important;
        padding: 16px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    /* Widget dashboard: un singur chenar; Phase 4 aplică .card și pe cardul interior */
    body.app-shell main#routerView .widgets-grid .widget-card > .card,
    body.app-shell main#routerView .widgets-grid .widget-card > .stat-card {
        padding: 0 !important;
        margin-bottom: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    body.app-shell main#routerView .widgets-grid .widget-card > .card .card-content {
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    body.app-shell main#routerView .widgets-grid .widget-card {
        overflow: visible !important;
        background: var(--card) !important;
        border: 1px solid var(--border-strong) !important;
        box-shadow: var(--shadow-sm) !important;
        margin-bottom: 0 !important;
    }

    body.app-shell main#routerView .card-title {
        font-size: var(--m-text-lg);
    }

    body.app-shell main#routerView .stat-card {
        border-radius: var(--m-radius-md) !important;
        padding: 14px;
    }

    body.app-shell main#routerView .stat-value {
        font-size: var(--m-text-2xl);
        font-variant-numeric: tabular-nums;
    }

    body.app-shell main#routerView .stat-label {
        font-size: var(--m-text-xs);
    }

    /* Forza cards (equipment fleet) */
    body.app-shell main#routerView .forza-card-container {
        border-radius: var(--m-radius-lg);
        overflow: hidden;
    }

    /* ---- Phase 5: Forms ---- */
    body.app-shell main#routerView input[type="text"],
    body.app-shell main#routerView input[type="email"],
    body.app-shell main#routerView input[type="password"],
    body.app-shell main#routerView input[type="number"],
    body.app-shell main#routerView input[type="search"],
    body.app-shell main#routerView input[type="tel"],
    body.app-shell main#routerView input[type="url"],
    body.app-shell main#routerView input[type="date"],
    body.app-shell main#routerView textarea,
    body.app-shell main#routerView select {
        min-height: 48px;
        font-size: 16px !important; /* prevents iOS auto-zoom */
        padding: 12px 14px;
        border-radius: var(--m-radius-md);
        box-sizing: border-box;
        width: 100%;
    }

    body.app-shell main#routerView .form-row,
    body.app-shell main#routerView [style*="display:flex"][style*="gap"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.app-shell main#routerView label {
        font-size: var(--m-text-sm);
        font-weight: 600;
        margin-bottom: 6px;
    }

    /* ---- Phase 6: Page Transitions ---- */
    body.app-shell main#routerView {
        transition: opacity 0.15s ease, transform 0.15s ease;
        will-change: opacity;
    }

    body.app-shell main#routerView.page-exit {
        opacity: 0;
        transform: translateY(6px);
    }

    /* ---- Phase 7: Gestures & interactions CSS ---- */

    /* Bottom sheet (reusable) */
    .mobile-bottom-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 85vh;
        background: var(--bg, #1E2A1D);
        border: 1px solid var(--border, rgba(170,166,150,0.22));
        border-bottom: none;
        border-radius: 20px 20px 0 0;
        padding: 8px 0 max(16px, env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 11000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-bottom-sheet.open {
        transform: translateY(0);
    }

    .mobile-bottom-sheet__grip {
        width: 36px;
        height: 4px;
        background: var(--text-muted, rgba(234,238,219,.4));
        opacity: 0.4;
        border-radius: 2px;
        margin: 0 auto 12px;
    }

    .mobile-bottom-sheet__backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 10999;
        opacity: 0;
        transition: opacity 0.25s ease;
        pointer-events: none;
    }

    .mobile-bottom-sheet__backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Pagini cu hartă Leaflet: limitează overscroll-ul (pinch + pull nu mai propagă spre shell) */
    body.app-shell main#routerView:has(.leaflet-container) {
        overscroll-behavior-y: contain;
    }

    /* Pull-to-refresh indicator */
    .mobile-ptr-indicator {
        position: absolute;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--surface, rgba(26,38,26,.55));
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent, #94C973);
        font-size: 16px;
        opacity: 0;
        transition: opacity 0.2s ease, top 0.2s ease;
    }

    .mobile-ptr-indicator.pulling {
        opacity: 1;
        top: 8px;
    }

    .mobile-ptr-indicator.refreshing {
        opacity: 1;
        top: 8px;
        animation: ptr-spin 0.8s linear infinite;
    }

    @keyframes ptr-spin {
        from { transform: translateX(-50%) rotate(0deg); }
        to { transform: translateX(-50%) rotate(360deg); }
    }

    /* Skeleton loading shimmer */
    .mobile-skeleton {
        background: linear-gradient(90deg, var(--surface, rgba(26,38,26,.55)) 25%, var(--surface-2, rgba(26,38,26,.35)) 50%, var(--surface, rgba(26,38,26,.55)) 75%);
        background-size: 200% 100%;
        animation: skeleton-shimmer 1.5s ease-in-out infinite;
        border-radius: var(--m-radius-sm);
    }

    @keyframes skeleton-shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    /* ---- Phase 8: Dashboard Mobile ---- */
    body.app-shell main#routerView .dashboard-widgets,
    body.app-shell main#routerView .widgets-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.app-shell main#routerView .stat-cards-grid,
    body.app-shell main#routerView .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Quick links: grid pe .dashboard-quick-links-grid (nu pe .card-content — un singur copil = jumătate din lățime) */
    body.app-shell main#routerView .widget-card[data-widget-type="quick_links"] .card-content {
        display: block !important;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    body.app-shell main#routerView .widget-card[data-widget-type="quick_links"] .dashboard-quick-links-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    body.app-shell main#routerView .widget-card[data-widget-type="quick_links"] .dashboard-quick-link-btn,
    body.app-shell main#routerView .widget-card[data-widget-type="quick_links"] .btn-primary.dashboard-quick-link-btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        font-size: var(--m-text-sm);
        padding: 10px 8px;
        text-align: center;
        justify-content: center;
    }

    /* ---- Phase 9: List Pages ---- */

    /* Sticky search bar */
    body.app-shell main#routerView .search-filter-bar,
    body.app-shell main#routerView .module-search,
    body.app-shell main#routerView [class*="filter-bar"],
    body.app-shell main#routerView [class*="search-bar"] {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg, #1E2A1D);
        padding: 10px 0;
        margin-bottom: 12px;
    }

    /* List items touch-friendly */
    body.app-shell main#routerView .list-item,
    body.app-shell main#routerView .parcel-item,
    body.app-shell main#routerView tr:not(.w_group_header):not(.w_group_item) {
        min-height: 56px;
    }

    /* Lucrări: rândurile sunt card / grilă — nu forța 56px pe <tr> (rupe alinierea) */
    body.app-shell main#routerView .works-list-page .w-works-table tr {
        min-height: 0;
    }

    /* FAB (Floating Action Button) */
    .mobile-fab {
        position: fixed;
        right: max(20px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--bottombar-height, 72px) + 20px);
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: var(--accent, #94C973);
        color: #1E2A1D;
        border: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        cursor: pointer;
        z-index: 45;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-fab:active {
        transform: scale(0.92);
    }
}

@media (max-width: 480px) {
    body.app-shell .top-bar {
        padding: 3px 6px 4px;
        padding-left: max(4px, env(safe-area-inset-left, 0px));
        padding-right: max(4px, env(safe-area-inset-right, 0px));
    }

    body.app-shell .top-controls {
        gap: 2px;
        padding: 2px;
    }

    body.app-shell .topbar-icon-btn,
    body.app-shell .topbar-avatar {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }

    body.app-shell .logo-image {
        height: 52px;
        max-height: 52px;
        width: auto;
        object-fit: contain;
    }

    body.app-shell[data-router-module="dashboard"] .top-bar .logo-image {
        height: 66px !important;
        max-height: 66px !important;
    }

    /* Bottom dock: icon + etichetă mai compacte pe ecrane înguste */

    body.app-shell .nav-dock__item i {
        font-size: 18px;
    }

    body.app-shell .nav-dock__label {
        font-size: 9px !important;
    }

    body.app-shell .topbar-page-title {
        font-size: 14px;
    }

    /* Content padding tighter on small phones */
    body.app-shell .content-center {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Tablou de bord: aceeași lățime utilă ca restul paginilor mici */
    body.dashboard-active.app-shell .content-center {
        padding: 10px 12px calc(var(--bottombar-height, 72px) + max(10px, env(safe-area-inset-bottom, 0px))) !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.app-shell main#routerView .stat-cards-grid,
    body.app-shell main#routerView .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

/* ---- Table → Card Responsive (small phones) ---- */
@media (max-width: 640px) {
    /* Exclude .w-works-table: lista Lucrări are layout propriu (grilă 2 col) în blocul ≤1023px */
    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) thead {
        display: none;
    }

    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) tbody tr {
        display: flex;
        flex-direction: column;
        padding: 12px 0;
        border-bottom: 1px solid var(--border, rgba(170,166,150,0.22));
        gap: 4px;
    }

    /*
     * Rând etichetă + valoare pe verticală (stânga), nu „etichetă 40% | valoare” orizontal.
     * Cu flex row + space-between, ::before gol sau fără data-label lăsa ~40% gol și împingea tot la dreapta.
     */
    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) tbody td {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        text-align: left;
        gap: 4px;
        padding: 6px 0;
        border: none;
        font-size: 14px;
    }

    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted, rgba(234,238,219,.55));
        flex: none;
        width: 100%;
        max-width: 100%;
        line-height: 1.3;
    }

    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) tbody td:not([data-label])::before,
    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) tbody td[data-label=""]::before {
        display: none;
    }

    body.app-shell main#routerView table.data-table:not(.keep-table):not(.w-works-table):not(.td-parcels-table) tbody td:empty {
        display: none;
    }
}
