/* ===========================================================================
   Reclaim — admin theme
   A thin monochrome "zinc" layer on top of Bootstrap 5.
   No inline styles anywhere in the app; everything lives here.
   =========================================================================== */

:root {
  --lf-bg:        #fbfbfb;
  --lf-surface:   #ffffff;
  --lf-ink:       #09090b;   /* near-black primary */
  --lf-ink-soft:  #27272a;
  --lf-muted:     #71717a;
  --lf-faint:     #a1a1aa;
  --lf-line:      #e4e4e7;
  --lf-line-soft: #f1f1f3;
  --lf-zinc-50:   #fafafa;
  --lf-zinc-100:  #f4f4f5;
  --lf-zinc-200:  #e4e4e7;
  --lf-rose:      #e11d48;
  --lf-amber:     #b45309;
  --lf-green:     #15803d;
  --lf-sidebar-w: 240px;

  /* Re-point Bootstrap's primary onto zinc so stock components match. */
  --bs-primary:        #09090b;
  --bs-primary-rgb:    9, 9, 11;
  --bs-body-color:     #27272a;
  --bs-body-bg:        #fbfbfb;
  --bs-border-color:   #e4e4e7;
  --bs-link-color:     #09090b;
  --bs-link-hover-color: #000000;
  --bs-focus-ring-color: rgba(9, 9, 11, .18);
}

* { -webkit-font-smoothing: antialiased; }

body {
  background: var(--lf-bg);
  color: var(--lf-ink-soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { text-decoration: none; }

/* ---- App shell ---------------------------------------------------------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.app-sidebar {
  width: var(--lf-sidebar-w);
  flex-shrink: 0;
  background: var(--lf-surface);
  border-right: 1px solid var(--lf-line);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100vh; }

.app-content { flex: 1 1 auto; overflow-y: auto; padding: 1.5rem; }
.content-wrap { max-width: 1500px; margin: 0 auto; }

/* ---- Sidebar brand ------------------------------------------------------ */
.sidebar-brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--lf-line);
  flex-shrink: 0;
}
.sidebar-brand .brand-mark {
  height: 28px; width: 28px;
  border-radius: 4px;
  background: var(--lf-ink);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.sidebar-brand .brand-text {
  font-weight: 700; font-size: 13px; letter-spacing: .01em;
  text-transform: uppercase; color: var(--lf-ink);
}
.sidebar-brand .brand-text span { color: var(--lf-faint); font-weight: 600; }

/* ---- Sidebar nav -------------------------------------------------------- */
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem .65rem; }
.sidebar-nav::-webkit-scrollbar { width: 0; }
.nav-group { margin-bottom: 1.4rem; }
.nav-group-label {
  padding: 0 .65rem; margin-bottom: .5rem;
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--lf-faint);
}
.nav-link-lf {
  display: flex; align-items: center; gap: .65rem;
  padding: 7px .65rem; border-radius: 4px;
  font-size: 13px; font-weight: 500; color: var(--lf-muted);
  transition: background-color .12s, color .12s;
}
.nav-link-lf .bi { font-size: 15px; width: 18px; text-align: center; }
.nav-link-lf:hover { background: var(--lf-zinc-50); color: var(--lf-ink); }
.nav-link-lf.active { background: var(--lf-zinc-100); color: var(--lf-ink); font-weight: 600; }
.nav-link-lf .nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 4px; background: var(--lf-ink); color: #fff;
  font-size: 10px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center;
}

