/* ==========================================================
   BASE
========================================================== */

body {
    background: #f3f5f4;
    font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    padding: 0;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

[id]{
    scroll-margin-top:90px;
}

.container,
.container-fluid{
    max-width:100%;
}

/* ==========================================================
   MODE NAVIGATEUR (par défaut)
========================================================== */

.app-header,
.app-bottom-nav{
    display:none;
}

/* ==========================================================
   MODE PWA (application installée)
========================================================== */

body.is-pwa{
    padding-top:84px;
    padding-bottom:96px;
}

body.is-pwa .navbar{
    display:none !important;
}

body.is-pwa .app-header{
    display:flex;
}

body.is-pwa .app-bottom-nav{
    display:flex;
}

/* ==========================================================
   HEADER
========================================================== */

.app-header{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:72px;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 18px;
    box-shadow:0 4px 18px rgba(0,0,0,.08);
    z-index:9998;
}

.app-title{
    font-size:18px;
    font-weight:900;
    color:#143d2c;
}

.app-subtitle{
    font-size:12px;
    color:#6c757d;
}

.app-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 19px;
}

.app-header-icon i {
    line-height: 1;
}

/* ==========================================================
   NAVIGATION BASSE
========================================================== */

.app-bottom-nav{
    position:fixed;
    left:12px;
    right:12px;
    bottom:12px;
    height:66px;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(14px);
    border:1px solid rgba(0,0,0,.06);
    border-radius:24px;
    display:none;
    justify-content:space-around;
    align-items:center;
    box-shadow:0 12px 35px rgba(0,0,0,.18);
    z-index:9998;
}

.app-bottom-nav a{
    flex:1;
    height:54px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:4px;
    text-decoration:none;
    color:#8a94a6;
    font-size:11px;
    font-weight:800;
    border-radius:18px;
}

.app-bottom-nav i{
    font-size:21px;
}

.app-bottom-nav span{
    font-size:10px;
}

.app-bottom-nav a.active{
    background:#e0f2fe;
    color:#2563eb;
}

.container,
.container-fluid {
    max-width: 100%;
}

h1,
.page-title,
.alert-secondary {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-weight: 800;
    color: #1f2a2e;
}

.card,
.alert,
.table {
    border-radius: 16px !important;
    overflow: hidden;
}

.btn-outline-primary {
    border-radius: 999px;
    font-weight: 600;
}

body {
    background: #f3f5f4;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Mobile & tablette */
@media (max-width: 991.98px) {
    body {
        padding-top: 84px;
        padding-bottom: 96px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    body {
        padding-top: 0;
        padding-bottom: 0;
    }
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: #ffffff;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.app-title {
    font-size: 18px;
    font-weight: 900;
    color: #143d2c;
    line-height: 1.1;
}

.app-subtitle {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    margin-top: 3px;
}

.app-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #f2f4f3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
}

.app-card {
    background: #fff;
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    border: 0;
}

.app-card-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #163b2d;
}

.app-grid{
    display:flex;
    justify-content:space-between;
    gap:10px;
    overflow-x:auto;
    scrollbar-width:none;
}

.app-grid::-webkit-scrollbar{
    display:none;
}
.app-shortcut{
    min-width:72px;
    background:white;
    border-radius:18px;
    padding:12px 8px;
    text-align:center;
    text-decoration:none;
    color:#2c3e50;
    box-shadow:0 6px 18px rgba(0,0,0,.08);
}

.app-shortcut-icon{
    width:46px;
    height:46px;
    border-radius:50%;
    margin:auto;
    margin-bottom:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
}

.app-shortcut-title{
    font-size:12px;
    font-weight:700;
}

.app-rank-card {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 30px rgba(37,99,235,.28);
}

.app-rank-label {
    font-size: 13px;
    font-weight: 700;
    opacity: .9;
}

.app-rank-main {
    font-size: 46px;
    font-weight: 900;
    line-height: 1;
}

.app-rank-main sup {
    font-size: 18px;
    margin-left: 2px;
}

.app-rank-points {
    text-align: right;
}

.app-rank-points strong {
    display: block;
    font-size: 34px;
    line-height: 1;
}

.app-rank-points span {
    font-size: 13px;
    font-weight: 700;
    opacity: .9;
}

.app-rank-details {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.app-rank-details div {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.app-rank-details strong {
    display: block;
    color: #1e293b;
    margin-top: 3px;
}


.ptr--ptr {
    box-shadow: none !important;
    font-size: 14px;
    font-weight: 700;
    color: #0b5d3b;
}

.ptr--icon {
    color: #0b5d3b;
}

.ptr--text {
    color: #0b5d3b;
}

#app-pull-refresh {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #0b5d3b;
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    z-index: 10000;
    transition: .2s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

#app-pull-refresh.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(8px);
}

/* ===========================
   ACCÈS RAPIDE
=========================== */
.quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.quick-action {
    flex: 1;
    text-decoration: none;
    text-align: center;
    color: #2d3748;
}

.quick-action:hover {
    color: #2d3748;
}

.quick-icon {
    width: 52px;
    height: 52px;
    margin: auto;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    margin-bottom: 7px;
    transition: .2s;
}

.quick-icon i {
    line-height: 1;
}

.quick-action:active .quick-icon {
    transform: scale(.92);
}

.quick-action span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
}

.quick-icon.blue { background: #dbeafe; color: #2563eb; }
.quick-icon.orange { background: #ffedd5; color: #ea580c; }
.quick-icon.green { background: #dcfce7; color: #16a34a; }
.quick-icon.purple { background: #ede9fe; color: #7c3aed; }
.quick-icon.red { background: #fee2e2; color: #dc2626; }

.app-btn-top {
    position: fixed;
    right: 18px;
    bottom: calc(72px + 18px);
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    z-index: 9997;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.app-btn-top.visible {
    display: flex;
}

.app-btn-top:active {
    transform: scale(.92);
}

#btnTop.app-btn-top {
    position: fixed !important;
    right: 18px !important;
    bottom: 96px !important;
    width: 52px !important;
    height: 52px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #2563eb !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.22) !important;
    z-index: 99999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
}

#btnTop.app-btn-top.visible {
    display: flex !important;
}

html {
    scroll-behavior: smooth;
}

[id] {
    scroll-margin-top: 90px;
}

body {
    padding-bottom: 96px;
}

body {
    background: #f3f5f4;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding-top: 0;
    padding-bottom: 0;
}

/* Par défaut : navigateur standard */
.app-header,
.app-bottom-nav {
    display: none !important;
}

/* Mode application installée */
body.is-pwa {
    padding-top: 84px;
    padding-bottom: 96px;
}

body.is-pwa .navbar {
    display: none !important;
}

body.is-pwa .app-header {
    display: flex !important;
}

body.is-pwa .app-bottom-nav {
    display: flex !important;
}