/* Accesso proprietario dal logo: tastierino, selezione tavolo e resoconto serata. */
body.owner-gate-open { overflow: hidden !important; }
body.owner-gate-open .fullscreen-toggle { display: none !important; }
.faro-owner-gate-fiscal-hidden { display: none !important; }
.faro-owner-gate-close-button {
  background: linear-gradient(135deg, #2563eb, #17346f) !important;
  border: 2px solid #d4a855 !important;
  color: #fff4d6 !important;
}
.faro-owner-gate-close-button .hub-btn-label { color: #fff4d6 !important; }
.owner-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.4vw, 24px);
  background: rgba(4, 3, 5, .9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-sans, "Manrope", sans-serif);
  color: var(--testo-primario, #f8f3e8);
}

.owner-gate-shell {
  --og-gold: #d5b36f;
  --og-red: #1d4ed8;
  width: min(100%, 430px);
  max-height: min(94vh, 920px);
  max-height: min(94dvh, 920px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #181217 0%, #0b090c 54%, #100b0d 100%);
  border: 1px solid rgba(213, 179, 111, .42);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .72), 0 0 0 1px rgba(37, 99, 235, .14) inset;
}

.owner-gate-shell--tables { width: min(100%, 920px); }
.owner-gate-shell--report { width: min(100%, 1180px); }

.owner-gate-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(213, 179, 111, .18);
  background: linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(213, 179, 111, .06));
}

.owner-gate-head__copy { flex: 1; min-width: 0; }
.owner-gate-kicker {
  margin-bottom: 4px;
  color: var(--og-gold);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.owner-gate-title {
  margin: 0;
  color: #fffaf0 !important;
  font: 800 clamp(1.02rem, 2.2vw, 1.36rem)/1.15 var(--font-sans, sans-serif) !important;
}
.owner-gate-subtitle {
  margin: 6px 0 0;
  color: #aaa0a4;
  font-size: .76rem;
  line-height: 1.35;
}
.owner-gate-close,
.owner-gate-back,
.owner-gate-refresh {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(213, 179, 111, .25);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: #f3e4c2;
  font: 700 .78rem/1 var(--font-sans, sans-serif);
  cursor: pointer;
  touch-action: manipulation;
}
.owner-gate-back,
.owner-gate-refresh { padding: 0 13px; }
.owner-gate-close { width: 44px; padding: 0; font-size: 1rem; }
.owner-gate-close:active,
.owner-gate-back:active,
.owner-gate-refresh:active { transform: scale(.96); }

.owner-gate-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 2vw, 22px);
}

