/* --- CLIENT-STYLE.CSS (TOTALEMENT ISOLÉ) ---
 * 
 * COMPOSANT RÉUTILISABLE : Password Field with Visibility Toggle & Generation
 * 
 * Structure HTML recommandée pour réutilisation :
 * <div class="password-field">
 *     <input type="password" id="unique-id" data-tooltip-label="Mon Label">
 *     <div class="password-field-actions">
 *         <button type="button" class="password-icon-button password-generate-button"
 *                 data-password-generate="#unique-id"
 *                 aria-label="Générer...">
 *             <span class="material-symbols-outlined">lock_reset</span>
 *             <div class="password-tooltip">Générer un mot de passe</div>
 *         </button>
 *         <button type="button" class="password-icon-button"
 *                 data-password-toggle="#unique-id"
 *                 aria-label="Afficher...">
 *             <span class="material-symbols-outlined">visibility</span>
 *             <div class="password-tooltip">Afficher le mot de passe</div>
 *         </button>
 *     </div>
 * </div>
 */

.is-client-app.client-dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Sora', sans-serif;
}

.is-client-app .material-symbols-outlined {
    font-feature-settings: 'liga' 1;
}

/* Keep footer at the bottom on short client pages. */
.is-client-app .container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.is-client-app .client-dashboard-container {
    flex: 1;
    width: 100%;
}

.is-client-app footer {
    margin-top: auto;
}

/* --- STYLE CONNEXION (CENTRAGE & ESPACEMENT INTELLIGENT) --- */
.is-client-app .login-box-wrapper {
    padding: 24px 0 40px;
}

.is-client-app .login-box {
    max-width: 400px;
    min-height: 460px;
    margin: 24px auto;
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid #eee;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.is-client-app .login-box.login-box-forgot {
    min-height: auto;
}

.is-client-app .register-box {
    width: min(100%, 900px);
    max-width: 900px;
    min-height: unset;
    padding: 40px;
}

/* --- COMPOSANT ÉTAT GÉNÉRIQUE (SUCCESS / INFO / ERROR) --- */
.is-client-app .state-panel {
    text-align: center;
    padding: 14px 12px 6px;
}

.is-client-app .state-panel-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    border: 1px solid transparent;
}

.is-client-app .state-panel-icon .material-symbols-outlined {
    font-size: 40px !important;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 48;
}

