/* common.css — Styles partages JGS Avocat */

:root {
  /* Couleurs principales — charte JGS */
  --bordeaux: #69150F;          /* Bordeaux principal */
  --bordeaux-dark: #4D0F0A;     /* Bordeaux assombri (hovers, actifs) */
  --bordeaux-light: #f5e6e3;    /* Bordeaux délavé pour les fonds doux */
  --or: #E2AF5A;                /* Or principal */
  --or-dark: #C99540;           /* Or assombri (hovers) */
  --or-light: #f9ecd5;          /* Or délavé pour fonds doux */
  /* Couleurs secondaires */
  --or-vif: #F4C124;            /* Or vif (accent ponctuel) */
  --sauge: #9EA680;             /* Vert sauge */
  --sauge-light: #e7eadd;       /* Sauge délavé pour fonds doux */
  /* Neutres */
  --cream: #faf6ef;             /* Crème, fond général */
  --text: #2c1f1c;              /* Texte principal */
  --text-muted: #8a7f75;        /* Texte secondaire */
  --border: #ebe2d3;            /* Bordures discrètes */
  /* Famille typographique de corps (charte : Garamond Premier Pro) */
  --font-body: 'EB Garamond', 'Cormorant Garamond', Garamond, Georgia, serif;
  --font-display: 'Cormorant Garamond', 'EB Garamond', Garamond, Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--cream); color: var(--text); min-height: 100vh; font-size: 16px; line-height: 1.55; }

/* ── SIDEBAR / NAV ───────────────────────────── */
header {
  background: var(--bordeaux);
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 56px; z-index: 200;
  display: flex; flex-direction: column;
  transition: width 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden; white-space: nowrap;
}
header.sidebar-open { width: 230px; }
.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 14px 14px; min-height: 56px;
}
.logo {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
  color: white; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
header.sidebar-open .logo { opacity: 1; }
.logo:hover { opacity: 0.85; }
.logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; color: white; flex-shrink: 0;
}
header.sidebar-open .logo-icon { display: none; }
.sidebar-pin {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 14px; cursor: pointer; padding: 4px; border-radius: 4px;
  transition: all 0.15s; opacity: 0; flex-shrink: 0;
}
header.sidebar-open .sidebar-pin { opacity: 1; }
.sidebar-pin:hover { color: white; background: rgba(255,255,255,.12); }
.sidebar-pin.pinned { color: white; transform: rotate(0deg); }
.sidebar-pin:not(.pinned) { transform: rotate(45deg); }
nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; flex: 1; }
nav a {
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 12.5px;
  letter-spacing: 0.04em; text-transform: uppercase; transition: all 0.15s;
  padding: 9px 14px 9px 18px; display: block; border-radius: 0 6px 6px 0;
  margin-right: 8px;
}
nav a:hover { color: white; background: rgba(255,255,255,.08); }
nav a.active { color: white; background: rgba(255,255,255,.13); font-weight: 600; }
#logout-btn-sidebar {
  color: rgba(255,255,255,.5); font-size: 11px; cursor: pointer;
  background: none; border: none; font-family: var(--font-body);
  padding: 12px 18px; text-align: left; text-transform: uppercase;
  letter-spacing: 0.04em; transition: color 0.15s;
  border-top: 1px solid rgba(255,255,255,.1); margin-top: auto;
}
#logout-btn-sidebar:hover { color: white; }
/* Body offset for sidebar */
body { margin-left: 56px; transition: margin-left 0.25s cubic-bezier(.4,0,.2,1); }
body.sidebar-pinned { margin-left: 230px; }

/* ── TOOLBAR ─────────────────────────────────── */
.toolbar {
  padding: 1.5rem 2.5rem; display: flex; align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: white;
  box-shadow: inset 0 -2px 0 var(--or); /* fin filet doré, signature charte */
}
.toolbar-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; font-style: italic; color: var(--bordeaux); letter-spacing: 0.005em; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }

