
* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    background: #f4f4f4;
}

.topbar {
    background: #2f3fa1;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
}

.logo {
    font-size: 26px;
    font-weight: bold;
}

.logo span {
    color: #f0e000;
}

.container {
    display: flex;
}

.sidebar {
    position: relative;
    width: 230px;
    background: #3b4cb8;
    color: white;
    min-height: 100vh;
    padding: 10px;
}

.sidebar h3 {
    background: #2f3fa1;
    padding: 6px;
    font-size: 14px;
    margin-top: 15px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    padding: 6px;
    cursor: pointer;
}

.sidebar li:hover,
.sidebar li.active {
    background: #5667d9;
}


.sidebar ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 6px;
}


.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #5667d9;
    color: white;
}


.sidebar .btn-logout {
    position: absolute;
    bottom: 20px;
    left: 10px;
    width: calc(100% - 20px);
    background: red;
    color: white;
    text-align: center;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
}

.sidebar .btn-logout:hover {
    background: darkred;
}

.content {
    flex: 1;
    background: white;
    padding: 20px;
}

.filters {
    margin-bottom: 15px;
}

.btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background: #eee;
    cursor: pointer;
}

.btn.active {
    background: #3b4cb8;
    color: white;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #3b4cb8;
    color: white;
    padding: 8px;
}

.table td {
    border: 1px solid #ccc;
    padding: 8px;
}

.status.red {
    color: red;
    font-weight: bold;
}


/* ===== FORMULAIRE */

.content form:not(.week-filters) {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}


/* chaque ligne */
.content form label {
    display: inline-block;
    width: 260px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* champs */
.content form input {
    width: calc(100% - 280px);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
}


/* focus */
.content form input:focus {
    outline: none;
    border-color: #3b4cb8;
    box-shadow: 0 0 0 2px rgba(59,76,184,0.2);
}



/* bouton */
.content form button {
    background: #3b4cb8;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.content form button:hover {
    background: #2f3fa1;
}

.content h1 {
    text-align: center;
    margin-bottom: 30px;
}

.content form button {
    display: block;
    margin-left: auto;
}


/* ===== PLANNING ===== */

.planning-table {
    width: 100%;
    border-collapse: collapse;
}

.planning-table th {
    background: #3b4cb8;
    color: white;
    padding: 10px;
}

.planning-table td {
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

.planning-table tr:nth-child(even) {
    background: #f4f6ff;
}


.content h3 {
    background: #f4f6ff;
    padding: 10px;
    border-left: 5px solid #3b4cb8;
}


.week-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 10px 15px;
    background: #f4f6ff;
    border-radius: 10px;
}

.week-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.week-filters {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-left: auto;

    background: transparent;
    padding: 0;
    box-shadow: none;
}


.week-filters select {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.week-filters button {
    padding: 6px 12px;
    border-radius: 6px;
    background: #3b4cb8;
    color: white;
    border: none;
    cursor: pointer;
}

.week-filters select[name="mois"] {
    width: 150px;
}

.week-filters select[name="annee"] {
    width: 90px;
}

.planning-totals td{
    background:#f4f6ff;
    border-top:2px solid #3b4cb8;
}




/*clients*/

.content h1 {
    text-align: center;
    margin-bottom: 20px;
}

.btn {
    background: #3b4cb8;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.btn:hover {
    background: #2f3fa1;
}

#ajouter-client-form input {
    width: 250px;
    padding: 6px 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

#ajouter-client-form select {
    width: 250px;
    padding: 6px 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}


#ajouter-client-form label {
    display: inline-block;
    width: 120px;
    font-weight: bold;
}

.planning-table {
    width: 100%;
    border-collapse: collapse;
}

.planning-table th {
    background: #3b4cb8;
    color: white;
    padding: 8px;
}

.planning-table td {
    padding: 8px;
    border: 1px solid #ccc;
}

/* champs */
.content form select {
    width: calc(100% - 280px);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
}

.content form select:focus {
    outline: none;
    border-color: #3b4cb8;
    box-shadow: 0 0 0 2px rgba(59,76,184,0.2);
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
}

.tab-link {
    border: 1px solid #3b4cb8;
    background: #ddd;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
}

.tab-link.active {
    background: #f4e6ff;
    color: #000;
    border-bottom: 1px solid #f4e6ff;
}

.tab-pane {
    display: none;
    background: #f4e6ff;
    padding: 15px 10px;
    border: 1px solid #3b4cb8;
}

.tab-pane.active {
    display: block;
}


/*listing*/

/* ===== LISTING CLIENT ===== */

.listing-client-page {
    background: #f4f4f4;
}

/* Bandeau bleu */
.listing-top-bar {
    background: #3b4cb8;
    color: #fff;
    text-align: center;
    font-weight: bold;
    padding: 4px 0;
    margin-bottom: 10px;
}