.is-client-app .state-panel-title {
    color: #111;
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.is-client-app .state-panel-text {
    color: #4b5563;
    margin: 0 0 22px;
    font-size: 15px;
}

.is-client-app .state-panel-hint {
    color: #9ca3af;
    margin: 0;
    font-size: 13px;
}

.is-client-app .state-panel-emoji {
    display: inline-block;
    font-size: 1.45em;
    line-height: 1;
    vertical-align: -0.08em;
}

.is-client-app .state-panel-success .state-panel-icon {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.is-client-app .state-panel-info .state-panel-icon {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.is-client-app .state-panel-error .state-panel-icon {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.is-client-app .state-panel-icon-maillike {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.is-client-app .state-box-narrow {
    max-width: 720px;
}

.is-client-app .state-panel-action {
    display: inline-flex;
    text-decoration: none;
    min-width: 230px;
}

.is-client-app .register-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.is-client-app .register-form .form-group-login {
    margin-bottom: 0;
}

.is-client-app .register-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.is-client-app .register-grid-identity {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.is-client-app .register-form.is-professional .register-grid-identity {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.is-client-app .login-box h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    font-size: 24px;
    margin: 0 auto 35px auto;
    letter-spacing: -1px;
    text-align: center;
    color: #111;
}

.is-client-app .login-box h2 .material-symbols-outlined {
    font-size: 24px;
    line-height: 1;
    order: 2;
}

.is-client-app .form-group-login {
    margin-bottom: 25px;
}

.is-client-app .form-group-login:last-of-type {
    margin-bottom: 0;
}

.is-client-app .form-group-login label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #9ca3af;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.is-client-app .form-group-login input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #eee;
    background: #f9fafb;
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.is-client-app .customer-kind-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.is-client-app .customer-kind-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.is-client-app .customer-kind-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.is-client-app .customer-kind-option span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 13px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.is-client-app .customer-kind-option input:checked + span {
    border-color: #0161bb;
    color: #0161bb;
    background: #fff;
    box-shadow: 0 6px 18px rgba(1, 97, 187, 0.12);
}

.is-client-app .customer-kind-option input:focus-visible + span {
    outline: 2px solid #0161bb;
    outline-offset: 2px;
}

.is-client-app .form-group-company[hidden] {
    display: none;
}

.is-client-app .password-field {
    position: relative;
}

.is-client-app .register-form .password-field--compact input {
    padding-top: 14px;
    padding-bottom: 14px;
}

.is-client-app .password-field input {
    padding-right: 104px;
}

.is-client-app .password-field-actions {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
}

.is-client-app .password-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #111;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
    opacity: 0.6;
    position: relative;
}

.is-client-app .password-icon-button:hover {
    background: #eef2f7;
    color: #111;
    opacity: 1;
}

.is-client-app .password-icon-button:focus-visible {
    outline: 2px solid #0161bb;
    outline-offset: 2px;
    opacity: 1;
}

.is-client-app .password-icon-button .material-symbols-outlined {
    font-size: 20px !important;
}

.is-client-app .relab-tooltip {
    position: fixed;
    pointer-events: none;
    background: #111827;
    /* Fallback */
    background: radial-gradient(circle, #0161bb 0%, #111827 150%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    white-space: nowrap !important;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
    letter-spacing: 0.5px;
    box-shadow: none;
    transform: translateY(-12px);
}

.is-client-app .relab-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #111827;
}

/* Affichage au survol des parents tooltippés */
.is-client-app [data-relab-tooltip]:hover .relab-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.is-client-app .password-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #111827;
    /* Fallback */
    background: radial-gradient(circle, #0161bb 0%, #111827 120%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    transform: translateY(-8px);
    z-index: 100;
    box-shadow: none;
    letter-spacing: 0.5px;
}

.is-client-app .password-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 12px;
    border: 5px solid transparent;
    border-top-color: #111827;
}

.is-client-app .password-icon-button:hover .password-tooltip {
    opacity: 1;
    transform: translateY(-4px);
}

.is-client-app .password-generate-button {
    color: #111;
}

.is-client-app .password-policy-box {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px;
}

.is-client-app .password-policy-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: #111827;
}

.is-client-app .password-policy-list {
    margin: 0;
    padding-left: 18px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.45;
}

.is-client-app .password-policy-list li.is-ok {
    color: #065f46;
    font-weight: 700;
}

.is-client-app .password-policy-regex {
    margin: 10px 0 0;
    font-size: 11px;
    color: #6b7280;
}

.is-client-app .password-policy-regex code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    background: #eef2f7;
    border-radius: 6px;
    padding: 2px 6px;
    color: #374151;
}

.is-client-app .password-policy-feedback {
    margin: 8px 0 0;
    min-height: 18px;
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
}

.is-client-app .password-policy-feedback.is-error {
    color: #b91c1c;
}

.is-client-app .password-policy-feedback.is-ok {
    color: #065f46;
}

.is-client-app .password-confirm-feedback {
    margin: 8px 0 0;
    min-height: 18px;
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
}

.is-client-app .password-confirm-feedback.is-error {
    color: #b91c1c;
}

.is-client-app .password-confirm-feedback.is-ok {
    color: #065f46;
}

.is-client-app .form-group-login input:focus {
    outline: none;
    border-color: #0161bb;
    background: #fff;
    box-shadow: 0 4px 15px rgba(1, 97, 187, 0.05);
}

.is-client-app .form-status-error {
    color: #ef4444;
    font-size: 13px;
    margin: 0 0 20px;
    font-weight: 700;
    text-align: center;
}

.is-client-app .btn-login {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #111 !important;
    color: #fff !important;
    font-weight: 700;
    padding: 18px !important;
    border-radius: 14px !important;
    border: none;
    cursor: pointer;
}

.is-client-app .register-submit {
    width: 100%;
    margin-top: 10px;
}

.is-client-app .login-help-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.is-client-app .login-help-links > .login-help-link:only-child {
    margin-inline: auto;
}

.is-client-app .register-help-links {
    justify-content: center;
}

.is-client-app .register-help-label {
    font-size: 12px;
    color: #9ca3af;
}

.is-client-app .login-help-link {
    color: #5b6472;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.is-client-app .login-help-link:hover {
    color: #0161bb;
}

/* --- DASHBOARD STRUCTURE --- */
.is-client-app .view-header {
    max-width: 1300px;
    margin: 0 auto 30px;
    text-align: left;
}

.is-client-app .view-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -1px;
    line-height: 1.2;
}

.is-client-app .view-header p {
    color: #888;
    margin: 6px 0 0 0;
    font-size: 15px;
}

.is-client-app .dashboard-app-layout {
    display: flex;
    gap: 100px;
    align-items: flex-start;
    max-width: 1300px;
    margin: 0 auto;
}

/* --- SIDEBAR DESKTOP --- */
.is-client-app .app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    position: sticky;
    top: 100px;
}