/* ---- Sidebar user block ------------------------------------------------- */
.sidebar-user { border-top: 1px solid var(--lf-line); padding: .65rem; flex-shrink: 0; }
.sidebar-user .user-avatar {
  height: 32px; width: 32px; border-radius: 4px; background: var(--lf-ink);
  color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user .user-name { font-size: 13px; font-weight: 700; color: var(--lf-ink); line-height: 1.2; }
.sidebar-user .user-role { font-size: 11px; color: var(--lf-muted); text-transform: capitalize; }

/* ---- Topbar ------------------------------------------------------------- */
.app-topbar {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 0 1.5rem;
  background: var(--lf-surface);
  border-bottom: 1px solid var(--lf-line);
}
.breadcrumbs { display: flex; align-items: center; gap: .5rem; min-width: 0;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.breadcrumbs a { color: var(--lf-faint); }
.breadcrumbs a:hover { color: var(--lf-ink); }
.breadcrumbs .sep { color: var(--lf-line); }
.breadcrumbs .current { color: var(--lf-ink); }
.topbar-link {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--lf-muted); display: inline-flex; align-items: center; gap: .35rem;
}
.topbar-link:hover { color: var(--lf-ink); }

/* Sidebar drawer toggle (mobile) */
.sidebar-toggle { background: none; border: 0; color: var(--lf-muted); font-size: 20px; padding: 0; }

/* ---- Cards -------------------------------------------------------------- */
.lf-card { background: var(--lf-surface); border: 1px solid var(--lf-line);
  border-radius: 4px; box-shadow: 0 1px 2px rgba(9,9,11,.04); }
.lf-card-pad { padding: 1.25rem; }
.lf-card-head {
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--lf-line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.lf-card-head h2, .lf-card-head h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--lf-ink); margin: 0;
}

/* ---- Stat cards (label · icon chip · big number · mini progress bar) ----- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 992px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--lf-surface); border: 1px solid var(--lf-line);
  border-radius: 4px; padding: 1.15rem 1.3rem 1.2rem; box-shadow: 0 1px 2px rgba(9,9,11,.03); }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.stat-card .stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--lf-muted); line-height: 1.3; }
.stat-card .stat-icon { height: 34px; width: 34px; border-radius: 4px;
  background: var(--lf-zinc-100); color: var(--lf-ink-soft); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.stat-card .stat-value { font-size: 34px; font-weight: 700; color: var(--lf-ink);
  line-height: 1; margin-top: .55rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-track { height: 5px; background: var(--lf-zinc-100); border-radius: 4px; margin-top: 1rem; overflow: hidden; }
.mini-fill { height: 100%; background: var(--lf-ink); border-radius: 4px; }
.mini-fill.is-stub { width: 18px; }
.w-fill-0 { width: 0; } .w-fill-10 { width: 10%; } .w-fill-20 { width: 20%; }
.w-fill-30 { width: 30%; } .w-fill-40 { width: 40%; } .w-fill-50 { width: 50%; }
.w-fill-60 { width: 60%; } .w-fill-70 { width: 70%; } .w-fill-80 { width: 80%; }
.w-fill-90 { width: 90%; } .w-fill-100 { width: 100%; }

/* ---- Page header -------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em;
  color: var(--lf-ink); margin: 0; }
.page-head .page-sub { font-size: 13px; color: var(--lf-muted); margin-top: .2rem; }

/* ---- Buttons ------------------------------------------------------------ */
.btn-lf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  line-height: 1; border-radius: 4px; padding: .65rem 1rem; border: 1px solid transparent;
  cursor: pointer; transition: background-color .12s, color .12s, border-color .12s; }
