/* ============================================================
   Customizable bottom navigation bar + section card grid
   ============================================================ */

/* ---------- Section tabs as a card grid ---------- */
.dashboard-container .tab-navigation {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px 24px;
    overflow: visible !important;
    border-bottom: none;
}
.dashboard-container .tab-btn {
    display: flex; /* no !important — must not override permission-based display:none */
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    min-height: 70px;
    padding: 16px 12px;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    border: 1px solid #ececec;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.dashboard-container .tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
}
.dashboard-container .tab-btn.active {
    border-color: #007bff;
    background: #e6f2ff;     /* light blue tint — keep the card readable */
    color: #004a99;          /* dark blue label */
    box-shadow: 0 4px 14px rgba(0, 123, 255, .28);
}
@media (max-width: 600px) {
    .dashboard-container .tab-navigation {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        padding: 12px;
    }
    .dashboard-container .tab-btn { font-size: 14px; min-height: 64px; }
}

/* ---------- Bottom navigation bar ---------- */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, .09);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 9990;
    direction: rtl;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.abn-item {
    flex: 1;
    max-width: 90px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
}
.abn-icon { font-size: 22px; line-height: 1; }
.abn-label { font-size: 11px; white-space: nowrap; }
.abn-item.active { color: #007bff; }
.abn-item:active { transform: scale(.92); }
.abn-edit { color: #999; }

/* ---------- Customization / account sheet ---------- */
.abn-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.abn-sheet {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 18px 18px 0 0;
    padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0));
    direction: rtl;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
    animation: abn-slide-up .22s ease;
}
@keyframes abn-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.abn-sheet h3 { margin: 0 0 4px; color: #185a9d; font-size: 19px; }
.abn-hint { margin: 0 0 14px; color: #888; font-size: 13px; }
.abn-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.abn-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
}
.abn-pick input { width: 18px; height: 18px; cursor: pointer; }
.abn-pick-icon { font-size: 20px; }
.abn-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.abn-sheet-actions button {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}
.abn-btn-cancel { background: #eceff3; color: #333; }
.abn-btn-save { background: #007bff; color: #fff; }

/* account sheet */
.abn-account { text-align: center; padding: 8px 0 4px; }
.abn-avatar-wrap { position: relative; width: 88px; height: 88px; margin: 0 auto 10px; }
.abn-avatar {
    width: 88px; height: 88px; border-radius: 50%;
    object-fit: cover; border: 3px solid #007bff; display: block;
}
.abn-avatar-ph {
    display: flex; align-items: center; justify-content: center;
    background: #007bff; color: #fff; font-size: 36px; font-weight: 800;
}
.abn-avatar-edit {
    position: absolute; bottom: 0; left: 0;
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid #fff; background: #185a9d; color: #fff;
    cursor: pointer; font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.abn-acc-name { font-size: 20px; font-weight: 800; color: #222; }
.abn-acc-line { color: #666; font-size: 14px; margin-top: 4px; }
.abn-acc-actions { flex-wrap: wrap; }
.abn-btn-pass { background: #e8f0fe; color: #1558c0; flex-basis: 100%; }
.abn-btn-logout { background: #ffe0e0; color: #c00; }

/* ---------- Lift floating UI above the bar ---------- */
body.has-bottom-nav .dashboard-container { padding-bottom: 84px; }
body.has-bottom-nav .sos-fab { bottom: 80px; }
body.has-bottom-nav .sos-cr-panel { bottom: 76px; }
body.has-bottom-nav .sticky-ann-stack { bottom: 172px; }
body.has-bottom-nav #enableNotificationsBtn { bottom: 80px !important; }
body.has-bottom-nav #pwaInstallBtn { bottom: 80px !important; }

/* ---------- Dark mode ---------- */
body.dark-mode .app-bottom-nav { background: #1f2733; border-color: #33404f; }
body.dark-mode .abn-item { color: #aab4c0; }
body.dark-mode .abn-sheet { background: #1f2733; }
body.dark-mode .abn-sheet h3 { color: #8ab4f8; }
body.dark-mode .abn-pick { border-color: #33404f; color: #e2e8f0; }
body.dark-mode .abn-acc-name { color: #e2e8f0; }
body.dark-mode .abn-btn-cancel { background: #33404f; color: #e2e8f0; }
body.dark-mode .dashboard-container .tab-btn { background: #1f2733; border-color: #33404f; color: #e2e8f0; }

/* Generic page clearance for standalone pages (visits, documents, polls...). */
body.has-bottom-nav { padding-bottom: 84px; }