.owner-gate-pin-display {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(213, 179, 111, .26);
  border-radius: 14px;
  background: rgba(0, 0, 0, .3);
}
.owner-gate-pin-dot {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(213, 179, 111, .48);
  border-radius: 50%;
  background: transparent;
  transition: background .12s ease, transform .12s ease, border-color .12s ease;
}
.owner-gate-pin-dot.is-filled {
  border-color: #f1d698;
  background: #f1d698;
  box-shadow: 0 0 12px rgba(213, 179, 111, .42);
  transform: scale(1.08);
}
.owner-gate-pin-status {
  min-height: 20px;
  margin: -3px 0 10px;
  text-align: center;
  color: #a99fa3;
  font-size: .76rem;
}
.owner-gate-pin-status.is-error { color: #ff9aa8; }
.owner-gate-pin-status.is-ok { color: #8dd5a0; }

.owner-gate-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.owner-gate-key {
  min-height: clamp(58px, 9dvh, 76px);
  border: 1px solid rgba(213, 179, 111, .24);
  border-radius: 14px;
  background: linear-gradient(160deg, #292027, #171217);
  color: #fff9ed;
  font: 800 clamp(1.25rem, 4vw, 1.65rem)/1 var(--font-sans, sans-serif);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.owner-gate-key:hover { border-color: rgba(213, 179, 111, .58); }
.owner-gate-key:active { transform: scale(.965); background: #3a2931; }
.owner-gate-key--utility { color: #d9c8a4; font-size: 1rem; }
.owner-gate-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  border: 1px solid #d5b36f;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #17346f);
  color: #fff;
  font: 800 .9rem/1 var(--font-sans, sans-serif);
  letter-spacing: .05em;
  cursor: pointer;
  touch-action: manipulation;
}
.owner-gate-submit:disabled,
.owner-gate-key:disabled { opacity: .45; cursor: wait; }

.owner-gate-loading,
.owner-gate-empty,
.owner-gate-error {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(213, 179, 111, .24);
  border-radius: 14px;
  color: #b9adb0;
  text-align: center;
}
.owner-gate-error { color: #ff9aa8; }
.owner-gate-error--compact {
  min-height: 0;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.owner-gate-table-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.owner-gate-table-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(213, 179, 111, .23);
  border-radius: 15px;
  background: linear-gradient(150deg, rgba(37, 99, 235, .1), rgba(255, 255, 255, .025));
}
.owner-gate-table-card__name { color: #fff7e7; font-size: 1rem; font-weight: 800; }
.owner-gate-table-card__meta { color: #a99fa3; font-size: .72rem; line-height: 1.35; }
.owner-gate-table-card__total { color: #f1d698; font-size: 1.28rem; font-weight: 850; }
.owner-gate-table-card button {
  min-height: 48px;
  margin-top: auto;
  border: 1px solid rgba(213, 179, 111, .54);
  border-radius: 10px;
  background: #1e40af;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.owner-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: #a99fa3;
  font-size: .72rem;
}
.owner-report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.owner-report-kpi {
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(213, 179, 111, .19);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}
.owner-report-kpi span { display: block; color: #9f9699; font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.owner-report-kpi strong { display: block; margin-top: 7px; color: #fff8e9; font-size: clamp(1.12rem, 2.5vw, 1.55rem); line-height: 1; }
.owner-report-kpi small { display: block; margin-top: 8px; color: #aaa0a4; font-size: .68rem; line-height: 1.3; }
.owner-report-kpi.is-good { border-color: rgba(91, 190, 118, .38); background: rgba(41, 114, 60, .09); }
.owner-report-kpi.is-warn { border-color: rgba(240, 185, 70, .42); background: rgba(132, 87, 18, .1); }
.owner-report-kpi.is-danger { border-color: rgba(231, 74, 96, .52); background: rgba(153, 27, 27, .14); }

.owner-report-section {
  margin-top: 16px;
  border: 1px solid rgba(213, 179, 111, .17);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(0, 0, 0, .16);
}
.owner-report-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(213, 179, 111, .14);
}
.owner-report-section__head h3 { margin: 0; color: #f5e9d1 !important; font-size: .9rem !important; }
.owner-report-section__head span { color: #9f9699; font-size: .68rem; }
.owner-report-storna {
  margin-left: auto;
  border: 1px solid rgba(213, 179, 111, .45);
  background: transparent;
  color: #f3e4c2;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.owner-report-storna:hover { border-color: #d5b36f; }
.owner-report-scroll { max-height: 340px; overflow: auto; }
.owner-report-table { width: 100%; border-collapse: collapse; font-size: .73rem; }
.owner-report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 11px;
  background: #181217;
  color: #9f9699;
  text-align: left;
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.owner-report-table td { padding: 10px 11px; border-top: 1px solid rgba(255, 255, 255, .055); color: #ddd4d6; vertical-align: middle; }
.owner-report-table td.is-money { color: #f1d698; font-weight: 800; white-space: nowrap; }
.owner-report-table td.is-danger { color: #ff9aa8; }
.owner-report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(213, 179, 111, .1);
  color: #e8d19f;
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}
.owner-report-badge.is-danger { background: rgba(198, 40, 40, .18); color: #ff9aa8; }
.owner-report-badge.is-good { background: rgba(70, 160, 92, .16); color: #9be1ad; }
.owner-report-alert {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(231, 74, 96, .46);
  border-radius: 13px;
  background: rgba(153, 27, 27, .14);
  color: #ffc0c8;
  font-size: .76rem;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .owner-gate-shell--report { max-height: 96vh; }
  .owner-gate-shell--report { max-height: 96dvh; }
  .owner-report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-gate-table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .owner-gate-overlay { padding: 0; place-items: stretch; }
  .owner-gate-shell,
  .owner-gate-shell--tables,
  .owner-gate-shell--report {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-width: 0;
    border-radius: 0;
  }
  .owner-gate-head { padding: 12px 13px; }
  .owner-gate-body { padding: 12px; }
  .owner-gate-key { min-height: 64px; }
  .owner-gate-table-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .owner-gate-table-card { min-height: 126px; padding: 12px; }
  .owner-report-kpis { gap: 8px; }
  .owner-report-kpi { min-height: 105px; padding: 11px; }
  .owner-report-table thead { display: none; }
  .owner-report-table,
  .owner-report-table tbody,
  .owner-report-table tr,
  .owner-report-table td { display: block; width: 100%; }
  .owner-report-table tr { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.07); }
  .owner-report-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .owner-report-table td::before { content: attr(data-label); color: #8f868a; text-align: left; }
}

@media (max-width: 370px) {
  .owner-report-kpis,
  .owner-gate-table-grid { grid-template-columns: 1fr; }
  .owner-gate-pin-dot { width: 13px; height: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .owner-gate-overlay *, .owner-gate-overlay *::before, .owner-gate-overlay *::after {
    transition: none !important;
    animation: none !important;
  }
}
