/* =====================================================================
   Painel do promotor
   ===================================================================== */
body { background: var(--grey-100); }

/* ---------------- PIN ---------------- */
.gate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: var(--rc-700); overflow: hidden; }
.gate-bg { position: absolute; inset: -30px; }
.gate-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px) saturate(.6); opacity: .35; transform: scale(1.1); }
.gate-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 80% at 50% 50%, rgba(226,0,26,.55), rgba(45,0,5,.92)); }
.gate-card {
  position: relative; width: min(380px, 100%); padding: 36px 32px 24px; border-radius: 28px; text-align: center;
  background: rgba(255,255,255,.97); box-shadow: var(--shadow-3); backdrop-filter: blur(20px);
}
.gate-logo { width: 150px; }
.gate-card h1 { font-size: 1.75rem; margin: 18px 0 6px; }
.gate-card p { color: var(--grey-600); margin: 0 0 22px; }
.pin { display: flex; justify-content: center; gap: 16px; margin-bottom: 24px; }
.pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--grey-300); transition: all .2s var(--ease-out); }
.pin i.on { background: var(--rc-500); border-color: var(--rc-500); transform: scale(1.15); }
.pin.ok i { background: var(--green); border-color: var(--green); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button, .keypad a {
  height: 60px; border-radius: 16px; border: 0; background: var(--grey-100); font-size: 1.5rem; font-weight: 500;
  display: grid; place-items: center; color: var(--grey-900); text-decoration: none; transition: background .2s, transform .15s var(--ease-out);
}
.keypad button:hover, .keypad a:hover { background: var(--rc-50); color: var(--rc-600); }
.keypad button:active { transform: scale(.94); background: var(--rc-100); }
.gate-hint { display: block; margin-top: 18px; color: var(--grey-500); font-size: .75rem; }

/* ---------------- Layout ---------------- */
.dash { min-height: 100dvh; padding-bottom: 120px; }
.dash-head {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 40px); background: rgba(255,255,255,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--grey-200);
}
.dash-brand { display: flex; align-items: center; gap: 18px; }
.dash-brand img { height: 42px; }
.dash-brand div { display: grid; padding-left: 18px; border-left: 1px solid var(--grey-200); }
.dash-brand strong { font-size: 1.125rem; }
.dash-brand span { font-size: .8125rem; color: var(--grey-500); }
.dash-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-head-actions label { cursor: pointer; }

.dash-main { max-width: 1320px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px); display: grid; gap: 24px; }

