/* ── NexoHub PWA mobile shell ── */
body.mob-pwa-route #components-reconnect-modal,
body.mob-pwa-route #components-reconnect-modal.components-reconnect-show {
    display: none !important;
    visibility: hidden !important;
}

.mob-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f4f7f6;
    color: #1e293b;
}

.mob-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #166534 0%, #1b8a5a 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(22, 101, 52, 0.25);
}

.mob-header img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

.mob-header-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.mob-header-sub {
    font-size: 0.72rem;
    opacity: 0.85;
    margin-left: auto;
}

.mob-header-action {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    padding: 0.35rem;
    line-height: 1;
    text-decoration: none;
}

.mob-header-action:hover {
    color: #fff;
}

.mob-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
}

.mob-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.45rem 0.25rem 0.55rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    border: none;
    background: transparent;
    min-height: 3.25rem;
}

.mob-tab i {
    font-size: 1.15rem;
}

.mob-tab--active {
    color: #1b8a5a;
}

.mob-search {
    position: relative;
    flex: 1;
    min-width: 0;
}

.mob-search--compact {
    margin-bottom: 0;
}

.mob-search input {
    padding-left: 2.25rem;
    border-radius: 10px;
    border: 1px solid #dce8e2;
    font-size: 0.88rem;
    background: #fff;
}

.mob-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mob-icon-btn {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dce8e2;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.mob-icon-btn--active {
    border-color: #1b8a5a;
    color: #1b8a5a;
    background: #ecfdf5;
}

.mob-icon-btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #1b8a5a;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 1rem;
    height: 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.2rem;
}

.mob-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mob-sort-select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    border-radius: 10px;
    font-size: 0.8rem;
    border-color: #e8eeeb;
}

.mob-result-count {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}

.mob-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.mob-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem 0.15rem 0.5rem;
    border-radius: 999px;
    max-width: 100%;
}

.mob-chip button {
    border: none;
    background: transparent;
    color: #166534;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
}

.mob-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.mob-doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mob-doc-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    background: #fff;
    border: 1px solid #e8eeeb;
    border-radius: 12px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.mob-doc-card:focus-visible {
    outline: 2px solid #1b8a5a;
    outline-offset: 2px;
}

.mob-doc-card:active {
    box-shadow: 0 2px 8px rgba(27, 138, 90, 0.15);
}

.mob-doc-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    background: #ecfdf5;
    color: #1b8a5a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 0.1rem;
}

.mob-doc-body {
    flex: 1;
    min-width: 0;
}

.mob-doc-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.mob-doc-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1e293b;
}

.mob-doc-chevron {
    flex-shrink: 0;
    font-size: 0.65rem;
    color: #cbd5e1;
    margin-top: 0.2rem;
}

.mob-doc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.mob-doc-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    font-size: 0.72rem;
}

.mob-doc-creancier {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mob-doc-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    align-items: center;
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid #f1f5f9;
}

.mob-doc-amount-cell {
    min-width: 0;
    overflow: hidden;
}

.mob-doc-date-cell {
    justify-self: end;
    flex-shrink: 0;
    padding-left: 0.25rem;
}

.mob-doc-amount {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    color: #166534;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mob-doc-date {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mob-doc-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.mob-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.mob-card {
    background: #fff;
    border: 1px solid #e8eeeb;
    border-radius: 14px;
    padding: 1rem;
}

.mob-card + .mob-card {
    margin-top: 0.75rem;
}

.mob-btn-primary {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #166534, #1b8a5a);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.mob-btn-primary:disabled {
    opacity: 0.6;
}

.mob-toast {
    position: fixed;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
}

.mob-toast--ok { background: #166534; color: #fff; }
.mob-toast--err { background: #dc2626; color: #fff; }

.mob-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}

.mob-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.mob-ticket-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.mob-ticket-row:last-child {
    border-bottom: none;
}

.mob-ticket-date {
    text-align: center;
    min-width: 2.5rem;
    font-size: 0.75rem;
    color: #64748b;
}

.mob-ticket-date strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
}

.mob-stat-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mob-stat {
    flex: 1;
    background: #fff;
    border: 1px solid #e8eeeb;
    border-radius: 10px;
    padding: 0.6rem;
    text-align: center;
}

.mob-stat-num {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1b8a5a;
}

.mob-stat-label {
    font-size: 0.68rem;
    color: #64748b;
}

