/* =============================================
   JUDOCLUB — Gestion de club de judo
   Fonts : Outfit (display) + Plus Jakarta Sans (body)
   ============================================= */

:root {
    --red: #C8102E;
    --red-dark: #9B0A20;
    --red-light: #E8354A;
    --gold: #E8A838;
    --gold-dark: #C48A20;
    --gold-light: #F2C462;
    --navy: #1B2A4A;
    --navy-light: #2D4470;
    --slate: #5C6778;
    --green: #2A9D6F;
    --bg: #F4F1EB;
    --bg-warm: #EDE8DF;
    --white: #FFFFFF;
    --text: #1A1A2E;
    --text-sub: #7A7A8E;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --f-display: 'Outfit', sans-serif;
    --f-body: 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
    font-family: var(--f-body);
    background: var(--bg);
    color: var(--text);
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { display: none; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--f-body); }

/* ======================== HEADER ======================== */
.app-header {
    background: linear-gradient(150deg, var(--red) 0%, var(--red-dark) 100%);
    padding: 18px 20px 22px;
    border-radius: 0 0 26px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
    animation: headerIn .45s ease;
}
.app-header::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0 0 26px 26px;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff' fill-opacity='.035'%3E%3Cpath d='M20 0L0 20h8l12-12 12 12h8z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.header-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.header-logo {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.12);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.08);
}
.header-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: 22px;
    color: #fff;
    letter-spacing: -.03em;
    line-height: 1;
}
.header-title span { color: var(--gold-light); }
.header-sub {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    font-weight: 500;
    margin-top: 3px;
    letter-spacing: .02em;
}
.header-user {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.1);
    border-radius: var(--radius-sm);
    padding: 8px 14px 8px 10px;
    position: relative; z-index: 1;
    border: 1px solid rgba(255,255,255,.06);
    transition: background .2s;
}
.header-user:hover { background: rgba(255,255,255,.16); }
.header-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 14px;
    font-family: var(--f-display);
}
.header-name { color: #fff; font-weight: 600; font-size: 14px; }

/* ======================== ROLE TOGGLE ======================== */
.role-toggle {
    display: flex;
    background: var(--white);
    border-radius: 14px;
    padding: 4px;
    margin: 16px 16px 4px;
    box-shadow: var(--shadow-sm);
}
.role-btn {
    flex: 1;
    padding: 11px 14px;
    border: none;
    border-radius: 11px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: transparent;
    color: var(--text-sub);
}
.role-btn.active {
    background: var(--red);
    color: #fff;
    box-shadow: 0 3px 14px rgba(200,16,46,.3);
}

/* ======================== VIEW PANELS ======================== */
.view-panel { display: none; }
.view-panel.active { display: block; }

/* ======================== SECTIONS ======================== */
.section-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15.5px;
    color: var(--text);
    margin: 20px 16px 10px;
    letter-spacing: -.01em;
    opacity: 0;
    animation: fadeUp .45s ease forwards;
}
.page-content { padding: 0 0 16px; }
.page-title {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--text);
    padding: 18px 16px 14px;
    letter-spacing: -.02em;
}

