/* ==========================================================================
   Sylati Funérarium — Prototype UI
   Feuille de style de la maquette (Bootstrap 5 + personnalisation GigaTech)
   ========================================================================== */

:root {
  --sf-brand:        #1b2a4a;
  --sf-brand-2:      #24365c;
  --sf-accent:       #b08d57;
  --sf-accent-soft:  #f1e7d8;
  --sf-bg:           #f4f5f8;
  --sf-surface:      #ffffff;
  --sf-border:       #e4e7ee;
  --sf-text:         #23272f;
  --sf-muted:        #6b7280;
  --sf-sidebar-w:    264px;
  --sf-header-h:     64px;
  --sf-radius:       14px;
  --sf-shadow:       0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--sf-bg);
  color: var(--sf-text);
  font-size: 14px;
}

h1, h2, h3, h4, h5, .sf-serif {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

a { text-decoration: none; }

.text-muted-2 { color: var(--sf-muted) !important; }

/* ---------- Layout ------------------------------------------------------- */

.sf-shell { min-height: 100vh; }

.sf-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sf-sidebar-w);
  background: linear-gradient(180deg, var(--sf-brand) 0%, #16213c 100%);
  color: #cdd5e4;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}

.sf-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0 1.15rem;
  height: var(--sf-header-h);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sf-sidebar__logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--sf-accent);
  color: #1b2a4a;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.sf-sidebar__title { color: #fff; font-weight: 600; font-size: 1.02rem; line-height: 1.1; }
.sf-sidebar__sub   { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sf-accent); }

.sf-nav {
  flex: 1;
  overflow-y: auto;
  padding: .85rem .6rem 2rem;
}
.sf-nav__section {
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #7c88a1;
  padding: 1.1rem .8rem .35rem;
}
.sf-nav__link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .8rem;
  border-radius: 9px;
  color: #cdd5e4;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sf-nav__link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #93a0ba; }
.sf-nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sf-nav__link:hover i { color: #fff; }
.sf-nav__link.active { background: var(--sf-accent); color: #1b2a4a; font-weight: 600; }
.sf-nav__link.active i { color: #1b2a4a; }

.sf-sidebar__foot {
  padding: .9rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .74rem;
  color: #8b97b0;
  flex-shrink: 0;
}

.sf-header {
  position: fixed;
  top: 0; right: 0; left: var(--sf-sidebar-w);
  height: var(--sf-header-h);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sf-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.4rem;
  z-index: 1030;
}
.sf-header__search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.sf-header__search i {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  color: var(--sf-muted);
}
.sf-header__search input {
  width: 100%;
  border: 1px solid var(--sf-border);
  background: var(--sf-bg);
  border-radius: 9px;
  padding: .5rem .8rem .5rem 2.2rem;
  font-size: .85rem;
}
.sf-header__search input:focus { outline: 2px solid var(--sf-accent-soft); border-color: var(--sf-accent); }

.sf-content {
  margin-left: var(--sf-sidebar-w);
  padding: calc(var(--sf-header-h) + 1.5rem) 1.6rem 3rem;
  min-height: 100vh;
}

.sf-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sf-brand); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: .8rem;
}

.sf-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  z-index: 1035; display: none;
}

@media (max-width: 991.98px) {
  .sf-sidebar { transform: translateX(-100%); }
  .sf-shell.is-open .sf-sidebar { transform: translateX(0); }
  .sf-shell.is-open .sf-backdrop { display: block; }
  .sf-header { left: 0; }
  .sf-content { margin-left: 0; padding-left: 1rem; padding-right: 1rem; }
}

/* ---------- Composants -------------------------------------------------- */

.sf-page-head { margin-bottom: 1.4rem; }
.sf-page-head h1 { font-size: 1.6rem; margin: 0 0 .15rem; }
.sf-page-head .lead { color: var(--sf-muted); font-size: .9rem; margin: 0; }

.breadcrumb { font-size: .8rem; margin-bottom: .4rem; }
.breadcrumb-item a { color: var(--sf-muted); }
.breadcrumb-item.active { color: var(--sf-text); }

.card {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--sf-border);
  font-weight: 600;
  padding: .9rem 1.15rem;
}
.card-body { padding: 1.15rem; }

.sf-stat {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.1rem 1.2rem;
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow);
  height: 100%;
}
.sf-stat__label { font-size: .78rem; color: var(--sf-muted); text-transform: uppercase; letter-spacing: .04em; padding-right: 2.6rem; min-height: 1.9em; }
.sf-stat__value { font-size: 1.7rem; font-weight: 700; font-family: "Playfair Display", serif; line-height: 1; }
.sf-stat__meta { font-size: .78rem; color: var(--sf-muted); }
.sf-stat__icon {
  position: absolute; right: 1rem; top: 1rem;
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--sf-accent-soft); color: var(--sf-accent);
}
.sf-stat { position: relative; }