.is-client-app .sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 25px;
}

.is-client-app .avatar-circle {
    width: 48px;
    height: 48px;
    background: #111;
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
}

.is-client-app .u-name {
    display: block;
    font-weight: 800;
    font-size: 16px;
    color: #111;
}

.is-client-app .u-badge {
    font-size: 11px;
    color: #0161bb;
    font-weight: 700;
    text-transform: uppercase;
}

.is-client-app .app-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.is-client-app .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: #555;
    font-weight: 700;
    border-radius: 12px;
    transition: 0.2s;
    font-size: 14px;
}

.is-client-app .app-nav .nav-link .material-symbols-outlined {
    font-size: 24px !important;
}

.is-client-app .nav-link.active {
    background: #f4f8ff;
    color: #0161bb;
}

.is-client-app .nav-link:hover:not(.active) {
    background: #f9fafb;
    color: #111;
}

.is-client-app .nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.is-client-app .soon-tag {
    font-size: 9px;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    color: #888;
}

/* --- MAIN CONTENT --- */
.is-client-app .app-main-content {
    flex: 1;
    min-width: 0;
    margin-top: 98px;
    /* Ajustement final millimétré pour alignement parfait avec nav.app-nav */
}

.is-client-app .erp-content-interv {
    width: 100%;
    max-width: 820px;
    margin: 0;
}

.is-client-app .erp-content-invoices {
    width: 100%;
    max-width: 820px;
    margin: 0;
}

/* --- TABLEAU COMPACT (640PX) --- */
.is-client-app .invoice-table-wrapper {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #eee;
    overflow: hidden;
    margin: 0;
    max-width: 100%;
}

.is-client-app .invoice-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.is-client-app .invoice-table th {
    background: #f9fafb;
    padding: 0 20px;
    height: 45px;
    text-align: left;
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    vertical-align: middle;
}

