/* SysTech — UI unificada PC + celular (estilo MEC) */
@import url('brand.css');

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* --- Topo dashboard (PC e celular) --- */
.mec-topo {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
}

.mec-saudacao h2 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.mec-saudacao h2 em {
    color: var(--systech-primary-light);
    font-style: normal;
}

.mec-saudacao p {
    font-size: 13px;
    color: #777;
    margin-top: 6px;
    font-style: italic;
}

.mec-topo-mes {
    margin-top: 10px;
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.mec-topo-cotacao-linha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    max-width: 100%;
}

.mec-cotacao-card {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    background: linear-gradient(180deg, #151922 0%, #12151c 100%);
    border: 1px solid #2a3140;
    border-top-color: rgba(52, 199, 89, 0.35);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(52, 199, 89, 0.12);
}

.mec-cotacao-card.erro .mec-cotacao-valor {
    color: #888;
}

.mec-cotacao-titulo {
    font-size: 10px;
    color: #8a92a3;
    margin-bottom: 2px;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mec-cotacao-atualizado {
    font-size: 9px;
    color: #6b7280;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.mec-cotacao-card.erro .mec-cotacao-atualizado {
    color: #ff6b6b;
}

.mec-cotacao-corpo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.mec-cotacao-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34c759;
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.65);
    animation: mecCotacaoPulse 2s ease infinite;
    flex-shrink: 0;
}

.mec-cotacao-par {
    font-size: 12px;
    color: #9aa3b2;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.mec-cotacao-valor {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

.mec-cotacao-spark {
    flex: 0 0 72px;
    width: 72px;
    height: 28px;
    opacity: 0.95;
}

.mec-cotacao-spark.vazio {
    display: none;
}

.mec-cotacao-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.mec-cotacao-trend svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.mec-cotacao-trend.alta {
    background: rgba(52, 199, 89, 0.16);
    color: #34c759;
}

.mec-cotacao-trend.baixa {
    background: rgba(255, 71, 87, 0.18);
    color: #ff5d55;
}

.mec-cotacao-trend.neutra {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
}

.mec-topo-tools {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
}

.mec-topo-btn-mes {
    position: relative;
    overflow: hidden;
}

.mec-topo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    min-width: 40px;
    padding: 0 10px;
    background: var(--systech-surface);
    border: 1px solid #2a3140;
    border-radius: 12px;
    color: #c5cdd9;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.mec-topo-btn-square {
    width: 40px;
    padding: 0;
}

.mec-topo-btn-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mec-topo-btn-chev {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    opacity: 0.7;
}

.mec-topo-select-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.dash-data-oculta {
    display: none;
}

@keyframes mecCotacaoPulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(52, 199, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

.mec-topo-controles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mec-topo-controles .mes-label {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    padding: 8px 14px;
    background: var(--systech-surface);
    border-radius: 10px;
}

/* Banner plano */
.mec-plano-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
    background: rgba(var(--systech-blue-rgb), 0.08);
    border: 1px solid rgba(var(--systech-blue-rgb), 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--systech-muted);
    position: relative;
    z-index: 1;
}

.mec-plano-banner > div {
    flex: 1 1 140px;
    min-width: 0;
}

.mec-plano-banner strong {
    color: var(--systech-primary-light);
    display: block;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.mec-plano-banner #planoTexto,
.mec-plano-banner span[id="planoTexto"] {
    display: block;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    font-size: 12px;
    color: var(--systech-text);
}

.mec-plano-banner--aviso {
    background: rgba(255, 159, 10, 0.12);
    border-color: rgba(255, 159, 10, 0.45);
}

.mec-plano-banner--aviso strong,
.mec-plano-banner--aviso .mec-plano-btn {
    color: #ffb340;
}

.mec-plano-banner--urgente,
.mec-plano-banner--vencido {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.45);
}

.mec-plano-banner--urgente strong,
.mec-plano-banner--vencido strong,
.mec-plano-banner--urgente .mec-plano-btn,
.mec-plano-banner--vencido .mec-plano-btn {
    color: #ff6b6b;
}

.mec-plano-btn {
    background: transparent;
    border: 1px solid rgba(var(--systech-blue-rgb), 0.45);
    color: var(--systech-primary-light);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    min-height: 36px;
    align-self: center;
}