/* ---------------- KPIs ---------------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  position: relative; overflow: hidden; display: grid; gap: 6px; padding: 22px 22px 20px; border-radius: 20px;
  background: #fff; box-shadow: var(--shadow-1);
}
.kpi span { font-size: .8125rem; color: var(--grey-500); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { font-size: 2.5rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-red { background: linear-gradient(135deg, var(--rc-500), var(--rc-600)); color: #fff; }
.kpi-red span { color: rgba(255,255,255,.8); }
.kpi-red .icon { position: absolute; right: -10px; bottom: -14px; width: 110px; height: 110px; opacity: .14; }
.kpi-red::after { content: ""; position: absolute; right: 18px; top: 18px; width: 70px; height: 42px; background: url(../assets/royal-canin-coroa-branca.svg) center / contain no-repeat; opacity: .35; }
.kpi-bar { display: block; height: 6px; border-radius: 6px; background: var(--grey-100); margin-top: 8px; overflow: hidden; }
.kpi-bar b { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--rc-500); }
[data-bar="impressos"] { background: var(--green) !important; }
[data-bar="pendentes"] { background: var(--gold) !important; }

/* ---------------- Board ---------------- */
.board { background: #fff; border-radius: 20px; box-shadow: var(--shadow-1); overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--grey-100); }
.tsearch { position: relative; flex: 1 1 280px; }
.tsearch .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--rc-500); }
.tsearch input {
  width: 100%; height: 46px; border-radius: var(--r-full); border: 1.5px solid var(--grey-200); padding: 0 16px 0 46px; outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.tsearch input:focus { border-color: var(--rc-500); box-shadow: 0 0 0 4px var(--rc-50); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  height: 34px; padding: 0 14px; border-radius: var(--r-full); border: 1.5px solid var(--grey-200); background: #fff;
  font-size: .8125rem; font-weight: 500; color: var(--grey-700); transition: all .2s var(--ease);
}
.filters button:hover { border-color: var(--rc-300); color: var(--rc-600); }
.filters button.on { background: var(--rc-500); border-color: var(--rc-500); color: #fff; }
.filters button em { font-style: normal; opacity: .6; margin-left: 4px; }
#fstatus, .fmt select {
  height: 40px; border-radius: var(--r-full); border: 1.5px solid var(--grey-200); padding: 0 34px 0 14px; background: #fff;
  font-size: .875rem; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--grey-600) 50%), linear-gradient(135deg, var(--grey-600) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tbl th { text-align: left; font-size: .75rem; font-weight: 500; color: var(--grey-500); text-transform: uppercase; letter-spacing: .06em; padding: 12px 14px; background: #fcfcfc; border-bottom: 1px solid var(--grey-100); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--grey-100); vertical-align: middle; }
.tbl tbody tr { transition: background .2s; cursor: pointer; }
.tbl tbody tr:hover { background: #fffafa; }
.tbl tbody tr.sel { background: var(--rc-50); }
.c-check { width: 44px; }
.c-act { width: 1%; white-space: nowrap; text-align: right; }
.tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--rc-500); cursor: pointer; }
.who { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.who .avatar { width: 40px; height: 40px; font-size: .875rem; flex: none; }
.who strong { display: block; font-weight: 700; }
.who small { color: var(--grey-500); font-size: .8125rem; }
.mono { font-variant-numeric: tabular-nums; color: var(--grey-600); letter-spacing: .03em; }
.st { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-full); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pend { background: var(--gold-light); color: #856516; }
.st-ger { background: var(--rc-50); color: var(--rc-600); }
.st-imp { background: var(--green-light); color: var(--green); }
.row-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--grey-600);
  display: inline-grid; place-items: center; transition: all .2s;
}
.row-btn:hover { background: var(--rc-500); color: #fff; }
.tbl-empty { padding: 48px; text-align: center; color: var(--grey-500); }

/* ---------------- Barra de seleção ---------------- */
.selbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 160%);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  padding: 10px 10px 10px 24px; border-radius: var(--r-full); background: var(--grey-900); color: #fff; box-shadow: var(--shadow-3);
  max-width: calc(100% - 32px);
}
.selbar .btn-ghost { color: #fff; }
.selbar .btn-ghost:hover { background: rgba(255,255,255,.1); }
.fmt { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--grey-300); }
.fmt select { height: 36px; background-color: var(--grey-800); color: #fff; border-color: var(--grey-700);
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); }

/* ---------------- Gaveta ---------------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(28,28,28,.4); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(440px, 100%); overflow-y: auto;
  padding: 32px 32px 28px; background: #fff; box-shadow: var(--shadow-3); transform: translateX(105%);
  display: flex; flex-direction: column; align-items: flex-start;
}
.drawer-close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--grey-100); display: grid; place-items: center; }
.drawer-close:hover { background: var(--rc-50); color: var(--rc-500); }
.drawer h2 { font-size: 1.75rem; line-height: 1.1; margin: 14px 40px 24px 0; }
.drawer p { color: var(--grey-600); margin: 0 0 22px; }
.d-badge { align-self: center; width: min(300px, 100%); aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-2); background: var(--grey-100); }
.d-badge img { width: 100%; height: 100%; display: block; }
.d-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin: 24px 0; padding: 16px 0; border-top: 1px dashed var(--grey-200); border-bottom: 1px dashed var(--grey-200); }
.d-meta dt { font-size: .75rem; color: var(--grey-500); text-transform: uppercase; letter-spacing: .06em; }
.d-meta dd { margin: 4px 0 0; font-weight: 500; }
.d-actions { display: flex; gap: 10px; width: 100%; margin-top: auto; }
.d-actions .btn { flex: 1; }

@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .c-hide { display: none; }
}
@media (max-width: 560px) {
  .dash-brand div { display: none; }
  .kpi strong { font-size: 2rem; }
  .filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .filters button { flex: none; }
}
