:root {
  --brand: #d71920;
  --brand-dark: #b0141a;
  --sidebar-bg: #1d1f24;
  --sidebar-fg: #c9ccd3;
  --sidebar-w: 248px;
  --bs-primary: #d71920;
  --bs-primary-rgb: 215, 25, 32;
  --bs-link-color: #b0141a;
  --bs-link-color-rgb: 176, 20, 26;
  --bs-link-hover-color: #8c1015;
}

body { background: #f3f4f6; font-size: .94rem; }
.boot-loader { min-height: 100vh; display: grid; place-items: center; }

/* Botões primários na cor da marca */
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #ec8a8e; box-shadow: 0 0 0 .2rem rgba(215, 25, 32, .18); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.text-bg-primary { background-color: var(--brand) !important; }

/* ---------------------------------------------------------------- login */
.auth-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(215, 25, 32, .35), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(135deg, #2a2d33 0%, #15161a 100%);
}
.auth-card {
  width: 100%; max-width: 400px; padding: 32px 28px; border-radius: 10px; color: #f1f1f1;
  background: rgba(30, 32, 37, .82); backdrop-filter: blur(6px); box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .08);
}
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-title { font-size: 1.45rem; letter-spacing: .5px; }
.auth-sub, .auth-muted { color: #a9adb6; font-size: .82rem; }
.auth-card .form-label { color: #d5d7dc; font-size: .85rem; }
.auth-card .form-control { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); color: #fff; }
.auth-card .form-control::placeholder { color: #8d929c; }
.auth-card .form-control:focus { background: rgba(255, 255, 255, .1); color: #fff; }
.auth-card .input-group-text { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #c3c6cd; }
.auth-card .toggle-pass { border-color: rgba(255, 255, 255, .18); color: #c3c6cd; }
.auth-card .form-check-label { color: #c9ccd3; font-size: .88rem; }
.auth-card .form-check-input { background-color: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.auth-card .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.auth-link { color: #f0a3a6; font-size: .85rem; text-decoration: none; }
.auth-link:hover { color: #fff; text-decoration: underline; }
.auth-card .btn-danger { background: var(--brand); border-color: var(--brand); letter-spacing: .5px; }
.auth-card .btn-danger:hover { background: var(--brand-dark); }
.auth-card .invalid-feedback { color: #ff9a9e; }
.auth-card .text-muted { color: #9aa0aa !important; }

/* ---------------------------------------------------------------- layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-fg); position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 1040; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: #fff; text-decoration: none; font-size: 1.15rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand:hover { color: #fff; }
.sidebar .nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.sidebar .nav-link { color: var(--sidebar-fg); border-radius: 6px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.nav-section { text-transform: uppercase; font-size: .7rem; letter-spacing: 1px; color: #7d828c; padding: 16px 12px 6px; }
.sidebar-footer { padding: 14px 20px; color: #6f747e; border-top: 1px solid rgba(255, 255, 255, .06); }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; padding: 0 20px; position: sticky; top: 0; z-index: 1020; }
.topbar .btn-light { background: transparent; border: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1035; }
  .content { padding: 16px; }
}

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header h1 { font-size: 1.45rem; margin: 0; font-weight: 600; }
.card { border: 0; }
.card-header { border-bottom: 1px solid #eef0f3; }
.table > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; font-weight: 600; background: #fafafa; }
tr.clickable { cursor: pointer; }

/* ---------------------------------------------------------------- painel */
.stat-tile { color: inherit; transition: transform .15s ease; }
.stat-tile:hover { transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: #6b7280; margin-top: 4px; }

/* ---------------------------------------------------------------- clientes */
.avatar-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: #e5e7eb; color: #9ca3af; }
.photo-box { position: relative; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #f3f4f6; border: 2px dashed #d1d5db; display: grid; place-items: center; }
.photo-box.face { width: 220px; aspect-ratio: 3 / 4; }
.photo-box.doc { width: 100%; max-width: 320px; aspect-ratio: 16 / 10; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box.doc img { object-fit: contain; background: #fff; }
.photo-empty { display: flex; flex-direction: column; align-items: center; color: #9ca3af; gap: 6px; }
.photo-empty i { font-size: 3rem; }
.photo-new { position: absolute; left: 8px; bottom: 8px; }
.consent-box { background: #fff8e6; border: 1px solid #fde3a7; border-radius: 8px; padding: 10px 10px 10px 34px; }
.address-block { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fcfcfd; }
.store-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }

/* ---------------------------------------------------------------- webcam */
.webcam-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.webcam-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-guide { position: absolute; left: 50%; top: 50%; width: 34%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 3px dashed rgba(255, 255, 255, .85); border-radius: 50% / 45%; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); pointer-events: none; }
.webcam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; }

/* ---------------------------------------------------------------- notas de acesso da loja */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.note-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 12px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.note-tile:hover, .note-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .08); border-color: #d1d5db; outline: none; }
.note-tile.empty { border-style: dashed; background: #fcfcfd; }
.note-tile.empty .note-icon { filter: grayscale(.6); opacity: .7; }
.note-tile.add { border-style: dashed; }
.note-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; }
.note-title { font-weight: 700; font-size: .9rem; letter-spacing: .3px; text-align: center; word-break: break-word; }
.note-sub { font-size: .75rem; color: #6b7280; }

.qr-img { width: 100%; max-width: 300px; image-rendering: pixelated; border: 1px solid #e5e7eb; border-radius: 8px; }

.toast-container { z-index: 1090; }
pre { white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