.btn-lf .bi { font-size: 13px; }
.btn-lf-primary { background: var(--lf-ink); color: #fff; }
.btn-lf-primary:hover { background: #000; color: #fff; }
.btn-lf-outline { background: var(--lf-surface); color: var(--lf-muted); border-color: var(--lf-line);
  box-shadow: 0 1px 2px rgba(9,9,11,.04); }
.btn-lf-outline:hover { background: var(--lf-zinc-50); color: var(--lf-ink); }
.btn-lf-ghost { background: transparent; color: var(--lf-muted); }
.btn-lf-ghost:hover { background: var(--lf-zinc-100); color: var(--lf-ink); }
.btn-lf-danger { background: transparent; color: var(--lf-rose); border-color: #fecdd3; }
.btn-lf-danger:hover { background: #fff1f2; }
.btn-lf-sm { padding: .45rem .7rem; font-size: 10.5px; }

/* ---- Forms -------------------------------------------------------------- */
.form-label-lf { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--lf-muted); margin-bottom: .4rem; }
.form-control-lf, .form-select-lf {
  width: 100%; padding: .55rem .75rem; background: var(--lf-zinc-50);
  border: 1px solid var(--lf-line); border-radius: 4px; font-size: 13px;
  color: var(--lf-ink); transition: border-color .12s, box-shadow .12s; }
.form-control-lf::placeholder { color: var(--lf-faint); }
.form-control-lf:focus, .form-select-lf:focus {
  outline: none; border-color: var(--lf-faint);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color); background: #fff; }
.form-control-lf.is-error, .form-select-lf.is-error { border-color: #fda4af; }
textarea.form-control-lf { resize: vertical; min-height: 90px; }
.field-error { color: var(--lf-rose); font-size: 11.5px; margin-top: .3rem; }
.form-hint { color: var(--lf-faint); font-size: 11.5px; margin-top: .3rem; }

/* Custom select — hide the native arrow, draw our own chevron. */
.form-select-lf {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 14px; }
.form-select-lf::-ms-expand { display: none; }

/* Custom file / image picker — the native input is hidden inside the label. */
.file-drop { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem;
  border: 1px dashed var(--lf-line); border-radius: 4px; background: var(--lf-zinc-50);
  cursor: pointer; transition: border-color .12s, background-color .12s; margin: 0; }
.file-drop:hover { border-color: var(--lf-faint); background: #fff; }
.file-drop input[type=file] { position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.file-drop .file-icon { height: 36px; width: 36px; border-radius: 4px; background: #fff;
  border: 1px solid var(--lf-line); display: inline-flex; align-items: center; justify-content: center;
  color: var(--lf-muted); font-size: 17px; flex-shrink: 0; }
.file-drop .file-body { min-width: 0; line-height: 1.3; }
.file-drop .file-text { font-size: 13px; color: var(--lf-ink-soft); font-weight: 600;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-drop .file-sub { font-size: 11.5px; color: var(--lf-faint); }
.file-drop.is-error { border-color: #fda4af; }

/* Searchable select (progressive enhancement over a native <select>). */
.ss { position: relative; display: block; width: 100%; }
.ss-native { position: absolute !important; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.ss-control { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; padding: .55rem .75rem; background: var(--lf-zinc-50); border: 1px solid var(--lf-line);
  border-radius: 4px; font-size: 13px; color: var(--lf-ink); cursor: pointer;
  transition: border-color .12s, box-shadow .12s; }
.ss-control:focus, .ss.open > .ss-control { outline: none; border-color: var(--lf-faint);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color); background: #fff; }
.ss-control .ss-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-control .ss-value.is-placeholder { color: var(--lf-faint); }
.ss-control .ss-caret { color: var(--lf-faint); flex-shrink: 0; font-size: 12px; display: inline-flex; }
.ss.is-error > .ss-control { border-color: #fda4af; }
.ss-panel { position: absolute; z-index: 1090; background: #fff; border: 1px solid var(--lf-line);
  border-radius: 4px; box-shadow: 0 8px 26px rgba(9,9,11,.14); overflow: hidden; min-width: 170px; }
.ss-search-wrap { padding: 6px; border-bottom: 1px solid var(--lf-line-soft); }
.ss-search { width: 100%; padding: .4rem .55rem; border: 1px solid var(--lf-line); border-radius: 4px;
  font-size: 13px; background: var(--lf-zinc-50); outline: none; }
.ss-search:focus { border-color: var(--lf-faint); background: #fff; }
.ss-options { max-height: 240px; overflow-y: auto; padding: 4px; }
.ss-option { padding: .45rem .6rem; border-radius: 4px; font-size: 13px; color: var(--lf-ink-soft);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-option:hover, .ss-option.active { background: var(--lf-zinc-100); color: var(--lf-ink); }
.ss-option.selected { font-weight: 600; color: var(--lf-ink); }
.ss-empty { padding: .65rem; text-align: center; color: var(--lf-faint); font-size: 12.5px; }

/* ---- Tables ------------------------------------------------------------- */
.table-lf { width: 100%; border-collapse: collapse; }
.table-lf thead th {
  padding: 1.05rem 1.1rem; text-align: left; font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--lf-muted);
  background: var(--lf-zinc-50); border-bottom: 1px solid var(--lf-line); white-space: nowrap; }
.table-lf tbody td { padding: .85rem 1.1rem; font-size: 13.5px; color: var(--lf-ink-soft);
  border-bottom: 1px solid var(--lf-line-soft); vertical-align: middle; }
.table-lf tbody tr { transition: background-color .1s ease; }
.table-lf tbody tr:last-child td { border-bottom: 0; }
.table-lf tbody tr:hover { background: var(--lf-zinc-50); }
.table-lf td.tabnum, .table-lf th.tabnum { font-variant-numeric: tabular-nums; }
/* Two-line cell: a primary value with a muted sub-line beneath it. */
.cell-main { font-weight: 600; color: var(--lf-ink); }
.cell-sub { font-size: 11.5px; color: var(--lf-faint); margin-top: 1px; }
.cell-sub.tabnum { font-variant-numeric: tabular-nums; }
/* Tables sit flush inside a card; round the card so header/footer corners follow. */
.lf-card > .table-responsive:first-child .table-lf thead th:first-child { border-top-left-radius: 4px; }
.lf-card > .table-responsive:first-child .table-lf thead th:last-child { border-top-right-radius: 4px; }

/* ---- Badges ------------------------------------------------------------- */
.badge-lf { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem;
  border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; border: 1px solid transparent; line-height: 1.4; }
.badge-zinc  { background: var(--lf-zinc-100); color: var(--lf-ink-soft); border-color: var(--lf-line); }
.badge-amber { background: #fffbeb; color: var(--lf-amber); border-color: #fde68a; }
.badge-green { background: #f0fdf4; color: var(--lf-green); border-color: #bbf7d0; }
.badge-rose  { background: #fff1f2; color: var(--lf-rose); border-color: #fecdd3; }

/* ---- Flash messages ----------------------------------------------------- */
.flash-stack { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.flash { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem;
  border-radius: 4px; font-size: 13px; border: 1px solid transparent; }
.flash .bi { font-size: 16px; }
.flash-success { background: #f0fdf4; color: var(--lf-green); border-color: #bbf7d0; }
.flash-danger  { background: #fff1f2; color: var(--lf-rose); border-color: #fecdd3; }
.flash-warning { background: #fffbeb; color: var(--lf-amber); border-color: #fde68a; }
.flash-info    { background: var(--lf-zinc-50); color: var(--lf-ink-soft); border-color: var(--lf-line); }
.flash .flash-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; }
.flash .flash-close:hover { opacity: 1; }

/* ---- Empty state -------------------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--lf-muted); }
.empty-state .bi { font-size: 34px; color: var(--lf-faint); display: block; margin-bottom: .6rem; }

/* ---- Confirm modal ------------------------------------------------------ */
.lf-modal-backdrop { position: fixed; inset: 0; z-index: 1080; display: none;
  align-items: center; justify-content: center; padding: 1rem;
  background: rgba(9,9,11,.35); backdrop-filter: blur(2px); }
.lf-modal-backdrop.show { display: flex; }
.lf-modal { background: #fff; border: 1px solid var(--lf-line); border-radius: 4px;
  box-shadow: 0 20px 50px rgba(9,9,11,.25); width: 100%; max-width: 420px; overflow: hidden; }
.lf-modal-body { padding: 1.25rem; display: flex; gap: .8rem; align-items: flex-start; }
.lf-modal-body .icon { height: 38px; width: 38px; border-radius: 4px; background: #fff1f2;
  color: var(--lf-rose); display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0; }
.lf-modal-body h3 { font-size: 14px; font-weight: 700; color: var(--lf-ink); margin: 0; }
.lf-modal-body p { font-size: 13px; color: var(--lf-muted); margin: .25rem 0 0; }
.lf-modal-foot { display: flex; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1.25rem; border-top: 1px solid var(--lf-line-soft); background: var(--lf-zinc-50); }

/* ---- Bootstrap modal — zinc skin (used for create/edit forms) ----------- */
.modal-content {
  border: 1px solid var(--lf-line); border-radius: 4px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(9,9,11,.22);
}
.modal-header { border-bottom: 1px solid var(--lf-line-soft); padding: 1rem 1.25rem; }
.modal-title { font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--lf-ink); }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--lf-line-soft); padding: .85rem 1.25rem;
  background: var(--lf-zinc-50); gap: .5rem; }

/* ---- Form switch (status toggles) --------------------------------------- */
.form-switch-lf { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.form-switch-lf input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-switch-lf .track { width: 38px; height: 21px; background: #d4d4d8; border-radius: 999px;
  position: relative; transition: background-color .15s; flex-shrink: 0; }
.form-switch-lf .track::after { content: ''; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.form-switch-lf input:checked + .track { background: var(--lf-ink); }
.form-switch-lf input:checked + .track::after { transform: translateX(17px); }
.form-switch-lf .switch-text { font-size: 13px; color: var(--lf-ink-soft); }

/* ---- List page header (title + search + action) ------------------------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.list-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--lf-ink); margin: 0; }
.list-head-controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.list-search { position: relative; }
.list-search .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: var(--lf-faint); font-size: 14px; pointer-events: none; }
.list-search input { width: 240px; max-width: 100%; padding-left: 2rem; }

/* ---- Table footer + pagination ------------------------------------------ */
.table-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .75rem 1rem; border-top: 1px solid var(--lf-line-soft); flex-wrap: wrap; }
.foot-summary { font-size: 11.5px; font-weight: 500; color: var(--lf-faint); margin: 0; }
.pager { display: inline-flex; align-items: center; gap: .15rem; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 .5rem; border-radius: 4px;
  font-size: 13px; font-weight: 500; color: var(--lf-muted); transition: background-color .12s, color .12s; }
.pager-btn:hover { background: var(--lf-zinc-100); color: var(--lf-ink); }
.pager-btn.active { background: var(--lf-ink); color: #fff; font-weight: 600; }
.pager-gap { padding: 0 .35rem; color: var(--lf-faint); }

/* ---- Row action buttons ------------------------------------------------- */
.row-actions { display: inline-flex; gap: .1rem; white-space: nowrap; justify-content: flex-end; }
.icon-btn-lf { display: inline-flex; align-items: center; justify-content: center;
  height: 30px; width: 30px; border: 0; background: transparent; border-radius: 4px;
  color: var(--lf-faint); cursor: pointer; transition: background-color .12s, color .12s; }
.icon-btn-lf:hover { background: var(--lf-zinc-100); color: var(--lf-ink); }
.icon-btn-lf.danger:hover { background: #fff1f2; color: var(--lf-rose); }
.col-actions { text-align: right; }

/* ---- Auth pages --------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; background: var(--lf-bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-mark { height: 44px; width: 44px; border-radius: 4px; background: var(--lf-ink);
  color: #fff; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
.auth-brand .auth-logo { max-height: 56px; max-width: 220px; object-fit: contain; }
.auth-brand h1 { font-size: 18px; font-weight: 700; color: var(--lf-ink); margin: .75rem 0 .15rem; }
.public-logo { max-height: 34px; max-width: 160px; object-fit: contain; }
.auth-brand p { font-size: 13px; color: var(--lf-muted); margin: 0; }

/* ---- Filter bar --------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1.25rem; }
.filter-bar .filter-field { display: flex; flex-direction: column; gap: .3rem; }
.filter-bar .filter-field .form-label-lf { margin-bottom: 0; }
.filter-bar .form-control-lf, .filter-bar .form-select-lf, .filter-bar .ss { min-width: 170px; }
.filter-bar .filter-grow { flex: 1 1 200px; }
.filter-bar .filter-field .ss-control { padding-top: .5rem; padding-bottom: .5rem; }
.filter-bar .filter-actions { display: flex; gap: .5rem; align-items: flex-end; }

/* ---- Form layout (full-page forms) -------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.form-section-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--lf-faint); margin: 0 0 .25rem; }

/* ---- Photo upload preview ----------------------------------------------- */
.photo-preview { width: 100%; max-width: 220px; aspect-ratio: 1; border: 1px solid var(--lf-line);
  border-radius: 4px; object-fit: cover; background: var(--lf-zinc-50); }
.photo-drop { border: 1px dashed var(--lf-line); border-radius: 4px; padding: 1rem; background: var(--lf-zinc-50); }

/* ---- Detail view -------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-photo { width: 100%; border-radius: 4px; border: 1px solid var(--lf-line); object-fit: cover; }
.detail-photo-empty { width: 100%; aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--lf-line);
  background: var(--lf-zinc-50); display: flex; align-items: center; justify-content: center;
  color: var(--lf-faint); font-size: 34px; }
.field-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; }
@media (max-width: 600px) { .field-list { grid-template-columns: 1fr; } }
.field-list .span-2 { grid-column: 1 / -1; }
.field-item .field-key { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--lf-faint); margin-bottom: .2rem; }
.field-item .field-val { font-size: 14px; color: var(--lf-ink-soft); }
.detail-ref { font-size: 12px; font-weight: 600; color: var(--lf-muted); font-variant-numeric: tabular-nums; }

/* ---- Utilities ---------------------------------------------------------- */
.text-muted-lf { color: var(--lf-muted) !important; }
.text-faint-lf { color: var(--lf-faint) !important; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.form-narrow { max-width: 860px; }
.divider-lf { height: 1px; background: var(--lf-line); margin: 1.25rem 0; }
.thumb-sm { height: 40px; width: 40px; border-radius: 4px; object-fit: cover; border: 1px solid var(--lf-line); }
.chart-box { position: relative; height: 280px; }
.tab-nav-lf { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--lf-line); margin-bottom: 1.25rem; }
.tab-nav-lf a { padding: .6rem 0; font-size: 13px; font-weight: 600; color: var(--lf-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-nav-lf a:hover { color: var(--lf-ink); }
.tab-nav-lf a.active { color: var(--lf-ink); border-bottom-color: var(--lf-ink); }

/* ---- Signature pad ------------------------------------------------------ */
.signature-wrap { border: 1px solid var(--lf-line); border-radius: 4px; background: #fff; overflow: hidden; }
.signature-pad { width: 100%; height: 180px; display: block; touch-action: none; cursor: crosshair; background: #fff; }
.signature-bar { display: flex; align-items: center; justify-content: space-between;
  padding: .4rem .6rem; border-top: 1px solid var(--lf-line-soft); background: var(--lf-zinc-50); }
.signature-bar span { font-size: 11.5px; color: var(--lf-faint); }

/* ---- Public pages ------------------------------------------------------- */
.public-body { background: var(--lf-bg); min-height: 100vh; display: flex; flex-direction: column; }
.public-header { background: var(--lf-surface); border-bottom: 1px solid var(--lf-line); }
.public-header .public-bar { max-width: 920px; margin: 0 auto; padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--lf-ink); }
.public-brand .brand-mark { height: 30px; width: 30px; border-radius: 4px; background: var(--lf-ink);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.public-nav { display: flex; gap: .4rem; }
.public-main { flex: 1 1 auto; padding: 2rem 1.25rem; }
.public-wrap { max-width: 720px; margin: 0 auto; }
.public-hero h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--lf-ink); margin: 0 0 .4rem; }
.public-hero p { color: var(--lf-muted); margin: 0 0 1.5rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.result-box { text-align: center; padding: 2.5rem 1.5rem; }
.result-box .result-icon { height: 56px; width: 56px; border-radius: 4px; background: #f0fdf4;
  color: var(--lf-green); display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 1rem; }
.result-ref { display: inline-block; margin-top: .5rem; padding: .5rem 1rem; border-radius: 4px;
  background: var(--lf-zinc-100); font-weight: 700; font-size: 18px; letter-spacing: .04em; color: var(--lf-ink); }

/* ---- DataTables alignment with the zinc theme --------------------------- */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--lf-line); border-radius: 4px; padding: .35rem .6rem;
  background: var(--lf-zinc-50); font-size: 13px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--lf-ink) !important; border-color: var(--lf-ink) !important;
  color: #fff !important; border-radius: 4px; }
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { font-size: 12.5px; color: var(--lf-muted); }

/* ---- Mobile sidebar drawer --------------------------------------------- */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(9,9,11,.3);
  z-index: 1040; display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1050;
    transform: translateX(-100%); transition: transform .25s ease; }
  .app-shell.drawer-open .app-sidebar { transform: translateX(0); }
  .app-shell.drawer-open .sidebar-overlay { display: block; }
}
@media (min-width: 992px) {
  .sidebar-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

/* Read-only demo banner */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem 1rem;
  font-size: .85rem;
  text-align: center;
  color: var(--lf-ink);
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}
.demo-banner i { color: var(--lf-amber); }
