/* ============================================================
   Auth + Reserves CSS — Centre d'Entrenament Roget
   Hereta la paleta del style.css:
   --primary: #d23030 · --dark: #091E3E · fons body: #444
   ============================================================ */

/* ---------- Header auth zone ---------- */
.auth-zone {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.auth-zone .btn-login {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-zone .profile-dropdown > .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    transition: all 0.3s;
}

.auth-zone .profile-dropdown > .nav-link:hover,
.navbar.sticky-top.shadow-sm .auth-zone .profile-dropdown > .nav-link {
    color: var(--primary);
    border-color: var(--primary);
}

.auth-zone .profile-dropdown .fa-user-circle {
    font-size: 1.3rem;
    color: var(--primary);
}

.auth-zone .dropdown-menu {
    background: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 220px;
}

.auth-zone .dropdown-menu .dropdown-item {
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: 0.25s;
}

.auth-zone .dropdown-menu .dropdown-item:hover,
.auth-zone .dropdown-menu .dropdown-item:focus {
    background: var(--primary);
    color: #fff;
}

.auth-zone .dropdown-menu .dropdown-item i {
    margin-right: 0.6rem;
    color: var(--primary);
}

.auth-zone .dropdown-menu .dropdown-item:hover i,
.auth-zone .dropdown-menu .dropdown-item:focus i {
    color: #fff;
}

/* Navbar sticky white state: ajustar text auth-zone */
.navbar.sticky-top.shadow-sm .auth-zone .btn-login {
    color: var(--primary);
    border-color: var(--primary);
}
.navbar.sticky-top.shadow-sm .auth-zone .profile-dropdown > .nav-link {
    color: var(--dark);
    border-color: rgba(0, 0, 0, 0.2);
}

/* ---------- Auth Modal ---------- */
#authModal .modal-content {
    background: var(--dark);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

#authModal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1.5rem 0.5rem;
}

#authModal .modal-title {
    color: var(--primary);
    text-transform: uppercase;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    letter-spacing: 1px;
}

#authModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(2);
}

#authModal .nav-tabs {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

#authModal .nav-tabs .nav-link {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.75rem 1.25rem;
}

#authModal .nav-tabs .nav-link.active,
#authModal .nav-tabs .nav-link:hover {
    color: #fff;
    border-bottom-color: var(--primary);
}

#authModal .form-control,
.auth-form .form-control {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    height: 50px;
}

#authModal .form-control::placeholder,
.auth-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#authModal .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(210, 48, 48, 0.25);
}

#authModal textarea.form-control { height: auto; }

/* Opcions dels selects sobre fons fosc — força colors perquè el
   navegador no deixi les opcions blanc-sobre-blanc quan no hi ha hover. */
body.bg-dark select option,
body.bg-dark select optgroup,
.auth-form select option,
#authModal select option,
#newUserModal select option,
.side-card select option {
    background-color: #0b1d3a !important;
    color: #fff !important;
}
body.bg-dark select option:checked,
.auth-form select option:checked,
#newUserModal select option:checked {
    background-color: #143b78 !important;
    color: #fff !important;
}

.phone-input-group .phone-prefix {
    flex: 0 0 120px;
    max-width: 120px;
}
.phone-input-group .form-control {
    height: 50px;
}

/* Responsive — mòbils i tauletes petites */
@media (max-width: 575.98px) {
    .phone-input-group .phone-prefix {
        flex: 0 0 96px;
        max-width: 96px;
        font-size: 0.85rem;
        padding-left: 0.5rem;
        padding-right: 0.25rem;
    }
    .phone-input-group .form-control {
        font-size: 0.95rem;
    }
    #newUserModal .modal-dialog,
    #authModal .modal-dialog {
        margin: 0.5rem;
    }
    #newUserModal .modal-body,
    #authModal .modal-body {
        padding: 1rem;
    }
    #newUserModal .form-control,
    #authModal .form-control,
    .auth-form .form-control {
        height: 46px;
        font-size: 16px; /* evita zoom automàtic a iOS */
    }
    #newUserModal .row.g-2 > [class*="col-"] {
        margin-bottom: 0.25rem;
    }
    #forcePwdModal .modal-dialog {
        margin: 0.5rem;
    }
}

/* Tauletes — assegurar que els camps amplats funcionen bé */
@media (min-width: 576px) and (max-width: 991.98px) {
    .phone-input-group .phone-prefix {
        flex: 0 0 110px;
        max-width: 110px;
    }
}

#authModal .form-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.4rem;
}

#authModal .auth-feedback {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}
#authModal .auth-feedback.ok    { color: #34AD54; }
#authModal .auth-feedback.error { color: #ff6b6b; }