/* ── SEARCH ──────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input {
  padding: 8px 16px 8px 36px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 13px; font-family: var(--font-body); background: var(--cream);
  width: 240px; outline: none; transition: border-color 0.2s, width 0.3s;
}
.search-wrap input:focus { border-color: var(--bordeaux); width: 300px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  padding: 8px 18px; border-radius: 6px; font-size: 13px;
  font-family: var(--font-body); cursor: pointer; font-weight: 500; transition: all 0.15s;
}
.btn-new {
  background: var(--bordeaux); color: white; border: none; padding: 8px 18px;
  border-radius: 6px; font-size: 13px; font-family: var(--font-body);
  cursor: pointer; transition: background 0.2s; font-weight: 500;
}
.btn-new:hover { background: var(--bordeaux-dark); }
.btn-primary { background: var(--bordeaux); color: white; border: none; }
.btn-primary:hover { background: var(--bordeaux-dark); }
.btn-cancel { background: white; color: var(--text-muted); border: 1px solid var(--border); }
.btn-cancel:hover { background: var(--cream); }
.btn-secondary { background: white; color: var(--bordeaux); border: 1px solid var(--bordeaux); }
.btn-secondary:hover { background: var(--bordeaux-light); }

/* ── TABLE ───────────────────────────────────── */
.table-wrap { padding: 1.5rem 2.5rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 700px; }
thead th {
  padding: 10px 14px; text-align: left; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1.5px solid var(--border); white-space: nowrap; background: white;
}
tbody tr {
  cursor: pointer; border-bottom: 1px solid rgba(0,0,0,0.04); transition: all 0.15s ease;
}
tbody tr:hover {
  filter: brightness(0.95); transform: translateX(4px);
  box-shadow: -3px 0 0 var(--bordeaux);
}
tbody td { padding: 14px; vertical-align: middle; }
.td-nom {
  font-family: var(--font-display); font-size: 15px;
  font-weight: 600; color: var(--bordeaux);
}
.td-dossier {
  font-family: var(--font-display); font-size: 15px;
  font-weight: 600; color: var(--bordeaux);
}
.td-client { font-weight: 500; }
.td-email { color: #5a6abf; font-size: 12.5px; }
.td-juri { color: #5a6abf; font-size: 12.5px; }
.td-nrc { font-family: monospace; color: var(--text-muted); font-size: 12px; }
.td-numero {
  font-family: monospace; font-size: 12.5px; font-weight: 600;
  color: var(--bordeaux); background: var(--bordeaux-light);
  padding: 3px 8px; border-radius: 4px; display: inline-block;
}

/* ── ROW COLORS (alternance discrète) ───────── */
tbody tr:nth-child(odd)  { background: #ffffff; }
tbody tr:nth-child(even) { background: var(--cream); }

/* ── STATUS BADGES (palette charte) ──────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.03em;
}
.s-Nouveau          { background: var(--or-light);       color: var(--or-dark); }
.s-En\ cours        { background: var(--sauge-light);    color: #5a6147; }
.s-Cl\F4tur\E9      { background: var(--bordeaux-light); color: var(--bordeaux); }
.s-En\ attente      { background: #f9efd9;               color: #8a6a25; }
.s-Remis            { background: var(--bordeaux-light); color: var(--bordeaux); }
.check              { color: var(--sauge); }
.state-msg { text-align: center; padding: 4rem; color: var(--text-muted); font-size: 15px; }

/* ── PAGINATION ──────────────────────────────── */
.pagination {
  display: flex; gap: 6px; justify-content: center;
  padding: 1.2rem 2.5rem; flex-wrap: wrap; align-items: center;
}
.page-btn {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: white; cursor: pointer; font-size: 13px;
  font-family: var(--font-body); transition: all 0.15s;
}
.page-btn:hover, .page-btn.active {
  background: var(--bordeaux); color: white; border-color: var(--bordeaux);
}

/* ── SELECTION BAR ───────────────────────────── */
.sel-bar {
  display: none; background: #2c2420; color: white;
  padding: 10px 2.5rem; align-items: center; justify-content: space-between; gap: 12px;
}
.sel-bar.show { display: flex; }
.sel-count { font-size: 13px; }
.btn-delete-sel {
  background: var(--bordeaux); color: white; border: none; padding: 7px 18px;
  border-radius: 6px; font-size: 13px; font-family: var(--font-body);
  cursor: pointer; font-weight: 500;
}
.btn-delete-sel:hover { background: var(--bordeaux-dark); }
/* alias pour affaires/consultations qui utilisent .btn-delete */
.btn-delete {
  background: var(--bordeaux); color: white; border: none; padding: 7px 18px;
  border-radius: 6px; font-size: 13px; font-family: var(--font-body);
  cursor: pointer; font-weight: 500;
}
.btn-delete:hover { background: var(--bordeaux-dark); }
.btn-cancel-sel {
  background: none; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.3);
  padding: 7px 14px; border-radius: 6px; font-size: 13px;
  font-family: var(--font-body); cursor: pointer; margin-right: 6px;
}
.btn-cancel-sel:hover { color: white; }
tbody tr.selected { outline: 2px solid var(--bordeaux); outline-offset: -2px; }
th.cb-col, td.cb-col { width: 36px; text-align: center; padding-left: 10px; display: none; }
.select-mode th.cb-col, .select-mode td.cb-col { display: table-cell; }
input[type=checkbox] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--bordeaux); }

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 12px; padding: 2rem;
  width: 560px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
}
.modal-title {
  font-family: var(--font-display); font-size: 1.5rem;
  font-weight: 700; font-style: italic;
  color: var(--bordeaux); margin-bottom: 1.5rem;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 1.5rem; }

