/* Fond général dashboard */
body.dashboard {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #f3f6fb 0%, #eef2f7 100%);
    margin: 0;
    color: #1f2933;
}

/* Header avec logo */
.header {
    background: #ffffffcc;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;  /* bouton à droite */
}

.header-right {
    display: flex;
    align-items: center;
}

.header-back-btn {
    padding-inline: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    height: 52px;
}

.header-title h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.header-title p {
    margin: 2px 0 0;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Conteneur principal */
.main {
    padding: 40px 24px 48px;
    max-width: 960px;
    margin: 0 auto;
}

/* Grille 2 x 2 */
.tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

/* Sur mobile : 1 colonne */
@media (max-width: 768px) {
    .tiles {
        grid-template-columns: 1fr;
    }
}

/* Cartes / tuiles */
.tile {
    background: radial-gradient(circle at top left, #fef3c7 0, #ffffff 40%, #ffffff 100%);
    border-radius: 18px;
    padding: 22px 22px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease,
                border-color 0.15s ease, background-position 0.15s ease;
    background-size: 180% 180%;
    background-position: 0% 0%;
}

.tile h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 600;
}

.tile p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Effet hover */
.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
    border-color: #fb923c;
    background-position: 100% 100%;
}

/* Variation de couleur par tuile */
.tile:nth-child(2) {
    background: radial-gradient(circle at top left, #e0f2fe 0, #ffffff 40%, #ffffff 100%);
}

.tile:nth-child(3) {
    background: radial-gradient(circle at top left, #dcfce7 0, #ffffff 40%, #ffffff 100%);
}

.tile:nth-child(4) {
    background: radial-gradient(circle at top left, #ede9fe 0, #ffffff 40%, #ffffff 100%);
}

/* Carte principale de facture */
.card.facture-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px 24px 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* En-tête facture : logo / titre+client / n° + date */
.facture-header-row {
    display: grid;
    grid-template-columns: 1fr minmax(0, 2fr) 1fr;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.facture-header-left {
    display: flex;
    align-items: flex-start;
}

.facture-logo-big {
    height: 100px;
}

.facture-header-center {
    text-align: center;
}

.facture-title-main {
    margin: 0 0 12px 0;
    letter-spacing: 0.18em;
    font-size: 1.8rem;
}

/* Client sous FACTURE */
.facture-client-bloc {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

.client-select-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.client-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    background-color: #ffffff;
}

.client-details {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.4;
}

/* N° + date en haut à droite */
.facture-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.meta-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.meta-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.meta-value-placeholder {
    color: #6b7280;
}

/* Inputs génériques de l'en-tête */
.meta-input {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* Date moderne */
.meta-date-wrapper {
    display: inline-flex;   /* au lieu de flex, pour garder la largeur du contenu */
    align-items: center;
    justify-content: flex-end;
}

.modern-date {
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    font-size: 0.95rem;
}

.meta-date-display {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Sections facture */
.facture-section {
    margin-top: 18px;
}

.section-title {
    font-size: 1.05rem;
    margin: 0 0 8px;
}

/* Bloc client (ancienne grille utilisée ailleurs, conservée) */
.client-row {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 16px;
}

.client-select label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.client-select select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.client-preview {
    border-radius: 10px;
    border: 1px dashed #d1d5db;
    padding: 10px 12px;
    background: #f9fafb;
}

.preview-placeholder {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Table prestations */
.table-lignes {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-lignes th,
.table-lignes td {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
}

.table-lignes th {
    text-align: left;
    background: #f9fafb;
    font-weight: 500;
}

.table-lignes input[type="text"],
.table-lignes input[type="number"] {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 5px 7px;
    font-size: 0.85rem;
}

.table-lignes tr:hover td {
    background: #f9fafb;
}

.col-nb,
.col-prix,
.col-total {
    width: 120px;
}

/* Frais */
.frais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.frais-item label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.frais-item input {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 5px 7px;
    font-size: 0.85rem;
}

/* Footer facture */
.facture-footer-row {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.total-ht {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.total-input {
    width: 160px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 6px 8px;
}

/* Boutons */
.actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #fb923c;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(248, 138, 48, 0.45);
}

.btn-primary:hover {
    background: #f97316;
}

.btn-secondary {
    background: transparent;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

/* Pages clients */
.clients-main {
    max-width: 1100px;
}

.clients-layout {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start;
}

.clients-card {
    margin-bottom: 0;
}

.form-row {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.form-row.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"] {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 7px 9px;
    font-size: 0.9rem;
}

.clients-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.clients-table th,
.clients-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
}

.clients-table th {
    text-align: left;
    background: #f9fafb;
}

.clients-actions-cell {
    text-align: right;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
}