.sf-stat--danger  { border-left: 3px solid #dc3545; }
.sf-stat--warning { border-left: 3px solid #f0ad4e; }
.sf-stat--success { border-left: 3px solid #2e7d32; }
.sf-stat--brand   { border-left: 3px solid var(--sf-brand); }

.table { font-size: .86rem; margin: 0; }
.table > thead th {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .05em;
  color: var(--sf-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--sf-border);
  white-space: nowrap;
}
.table > tbody td { vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: #faf7f2; }
.sf-ref { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; color: var(--sf-brand); font-weight: 600; }

.badge { font-weight: 600; padding: .35em .6em; border-radius: 6px; }
.badge-soft-green  { background:#e5f3e8; color:#1f7a35; }
.badge-soft-amber  { background:#fbeed9; color:#9a6b12; }
.badge-soft-red    { background:#fbe4e6; color:#b3261e; }
.badge-soft-blue   { background:#e3ecfb; color:#1c4f9c; }
.badge-soft-grey   { background:#eceef2; color:#525a6b; }
.badge-soft-violet { background:#ece6fb; color:#5b3bb0; }

.btn-brand { background: var(--sf-brand); border-color: var(--sf-brand); color: #fff; }
.btn-brand:hover { background: #142038; border-color: #142038; color: #fff; }
.btn-accent { background: var(--sf-accent); border-color: var(--sf-accent); color: #1b2a4a; font-weight: 600; }
.btn-accent:hover { background: #9c7a46; border-color: #9c7a46; color: #fff; }
.btn-outline-brand { border-color: var(--sf-border); color: var(--sf-brand); background:#fff; }
.btn-outline-brand:hover { background: var(--sf-bg); }

.sf-filterbar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: end;
  padding: 1rem 1.15rem;
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow);
  margin-bottom: 1.1rem;
}
.sf-filterbar .form-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sf-muted); margin-bottom: .2rem; }
.sf-filterbar .form-select, .sf-filterbar .form-control { font-size: .85rem; min-width: 160px; }

.sf-proto-banner {
  background: repeating-linear-gradient(45deg, #fff7ea, #fff7ea 12px, #fdf1dc 12px, #fdf1dc 24px);
  border: 1px solid #efd9b4;
  color: #8a6414;
  border-radius: 10px;
  padding: .55rem .9rem;
  font-size: .8rem;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .5rem;
}

/* Timeline */
.sf-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.sf-timeline::before {
  content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--sf-border);
}
.sf-timeline li { position: relative; padding: 0 0 1.3rem 2.2rem; }
.sf-timeline li::before {
  content: ""; position: absolute; left: 4px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--sf-accent);
}
.sf-timeline li.is-muted::before { border-color: var(--sf-border); }
.sf-timeline__time { font-size: .74rem; color: var(--sf-muted); }
.sf-timeline__title { font-weight: 600; }

/* Checklist */
.sf-check {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .9rem;
  border: 1px solid var(--sf-border);
  border-radius: 10px;
  margin-bottom: .5rem;
  background: #fff;
}
.sf-check__ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.sf-check--ok    .sf-check__ico { background:#e5f3e8; color:#1f7a35; }
.sf-check--wait  .sf-check__ico { background:#fbeed9; color:#9a6b12; }
.sf-check--miss  .sf-check__ico { background:#fbe4e6; color:#b3261e; }
.sf-check__name { font-weight: 600; }
.sf-check__meta { font-size: .78rem; color: var(--sf-muted); }

/* Workflow steps */
.sf-steps { display: flex; flex-wrap: wrap; gap: .4rem; }
.sf-step {
  flex: 1; min-width: 120px;
  padding: .6rem .7rem;
  border-radius: 9px;
  border: 1px solid var(--sf-border);
  background: #fff;
  font-size: .8rem;
  text-align: center;
}
.sf-step.is-done { background: var(--sf-brand); color: #fff; border-color: var(--sf-brand); }
.sf-step.is-current { background: var(--sf-accent); color: #1b2a4a; border-color: var(--sf-accent); font-weight: 600; }
.sf-step small { display: block; opacity: .8; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }

/* Login */
.sf-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.sf-login__aside {
  background: linear-gradient(180deg, var(--sf-brand), #10192e);
  color: #fff;
  padding: 3.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
}
.sf-login__form { display: grid; place-items: center; padding: 2rem; }
.sf-login__card { width: 100%; max-width: 380px; }
@media (max-width: 860px) { .sf-login { grid-template-columns: 1fr; } .sf-login__aside { display: none; } }

.sf-kv { display: grid; grid-template-columns: 190px 1fr; gap: .5rem 1rem; font-size: .87rem; }
.sf-kv dt { color: var(--sf-muted); font-weight: 500; }
.sf-kv dd { margin: 0; font-weight: 500; }

.progress { background: var(--sf-border); border-radius: 20px; }
.progress-bar { background: var(--sf-accent); }

.nav-tabs { border-bottom: 1px solid var(--sf-border); gap: .2rem; }
.nav-tabs .nav-link { border: none; color: var(--sf-muted); font-weight: 600; font-size: .88rem; padding: .6rem .9rem; }
.nav-tabs .nav-link.active { color: var(--sf-brand); border-bottom: 2px solid var(--sf-accent); background: transparent; }

.form-label { font-weight: 600; font-size: .82rem; margin-bottom: .3rem; }
.form-section-title {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  margin: 1.6rem 0 .8rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--sf-border);
}
