/* ===============================
   BASE
=============================== */
* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  display: flex;
  height: 100vh;
  background: #f4f6f9;
}

/* ===============================
   SIDEBAR
=============================== */
#sidebar {
  width: 240px;
  background: #1e3a8a;
  color: #fff;
  display: flex;
  flex-direction: column;
}

#sidebar h1 {
  font-size: 16px;
  text-align: center;
  padding: 20px 10px;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

#sidebar a {
  padding: 14px 20px;
  color: #fff;
  text-decoration: none;
  display: block;
  cursor: pointer;
}

#sidebar a:hover {
  background: rgba(255,255,255,0.15);
}

/* ===============================
   MAIN
=============================== */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#header {
  background: #fff;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}

#content {
  padding: 20px;
  overflow-y: auto;
}

/* ===============================
   TABLES
=============================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th, td {
  border: 1px solid #ccc;
  padding: 8px;
}

button {
  cursor: pointer;
}

/* ===============================
   PAGE DEVIS
=============================== */
.quote-editor {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
}

/* ===============================
   HEADER DEVIS
=============================== */
.quote-header {
  background: #fff;
  padding: 15px;
  border-bottom: 1px solid #ddd;

  display: grid;
  grid-template-columns: 2fr 2fr;
  gap: 12px;
}

/* carte standard */
.quote-card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px 14px;
}

/* pleine largeur */
.quote-card.full {
  grid-column: 1 / -1;
}

.quote-card label {
  font-size: 12px;
  color: #f97316;
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

.quote-card input,
.quote-card textarea,
.quote-card select {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
}

/* ===============================
   ACTIONS + BADGES (HEADER)
=============================== */
.quote-card > div {
  display: flex;
  justify-content: flex-end; /* 🔥 aligné à droite */
  align-items: center;
  gap: 10px;
}

/* ===============================
   BADGES
=============================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;          /* 🔥 hauteur uniforme */
  padding: 0 16px;

  font-size: 14px;
  font-weight: 600;

  border-radius: 6px;
  cursor: pointer;
  user-select: none;

  background: #e5e7eb;
  color: #111827;

  transition: background 0.15s ease, transform 0.05s ease;
}

.badge:hover {
  background: #d1d5db;
}

.badge:active {
  transform: translateY(1px);
}

/* ===============================
   STATUT
=============================== */
.badge-status {
  background: #facc15; /* jaune */
  color: #000;
}

.badge-status.signed {
  background: #3b82f6;
  color: #fff;
}

.badge-status.invoiced {
  background: #22c55e;
  color: #fff;
}

/* ===============================
   BADGES SPÉCIAUX
=============================== */
.badge-pdf {
  background: #e0e7ff;
  color: #1e3a8a;
}

.badge-mail {
  background: #dcfce7;
  color: #166534;
}

.badge-more {
  background: #f3f4f6;
  font-size: 18px;
  padding: 0 14px;
}

/* ===============================
   MENU DÉROULANT STATUT
=============================== */
.badge-menu {
  position: absolute;
  top: 44px;
  right: 0;

  min-width: 160px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);

  z-index: 1000;
}

.badge-menu div {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.badge-menu div:hover {
  background: #f4f6f9;
}

/* ===============================
   CONTENU DEVIS
=============================== */
.quote-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  padding-bottom: 140px;
  background: #f4f6f9;
}

.quote-description {
  white-space: pre-line;
  color: #333;
}

/* ===============================
   RÉSERVES
=============================== */
.quote-reserves {
  margin-top: 20px;
}

.quote-reserves h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: #f97316;
}

#quote-reserves-display {
  font-size: 13px;
  color: #444;
  white-space: pre-line;
}
.quote-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ===============================
   BARRE PRODUITS
=============================== */
#product-bar {
  margin-left: auto;
}

/* ===============================
   MODE ÉDITION
=============================== */
.editable-text {
  border: 1px solid #ccc;
  padding: 6px;
  min-height: 40px;
  background: #fff;
}

.text-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.text-toolbar button {
  font-size: 12px;
  padding: 2px 6px;
}
/* ===============================
   LISTE DEVIS (STYLE MODERNE)
=============================== */

.quotes-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quotes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quotes-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.quotes-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

#search-client {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 220px;
  background: #fff;
}

.btn-primary {
  padding: 8px 14px;
  background: #1e3a8a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
}

.btn-primary:hover {
  opacity: 0.9;
}

.quotes-table-wrapper {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

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

.quotes-table thead {
  background: #f3f4f6;
}

.quotes-table th {
  text-align: left;
  padding: 12px;
  font-size: 13px;
  color: #555;
}

.quotes-table td {
  padding: 12px;
  font-size: 14px;
  border-top: 1px solid #f0f0f0;
}

.quotes-table tbody tr:hover {
  background: #f9fafb;
}

.quotes-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.quotes-table td:last-child {
  text-align: right;
}

.quotes-table button {
  border: none;
  background: #f3f4f6;
  padding: 6px 8px;
  border-radius: 4px;
  margin-left: 5px;
}

.quotes-table button:hover {
  background: #e5e7eb;
}
.saas-quotes table {
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
}

.saas-quotes th {
    background: #f5f7fa;
    text-align: left;
    font-weight: 600;
    padding: 14px;
    font-size: 14px;
}

.saas-quotes td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.saas-quotes tr:hover {
    background-color: #f9fafb;
}

.saas-quotes button {
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    cursor: pointer;
}

.quote-header-actions.full {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.invoice-description-editor {
  min-height: 70px;
  padding: 8px;
  border: 1px solid #ccc;
  background: #fff;
}

.invoice-description-editor:focus {
  outline: none;
  border-color: #f57c00;
}
.btn-primary2 {
  padding: 8px 14px;
  background: #1e3a8a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
}