/* ======================== CARD GRID ======================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 6px;
}
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius);
    padding: 15px 5px 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 92px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    opacity: 0;
    transform: translateY(12px) scale(.97);
    animation: cardIn .38s ease forwards;
}
.card-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-btn:hover { transform: translateY(-2px) scale(1.03); }
.card-btn:active { transform: scale(.95) !important; transition-duration: .08s; }

.card-btn.red   { background: var(--red);   box-shadow: 0 4px 14px rgba(200,16,46,.25); }
.card-btn.gold  { background: var(--gold);  box-shadow: 0 4px 14px rgba(232,168,56,.25); }
.card-btn.navy  { background: var(--navy);  box-shadow: 0 4px 14px rgba(27,42,74,.25); }
.card-btn.slate { background: var(--slate); box-shadow: 0 4px 14px rgba(92,103,120,.25); }
.card-btn.green { background: var(--green); box-shadow: 0 4px 14px rgba(42,157,111,.25); }

.card-btn.red:hover   { box-shadow: 0 8px 22px rgba(200,16,46,.38); }
.card-btn.gold:hover  { box-shadow: 0 8px 22px rgba(232,168,56,.38); }
.card-btn.navy:hover  { box-shadow: 0 8px 22px rgba(27,42,74,.38); }
.card-btn.slate:hover { box-shadow: 0 8px 22px rgba(92,103,120,.38); }
.card-btn.green:hover { box-shadow: 0 8px 22px rgba(42,157,111,.38); }

.card-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.card-label {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    letter-spacing: .01em;
}

/* ======================== BOTTOM NAV ======================== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 430px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 max(14px, env(safe-area-inset-bottom));
    box-shadow: 0 -3px 18px rgba(0,0,0,.05);
    border-radius: 20px 20px 0 0;
    z-index: 100;
}
.nav-tab {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 4px 14px;
    position: relative;
    transition: all .2s;
}
.nav-tab span {
    font-size: 10px; font-weight: 500; color: #A0A0B0;
    transition: all .2s;
}
.nav-tab.active span { color: var(--red); font-weight: 700; }
.nav-icon { transition: transform .2s; }
.nav-tab.active .nav-icon { transform: scale(1.12); }
.nav-indicator {
    position: absolute; top: -2px;
    width: 20px; height: 3px;
    background: var(--red);
    border-radius: 2px;
}

/* ======================== PLANNING ======================== */
.day-label {
    font-size: 12px; font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 0 16px;
    margin: 16px 0 8px;
}
.course-card {
    background: var(--white);
    border-radius: 14px;
    padding: 13px 16px;
    margin: 0 16px 8px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--red);
    transition: transform .2s;
}
.course-card:hover { transform: translateX(3px); }
.course-time {
    font-weight: 700; font-size: 12.5px;
    min-width: 90px;
    color: var(--red);
    font-family: var(--f-display);
}
.course-info h4 { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.course-info small { font-size: 11px; color: var(--text-sub); }

.course-card.cat-eveil    { border-color: #72b5be; } .course-card.cat-eveil .course-time    { color: #457b9d; }
.course-card.cat-benjamin { border-color: #457b9d; } .course-card.cat-benjamin .course-time { color: #457b9d; }
.course-card.cat-cadet    { border-color: var(--red); }
.course-card.cat-senior   { border-color: var(--navy); }   .course-card.cat-senior .course-time   { color: var(--navy); }
.course-card.cat-poussin  { border-color: var(--green); }  .course-card.cat-poussin .course-time  { color: var(--green); }
.course-card.cat-compet   { border-color: #e76f51; }       .course-card.cat-compet .course-time   { color: #e76f51; }
.course-card.cat-loisir   { border-color: var(--slate); }  .course-card.cat-loisir .course-time   { color: var(--slate); }

/* ======================== STATS ======================== */
.stat-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; padding: 0 16px; margin-bottom: 18px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 10.5px; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.stat-value { font-family: var(--f-display); font-size: 28px; font-weight: 800; line-height: 1; }
.stat-change { font-size: 11px; font-weight: 600; color: var(--green); margin-top: 4px; }

.belt-chart {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    margin: 0 16px;
    box-shadow: var(--shadow-sm);
}
.belt-chart h3 { font-family: var(--f-display); font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.belt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.belt-row:last-child { margin-bottom: 0; }
.belt-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.belt-name { font-size: 12px; font-weight: 600; width: 56px; flex-shrink: 0; }
.belt-bar-bg { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.belt-bar { height: 100%; border-radius: 5px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.belt-count { font-size: 12px; font-weight: 700; color: var(--text-sub); width: 26px; text-align: right; }

/* ======================== LISTS ======================== */
.list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 0 16px 8px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s;
    cursor: pointer;
}
.list-card:hover { transform: translateX(3px); }
.list-info h4 { font-weight: 600; font-size: 14px; margin-bottom: 1px; }
.list-info small { font-size: 11.5px; color: var(--text-sub); }
.list-badge {
    font-size: 11px; font-weight: 600;
    padding: 4px 11px; border-radius: 8px;
    background: var(--bg); color: var(--text-sub);
    flex-shrink: 0; white-space: nowrap;
}
.list-badge.green { background: #e8f5e9; color: #2e7d32; }
.list-badge.red   { background: #fce4ec; color: #c62828; }
.list-badge.gold  { background: #fff8e1; color: #e65100; }
.list-badge.navy  { background: #e3eaf5; color: #1B2A4A; }

/* ======================== PROFIL ======================== */
.profile-card {
    background: var(--white);
    border-radius: 22px;
    padding: 28px 20px 24px;
    margin: 18px 16px 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.profile-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 78px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
}
.profile-avatar {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    position: relative; z-index: 1;
    border: 4px solid var(--white);
    box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.profile-name { font-family: var(--f-display); font-weight: 800; font-size: 20px; position: relative; z-index: 1; }
.profile-grade { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.profile-role { font-size: 12px; color: var(--red); font-weight: 600; margin-top: 3px; }

/* ======================== DETAIL PAGES ======================== */
.detail-header { display: flex; align-items: center; padding: 14px 16px 4px; }
.btn-back {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 5px;
    font-size: 14px; font-weight: 600; color: var(--red);
    padding: 6px 0;
    font-family: var(--f-body);
}
.detail-title {
    font-family: var(--f-display);
    font-weight: 800; font-size: 22px;
    padding: 2px 16px 14px;
    letter-spacing: -.02em;
}

/* ======================== WIDGETS ======================== */
.summary-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    margin: 0 16px 14px;
    box-shadow: var(--shadow-sm);
}
.summary-box .summary-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.summary-box .summary-head h3 {
    font-family: var(--f-display); font-weight: 700; font-size: 15px;
}
.summary-cols {
    display: flex; gap: 10px;
}
.summary-col {
    flex: 1;
    background: var(--bg);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.summary-col .big {
    font-family: var(--f-display);
    font-size: 26px; font-weight: 800; line-height: 1;
}
.summary-col .small { font-size: 11px; color: var(--text-sub); margin-top: 3px; }
.summary-col .big.green { color: var(--green); }
.summary-col .big.red { color: var(--red); }

/* Chips appel */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 13px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all .15s;
    font-family: var(--f-body);
}
.chip.ok  { background: #e8f5e9; color: #2e7d32; }
.chip.ko  { background: #fce4ec; color: #c62828; }
.chip:active { transform: scale(.94); }

/* ======================== ANIMATIONS ======================== */
@keyframes headerIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes listIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
