/* ============================================================
   mais.css — Plantão10
   Aba "Mais" (substitui o drawer mobile) + slot dinâmico do header.
   ============================================================ */

/* ===== Aba "Mais" ========================================== */
.tab-mais .tab-mais-shell {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 4px 12px 24px;
    box-sizing: border-box;
}

.mais-section { margin-bottom: 18px; }
.mais-section-title {
    margin: 0 0 8px;
    padding: 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 8px;
}
.mais-section-title i { font-size: 0.8rem; opacity: 0.7; }

.mais-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-container);
    border: 1px solid var(--rec-split-border, var(--border-color));
    border-radius: 12px;
    overflow: hidden;
}
.mais-list li + li { border-top: 1px solid var(--rec-split-border, var(--border-color)); }

.mais-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    box-sizing: border-box;
    min-height: 52px;
}
.mais-list-item:hover,
.mais-list-item:active { background: var(--hover-row, rgba(0,0,0,0.04)); }

.mais-item-icon {
    width: 24px;
    text-align: center;
    color: var(--accent-color);
    font-size: 1.05rem;
    flex-shrink: 0;
}
.mais-item-label { flex: 1; min-width: 0; }
.mais-item-chev {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.mais-list-item-danger .mais-item-icon { color: var(--danger-color, #d33); }
.mais-list-item-danger .mais-item-label { color: var(--danger-color, #d33); font-weight: 600; }

.mais-list-item-primary .mais-item-label { color: var(--accent-color); font-weight: 700; }
.mais-list-item-cta {
    background: var(--accent-color);
    color: #fff;
}
.mais-list-item-cta:hover,
.mais-list-item-cta:active { background: var(--accent-hover, var(--accent-color)); }
.mais-list-item-cta .mais-item-icon,
.mais-list-item-cta .mais-item-label { color: #fff; }

/* Tema picker dentro da aba Mais */
.mais-tema-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-container);
    border: 1px solid var(--rec-split-border, var(--border-color));
    border-radius: 12px;
    padding: 8px;
}
.mais-tema-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.mais-tema-opt:hover { background: var(--hover-row, rgba(0,0,0,0.04)); }
.mais-tema-opt.selected {
    background: var(--accent-tint, rgba(16,83,164,0.07));
    border-color: var(--accent-color);
}
.mais-tema-opt .mt-preview {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, #fff 0 50%, #eef 50% 100%);
}
.mais-tema-opt .mt-light    { background: linear-gradient(135deg, #fff 0 50%, #f1f5fb 50% 100%); }
.mais-tema-opt .mt-hospital { background: linear-gradient(135deg, #0a0d12 0 50%, #1c2128 50% 100%); }
.mais-tema-opt .mt-carvao   { background: linear-gradient(135deg, #1a2233 0 50%, #233047 50% 100%); }
.mais-tema-opt .mt-label { flex: 1; }
.mais-tema-opt .mt-check {
    color: var(--accent-color);
    opacity: 0;
    font-size: 0.95rem;
}
.mais-tema-opt.selected .mt-check { opacity: 1; }

/* Aba "Mais" só é relevante no mobile, mas pode ser aberta no desktop também
   (não tem prejuízo visual). No desktop, o sticky wrapper já está display:none. */


/* ===== Slot dinâmico do header ============================ */
.header-dynamic-slot {
    display: none;
    flex: 1;
    min-width: 0;
    align-items: center;
    margin: 0 8px;
}
.header-dynamic-slot.active { display: flex; }

/* Inputs/selects clonados dentro do slot: aparência padronizada */
.header-dynamic-slot .header-dynamic-clone {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1.5px solid color-mix(in srgb, var(--accent-color) 40%, transparent);
    border-radius: 8px;
    background: var(--bg-container);
    color: var(--text-main);
    /* 16px mínimo para iOS Safari não dar zoom ao focar input. */
    font-size: 16px;
    font-weight: 500;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    box-sizing: border-box;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a9ab8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 14px;
}
.header-dynamic-slot select.header-dynamic-clone {
    /* select usa chevron em vez de lupa */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a9ab8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-position: right 12px center;
    padding-left: 14px;
    padding-right: 36px;
}
.header-dynamic-slot .header-dynamic-clone:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-tint, rgba(16,83,164,0.18)), 0 2px 8px rgba(0,0,0,0.08);
}

/* Mobile: quando o slot está ativo, o título some para abrir espaço.
   Layout vira: [logo] [slot] [user-pill] em linha única. */
@media (max-width: 900px) {
    body.header-slot-active #titulo-sistema,
    body.header-slot-active .title-mobile { display: none !important; }
    body.header-slot-active .header-left { width: auto; padding-top: 0; flex: 0 0 auto; }
    body.header-slot-active .header-right { width: auto; }
    body.header-slot-active .header-inner { flex-wrap: nowrap; gap: 8px; }

    /* Demais controles do .header-right somem no modo compacto;
       o user pill já foi movido pelo JS para fora de .header-left. */
    body.header-slot-active .header-right > div:not(.user-dropdown-container),
    body.header-slot-active .header-right > button,
    body.header-slot-active .header-right > .tema-picker-wrap,
    body.header-slot-active .header-right > .visitor-links { display: none !important; }

    /* Quando o slot está ativo, a pill mobile (user-pill ou btn-login-mobile,
       movida pelo JS para depois do slot) fica como item flex independente,
       com margin-left zero (não precisa do auto). */
    body.header-slot-active #btn-user-mobile.user-mini-pill,
    body.header-slot-active #btn-login-mobile.btn-login-mobile {
        margin-left: 0;
        flex: 0 0 auto;
    }
}

/* Desktop: slot sempre escondido. */
@media (min-width: 901px) {
    .header-dynamic-slot { display: none !important; }
}


/* ===== Sticky wrapper com 4 botões ========================= */
@media (max-width: 900px) {
    .main-tabs-sticky-wrapper .main-tabs .tab-btn {
        /* 25% cada com 4 botões em vez de 33% com 3. */
        font-size: 10.5px !important;
    }
    .main-tabs-sticky-wrapper .main-tabs .tab-btn .tab-icon { font-size: 17px; }
}