/* Painel principal do Dashboard */
.dash-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.dash-hero-copy,
.dash-os-vazio {
    background: var(--systech-surface);
    border: 1px solid var(--systech-border);
    border-radius: 16px;
}

.dash-hero-copy {
    position: relative;
    overflow: hidden;
    padding: 22px;
    background:
        radial-gradient(circle at top right, rgba(var(--systech-primary-rgb), 0.14), transparent 35%),
        linear-gradient(135deg, var(--systech-surface) 0%, var(--systech-bg) 100%);
}

.dash-hero-copy::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(107, 159, 255, 0.1);
}

.dash-kicker {
    display: inline-flex;
    color: var(--systech-primary);
    background: rgba(var(--systech-primary-rgb), 0.1);
    border: 1px solid rgba(var(--systech-primary-rgb), 0.18);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.dash-hero-copy h3 {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 24px;
    margin-top: 14px;
}

.dash-hero-copy p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    color: #8f949f;
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0 18px;
}

.dash-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dash-btn-principal,
.dash-btn-secundario,
.dash-link-btn,
.dash-os-vazio button {
    border-radius: 12px;
    min-height: 44px;
    font-weight: 800;
}

.dash-btn-principal {
    background: var(--systech-primary);
    color: #fff;
    padding: 12px 20px;
}

.dash-btn-secundario,
.dash-link-btn {
    background: var(--systech-surface-2);
    color: #fff;
    border: 1px solid var(--systech-border);
    padding: 12px 18px;
}

.card-aniversario {
    position: relative;
}

.card-fechar {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.card-aniversario.oculto { display: none; }

/* Ações rápidas — PC e celular */
.mec-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.mec-btn-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    flex: 1;
    min-width: 140px;
}

.mec-btn-acao.primario {
    background: #34c759;
    color: #fff;
    flex: 1 1 100%;
}

.mec-btn-acao.secundario {
    background: var(--systech-surface-2);
    color: var(--systech-text);
    border: 1px solid var(--systech-border);
}

/* Métricas — grid responsivo */
.mec-metricas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mec-metric-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--systech-surface);
    border: 1px solid var(--systech-border);
    border-radius: 14px;
    padding: 16px;
    border-left: 4px solid var(--cor, var(--systech-primary-light));
}