/* Bloc mail en haut */
.listing-mail-box {
    width: 60%;
    margin: 0 auto 25px;
    border: 1px solid #3b4cb8;
    background: #f4e6ff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.listing-mail-header {
    background: #3b4cb8;
    color: #fff;
    text-align: center;
    font-weight: bold;
    padding: 6px 0;
}

.listing-mail-row {
    padding: 8px 15px;
    text-align: center;
}

.listing-mail-row span:first-child {
    margin-right: 10px;
    font-weight: bold;
}

.listing-mail-row input[type="email"] {
    width: 80%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.listing-mail-footer button {
    padding: 6px 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #ddd;
    cursor: pointer;
}

/* Bloc principal document */
.listing-document {
    background: #fff;
    padding: 20px 25px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* En-têtes société / client */
.listing-header-blocks {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.listing-our-company {
    width: 40%;
    font-size: 13px;
}

.listing-client-block {
    width: 50%;
    text-align: right;
    font-size: 13px;
}

/* Bouton orange "LISTING CLIENT" */
.listing-orange-btn {
    background: #ff9900;
    color: #fff;
    font-weight: bold;
    padding: 8px 20px;
    display: inline-block;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* PAGE / DATE / CLIENT */
.listing-page-info {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.listing-page-box {
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 5px 12px;
    text-align: center;
    min-width: 80px;
}

.listing-page-box .label {
    font-size: 11px;
    font-weight: bold;
}

.listing-page-box .value {
    font-size: 13px;
}

/* Adresse client */
.listing-client-address {
    margin-top: 10px;
    text-align: left;
    float: right;
}

/* Titre listing période */
.listing-period-title {
    margin-top: 30px;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Tableau listing */
.listing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 25px;
}

.listing-table th {
    background: #e6d0ff;
    border-bottom: 1px solid #ccc;
    padding: 6px 4px;
}

.listing-table td {
    border-bottom: 1px solid #eee;
    padding: 4px 4px;
}

/* Totaux bas de page */
.listing-totals-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.listing-totals-table {
    border-collapse: collapse;
    font-size: 12px;
}

.listing-totals-table th,
.listing-totals-table td {
    border: 1px solid #ccc;
    padding: 4px 6px;
    text-align: right;
}

.listing-totals-table th:first-child,
.listing-totals-table td:first-child {
    text-align: center;
}

.listing-totals-right {
    border-collapse: collapse;
    font-size: 12px;
}

.listing-totals-right th,
.listing-totals-right td {
    border: 1px solid #ccc;
    padding: 4px 8px;
    text-align: right;
}

.listing-totals-right th {
    background: #f5f5f5;
}


/* barre pdf*/

.pdf-toolbar {
    background: #222;
    color: white;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: 6px;
    width: fit-content;
    margin: 15px 0;
}

.pdf-toolbar button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.pdf-toolbar button:hover {
    color: #f0e000;
}

.btn-retour {
    background: #3b4cb8;
    color: white !important;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    margin-left: 25px;
}

.btn-retour:hover {
    background: #2f3fa1;
}



/*FACTURES*/

/* ===== FACTURE ===== */


.invoice-meta{
  width:45%;
  font-size:13px;
  line-height:1.25;
  text-align:left;
}

.invoice-title{
  padding: 10px 20px;
  font-weight:bold;
}

.invoice-table{
  width:100%;
  border-collapse:collapse;
  margin: 0 0 15px 0;
  background:#fff;
}

.invoice-table th{
  background:#e7d3ff;
  border:1px solid #ccc;
  padding:8px;
  font-size:12px;
}

.invoice-table td{
  border:1px solid #ddd;
  padding:8px;
  font-size:12px;
  vertical-align:top;
}

.invoice-table td.pre{
  white-space:pre-line;
}

.invoice-footer{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding: 0 20px 20px 20px;
}

.invoice-notes{
  width:55%;
  font-size:12px;
  color:#333;
}

.invoice-totals{
  width:35%;
  font-size:13px;
  text-align:right;
}


.invoice-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:18px;
  background:#fff;
  gap:30px;
  padding:20px;
}

.invoice-company{
  font-size:13px;
  line-height:1.25;
  width:45%;
}

.invoice-client{
  width:45%;
  text-align:left;
  font-size:13px;
  line-height:1.25;
}

.invoice-client-name{
  font-weight:bold;
  margin-bottom:6px;
  letter-spacing:0.3px;
}

/* Tableau récap facture */
.invoice-mini-table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  font-size:13px;
}

.invoice-mini-table th,
.invoice-mini-table td{
  border:1px solid #333;
  padding:6px 8px;
  text-align:center;
}

.invoice-mini-table th{
  font-weight:bold;
}


.invoice-page {
    background: #ffffff;
    width: 100%;
    min-height: 100vh;
    padding: 30px 40px;
    box-sizing: border-box;
}

body {
    background: #f4f4f4;
}

/* Impression / PDF */
@media print{
  .no-print{ display:none !important; }
  body{ background:#fff !important; }
  .content{ padding:0 !important; }
  .invoice-header, .invoice-title, .invoice-footer{ page-break-inside:avoid; }
}



/* ==== Facture : fond blanc sur toute la page imprimée ==== */
.invoice-page,
#invoice-print {
  background: #fff;
}

/* Conteneur imprimé : on force une "page" A4 propre */
#invoice-print {
  min-height: 297mm;
  padding: 12mm 12mm 18mm 12mm;
  box-sizing: border-box;
  position: relative;
}

/* Pied de page collé en bas du PDF */
/* ====== FACTURE : zone imprimée ====== */
#invoice-print{
  background:#fff;
  min-height: 297mm;
  padding: 12mm 12mm 18mm 12mm;
  box-sizing: border-box;

  /* on garde flex pour pousser le footer en bas à l'écran */
  display: flex;
  flex-direction: column;
}

/* le contenu principal prend l'espace */
.invoice-content{
  flex: 1 1 auto;
}

/* footer poussé en bas */
.invoice-bottom{
  margin-top: auto;
}

/* ====== FOOTER mise en forme*/
.invoice-footer-table{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.invoice-footer-left{
  width: 65%;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
  padding-right: 10px;
}

.invoice-footer-right{
  width: 35%;
  vertical-align: top;
  background: #6f86a9;
  color: #fff;
  padding: 12px 14px;
  text-align: right;
  font-size: 13px;
  line-height: 1.6;
}

.invoice-legal-text{
  font-size: 11px;
  line-height: 1.25;
  margin: 6px 0 8px 0;
}

.invoice-company-footer{
  text-align: center;
  font-size: 11px;
  line-height: 1.25;
}

/* éviter que le footer se coupe */
@media print{
  .invoice-bottom,
  .invoice-footer-table,
  .invoice-legal-text,
  .invoice-company-footer{
    page-break-inside: avoid;
  }
}



/* ===== Bloc mail en haut (comme image) ===== */
.listing-mail-box{
    width: 60%;
    margin: 0 auto 25px;
    border: 1px solid #3b4cb8;
    background: #f4e6ff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}

.listing-mail-header{
    background: #3b4cb8;
    color: #fff;
    text-align: center;
    font-weight: bold;
    padding: 8px 0;
    letter-spacing: 0.5px;
}

.listing-mail-row{
    padding: 10px 15px;
    text-align: center;
    font-size: 14px;
}

.listing-mail-row input[type="email"]{
    width: 75%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #cfcfcf;
    outline: none;
}

.listing-mail-row input[type="email"]:focus{
    border-color: #3b4cb8;
    box-shadow: 0 0 0 2px rgba(59,76,184,0.15);
}

.listing-mail-footer{
    padding-bottom: 16px;
}

.listing-mail-footer button{
    padding: 7px 22px;
    border-radius: 4px;
    border: 1px solid #bfbfbf;
    background: #e6e6e6;
    cursor: pointer;
    font-weight: 600;
}

.listing-mail-footer button:hover{
    background: #dcdcdc;
}

.etat-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:50%;
  font-size:14px;
}

.etat-paid{ background:#e9f9ee; color:#1aa34a; border:1px solid #1aa34a; }     /* flèche verte */
.etat-unpaid{ background:#ffecec; color:#d11a2a; border:1px solid #d11a2a; }   /* croix rouge */
.etat-relance{ background:#fff3e6; color:#ff7a00; border:1px solid #ff7a00; }  /* flèche orange */

.etat-cell{ text-align:center; }
.etat-cell button{
  background:none;
  border:none;
  cursor:pointer;
  padding:0;
}

.btn-duplicate { color:#0e7adf; }
.btn-duplicate:hover { color:#ff9900; }


/* Bouton supprimer dans le planning */
.planning-table form.btn-delete-form {
    display: inline-block;      /* pour rester sur la ligne */
    margin: 0;                  /* pas de marge par défaut */
}

.planning-table form.btn-delete-form button {
    background: #ff4d4d;        /* rouge classique */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;           /* petit bouton */
    font-size: 12px;            /* texte plus petit */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.planning-table form.btn-delete-form button:hover {
    background: #d11a2a;        /* rouge plus foncé au hover */
}



/* Petit bouton dupliquer dans le planning */
.planning-table form.btn-duplicate-form {
    display: inline-block;
    margin: 0;
}

.planning-table form.btn-duplicate-form button {
    background: #0e7adf;       /* bleu */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.planning-table form.btn-duplicate-form button:hover {
    background: #ff9900;       /* orange au hover */
}


