/**********************************************************
  ______ ____  _   _ _______ _____ 
 |  ____/ __ \| \ | |__   __/ ____|
 | |__ | |  | |  \| |  | | | (___  
 |  __|| |  | | . ` |  | |  \___ \ 
 | |   | |__| | |\  |  | |  ____) |
 |_|    \____/|_| \_|  |_| |_____/ 
                                   
**********************************************************/

@font-face {
    font-family: "Nunito-Bold";
    src: url("/fonts/Nunito-Bold.ttf");
}

@font-face {
    font-family: "Nunito-BoldItalic";
    src: url("/fonts/Nunito-BoldItalic.ttf");
}

@font-face {
    font-family: "Nunito-Italic";
    src: url("/fonts/Nunito-Italic.ttf");
}

@font-face {
    font-family: "Nunito-Light";
    src: url("/fonts/Nunito-Light.ttf");
}

@font-face {
    font-family: "Nunito-LightItalic";
    src: url("/fonts/Nunito-LightItalic.ttf");
}

@font-face {
    font-family: "Nunito-Medium";
    src: url("/fonts/Nunito-Medium.ttf");
}

@font-face {
    font-family: "Nunito-MediumItalic";
    src: url("/fonts/Nunito-MediumItalic.ttf");
}

@font-face {
    font-family: "Nunito-Regular";
    src: url("/fonts/Nunito-Regular.ttf");
}

@font-face {
    font-family: "Nunito-SemiBold";
    src: url("/fonts/Nunito-SemiBold.ttf");
}

@font-face {
    font-family: "Nunito-SemiBoldItalic";
    src: url("/fonts/Nunito-SemiBoldItalic.ttf");
}

/**********************************************************
   _____ ______ _______ _______ _____ _   _  _____  _____ 
  / ____|  ____|__   __|__   __|_   _| \ | |/ ____|/ ____|
 | (___ | |__     | |     | |    | | |  \| | |  __| (___  
  \___ \|  __|    | |     | |    | | | . ` | | |_ |\___ \ 
  ____) | |____   | |     | |   _| |_| |\  | |__| |____) |
 |_____/|______|  |_|     |_|  |_____|_| \_|\_____|_____/ 

**********************************************************/

/* Variables de couleurs - Direction artistique L'Amusée Paris */
:root {
    --color-primary: #2c2c2c;
    --color-primary-dark: #1a1a1a;
    --color-primary-light: #4a4a4a;
    --color-secondary: #f5f5f5;
    --color-accent: #e8e8e8;
    --color-text: #1a1a1a;
    --color-text-light: #6b6b6b;
    --color-bg: #fafafa;
    --color-white: #ffffff;
    --color-border: #e0e0e0;
    --color-shadow: rgba(0, 0, 0, 0.06);
    --color-shadow-hover: rgba(0, 0, 0, 0.12);
}

/* Application des fonts personnalisées */
body {
    font-family: 'Nunito-Regular', 'Helvetica Neue', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

h1, h2 {
    font-family: 'Nunito-Bold', 'Helvetica Neue', sans-serif;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h3 {
    font-family: 'Nunito-SemiBold', 'Helvetica Neue', sans-serif;
    color: var(--color-text);
}

h4, h5 {
    font-family: 'Nunito-Medium', 'Helvetica Neue', sans-serif;
    color: var(--color-text);
}

/* Layout principal */
main {
    margin-left: 200px;
    padding: 40px;
    min-height: 100vh;
    background-color: var(--color-bg);
}

/* Carte profil (sidebar dashboard + listes) */
.user-profile-card {
    width: 25%;
    min-width: 280px;
}

/* Layout dashboard (profil + contenu) */
.customer-space-layout {
    flex-wrap: nowrap;
}

@media (max-width: 1199.98px) {
    .customer-space-layout {
        flex-wrap: wrap;
    }

    .customer-space-layout > .user-profile-card,
    .customer-space-layout > .card:first-child {
        width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 0;
    }

    .customer-space-layout > .card:last-child {
        width: 100% !important;
    }
}

/* Header sidebar - Style épuré L'Amusée */
header.customer-sidebar,
.customer-sidebar {
    background: var(--color-white);
    width: 200px;
    height: 100vh;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    box-shadow: 2px 0 8px var(--color-shadow);
    border-right: 1px solid var(--color-border);
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-secondary);
}

.customer-sidebar > aside,
.customer-sidebar-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    height: 100%;
}