.mec-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.mec-metric-info .label { font-size: 13px; color: #999; }
.mec-metric-info .sub { font-size: 11px; color: #666; margin-top: 2px; }
.mec-metric-info .valor {
    font-size: 20px;
    font-weight: 800;
    color: var(--cor, var(--systech-primary-light));
    margin-top: 2px;
}

/* Live cards */
.mec-live-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.mec-live-card {
    background: var(--systech-surface);
    border: 1px solid var(--systech-border);
    border-radius: 14px;
    padding: 18px;
    position: relative;
}

.mec-live-card.azul { border-color: rgba(107, 159, 255, 0.25); }

.mec-live-card .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    font-weight: 800;
    color: var(--systech-primary-light);
    background: rgba(107, 159, 255, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
}

.mec-live-card.verde .badge { color: #34c759; background: rgba(52, 199, 89, 0.15); }
.mec-live-card.verde .valor { color: #34c759; }

.mec-live-card .titulo {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mec-live-card .valor {
    font-size: 28px;
    font-weight: 800;
    color: var(--systech-primary-light);
}

.mec-live-card .sub { font-size: 11px; color: #666; margin-top: 4px; }

@media (min-width: 641px) {
    .mec-topo-tools {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .mec-topo-btn {
        height: 44px;
        min-width: 44px;
        padding: 0 12px;
        font-size: 13px;
    }

    .mec-topo-btn-square {
        width: 44px;
    }

    .mec-cotacao-valor {
        font-size: 22px;
    }
}

@media (max-width: 640px) {
    .mec-live-row {
        grid-template-columns: 1fr;
    }

    .mec-cotacao-valor {
        font-size: 16px;
    }

    .mec-cotacao-titulo {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .mec-cotacao-par {
        font-size: 10px;
    }

    .mec-cotacao-trend {
        padding: 3px 6px;
        font-size: 9px;
    }

    .mec-topo-btn {
        height: 38px;
        min-width: 38px;
        padding: 0 8px;
        font-size: 11px;
    }

    .mec-topo-btn-square {
        width: 38px;
    }

    #dashBtnMesLabel {
        max-width: 36px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mec-plano-banner {
        padding: 10px 12px;
        gap: 8px;
    }

    .mec-plano-btn {
        width: auto;
        min-height: 34px;
        padding: 7px 10px;
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .mec-cotacao-par {
        display: none;
    }
}

/* Últimas OS no Dashboard */
.dash-lista-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 12px;
}

.dash-lista-top .secao-titulo {
    margin-bottom: 2px;
}

.dash-lista-top p {
    color: #777;
    font-size: 13px;
}

.dash-link-btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
}

.dash-os-card {
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dash-os-card:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--systech-primary-rgb), 0.25);
    background: #202024;
}

.dash-os-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.dash-os-main strong {
    color: #fff;
    font-size: 14px;
}

.dash-os-main small {
    color: #777;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-os-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: #777;
    font-size: 12px;
    flex-wrap: wrap;
}

.dash-os-meta strong {
    color: var(--systech-primary);
    font-size: 13px;
}

.dash-os-vazio {
    display: grid;
    gap: 8px;
    padding: 26px;
    text-align: center;
    color: #777;
}

.dash-os-vazio strong {
    color: #fff;
    font-size: 16px;
}

.dash-os-vazio button {
    justify-self: center;
    margin-top: 6px;
    background: var(--systech-primary);
    color: #000;
    padding: 10px 16px;
}

.status-badge.aguardando_aprovacao { background: rgba(245, 166, 35, .2); color: #f5a623; }
.status-badge.aguardando_retirada { background: rgba(255, 149, 0, .2); color: #ff9500; }
.status-badge.cancelada { background: rgba(255, 59, 48, .2); color: #ff3b30; }

/* Barra de página interna (PC + mobile) */
.mec-page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mec-page-bar h1 {
    font-size: 24px;
    font-weight: 700;
}

.mec-page-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mec-page-acoes .mec-btn-acao {
    flex: 0 1 auto;
    min-width: auto;
    padding: 10px 16px;
    font-size: 13px;
}

.mec-page-acoes .mec-btn-acao.primario {
    flex: 0 1 auto;
}

/* --- MOBILE --- */
@media (max-width: 1024px) {
    body {
        flex-direction: column;
        overflow: hidden;
        height: 100dvh;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .sidebar { display: none !important; }
    .menu-mobile-btn, .sidebar-overlay { display: none !important; }

    .main {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 12px 14px calc(80px + env(safe-area-inset-bottom));
        height: auto;
        min-height: 0;
        width: 100%;
        max-width: 100%;
    }

    .systech-install-bar {
        bottom: calc(56px + env(safe-area-inset-bottom));
    }

    .mec-saudacao h2 { font-size: 22px; }

    .dash-hero {
        grid-template-columns: 1fr;
    }

    .dash-hero-copy {
        padding: 20px;
    }

    .dash-hero-copy h3 {
        font-size: 22px;
    }

    .mec-metricas { grid-template-columns: 1fr; }

    .mec-btn-acao.primario { flex: 1 1 100%; }
    .mec-btn-acao.secundario { flex: 1 1 calc(50% - 5px); min-width: 0; }

    .card-faturamento { flex-direction: column; }
    .faturamento-detalhes { width: 100%; justify-content: space-between; }

    .dash-lista-top {
        align-items: flex-start;
    }

    .dash-os-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .dash-os-meta {
        width: 100%;
        justify-content: space-between;
    }

    input, select, textarea { font-size: 16px; }
    button:not(.mec-header-ico):not(.mec-topo-btn), .nav-item, .acao-btn { min-height: 44px; }
    .mec-header-ico { cursor: pointer; touch-action: manipulation; }
}

/* Header mobile/tablet fixo */
.mec-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 120;
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 14px 10px;
    box-sizing: border-box;
    background: var(--systech-bg);
    border-bottom: 1px solid var(--systech-border);
    overflow: visible;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mec-header-brand {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.mec-header-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

.logo-header-mobile {
    display: block;
    width: clamp(120px, 34vw, 150px);
    height: auto;
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

.mec-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
    z-index: 2;
    margin-left: auto;
}

@media (max-width: 1024px) {
    .mec-header {
        display: flex;
    }
}

@media (max-width: 640px) {
    .mec-header {
        padding-left: 12px;
        padding-right: 12px;
        gap: 10px;
    }

    .logo-header-mobile {
        width: clamp(120px, 38vw, 140px);
        max-height: 44px;
    }

    .mec-header-ico--aux {
        display: none;
    }

    .mec-header-actions {
        gap: 8px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .logo-header-mobile {
        width: 150px;
        max-height: 48px;
    }

    .mec-header-actions {
        gap: 10px;
    }
}

.mec-header-ico {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-height: 38px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--systech-text);
    display: inline-grid;
    place-items: center;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}

.mec-header-ico:hover {
    background: rgba(var(--systech-blue-rgb), 0.1);
}

.mec-header-ico svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    pointer-events: none;
}

.mec-header-ico.ativo {
    background: rgba(var(--systech-blue-rgb), 0.14);
    color: var(--systech-primary-light);
}

.mec-notify-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--systech-gradient);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2px solid var(--systech-bg);
}

.mec-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--systech-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(var(--systech-purple-rgb), 0.25);
}

.mec-header-desktop {
    display: none;
}

@media (min-width: 1025px) {
    .mec-header-desktop {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin: -8px 0 18px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--systech-border);
    }

    .mec-header-desktop .mec-header-actions {
        position: static;
        transform: none;
        margin-top: 0;
        justify-self: auto;
        grid-area: auto;
    }

    .mec-notify-panel {
        top: 72px;
        right: 32px;
    }
}

.mec-tablet-rail {
    display: none;
}

.mec-tablet-eye {
    display: none;
}

.mec-notify-panel {
    display: none;
    position: fixed;
    top: calc(max(8px, env(safe-area-inset-top)) + 52px);
    right: 12px;
    width: min(320px, calc(100vw - 24px));
    max-height: min(52dvh, 420px);
    overflow: hidden;
    z-index: 240;
    background: #12141a;
    border: 1px solid #263044;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.mec-notify-panel.aberto {
    display: block;
    animation: mecNotifyIn 0.22s ease;
}

.mec-notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #252b38;
}

.mec-notify-head strong {
    color: #fff;
    font-size: 15px;
}

.mec-notify-head button {
    background: transparent;
    color: #8a92a3;
    border: none;
    font-size: 22px;
    padding: 0 4px;
    min-height: 32px;
}

.mec-notify-list {
    padding: 8px;
    max-height: calc(60dvh - 55px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mec-notify-item {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 10px;
    border-radius: 14px;
    color: #dfe4ef;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.mec-notify-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.mec-notify-item + .mec-notify-item {
    margin-top: 4px;
}

.mec-notify-dot {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(107, 159, 255, 0.14);
    color: var(--systech-primary-light);
    font-weight: 900;
}

.mec-notify-item strong {
    display: block;
    color: #fff;
    font-size: 13px;
}

.mec-notify-item span:not(.mec-notify-dot) {
    display: block;
    color: var(--systech-muted);
    font-size: 12px;
    margin-top: 2px;
}

.mec-notify-item b {
    min-width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #1f2633;
    color: #fff;
    font-size: 12px;
}

.mec-notify-item.amarelo .mec-notify-dot { background: rgba(245, 166, 35, 0.16); color: #f5a623; }
.mec-notify-item.laranja .mec-notify-dot { background: rgba(255, 149, 0, 0.16); color: #ff9500; }
.mec-notify-item.vermelho .mec-notify-dot { background: rgba(255, 59, 48, 0.16); color: #ff5d55; }

.mec-notify-empty {
    display: grid;
    gap: 4px;
    padding: 22px 14px;
    text-align: center;
    color: #8992a3;
}

.mec-notify-empty strong {
    color: #fff;
}

@keyframes mecNotifyIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Bottom nav — só celular */
.mec-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #0d0d0f;
    border-top: 1px solid #1f1f22;
    padding: 6px 4px max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
}

@media (max-width: 1024px) {
    .mec-bottom-nav { display: flex; }
}

.mec-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    color: #666;
    font-size: 10px;
    cursor: pointer;
    min-height: 48px;
    max-height: 56px;
    justify-content: center;
    position: relative;
    font-family: inherit;
}

.mec-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.mec-nav-item.ativo { color: var(--systech-primary-light); }

.mec-nav-item.ativo::before {
    content: '';
    position: absolute;
    top: 0;
    width: 40px;
    height: 2px;
    background: var(--systech-primary-light);
    border-radius: 0 0 2px 2px;
}

/* Sheet menu — só celular */
.mec-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 250;
}

.mec-sheet-overlay.aberto { display: block; }

.mec-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 260;
    background: #12141a;
    border-radius: 20px 20px 0 0;
    max-height: 85dvh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mec-sheet.aberto { transform: translateY(0); }

.mec-sheet-handle {
    width: 40px;
    height: 4px;
    background: #444;
    border-radius: 4px;
    margin: 10px auto 0;
}

.mec-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--systech-border);
}

.mec-sheet-header h2 { font-size: 18px; font-weight: 700; }

.mec-sheet-close {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
}

.mec-sheet-list {
    overflow-y: auto;
    padding: 8px 12px 20px;
    -webkit-overflow-scrolling: touch;
}

.mec-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 12px;
    color: #ddd;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid transparent;
}

.mec-sheet-item svg {
    width: 20px;
    height: 20px;
    stroke: #888;
    fill: none;
    stroke-width: 1.5;
}

.mec-sheet-item .chevron { margin-left: auto; color: #555; }

.mec-sheet-item.ativo {
    border-color: rgba(107, 159, 255, 0.4);
    color: var(--systech-primary-light);
    background: rgba(107, 159, 255, 0.08);
}

.mec-sheet-item.em-breve { opacity: 0.45; }

.mec-sheet-item.sair {
    color: #ff6b6b;
    margin-top: 8px;
    border-top: 1px solid var(--systech-border);
    border-radius: 0;
    padding-top: 18px;
}

.mec-sheet-label {
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 12px 4px;
}

@media (min-width: 1025px) {
    .mec-header,
    .mec-bottom-nav,
    .mec-sheet,
    .mec-sheet-overlay { display: none !important; }

    .mec-metricas { grid-template-columns: repeat(3, 1fr); }
    .mec-btn-acao.primario { flex: 0 1 auto; min-width: 180px; }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .main {
        padding: 18px 22px calc(86px + env(safe-area-inset-bottom));
    }

    .mec-header {
        padding-left: 22px;
        padding-right: 22px;
    }

    .mec-metricas { grid-template-columns: repeat(2, 1fr); }
    .dash-hero { grid-template-columns: 1fr; }
    .card-faturamento { flex-direction: row; align-items: center; }
    .faturamento-detalhes { width: auto; justify-content: flex-end; }
    .mec-btn-acao.primario { flex: 1 1 calc(50% - 5px); }
    .mec-btn-acao.secundario { flex: 1 1 calc(33.333% - 8px); min-width: 0; }
    .fin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .form-linha input,
    .form-linha select { flex: 1 1 calc(50% - 10px) !important; }
    .page-header {
        align-items: center;
        gap: 12px;
    }
    .modal-conteudo {
        width: min(680px, calc(100vw - 40px)) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    body.tablet-shell,
    body.ordens-page {
        background: var(--systech-bg);
    }

    body.tablet-shell .sidebar,
    body.tablet-shell .menu-mobile-btn,
    body.tablet-shell .sidebar-overlay,
    body.ordens-page .sidebar,
    body.ordens-page .menu-mobile-btn,
    body.ordens-page .sidebar-overlay {
        display: none !important;
    }

    body.tablet-shell .main,
    body.ordens-page .main {
        margin-left: 44px;
        width: calc(100% - 44px);
        padding: 12px 18px calc(86px + env(safe-area-inset-bottom));
        min-height: 0;
    }

    body.tablet-shell .mec-header,
    body.ordens-page .mec-header {
        display: flex !important;
        padding-left: calc(44px + 14px);
    }

    body.tablet-shell .mec-bottom-nav,
    body.ordens-page .mec-bottom-nav {
        display: flex !important;
        padding-left: calc(44px + env(safe-area-inset-left));
    }
}

@media (min-width: 769px) {
    .os-page {
        display: block;
        overflow: hidden;
        height: 100dvh;
        padding-left: env(safe-area-inset-left);
        background: var(--systech-bg);
    }

    .os-page .sidebar,
    .os-page .mec-header,
    .os-page .mec-bottom-nav,
    .os-page .mec-sheet,
    .os-page .mec-sheet-overlay,
    .os-page .menu-mobile-btn,
    .os-page .sidebar-overlay {
        display: none !important;
    }

    .os-page .main {
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        margin-left: 44px;
        padding: 34px 22px 28px;
        width: calc(100% - 44px);
    }

    .mec-tablet-rail {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 220;
        width: 44px;
        padding: max(72px, calc(env(safe-area-inset-top) + 58px)) 6px 10px;
        flex-direction: column;
        align-items: center;
        gap: 9px;
        background: var(--systech-bg);
        border-right: 1px solid var(--systech-border);
    }

    .mec-rail-item {
        width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 0;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: #748096;
        display: grid;
        place-items: center;
    }

    .mec-rail-item svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.6;
    }

    .mec-rail-item.ativo {
        background: var(--systech-primary);
        color: #fff;
        box-shadow: 0 0 18px rgba(var(--systech-primary-rgb), 0.35);
    }

    .mec-rail-item.em-breve {
        opacity: 0.55;
    }

    .mec-tablet-eye {
        display: grid;
        position: fixed;
        top: max(42px, env(safe-area-inset-top));
        right: 12px;
        z-index: 230;
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
        border: 1px solid #253146;
        border-radius: 50%;
        background: rgba(13, 17, 25, 0.9);
        color: #e7eaf0;
        place-items: center;
        cursor: pointer;
        touch-action: manipulation;
    }

    .mec-tablet-tema {
        display: grid;
        position: fixed;
        top: max(42px, env(safe-area-inset-top));
        right: 56px;
        z-index: 230;
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
        border: 1px solid #253146;
        border-radius: 50%;
        background: rgba(13, 17, 25, 0.9);
        color: #e7eaf0;
        place-items: center;
        cursor: pointer;
        touch-action: manipulation;
    }

    .mec-tablet-tema svg,
    .mec-tablet-eye svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.7;
    }

    .mec-tablet-eye.ativo {
        color: var(--systech-primary-light);
        border-color: rgba(107, 159, 255, 0.4);
        background: rgba(47, 128, 255, 0.12);
    }

    .mec-tablet-tema.ativo {
        color: var(--systech-primary-light);
        border-color: rgba(107, 159, 255, 0.4);
        background: rgba(47, 128, 255, 0.12);
    }
}

@media (max-width: 480px) {
    .mec-btn-acao.secundario { flex: 1 1 100%; }
}

@media (max-width: 768px) {
    .fin-cards,
    .grid {
        grid-template-columns: 1fr !important;
    }

    .form-linha input,
    .form-linha select,
    .form-linha button {
        flex: 1 1 100% !important;
        width: 100%;
    }

    .cliente-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

/* Busca global — overlay oculto até clicar na lupa */
body.mec-busca-aberta {
    overflow: hidden;
}

.mec-busca-panel {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 10050;
    margin: 0;
    padding: max(72px, env(safe-area-inset-top) + 48px) 16px 16px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.mec-busca-panel.aberto {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.mec-busca-dialog {
    width: min(560px, 100%);
    animation: st-fade-up 0.25s ease both;
}

.mec-busca-head {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--systech-surface);
    border: 1px solid var(--systech-border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.mec-busca-head svg {
    width: 20px;
    height: 20px;
    color: var(--systech-muted);
    flex-shrink: 0;
}

.mec-busca-head input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--systech-text);
    font-size: 16px;
    outline: none;
}

.mec-busca-head input::placeholder {
    color: var(--systech-muted);
}

.mec-busca-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--systech-surface-2);
    color: var(--systech-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.mec-busca-close:hover {
    background: rgba(var(--systech-primary-rgb), 0.15);
    color: var(--systech-text);
}

.mec-busca-resultados {
    margin-top: 8px;
    max-height: min(60vh, 480px);
    overflow: auto;
    background: var(--systech-surface);
    border: 1px solid var(--systech-border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.mec-busca-grupo {
    margin-bottom: 8px;
}

.mec-busca-grupo strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--systech-muted);
    margin: 8px 10px 4px;
}

.mec-busca-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}

.mec-busca-item:hover {
    background: rgba(var(--systech-primary-rgb), 0.12);
}

.mec-busca-hint {
    padding: 20px 16px;
    color: var(--systech-muted);
    font-size: 13px;
    text-align: center;
    margin: 0;
}