.is-client-app .invoice-table td {
    height: 55px;
    padding: 0 20px;
    border-bottom: 1px solid #f8fafc;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* RÉPARTITION SPÉCIFIQUE : INTERVENTIONS (Unifié) */
.is-client-app .table-interventions th:nth-child(3),
.is-client-app .table-interventions td:nth-child(3) {
    text-align: center;
}

.is-client-app .table-interventions th:nth-child(4),
.is-client-app .table-interventions td:nth-child(4) {
    text-align: center;
}

/* RÉPARTITION SPÉCIFIQUE : FACTURES */
.is-client-app .table-invoices th:nth-child(1),
.is-client-app .table-invoices td:nth-child(1) {
    width: 200px;
}

.is-client-app .table-invoices th:nth-child(2),
.is-client-app .table-invoices td:nth-child(2) {
    width: 130px;
    /* Date compacte */
}

.is-client-app .table-invoices th:nth-child(3),
.is-client-app .table-invoices td:nth-child(3) {
    width: 160px;
    /* Total TTC resserré */
    text-align: center;
}

/* COLONNES COMMUNES (STATUT & ACTION) */
.is-client-app .invoice-table th:nth-child(4),
.is-client-app .invoice-table td:nth-child(4) {
    width: 130px;
    text-align: center;
}

.is-client-app .invoice-table th:nth-child(5),
.is-client-app .invoice-table td:nth-child(5) {
    width: 100px;
    text-align: center;
}

.is-client-app .invoice-ref {
    color: #111 !important;
    font-weight: 600;
}

.is-client-app .invoice-date {
    color: #9ca3af !important;
    font-weight: 600;
}

.is-client-app .invoice-total {
    color: #111 !important;
    font-weight: 600;
}

/* --- OVERRIDES SPECIFIQUES: TICKETS / INTERVENTIONS --- */
.is-client-app .ticket-desc-html,
.is-client-app .ticket-desc-html .ql-editor,
.is-client-app .ticket-desc-html>div {
    height: auto !important;
    min-height: 0 !important;
    white-space: normal !important;
    padding: 0 !important;
    margin: 0 !important;
}

.is-client-app .ticket-desc-html p {
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
}

.is-client-app .ticket-desc-html p:last-child {
    margin-bottom: 0 !important;
}

.is-client-app .ticket-desc-html *,
.is-client-app .ticket-desc-html p {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.is-client-app .ticket-desc-html *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.is-client-app .ticket-row {
    transition: background-color 0.2s ease;
}

.is-client-app .ticket-row.ticket-expanded td {
    height: auto !important;
    white-space: normal !important;
    padding-top: 14px !important;
    padding-bottom: 22px !important;
    vertical-align: middle !important;
}

.is-client-app .ticket-row:not(.ticket-closed):hover {
    cursor: pointer;
}

.is-client-app .ticket-row.ticket-closed {
    cursor: default;
}

/* --- COMPOSANTS --- */
.is-client-app .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.is-client-app .status-paid {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.2);
}

.is-client-app .status-unpaid {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

/* EXTENSION DES STATUS BADGES POUR LE HELP DESK */
.is-client-app .status-open {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.2);
}

.is-client-app .status-replied {
    background: rgba(234, 179, 8, 0.12);
    color: #a16207;
    border-color: rgba(234, 179, 8, 0.2);
}

.is-client-app .status-hold {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
    border-color: rgba(107, 114, 128, 0.2);
}

.is-client-app .status-closed {
    background: rgba(5, 150, 105, 0.12);
    color: #065f46;
    border-color: rgba(5, 150, 105, 0.2);
}

/* Vert foncé */

.is-client-app .btn-download-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.is-client-app .btn-download-icons,
.is-client-app .btn-download-icons:visited {
    color: #4b5563;
}

.is-client-app .btn-download-icons .icon-pdf,
.is-client-app .btn-download-icons:visited .icon-pdf {
    color: #ef4444 !important;
}

.is-client-app .btn-download-icons .icon-down,
.is-client-app .btn-download-icons:visited .icon-down {
    color: #4b5563 !important;
}

.is-client-app .btn-download-icons:hover {
    background: #111;
    border-color: #111;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.is-client-app .btn-download-icons:not(.action-toggle-btn):hover .material-symbols-outlined {
    color: #fff !important;
}

/* Neutralisation pour le bouton de déploiement (Action + / -) */
.is-client-app .action-toggle-btn:hover {
    background: transparent !important;
    border-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}


/* LOGIQUE D'AFFICHAGE BARRE MOBILE */
.is-client-app .mobile-app-bar {
    display: none;
}

/* --- MOBILE --- */
@media (max-width: 900px) {

    .is-client-app .main-site-header,
    .is-client-app footer {
        display: none !important;
    }

    .is-client-app .mobile-app-bar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: #fff;
        border-bottom: 1px solid #eee;
        z-index: 3000;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
    }

    .is-client-app .dashboard-app-layout {
        flex-direction: column;
        margin-top: 65px;
        gap: 0;
    }

    .is-client-app .app-sidebar {
        width: 100%;
        position: sticky;
        top: 65px;
        z-index: 2000;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
    }

    .is-client-app .invoice-table-wrapper {
        max-width: 100%;
    }

    .is-client-app .app-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 15px;
        gap: 10px;
    }

    .is-client-app .nav-link {
        white-space: nowrap;
        font-size: 13px;
        padding: 10px 16px;
        background: #f9fafb;
        border: 1px solid #eee;
    }

    .is-client-app .app-main-content {
        padding: 25px 20px 80px;
    }

    .is-client-app .register-box {
        width: 100%;
        max-width: 100%;
        padding: 30px 24px;
    }

    .is-client-app .register-grid-two {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .is-client-app .register-grid-identity {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .is-client-app .invoice-table {
        table-layout: auto;
    }

    .is-client-app .invoice-table th {
        display: none;
    }

    .is-client-app .invoice-table td {
        height: auto;
        padding: 15px 15px;
        width: auto !important;
    }
}