.customer-sidebar::-webkit-scrollbar,
header.customer-sidebar::-webkit-scrollbar {
    width: 6px;
}

.customer-sidebar::-webkit-scrollbar-thumb,
header.customer-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--color-accent);
    border-radius: 10px;
}

.customer-sidebar::-webkit-scrollbar-track,
header.customer-sidebar::-webkit-scrollbar-track {
    background-color: var(--color-secondary);
}

/* Logo */
.logo {
    padding: 30px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-secondary);
}

.logo a {
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

/* Styles pour les liens dans la sidebar */
.customer-sidebar nav a,
.customer-sidebar .sidebar-footer a,
header.customer-sidebar nav a,
header.customer-sidebar .sidebar-footer a {
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.customer-sidebar nav a:hover,
.customer-sidebar .sidebar-footer a:hover,
header.customer-sidebar nav a:hover,
header.customer-sidebar .sidebar-footer a:hover {
    color: var(--color-text) !important;
    background-color: var(--color-secondary) !important;
    transform: none;
}

/* Styles pour les liens actifs dans la sidebar */
.active-link {
    color: var(--color-text) !important;
    background-color: var(--color-secondary) !important;
    font-weight: 600;
}

/* Cards - Style épuré L'Amusée */
.card {
    border: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: 0 1px 3px var(--color-shadow);
    transition: all 0.2s ease;
    background: var(--color-white);
    overflow: hidden;
}

/* Menus actions (factures / devis) : ne pas couper le dropdown */
.card.invoice-card-clickable,
.card.estimate-card-clickable {
    overflow: visible;
}

.card.invoice-card-clickable .card-body,
.card.estimate-card-clickable .card-body {
    overflow: visible;
}

.document-card-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    max-width: 100%;
    pointer-events: auto;
}

.document-card-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--color-white);
    color: var(--color-text);
}

.document-card-menu-btn:hover,
.document-card-menu-btn:focus {
    background: var(--color-secondary);
    color: var(--color-text);
}

.document-card-menu .dropdown-menu {
    z-index: 1060;
    min-width: 12rem;
}

.document-card-actions-mobile {
    display: none;
}

.card:hover {
    box-shadow: 0 4px 12px var(--color-shadow-hover);
    border-color: var(--color-text-light);
}

/* Cartes imbriquées (dans le dashboard) */
.card .card {
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px var(--color-shadow);
    background: var(--color-white);
}

.card .card:hover {
    box-shadow: 0 2px 6px var(--color-shadow-hover);
    border-color: var(--color-text-light);
}

.card-body {
    padding: 30px;
}

/* Badges - Style minimaliste L'Amusée */
.badge {
    padding: 6px 12px;
    border-radius: 0;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--color-border);
}

.bg-secondary {
    background-color: var(--color-white) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

.bg-success {
    background: var(--color-white) !important;
    color: var(--color-text) !important;
    border-color: #4a9b6e !important;
}

.bg-danger {
    background: var(--color-white) !important;
    color: var(--color-text) !important;
    border-color: #d87a6a !important;
}

/* Buttons - Style minimaliste L'Amusée */
.btn-primary {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 0;
    padding: 12px 32px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: none;
    box-shadow: none;
}

.btn-link {
    color: var(--color-text-light);
    transition: all 0.3s ease;
}

.btn-link:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* Form controls - Style épuré L'Amusée */
.form-control {
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 12px 16px;
    transition: all 0.2s ease;
    background: var(--color-white);
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--color-text);
    box-shadow: none;
    outline: none;
    background: var(--color-white);
}

