/* UniSite campaign console - shared styles (plan Task 9). Bootstrap 5 provides layout/components;
   this file only adds what is specific to this console: the login card, the lead list's cards vs
   table breakpoint, the venue card's two panels, and the C12/C1/C11 mobile and interaction rules
   Bootstrap does not give for free. */

:root {
  --unisite-shown-bg: #f3f7f3;
  --unisite-shown-border: #a9d2ac;
  --unisite-confidential-bg: #fff6ec;
  --unisite-confidential-border: #e6c48a;
}

/* Every element this console makes clickable gets an explicit cursor, even when it is not a
   native <button>/<a> (DIRECTIVES C1). Native controls already have this from the browser. */
.clickable {
  cursor: pointer;
}

/* The lead list's sortable <th> labels ("Stato commerciale <i class="fa-solid fa-sort">") must
   never wrap between the label and its own icon - coordinator review, 2026-12-01: "Stato
   commerciale" wrapped, leaving the sort icon alone on its own second line. Only .clickable <th>
   cells carry an icon today, so scoping this to th.clickable is enough. */
th.clickable {
  white-space: nowrap;
}

/* 44 px minimum touch target (DIRECTIVES C12) on every button in this console, including
   Bootstrap's own .btn-sm (measured at 31 px unpatched - this rule is load-bearing, not
   decorative). Icon-only buttons additionally get a matching min-width so they stay square. */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  min-width: 44px;
}

/* A little breathing room between an icon and the label that follows it inside a button (not
   icon-only buttons, which centre a single glyph with no label at all). */
.btn:not(.btn-icon) i.fa-solid,
.btn:not(.btn-icon) i.fa-regular {
  margin-right: 6px;
}

/* Same 44 px rule for every tappable form field (Bootstrap's default .form-control/.form-select
   measure 38 px unpatched). .form-control-lg (the login fields) is already taller than 44 px. */
.form-control,
.form-select {
  min-height: 44px;
}

/* --- login page --- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f7;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card-inner {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.login-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

/* --- lead list (index.html) --- */

/* Filters sit in a left sidebar from the tablet up (DIRECTIVES C13); on the phone they collapse
   behind the "Filtri" button and open as a full-height drawer (DIRECTIVES C12). */
.filters-panel {
  background: #fff;
  border-right: 1px solid var(--bs-border-color);
  padding: 16px;
}

@media (max-width: 767.98px) {
  .filters-panel {
    position: fixed;
    inset: 0;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    border-right: none;
    padding: 16px;
  }
  .filters-panel.open {
    transform: translateX(0);
  }
  .filters-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(0, 0, 0, 0.4);
  }
  .filters-backdrop.open {
    display: block;
  }
}

.leads-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Cards on the phone, table from the tablet up (DIRECTIVES C12/C13). */
.leads-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 768px) {
  .leads-cards {
    display: none;
  }
  .leads-table-wrap {
    display: block;
  }
}

@media (max-width: 767.98px) {
  .leads-table-wrap {
    display: none;
  }
}

.lead-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}

.lead-card .lead-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.priority-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Priority is told apart by an icon shape too, never by colour alone (Luca is colour-blind,
   DIRECTIVES C13): the dot is only a secondary cue next to the text badge. */
.priority-badge {
  font-size: 0.8rem;
}

/* --- venue card (venue.html) --- */

.venue-panel {
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.venue-panel-shown {
  background: var(--unisite-shown-bg);
  border: 1px solid var(--unisite-shown-border);
}

.venue-panel-confidential {
  background: var(--unisite-confidential-bg);
  border: 1px solid var(--unisite-confidential-border);
}

.venue-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 14px;
}

.venue-divider {
  border: none;
  border-top: 3px dashed var(--bs-border-color);
  margin: 28px 0;
}

.finding-card {
  border-left: 4px solid var(--bs-secondary-color);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 0 8px 8px 0;
}

.finding-card.severity-alta {
  border-left-color: var(--bs-danger);
}

.finding-card.severity-media {
  border-left-color: var(--bs-warning);
}

.finding-card.severity-bassa {
  border-left-color: var(--bs-secondary);
}

.note-item {
  border-bottom: 1px solid var(--bs-border-color);
  padding: 10px 0;
}

.note-item:last-child {
  border-bottom: none;
}

.history-item {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
}

/* The easy-address QR (plan Task 12): large and framed, meant to be pointed at with the owner's
   own phone camera (design spec 12.1). */
.qr-panel {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.qr-panel img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Full-screen modals on the phone (DIRECTIVES C12). */
@media (max-width: 767.98px) {
  .modal-dialog {
    max-width: none;
    margin: 0;
    height: 100%;
  }
  .modal-content {
    height: 100%;
    border-radius: 0;
  }
}

/* --- client mode (client.html, Task 13) --- */
/* Full-screen, one visible way out ("Esci"), the audit side-by-side with the preview from the
   tablet up, stacked on the phone (design spec 12.1, DIRECTIVES C12). Dark so it reads well held
   up in a dining room; every control here is large (44 px+, DIRECTIVES C12) since this page is
   handed to someone who has never seen it before. */
.client-body {
  background: #111;
  color: #f4f4f4;
  min-height: 100vh;
}

.client-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #1c1c1c;
  border-bottom: 1px solid #333;
  position: sticky;
  top: 0;
  z-index: 10;
}

.client-brand {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 16px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .client-content {
    flex-direction: row;
    align-items: flex-start;
  }
  .client-column {
    flex: 1 1 0;
  }
}

.client-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 14px;
}

.client-content .finding-card {
  background: #242424;
  color: #f4f4f4;
}

.client-content .qr-panel {
  display: inline-block;
}