/* ---------- Page wrappers ---------- */
.page-wrapper {
    background: #444;
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
}

.page-wrapper .section-title-block {
    text-align: center;
    margin-bottom: 3rem;
}

.page-wrapper .section-title-block h5 {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
}

.page-wrapper .section-title-block h1 {
    color: #fff;
    font-weight: 800;
}

/* ---------- Calendari Playtomic-like ---------- */
.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #2c2c2c;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #fff;
}

.cal-toolbar .cal-week-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
}

.cal-toolbar button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s;
}

.cal-toolbar button:hover { background: #b02525; }

.cal-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 4px;
    background: #2c2c2c;
    padding: 8px;
    border-radius: 8px;
    overflow-x: auto;
}

.cal-head {
    background: var(--dark);
    color: #fff;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.cal-head.today {
    background: var(--primary);
}

.cal-hour {
    background: var(--dark);
    color: #fff;
    text-align: center;
    padding: 1rem 0.25rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-radius: 4px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-cell {
    background: #3a3a3a;
    color: #fff;
    border-radius: 4px;
    padding: 0.5rem 0.4rem;
    min-height: 78px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    transition: background 0.2s;
}

.cal-cell.closed {
    background: repeating-linear-gradient(45deg, #2a2a2a, #2a2a2a 6px, #333 6px, #333 12px);
    color: rgba(255, 255, 255, 0.4);
}

.cal-cell .cap {
    font-size: 0.75rem;
    opacity: 0.85;
}

.cal-cell.available    { background: #2e5f3a; }
.cal-cell.almost-full  { background: #8a5a1f; }
.cal-cell.full         { background: #6b1d1d; }
.cal-cell.mine         { background: #4a8ec4; }  /* Blau suau — diferenciat del vermell de "complet" */

.cal-cell button {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: 0.2s;
}
.cal-cell button:hover { background: rgba(255, 255, 255, 0.25); }
.cal-cell.mine button.cancel  { background: rgba(0, 0, 0, 0.35); }

/* Admin: llista de reservants dins la cel·la */
.cal-cell .reserver-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 0.75rem;
    text-align: left;
}
.cal-cell .reserver-list li {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    align-items: center;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.18);
    margin-bottom: 2px;
}
.cal-cell .reserver-list .rm-res {
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.9rem;
    line-height: 1;
}
.cal-cell .reserver-list .rm-res:hover { color: #ffb3b3; }

/* ---------- Vista mòbil (estil Playtomic) ---------- */
.mobile-day-view { display: none; }

.mobile-day-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.mobile-day-chips::-webkit-scrollbar { height: 3px; }
.mobile-day-chips::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}
.day-chip {
    flex: 0 0 auto;
    min-width: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 0.5rem 0.5rem 0.6rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s;
}
.day-chip .dc-name {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}
.day-chip .dc-num {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 0.25rem;
}
.day-chip.today { border-color: rgba(210, 48, 48, 0.5); }
.day-chip.today .dc-name { color: var(--primary); opacity: 1; }
.day-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(210, 48, 48, 0.35);
}
.day-chip.active .dc-name { color: rgba(255, 255, 255, 0.95); opacity: 1; }
.day-chip.active .dc-num { color: #fff; }
.day-chip.closed { opacity: 0.4; }
.day-chip:active { transform: scale(0.97); }

.mobile-slots-header {
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 1rem 0 0.75rem;
}

.mobile-slot-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.ms-slot {
    display: flex;
    align-items: center;
    background: #2f2f2f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid #555;
    border-radius: 10px;
    padding: 0.85rem 0.85rem;
    gap: 0.75rem;
    color: #fff;
}
.ms-slot.available    { border-left-color: #2e5f3a; }
.ms-slot.almost-full  { border-left-color: #8a5a1f; }
.ms-slot.full         { border-left-color: #6b1d1d; opacity: 0.65; }
.ms-slot.mine         { border-left-color: #4a8ec4; background: rgba(74, 142, 196, 0.18); }
.ms-slot.past         { opacity: 0.5; }

.ms-slot-left { min-width: 56px; }
.ms-slot-time {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    line-height: 1;
}
.ms-slot-end {
    font-size: 0.72rem;
    opacity: 0.55;
    margin-top: 0.2rem;
}
.ms-slot-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.ms-slot-cap {
    font-size: 0.88rem;
    opacity: 0.9;
}
.ms-slot-cap i {
    color: var(--primary);
    margin-right: 0.35rem;
    font-size: 0.85em;
}
.ms-tag {
    font-size: 0.7rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    align-self: flex-start;
    font-weight: 600;
}
.ms-tag.mine {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.ms-slot-action .ms-btn {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.ms-slot-action .ms-btn:active { transform: scale(0.96); }
.ms-slot-action .ms-btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.ms-slot-action .ms-status {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
    white-space: nowrap;
}
.ms-slot-action .ms-status.muted { color: rgba(255, 255, 255, 0.5); }

.ms-empty {
    text-align: center;
    padding: 1.75rem 1rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    font-style: italic;
}

/* ---------- Cards "Les meves reserves" ---------- */
.reservation-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.reservation-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: #fff;
    gap: 1rem;
}
.reservation-card.past {
    border-left-color: rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}
.reservation-card .rc-info { flex: 1; min-width: 0; }
.reservation-card .rc-date {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-transform: capitalize;
    margin-bottom: 0.2rem;
}
.reservation-card .rc-time {
    font-size: 0.9rem;
    opacity: 0.85;
}
.reservation-card .rc-date i,
.reservation-card .rc-time i { color: var(--primary); }
.reservation-card .rc-action { flex-shrink: 0; }

/* Activar la vista mòbil per sota de 768px (només telèfons).
   A tauleta (768-991px) es manté la grid/taula desktop però amb ajustos compactes
   definits més avall. */
@media (max-width: 767.98px) {
    .cal-grid { display: none !important; }
    .mobile-day-view { display: block; }
    .reserves-legend { display: none; }

    /* Toolbar setmana més compacta */
    .cal-toolbar {
        padding: 0.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .cal-toolbar button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .cal-week-label {
        font-size: 0.95rem;
        order: 0;
        width: 100%;
        text-align: center;
        margin: 0;
    }

    /* Reservation cards: en mòbil, l'acció a sota */
    .reservation-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .reservation-card .rc-action {
        width: 100%;
        text-align: center;
    }
    .reservation-card .rc-action .btn {
        width: 100%;
    }
}

/* ---------- Taula històric + admin users ---------- */
.data-table {
    width: 100%;
    background: #2c2c2c;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
}
.data-table th {
    background: var(--dark);
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 0.85rem;
    text-align: left;
}
.data-table td {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.data-table .btn-icon {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
    transition: 0.2s;
}
.data-table .btn-icon:hover { background: var(--primary); border-color: var(--primary); }

.role-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.role-badge.admin  { background: var(--primary); color: #fff; }
.role-badge.client { background: #4a8ec4;       color: #fff; }
.role-badge.user   { background: #34AD54;       color: #fff; }

/* Pill de saldo de crèdits */
.credits-pill {
    display: inline-block;
    background: rgba(218, 165, 32, 0.18);
    color: #f5d76e;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    border: 1px solid rgba(218, 165, 32, 0.35);
    white-space: nowrap;
}

/* Banner de saldo a la pàgina de reserves del client */
.credits-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.12), rgba(218, 165, 32, 0.04));
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-left: 4px solid #f5d76e;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    margin: 1rem 0 1.5rem;
    color: #fff;
}
.credits-banner .cb-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Nunito', sans-serif;
}
.credits-banner .cb-left i {
    color: #f5d76e;
    font-size: 1.4rem;
}
.credits-banner .cb-left .cb-label {
    font-weight: 700;
    letter-spacing: 0.3px;
}
.credits-banner .cb-right {
    text-align: right;
    font-family: 'Nunito', sans-serif;
}
.credits-banner .cb-right #creditsBalance {
    font-size: 1.8rem;
    font-weight: 800;
    color: #f5d76e;
    line-height: 1;
}
.credits-banner .cb-right .cb-unit {
    margin-left: 0.4rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}
.credits-banner.empty {
    background: linear-gradient(135deg, rgba(210, 48, 48, 0.18), rgba(210, 48, 48, 0.04));
    border-color: rgba(210, 48, 48, 0.45);
    border-left-color: var(--primary);
}
.credits-banner.empty .cb-left i,
.credits-banner.empty .cb-right #creditsBalance {
    color: #ff9b9b;
}
.credits-banner.empty::after {
    content: " — Contacta amb el centre per recarregar";
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-style: italic;
}
@media (max-width: 575.98px) {
    .credits-banner { padding: 0.7rem 0.9rem; }
    .credits-banner .cb-right #creditsBalance { font-size: 1.4rem; }
    .credits-banner.empty::after { display: block; margin-top: 0.4rem; }
}

/* ---------- Admin layout: pills + side panel ---------- */
.admin-pills .nav-link {
    color: #fff;
    background: #2c2c2c;
    margin-right: 0.5rem;
    border-radius: 4px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}
.admin-pills .nav-link.active { background: var(--primary); }

.side-card {
    background: #2c2c2c;
    color: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}
.side-card h5 {
    color: var(--primary);
    text-transform: uppercase;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

.side-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------- Toast / feedback ---------- */
.flash-msg {
    position: fixed;
    top: 90px;
    right: 24px;
    background: var(--dark);
    color: #fff;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    z-index: 1080;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-family: 'Nunito', sans-serif;
    max-width: 340px;
    opacity: 0;
    transform: translateX(20px);
    transition: 0.3s;
}
.flash-msg.show { opacity: 1; transform: translateX(0); }
.flash-msg.ok    { border-left-color: #34AD54; }
.flash-msg.error { border-left-color: #ff6b6b; }

/* ---------- Responsive ---------- */
/* Defensa: per a tots els navbars, evitem que els enllaços es trenquin en
   2-3 línies en pantalles intermèdies. */
@media (max-width: 1399.98px) {
    .navbar .navbar-nav .nav-link {
        white-space: nowrap;
        padding-left: 0.7rem !important;
        padding-right: 0.7rem !important;
        font-size: 0.92rem;
    }
}
@media (max-width: 1199.98px) {
    /* Padding lateral del navbar molt més compacte (sobreescriu px-5) */
    .navbar.navbar-expand-lg,
    .navbar.navbar-expand-xl,
    .navbar.navbar-expand-xxl {
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }
    .navbar.navbar-expand-lg .navbar-brand,
    .navbar.navbar-expand-xl .navbar-brand,
    .navbar.navbar-expand-xxl .navbar-brand {
        margin-right: 0.5rem;
    }
    .navbar.navbar-expand-lg .navbar-brand img,
    .navbar.navbar-expand-xl .navbar-brand img,
    .navbar.navbar-expand-xxl .navbar-brand img {
        width: 45px;
        height: auto;
    }
    .navbar .navbar-nav .nav-link {
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
        font-size: 0.78rem;
    }
    /* Auth-zone més compacte i sense possibilitat de quedar comprimida */
    .navbar .auth-zone {
        flex-shrink: 0;
        margin-left: 0.3rem !important;
    }
    .navbar .auth-zone .profile-dropdown > .nav-link {
        padding: 0.35rem 0.8rem !important;
        font-size: 0.85rem;
    }
    .navbar .auth-zone .profile-dropdown > .nav-link span {
        max-width: 90px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: middle;
    }
    .navbar .auth-zone .btn-login {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* iPad portrait i tauletes petites: encara més compacte */
@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link {
        padding-left: 0.3rem !important;
        padding-right: 0.3rem !important;
        font-size: 0.75rem;
    }
}

/* index.html usa navbar-expand-xxl (col·lapsa < 1400px) perquè té molts enllaços
   i en tauletes landscape (fins al iPad Pro 12.9" = 1366px) s'aplasten.
   Així tauletes en horitzontal també veuen hamburguesa, només ordinadors
   reals (>=1400px) tenen el menú expandit. */
@media (max-width: 1399.98px) {
    .navbar.navbar-expand-xxl {
        padding: 0.5rem 1rem !important;
        flex-wrap: wrap;
        align-items: center;
    }
    .navbar.navbar-expand-xxl .navbar-brand {
        margin-right: 0.5rem;
        padding: 0 !important;
    }
    .navbar.navbar-expand-xxl .navbar-brand img {
        width: 48px;
        height: auto;
    }
    .navbar.navbar-expand-xxl .navbar-toggler {
        padding: 0.3rem 0.55rem;
        font-size: 1rem;
    }
    /* Quan s'obre el menú hamburguesa: compacte + scroll si no cap */
    .navbar.navbar-expand-xxl .navbar-collapse {
        flex-basis: 100%;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
    }
    .navbar.navbar-expand-xxl .navbar-nav .nav-link {
        padding: 0.45rem 0.25rem !important;
        font-size: 0.95rem;
        line-height: 1.2;
        white-space: normal;
    }
    .navbar.navbar-expand-xxl .auth-zone {
        width: 100%;
        justify-content: center;
        margin-top: 0.4rem;
        margin-left: 0 !important;
    }
    .navbar.navbar-expand-xxl .auth-zone .btn-login {
        width: 100%;
        max-width: 320px;
        white-space: normal;
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
        line-height: 1.2;
    }
    .navbar.navbar-expand-xxl .auth-zone .profile-dropdown {
        width: 100%;
        max-width: 320px;
    }
    .navbar.navbar-expand-xxl .auth-zone .profile-dropdown > .nav-link {
        justify-content: center;
        width: 100%;
        padding: 0.45rem 0.9rem;
        font-size: 0.9rem;
    }
    .navbar.navbar-expand-xxl .auth-zone .dropdown-menu {
        width: 100%;
        text-align: left;
        font-size: 0.9rem;
    }
}

/* admin.html i reserves.html usen navbar-expand-lg (col·lapsa < 992px) perquè
   només tenen logo + auth-zone (sense menú central). */
@media (max-width: 991.98px) {
    .navbar.navbar-expand-lg {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        flex-wrap: wrap;
        align-items: center;
    }
    .navbar.navbar-expand-lg .navbar-brand {
        margin-right: 0.5rem;
    }
    .navbar.navbar-expand-lg .navbar-brand img {
        width: 55px;
        height: auto;
    }
    .navbar-toggler {
        padding: 0.35rem 0.6rem;
        font-size: 1.1rem;
    }
    .navbar-collapse {
        flex-basis: 100%;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    .auth-zone {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        margin-left: 0 !important;
    }
    .auth-zone .btn-login {
        width: 100%;
        max-width: 360px;
        white-space: normal;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        line-height: 1.25;
    }
    .auth-zone .profile-dropdown {
        width: 100%;
        max-width: 360px;
    }
    .auth-zone .profile-dropdown > .nav-link {
        justify-content: center;
        width: 100%;
        padding: 0.55rem 1rem;
    }
    .auth-zone .dropdown-menu {
        width: 100%;
        text-align: left;
    }
}

/* Mòbils petits: encara més compacte */
@media (max-width: 575.98px) {
    .navbar.navbar-expand-lg {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .navbar.navbar-expand-lg .navbar-brand img {
        width: 48px;
    }
    .auth-zone .btn-login {
        font-size: 0.85rem;
        letter-spacing: 0;
    }
    .auth-zone .profile-dropdown > .nav-link span {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .cal-grid {
        grid-template-columns: 60px repeat(7, minmax(90px, 1fr));
        font-size: 0.75rem;
    }
    .cal-cell { min-height: 60px; padding: 0.35rem; }
}

/* ============================================================
   v2: Rols, aprovacions, sèries, slots i login mòbil
   ============================================================ */

/* ---------- Pending section (admin panel) ---------- */
.pending-section { color: #fff; }
.pending-section h4 { font-family: 'Nunito', sans-serif; font-weight: 700; }
.pending-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(212, 155, 0, 0.08);
    border: 1px solid rgba(212, 155, 0, 0.25);
    border-left: 4px solid #d49b00;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    color: #fff;
    gap: 1rem;
    flex-wrap: wrap;
}
.pending-card .pc-info { flex: 1; min-width: 220px; }
.pending-card .pc-user { font-weight: 700; font-family: 'Nunito', sans-serif; }
.pending-card .pc-slot { font-size: 0.9rem; opacity: 0.9; margin-top: 0.25rem; }
.pending-card .pc-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
@media (max-width: 575.98px) {
    .pending-card { flex-direction: column; align-items: stretch; }
    .pending-card .pc-actions { width: 100%; }
    .pending-card .pc-actions .btn { flex: 1; }
}

/* ---------- Pending badge (sloteig) ---------- */
.pending-badge {
    background: rgba(212, 155, 0, 0.25);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.ms-tag.pending {
    background: rgba(212, 155, 0, 0.3);
    color: #fff;
}

/* ---------- Slot menu (admin per cel·la) ---------- */
.cal-cell .cap-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}
.cal-cell .slot-menu {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 0 0.4rem;
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
    transition: 0.2s;
}
.cal-cell .slot-menu:hover { background: rgba(255,255,255,0.2); }
.cal-cell .cap-override {
    background: rgba(74, 142, 196, 0.3);
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}
.cal-cell.blocked {
    background: rgba(139, 0, 0, 0.45);
    color: #fff;
    text-align: center;
}
.cal-cell.blocked button {
    background: rgba(255,255,255,0.15);
    margin-top: 0.3rem;
}
.ms-slot.blocked {
    border-left-color: #8b0000;
    background: rgba(139, 0, 0, 0.18);
}
.ms-slot.blocked .ms-slot-cap { color: #ff9c9c; }

/* ---------- Series modal ---------- */
.series-schedule {
    width: 100%;
    color: #fff;
    border-collapse: collapse;
    font-family: 'Nunito', sans-serif;
}
.series-schedule th,
.series-schedule td {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.35rem 0.25rem;
    text-align: center;
    font-size: 0.85rem;
}
.series-schedule th {
    background: rgba(255,255,255,0.05);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.series-schedule td.hour-label {
    background: rgba(255,255,255,0.04);
    font-weight: 700;
}
.series-schedule td.closed {
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.25);
}
.series-schedule input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.series-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.4rem;
    color: #fff;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---------- Reservation card variant: pending ---------- */
.reservation-card.pending {
    border-left-color: #d49b00;
    background: rgba(212, 155, 0, 0.08);
}

/* ============================================================
   Login page (login.html) — mobile-first, app-like
   ============================================================ */
body.login-page {
    background: linear-gradient(180deg, #091e3e 0%, #1a1a1a 100%);
    min-height: 100vh;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    margin: 0;
}
.login-wrapper {
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.login-back {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.2s;
}
.login-back:hover { background: rgba(255,255,255,0.15); color: #fff; }

.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo { margin-bottom: 1.25rem; filter: drop-shadow(0 4px 12px rgba(210,48,48,0.3)); }
.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: #fff;
}
.login-subtitle {
    color: rgba(255,255,255,0.65);
    font-size: 0.95rem;
    margin: 0;
}

.login-form { margin-bottom: 2rem; }
.login-field { margin-bottom: 1.25rem; }
.login-field label {
    display: block;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}
.login-input {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    transition: all 0.2s;
}
.login-input:focus-within {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(210,48,48,0.15);
}
.login-input > i {
    color: rgba(255,255,255,0.4);
    padding: 0 0.9rem;
    font-size: 1rem;
}
.login-input input {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1rem;
    padding: 0.95rem 0.5rem 0.95rem 0;
    height: 56px;
    outline: none;
    font-family: inherit;
}
.login-input input::placeholder { color: rgba(255,255,255,0.4); }
.login-toggle-pwd {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.4);
    padding: 0 0.9rem;
    font-size: 1rem;
    cursor: pointer;
}
.login-toggle-pwd:hover { color: #fff; }

.login-submit {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(210,48,48,0.35);
}
.login-submit:hover:not(:disabled) {
    background: #b02525;
    box-shadow: 0 6px 20px rgba(210,48,48,0.5);
}
.login-submit:active { transform: scale(0.98); }
.login-submit:disabled { opacity: 0.6; cursor: wait; }

#loginPageFeedback {
    margin-top: 1rem;
    text-align: center;
    min-height: 1.2rem;
    font-size: 0.9rem;
}
#loginPageFeedback.ok    { color: #6dd56d; }
#loginPageFeedback.error { color: #ff8080; }

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}
.login-footer p { margin-bottom: 0.6rem; }
.login-register-hint {
    background: rgba(210,48,48,0.08);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
}
.login-register-hint a { color: var(--primary); text-decoration: none; font-weight: 700; }

/* Toggle Login ↔ Registre (mòbil) */
.login-toggle-link {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 1rem;
    margin-bottom: 0;
}
.login-toggle-link a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 0.35rem;
}
.login-toggle-link a:hover { color: var(--primary); }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Sticky toolbar a reserves mòbil (millor UX) */
@media (max-width: 767.98px) {
    .cal-toolbar {
        position: sticky;
        top: 0;
        z-index: 100;
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    .day-chip { transition: transform 0.15s, background 0.2s; }
    .ms-slot  { transition: transform 0.15s, opacity 0.2s; }
    .ms-btn   { transition: transform 0.1s; }
}

/* ---------- Slot Actions Modal (admin) ---------- */
.slot-actions-tabs {
    display: flex;
    gap: 0.5rem;
}
.slot-act-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 10px;
    padding: 0.85rem 0.5rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}
.slot-act-tab:hover { background: rgba(255, 255, 255, 0.12); }
.slot-act-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(210, 48, 48, 0.35);
}
.slot-act-tab i { font-size: 1.25rem; opacity: 0.9; }
.slot-act-panel { padding-top: 0.5rem; }
#slotActionsModal .form-control {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
#slotActionsModal .form-label {
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .slot-actions-tabs { flex-direction: column; }
    .slot-act-tab {
        padding: 0.7rem;
        font-size: 0.9rem;
        text-align: left;
    }
    .slot-act-tab i.d-block { display: inline-block !important; margin-right: 0.5rem; font-size: 1rem; }
    .slot-act-tab i.mb-1   { margin-bottom: 0 !important; }
}

/* ---------- Auth zone fora del collapse — sempre visible ---------- */
.navbar .auth-zone.navbar-auth-mobile {
    margin-left: auto;
}

/* En mòbil/tauleta: pill compacta al costat del toggler */
@media (max-width: 1199.98px) {
    .navbar .auth-zone.navbar-auth-mobile {
        order: 2;
        margin-left: auto;
        margin-right: 0.5rem;
        width: auto !important;
        flex-shrink: 0;
        justify-content: flex-end;
    }
    .navbar-auth-mobile .profile-dropdown > .nav-link {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.85rem !important;
    }
    .navbar-auth-mobile .profile-dropdown > .nav-link span {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: middle;
    }
    .navbar-auth-mobile .btn-login {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem !important;
        width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
    }
    .navbar-auth-mobile .dropdown-menu {
        min-width: 220px;
    }
    /* Si el navbar no té menú central (admin/reserves), amaguem el toggler */
    .navbar.navbar-no-menu .navbar-toggler {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-auth-mobile .profile-dropdown > .nav-link span {
        max-width: 80px;
        font-size: 0.8rem;
    }
    .navbar-auth-mobile .profile-dropdown .fa-user-circle {
        font-size: 1.1rem;
    }
}

/* ---------- Sèries agrupades a "Les meves reserves" ---------- */
.series-group {
    background: rgba(74, 142, 196, 0.06);
    border: 1px solid rgba(74, 142, 196, 0.25);
    border-left: 3px solid #4a8ec4;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}
.series-head {
    width: 100%;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    transition: background 0.2s;
}
.series-head:hover { background: rgba(74, 142, 196, 0.12); }
.series-head .toggle-icon {
    font-size: 0.9rem;
    color: #4a8ec4;
    width: 14px;
    flex-shrink: 0;
}
.series-head .series-summary {
    flex: 1;
    min-width: 0;
}
.series-head .series-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}
.series-head .series-meta {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}
.series-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 0.5rem;
}
.series-body.open {
    max-height: 5000px;
    padding: 0 0.5rem 0.6rem;
}
.series-body .reservation-card.in-series {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(74, 142, 196, 0.4);
    margin-bottom: 0.4rem;
    padding: 0.7rem 0.85rem;
}
.series-body .reservation-card.in-series .rc-date {
    font-size: 0.9rem;
    font-weight: 600;
}
.series-body .reservation-card.in-series .rc-time {
    font-size: 0.82rem;
}

/* ---------- Botó d'acció a la capçalera del dia (admin calendar) ---------- */
.cal-head .day-action-btn {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.3;
    font-family: 'Nunito', sans-serif;
}
.cal-head .day-action-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}
.cal-head .day-action-btn.block {
    border-color: rgba(210, 48, 48, 0.45);
    background: rgba(210, 48, 48, 0.18);
    color: #ffb8b8;
}
.cal-head .day-action-btn.block:hover {
    background: rgba(210, 48, 48, 0.55);
    border-color: var(--primary);
    color: #fff;
}
.cal-head .day-action-btn.unblock {
    border-color: rgba(74, 142, 196, 0.55);
    background: rgba(74, 142, 196, 0.25);
    color: #b8e0ff;
}
.cal-head .day-action-btn.unblock:hover {
    background: rgba(74, 142, 196, 0.55);
    color: #fff;
}

/* ---------- Vista mòbil admin (calendari + reservers) ---------- */
.mobile-slots-header.mobile-slots-header-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.mobile-slots-header-admin .msh-action {
    margin-left: auto;
}
.mobile-slots-header-admin .msh-action .day-action-btn {
    margin-top: 0;
}

/* Slot d'admin: pot tenir reservers a sota i un menú ⋮ d'accions */
.ms-slot.admin-slot {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.ms-slot.admin-slot .ms-slot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}
.ms-slot.admin-slot .ms-slot-action-admin {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ms-slot.admin-slot .slot-menu-mobile {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
}
.ms-slot.admin-slot .slot-menu-mobile:hover {
    background: rgba(255, 255, 255, 0.22);
}

.ms-slot.admin-slot .ms-reservers {
    list-style: none;
    padding: 0.5rem 0 0;
    margin: 0.5rem 0 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ms-slot.admin-slot .ms-reservers li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}
.ms-slot.admin-slot .ms-reservers .rm-res-mobile {
    background: transparent;
    border: 0;
    color: #ff9b9b;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.3rem;
    transition: color 0.2s;
}
.ms-slot.admin-slot .ms-reservers .rm-res-mobile:hover { color: #ff5252; }

.ms-slot .ms-override {
    display: inline-block;
    background: rgba(74, 142, 196, 0.3);
    color: #b8e0ff;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.35rem;
}
.ms-slot.blocked .ms-block-reason {
    display: block;
    color: #ffb8b8;
    opacity: 0.85;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

/* ---------- Llista d'usuaris: taula desktop + cards mòbil ---------- */
.user-list-mobile { display: none; }

@media (max-width: 767.98px) {
    .users-table { display: none !important; }
    .user-list-mobile { display: flex; flex-direction: column; gap: 0.6rem; }
}

.user-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #2c2c2c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
    color: #fff;
    transition: background 0.2s;
}
.user-card .uc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(210, 48, 48, 0.18);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.user-card .uc-main {
    flex: 1;
    min-width: 0;
}
.user-card .uc-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.user-card .uc-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    word-break: break-word;
}
.user-card .uc-username {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.35rem;
}
.user-card .uc-username i { margin-right: 0.25rem; opacity: 0.7; }
.user-card .uc-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.2rem;
    word-break: break-word;
}
.user-card .uc-info i {
    color: var(--primary);
    margin-right: 0.4rem;
    width: 14px;
    text-align: center;
}
.user-card .uc-info a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}
.user-card .uc-info a:hover { color: var(--primary); }
.user-card .uc-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}
.user-card .uc-actions .btn-icon {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    transition: all 0.2s;
}
.user-card .uc-actions .btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ============================================================
   Sticky footer — el banner vermell sempre baix del tot
   encara que el contingut sigui curt.
   ============================================================ */
body.bg-dark {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.bg-dark > main,
body.bg-dark > .page-wrapper,
body.bg-dark > main.page-wrapper {
    flex: 1 0 auto;
}
/* L'últim container vermell (footer d'admin/reserves/login) baix del tot */
body.bg-dark > .container-fluid[style*="d23030"],
body.bg-dark > .container-fluid.text-white[style*="d23030"] {
    flex-shrink: 0;
    margin-top: auto;
}

/* ============================================================
   TAULETA (768–991px): adapta la vista DESKTOP perquè càpiga bé
   ============================================================ */
@media (min-width: 768px) and (max-width: 991.98px) {

    /* ----- Calendari (client + admin) ----- */
    .cal-grid {
        grid-template-columns: 55px repeat(7, minmax(82px, 1fr));
        gap: 3px;
        padding: 6px;
        font-size: 0.78rem;
    }
    .cal-head {
        padding: 0.5rem 0.3rem;
        font-size: 0.72rem;
        letter-spacing: 0.3px;
    }
    .cal-head span { font-size: 0.95rem !important; }
    .cal-head .day-action-btn {
        margin-top: 0.2rem;
        padding: 0.1rem 0.4rem;
        font-size: 0.6rem;
    }
    .cal-hour {
        padding: 0.5rem 0.15rem;
        font-size: 0.75rem;
    }
    .cal-cell {
        min-height: 64px;
        padding: 0.3rem 0.25rem;
        font-size: 0.72rem;
    }
    .cal-cell .cap { font-size: 0.7rem; }
    .cal-cell button {
        padding: 0.2rem 0.35rem;
        font-size: 0.65rem;
        margin-top: 0.2rem;
    }
    .cal-cell .reserver-list {
        font-size: 0.66rem;
        margin: 0.25rem 0;
    }
    .cal-cell .reserver-list li {
        padding: 0.1rem 0.35rem;
        gap: 0.25rem;
    }
    .cal-cell .slot-menu {
        padding: 0 0.3rem;
        font-size: 0.75rem;
    }
    .cal-cell .cap-override {
        font-size: 0.62rem;
        padding: 0.05rem 0.3rem;
    }
    .cal-cell.closed { font-size: 0.7rem; }
    .cal-cell.blocked .cap { font-size: 0.7rem; }

    /* ----- Toolbar setmana ----- */
    .cal-toolbar {
        padding: 0.65rem 0.85rem;
    }
    .cal-toolbar button {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
    }
    .cal-toolbar .cal-week-label {
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }

    /* ----- Taula d'usuaris (admin) ----- */
    .users-table {
        font-size: 0.85rem;
    }
    .users-table th,
    .users-table td {
        padding: 0.6rem 0.55rem;
    }
    /* Amagar columna "Usuari" (username) — el client ja s'identifica pel nom+email */
    .users-table th:nth-child(6),
    .users-table td:nth-child(6) { display: none; }

    .users-table .btn-icon {
        padding: 0.35rem 0.55rem;
        font-size: 0.85rem;
    }
    .role-badge {
        font-size: 0.65rem;
        padding: 0.12rem 0.45rem;
    }

    /* ----- Cards "Les meves reserves" (client) ----- */
    .reservation-card { padding: 0.75rem 0.9rem; }
    .reservation-card .rc-date { font-size: 0.95rem; }
    .reservation-card .rc-time { font-size: 0.85rem; }

    /* ----- Side card de configuració (admin reserves) ----- */
    .side-card {
        padding: 1rem;
    }
    .side-card h5 { font-size: 1rem; }

    /* ----- Taula de sèries recurrents ----- */
    .series-schedule th,
    .series-schedule td {
        padding: 0.25rem 0.15rem;
        font-size: 0.78rem;
    }
}