.form-label {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Navigation pills - Style minimaliste L'Amusée */
.nav-pills .nav-link {
    border-radius: 0;
    padding: 12px 20px;
    color: var(--color-text);
    transition: all 0.2s ease;
    font-weight: 400;
    margin: 0 2px;
    border-bottom: 2px solid transparent;
    pointer-events: auto !important;
    position: relative;
    z-index: 11;
    cursor: pointer;
}

.nav-pills .nav-link:hover {
    background-color: transparent;
    color: var(--color-text);
    border-bottom-color: var(--color-border);
}

.nav-pills .nav-link.active {
    background: transparent;
    color: var(--color-text);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
    box-shadow: none;
}

/* Assurer que la barre de navigation est toujours cliquable */
.pb-4 > .card {
    position: relative;
    z-index: 10;
}

.pb-4 > .card .card-body {
    position: relative;
    z-index: 10;
}

.pb-4 > .card .nav-pills {
    position: relative;
    z-index: 10;
}

.pb-4 > .card .nav-item {
    position: relative;
    z-index: 11;
}

/* Dropdown - Style épuré L'Amusée */
.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: 0 2px 8px var(--color-shadow);
    padding: 4px 0;
    margin-top: 4px;
}

.dropdown-item {
    border-radius: 0;
    padding: 10px 20px;
    transition: all 0.2s ease;
    color: var(--color-text);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--color-secondary);
    color: var(--color-text);
}

/* List group - Style épuré L'Amusée */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
    background: transparent;
    font-size: 0.9rem;
}

.list-group-item:last-child {
    border-bottom: 1px solid var(--color-border);
}

/* ============================================
   Barre mobile + menu latéral (téléphone)
   ============================================ */

.mobile-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 16px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 4px var(--color-shadow);
}

.mobile-top-bar-title {
    font-family: 'Nunito-SemiBold', 'Helvetica Neue', sans-serif;
    font-size: 1.125rem;
    color: var(--color-text);
}

.mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
    background: var(--color-secondary);
    outline: none;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}

/* Tablette : sidebar compacte (icônes) */
@media screen and (min-width: 992px) and (max-width: 1199.98px) {
    header.customer-sidebar {
        width: 72px;
    }

    main.customer-space-main,
    main {
        margin-left: 72px;
        padding: 24px;
    }

    .logo svg {
        width: 48px !important;
    }

    .customer-sidebar nav a span,
    .customer-sidebar .sidebar-footer a span,
    header.customer-sidebar nav a span,
    header.customer-sidebar .sidebar-footer a span {
        display: none;
    }

    .customer-sidebar nav a,
    .customer-sidebar .sidebar-footer a,
    header.customer-sidebar nav a,
    header.customer-sidebar .sidebar-footer a {
        justify-content: center !important;
        padding: 14px !important;
        gap: 0 !important;
    }
}