/* ── MODAL CONFIRM (suppression) ─────────────── */
.modal-confirm {
  background: white; border-radius: 12px; padding: 2rem;
  width: 420px; max-width: 90vw;
}
.modal-confirm-title {
  font-family: var(--font-display); font-size: 1.5rem;
  font-weight: 700; font-style: italic;
  color: var(--bordeaux); margin-bottom: 0.8rem;
}
.modal-confirm-text {
  font-size: 13.5px; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6;
}
.modal-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-confirm-cancel {
  background: white; color: var(--text-muted); border: 1px solid var(--border);
  padding: 8px 18px; border-radius: 6px; font-size: 13px;
  font-family: var(--font-body); cursor: pointer;
}
.btn-confirm-delete {
  background: var(--bordeaux); color: white; border: none; padding: 8px 18px;
  border-radius: 6px; font-size: 13px; font-family: var(--font-body);
  cursor: pointer; font-weight: 500;
}
.btn-confirm-delete:hover { background: var(--bordeaux-dark); }

/* ── FORM ────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--bordeaux);
}
.form-field input {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13.5px; font-family: var(--font-body);
  outline: none; transition: border-color 0.2s;
}
.form-field input:focus { border-color: var(--bordeaux); }
.form-field select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13.5px; font-family: var(--font-body);
  outline: none; background: white;
}
.form-field select:focus { border-color: var(--bordeaux); }
.form-field textarea {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13.5px; font-family: var(--font-body);
  outline: none; transition: border-color 0.2s;
  resize: none; overflow: hidden; min-height: 52px; line-height: 1.6; width: 100%;
}
.form-field textarea:focus { border-color: var(--bordeaux); }

/* ── TOGGLE TYPE (particulier/organisme) ─────── */
.toggle-type {
  display: flex; gap: 0; border: 1px solid var(--bordeaux);
  border-radius: 8px; overflow: hidden; margin-bottom: 1.2rem;
}
.toggle-type button {
  flex: 1; padding: 10px; font-size: 11px; font-family: var(--font-body);
  border: none; cursor: pointer; background: white; color: var(--bordeaux);
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; transition: all 0.15s;
}
.toggle-type button.active { background: var(--bordeaux); color: white; }

/* ── BACK BAR (detail pages) ─────────────────── */
.back-bar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0.8rem 2.5rem; display: flex; align-items: center; gap: 12px;
}
.back-btn { color: var(--bordeaux); font-size: 13px; cursor: pointer; }
.back-btn:hover { opacity: 0.7; }
.back-sep { color: var(--text-muted); }
.back-current { font-family: var(--font-display); font-size: 15px; }

/* ── DETAIL PAGES ────────────────────────────── */
.content { max-width: 1000px; margin: 2rem auto; padding: 0 2.5rem; }
.hero-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem 2.5rem; margin-bottom: 1.5rem;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.hero-title {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 700; font-style: italic;
  color: var(--bordeaux); letter-spacing: 0.005em;
}
.hero-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.hero-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.sections-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.section-card {
  background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem 2rem;
}
.section-card.full { grid-column: 1 / -1; }
.section-title {
  font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 700; color: var(--bordeaux); margin-bottom: 1rem;
  letter-spacing: 0.005em;
}
.info-row { display: flex; gap: 8px; margin-bottom: 0.6rem; font-size: 13.5px; }
.info-label { font-weight: 500; color: var(--text-muted); min-width: 120px; }
.info-value { color: var(--text); }

/* ── INLINE DROPDOWN ─────────────────────────── */
.inline-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: white; border: 1px solid var(--border); border-radius: 6px;
  max-height: 220px; overflow-y: auto; z-index: 400;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); display: none;
}
.inline-dropdown.open { display: block; }
.inline-dropdown-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.inline-dropdown-item:last-child { border-bottom: none; }
.inline-dropdown-item:hover { background: var(--bordeaux-light); color: var(--bordeaux); }
