/* =========================================================
   POLIVO - feuille de style
   ========================================================= */
:root {
  --pv-primary: #1f6f78;
  --pv-primary-dark: #17545b;
  --pv-navy: #1d2b45;
  --pv-accent: #f2b84b;
  --pv-bg: #f4f6f8;
  --pv-border: #e3e7ec;
  --bs-primary: #1f6f78;
  --bs-primary-rgb: 31, 111, 120;
  --bs-link-color: #1f6f78;
  --bs-link-color-rgb: 31, 111, 120;
  --bs-link-hover-color: #17545b;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
body { background: var(--pv-bg); color: #24303f; }

/* boutons primaires aux couleurs Polivo */
.btn-primary { --bs-btn-bg: var(--pv-primary); --bs-btn-border-color: var(--pv-primary); --bs-btn-hover-bg: var(--pv-primary-dark);
  --bs-btn-hover-border-color: var(--pv-primary-dark); --bs-btn-active-bg: var(--pv-primary-dark); --bs-btn-disabled-bg: var(--pv-primary); }
.btn-outline-primary { --bs-btn-color: var(--pv-primary); --bs-btn-border-color: #a9cbcf; --bs-btn-hover-bg: var(--pv-primary);
  --bs-btn-hover-border-color: var(--pv-primary); --bs-btn-active-bg: var(--pv-primary); --bs-btn-active-border-color: var(--pv-primary); }
.text-bg-primary { background-color: var(--pv-primary) !important; }
.form-control:focus, .form-select:focus { border-color: #7fb3b9; box-shadow: 0 0 0 .2rem rgba(31,111,120,.15); }

/* navbar */
.app-navbar { background: var(--pv-navy); padding: .55rem 0; }
.app-navbar .navbar-brand, .app-navbar .nav-link { color: #dfe6ee; white-space: nowrap; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: #fff; }
.app-navbar .nav-link.active { box-shadow: inset 0 -2px 0 var(--pv-accent); }
.app-navbar .navbar-toggler { border-color: rgba(255,255,255,.3); }
.app-navbar .navbar-toggler-icon { filter: invert(1); }
.brand-name { font-weight: 700; letter-spacing: .3px; font-size: 1.2rem; color: #fff; }
.brand-sub { font-size: .8rem; color: #9fb0c3; border-left: 1px solid #3c4d6b; padding-left: .6rem; }
.search-box { min-width: 230px; }
@media (max-width: 1199px) { .brand-sub { display: none !important; } }
.search-box .input-group-text, .search-box .form-control { background: #2a3a58; border-color: #3c4d6b; color: #fff; }
.search-box .form-control::placeholder { color: #9fb0c3; }
.avatar-sm { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--pv-accent); color: var(--pv-navy);
  align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.app-footer { border-top: 1px solid var(--pv-border); background: #fff; margin-top: 2rem; }

/* titres de page */
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; font-weight: 650; }
.page-head .crumb { font-size: .85rem; color: #6c7a8b; }
.page-head .crumb a { text-decoration: none; }

/* cartes */
.card { border: 1px solid var(--pv-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--pv-border); font-weight: 600; border-radius: .75rem .75rem 0 0 !important; }
.kpi { padding: 1.1rem 1.2rem; display: flex; flex-direction: row; gap: 1rem; align-items: center; text-decoration: none; color: inherit; height: 100%; }
.kpi:hover { box-shadow: 0 4px 14px rgba(16,24,40,.08); }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: none; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kpi-label { font-size: .82rem; color: #6c7a8b; margin-top: .25rem; }
.c-teal   { background: #e3f3f1; color: #1f6f78; }
.c-orange { background: #fdf0de; color: #c27410; }
.c-blue   { background: #e5eefb; color: #2b5fb4; }
.c-purple { background: #efe8fa; color: #6d43b5; }
.c-slate  { background: #e9edf2; color: #3d4b5f; }
.c-red    { background: #fde8e8; color: #c0392b; }

.list-item { display: flex; gap: .85rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid #eef1f4; text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #f8fafb; }
.date-chip { min-width: 52px; text-align: center; border-radius: 10px; background: #f0f4f7; padding: .3rem .2rem; line-height: 1.1; }
.date-chip .d { font-size: 1.15rem; font-weight: 700; }
.date-chip .m { font-size: .7rem; text-transform: uppercase; color: #6c7a8b; }
.date-chip.soon { background: #fdf0de; }
.date-chip.today { background: var(--pv-primary); color: #fff; }
.date-chip.today .m { color: #d6eeee; }

.avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; background: #e3f3f1; color: var(--pv-primary); flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* tableaux */
.table-app { margin: 0; }
.table-app thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: #6c7a8b; background: #f8fafb; font-weight: 600; border-bottom-width: 1px; }
.table-app td { vertical-align: middle; }
.table-app tr.clickable { cursor: pointer; }
.table-app tr.clickable:hover td { background: #f8fafb; }

/* formulaires */
.form-card { margin-bottom: 1.25rem; }
.form-card > .card-body { padding: 1.25rem 1.4rem; }
.section-title { margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid #eef1f4; }
.section-title h2 { font-size: 1.05rem; font-weight: 650; margin: 0; color: var(--pv-navy); }
.section-title h2 .bi { color: var(--pv-primary); }
.form-label { font-weight: 500; font-size: .88rem; color: #46556a; }
.btn-group-choice .btn { font-size: .88rem; }
.btn-group-choice { margin-right: .25rem; }
.question { font-weight: 600; color: var(--pv-navy); margin-bottom: .35rem; }
.question .num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--pv-primary); color: #fff;
  align-items: center; justify-content: center; font-size: .8rem; margin-right: .4rem; }
.sub-block { background: #f8fafb; border: 1px dashed #d5dce4; border-radius: .6rem; padding: 1rem; }
.sub-block-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #c27410; margin-bottom: .75rem; }

.yn-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid #f0f2f5; }
.yn-row:last-child { border-bottom: 0; }
.yn-label { font-size: .92rem; }
.yn-label small { color: #6c7a8b; }
.yn-ctrl { flex: none; }
.yn-sub { margin: .25rem 0 .6rem 1.2rem; padding-left: .8rem; border-left: 3px solid #e3f3f1; }

.room-grid .input-group-text { min-width: 0; }

/* lecture seule */
.ro-field { margin-bottom: .2rem; }
.ro-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .3px; color: #7a8899; font-weight: 600; }
.ro-value { font-size: .97rem; padding: .15rem 0 .4rem; min-height: 1.6rem; border-bottom: 1px dotted #d8dee6; }

/* signature */
.sigpad { position: relative; border: 2px dashed #b8c4d1; border-radius: .6rem; background: #fff; height: 170px; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; border-radius: .5rem; }
.sigpad .sig-hint { position: absolute; inset: auto 0 8px 0; text-align: center; font-size: .78rem; color: #a3afbd; pointer-events: none; }
.sigpad.signed .sig-hint { display: none; }
.sig-box { border: 1px solid var(--pv-border); border-radius: .5rem; height: 120px; display: flex; align-items: center; justify-content: center; background: #fff; }
.sig-img { max-height: 110px; max-width: 100%; }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.photo-tile { position: relative; border-radius: .5rem; overflow: hidden; border: 1px solid var(--pv-border); background: #fff; }
.photo-tile img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-tile .cap { font-size: .72rem; padding: .3rem .45rem; color: #5b6878; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-tile .del { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.92); border-radius: 6px; padding: 1px 6px; font-size: .78rem; }
.photo-cat { border: 1px solid var(--pv-border); border-radius: .6rem; padding: .8rem; background: #fff; height: 100%; }
.photo-cat-title { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.preview-strip { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.preview-strip img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--pv-border); }

/* barre d'actions collante */
.sticky-actions { position: sticky; bottom: 0; z-index: 10; background: rgba(255,255,255,.96); border-top: 1px solid var(--pv-border);
  padding: .75rem 0; margin-top: 1rem; backdrop-filter: blur(4px); }

/* fiche client */
.client-hero { display: flex; gap: 1rem; align-items: center; }
.info-dl dt { font-size: .75rem; text-transform: uppercase; color: #7a8899; font-weight: 600; letter-spacing: .3px; }
.info-dl dd { margin-bottom: .6rem; }
.form-tile { display: flex; gap: .75rem; align-items: center; padding: .9rem; border: 1px solid var(--pv-border); border-radius: .7rem;
  text-decoration: none; color: inherit; background: #fff; height: 100%; }
.form-tile:hover { border-color: #a9cbcf; box-shadow: 0 3px 10px rgba(16,24,40,.06); }

/* login */
.login-page { background: linear-gradient(135deg, #1d2b45 0%, #1f6f78 100%); min-height: 100vh; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 1rem; padding: 2.2rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card .brand-name { color: var(--pv-navy); }
.demo-hint { font-size: .85rem; background: #fdf6e7; border: 1px solid #f4dfae; border-radius: .5rem; padding: .55rem .75rem; color: #7a5a14; }

/* impression */
.only-print { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .app-navbar, .app-footer, .btn, .sticky-actions, .js-clear { display: none !important; }
  .only-print { display: block !important; }
  .print-header { border-bottom: 2px solid var(--pv-primary); padding-bottom: 6px; margin-bottom: 10px; }
  .print-footer { margin-top: 12px; padding-top: 6px; border-top: 1px solid #ccc; text-align: center; color: #777; }
  main.container-xl { max-width: 100%; padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .form-card { break-inside: auto; }
  .ro-field.is-empty .ro-value { min-height: 1.3rem; }
  a { color: inherit; text-decoration: none; }
  .photo-tile img { height: 90px; }
  .badge { border: 1px solid #999; color: #000 !important; background: transparent !important; }
}