/* Téléphone */
@media screen and (max-width: 991.98px) {
    html {
        font-size: 18px;
        scroll-padding-top: calc(56px + 52px + env(safe-area-inset-top));
    }

    body.customer-space-app {
        font-size: 1rem;
    }

    header.customer-sidebar {
        width: min(300px, 88vw);
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 1050;
        box-shadow: 4px 0 24px var(--color-shadow-hover);
    }

    header.customer-sidebar.is-open {
        transform: translateX(0);
    }

    header.customer-sidebar nav a span,
    header.customer-sidebar .sidebar-footer a span {
        display: inline;
    }

    header.customer-sidebar nav a,
    header.customer-sidebar .sidebar-footer a {
        justify-content: flex-start !important;
        padding: 14px 20px !important;
        font-size: 1rem;
        min-height: 48px;
    }

    header.customer-sidebar nav a svg,
    header.customer-sidebar .sidebar-footer a svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .logo svg {
        display: block !important;
        width: 140px !important;
    }

    main.customer-space-main,
    main {
        margin-left: 0;
        padding: 12px 16px 16px;
        padding-top: calc(56px + 8px + env(safe-area-inset-top));
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    /* Onglets Profil / Devis / Factures… collés sous la barre mobile */
    .customer-space-tabbar {
        position: sticky;
        top: calc(56px + env(safe-area-inset-top));
        z-index: 1035;
        padding-bottom: 0.5rem !important;
        margin: 0 -16px 0.75rem;
        padding-left: 16px;
        padding-right: 16px;
        background: var(--color-bg);
    }

    .customer-space-tabbar > .card {
        margin-bottom: 0;
        box-shadow: 0 2px 6px var(--color-shadow);
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    h5 {
        font-size: 1.125rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn,
    .btn-primary {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .form-control,
    .form-select {
        font-size: 1rem;
        min-height: 48px;
        padding: 12px 14px;
    }

    .form-label {
        font-size: 1rem;
    }

    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    .form-check-label {
        font-size: 1rem;
        line-height: 1.5;
    }

    .list-group-item {
        font-size: 1rem;
        padding: 16px 0;
    }

    .badge {
        font-size: 0.8125rem;
        padding: 8px 12px;
    }

    .nav-pills .nav-link {
        padding: 12px 16px;
        font-size: 0.9375rem;
        white-space: nowrap;
    }

    .nav-pills .nav-link svg {
        width: 18px;
        height: 18px;
    }

    .customer-space-tabbar .card-body {
        padding: 12px 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .customer-space-tabbar .nav {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 4px;
        min-width: min-content;
    }

    .user-profile-card {
        width: 100% !important;
        min-width: 0 !important;
    }

    .user-profile-card h4 {
        font-size: 1.35rem;
    }

    .user-profile-card .pp-user {
        width: 96px;
        height: 96px;
    }

    .user-profile-card .pp-user svg {
        width: 56px;
        height: 56px;
    }

    .content-profile-user {
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    /* Liste devis/factures/RDV : pas de carte profil (déjà l’onglet + menu) */
    .content-profile-user > .user-profile-card,
    .content-profile-user > .user-profile {
        display: none !important;
    }

    .content-profile-user .user-document {
        width: 100% !important;
        padding: 1rem !important;
        margin-top: 0;
    }

    /* Titre redondant avec l’onglet actif */
    .content-profile-user .user-document > h4:first-of-type {
        display: none;
    }

    .appointment-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .appointment-tab {
        font-size: 1rem !important;
        padding: 12px 16px !important;
        min-height: 44px;
    }

    .customer-space-layout .card .card h5 {
        font-size: 1.125rem;
    }

    .table-responsive {
        font-size: 0.9375rem;
    }

    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }

    .dropdown-item {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .btn-link {
        min-width: 44px;
        min-height: 44px;
    }

    .invoice-card-clickable .card-body > .d-flex.justify-content-between,
    .estimate-card-clickable .card-body > .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .invoice-card-clickable .document-card-toolbar,
    .estimate-card-clickable .document-card-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-card-clickable .document-card-menu-dropdown,
    .estimate-card-clickable .document-card-menu-dropdown {
        display: none;
    }

    .invoice-card-clickable .document-card-actions-mobile,
    .estimate-card-clickable .document-card-actions-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        margin-top: 4px;
    }

    .content-profile-user .user-document,
    .content-profile-user .appointment-tab-content {
        overflow: visible;
    }

    .customer-space-main .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    .customer-space-main .d-flex.gap-2.mb-3 {
        flex-wrap: wrap;
    }

    .customer-space-main .d-flex.gap-2.mb-3 .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* Animations subtiles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.4s ease-out;
}

/* Décorations discrètes */
.ring {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border: 1px solid var(--color-primary) !important;
}