.mob-period-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.mob-install-banner {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mob-install-banner button {
    margin-left: auto;
    white-space: nowrap;
}

.mob-desktop-link {
    display: none;
}

@media (max-width: 380px) {
    .mob-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mob-result-count {
        text-align: right;
    }
}

.mob-sheet--filters {
    max-height: 85dvh;
}

.mob-filter-field {
    margin-bottom: 0.65rem;
}

.mob-filter-field select,
.mob-filter-field input[type="date"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.mob-filter-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.mob-filter-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.mob-install-page {
    max-width: 24rem;
    margin: 0 auto;
}

.mob-install-hero {
    text-align: center;
    padding: 1rem 0 1.25rem;
}

.mob-install-hero i {
    font-size: 2.5rem;
    color: #1b8a5a;
    margin-bottom: 0.5rem;
}

.mob-ios-hint {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.mob-doc-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.25rem;
    align-items: center;
}

.mob-badge--status { background: #e0f2fe; color: #0369a1; }
.mob-badge--light { background: #f1f5f9; color: #475569; }
.mob-badge--paid { background: #dcfce7; color: #166534; }
.mob-badge--unpaid { background: #fee2e2; color: #b91c1c; }
.mob-badge--pending { background: #e0e7ff; color: #3730a3; }

.mob-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 500;
    display: flex;
    align-items: flex-end;
}

.mob-sheet {
    background: #fff;
    width: 100%;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: mob-slide-up 0.25s ease-out;
}

@keyframes mob-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mob-sheet-handle {
    width: 2.5rem;
    height: 4px;
    background: #cbd5e1;
    border-radius: 4px;
    margin: 0.5rem auto 0;
}

.mob-sheet-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 1rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.mob-sheet-title {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.3;
}

.mob-sheet-body {
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
    flex: 1;
}

.mob-sheet-footer {
    display: flex;
    padding: 0.65rem 1rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.mob-meta-section {
    margin-bottom: 1rem;
}

.mob-meta-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1b8a5a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #ecfdf5;
}

.mob-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 0.82rem;
}

.mob-meta-row--block {
    flex-direction: column;
    gap: 0.25rem;
}

.mob-meta-label {
    color: #64748b;
    flex-shrink: 0;
    max-width: 45%;
}

.mob-meta-value {
    color: #1e293b;
    text-align: right;
    word-break: break-word;
}

.mob-meta-value--empty {
    color: #cbd5e1;
}

.mob-meta-ocr {
    font-size: 0.75rem;
    color: #475569;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 8rem;
    overflow-y: auto;
    white-space: pre-wrap;
}

.mob-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.mob-sheet--detail {
    max-height: 92dvh;
}

.mob-doc-preview {
    margin-bottom: 0.75rem;
    border: 1px solid #e8eeeb;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.mob-doc-preview-frame {
    width: 100%;
    height: 42vh;
    min-height: 220px;
    border: 0;
    display: block;
}

.mob-doc-preview-img {
    width: 100%;
    max-height: 42vh;
    object-fit: contain;
    display: block;
    background: #fff;
}

.mob-doc-preview-fallback {
    text-align: center;
    padding: 1.5rem 1rem;
}

.mob-sheet-footer--actions {
    gap: 0.5rem;
}

.mob-period-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding: 0.45rem 0.6rem;
    background: #fff;
    border: 1px solid #e8eeeb;
    border-radius: 12px;
}

.mob-period-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #dce8e2;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mob-period-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #166534;
    text-align: center;
    flex: 1;
}

.mob-budget-section {
    margin-bottom: 0.75rem;
}

.mob-budget-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.55rem 0.65rem;
    background: #fff;
    border: 1px solid #e8eeeb;
    border-radius: 10px;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mob-budget-toggle--open {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.mob-budget-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.mob-budget-panel {
    margin-top: 0.45rem;
}

.mob-budget-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0.35rem;
    min-height: 0;
}

.mob-budget-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mob-budget-clear {
    border: none;
    background: transparent;
    color: #1b8a5a;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0;
}

.mob-budget-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mob-budget-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    background: #fff;
    border: 1px solid #e8eeeb;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mob-budget-item--active {
    border-color: #1b8a5a;
    background: #f0fdf4;
}

.mob-budget-item--over .mob-budget-spent {
    color: #dc2626;
}

.mob-budget-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.mob-budget-item-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.mob-budget-item-pct {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.mob-budget-item-amounts {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    margin-bottom: 0.3rem;
}

.mob-budget-spent {
    font-size: 0.82rem;
    font-weight: 800;
    color: #166534;
}

.mob-budget-total {
    font-size: 0.7rem;
    color: #94a3b8;
}

.mob-budget-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.mob-budget-fill {
    height: 100%;
    background: #1b8a5a;
    border-radius: 4px;
    transition: width 0.25s ease;
}

.mob-budget-fill--over {
    background: #ef4444;
}

