/* =============================================
   BRINDISA RETAIL CHECKS — AUDIT PAGE STYLES
   ============================================= */

/* ---- AUTH BOX ---- */
.auth-box {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  margin: 0 20px;
}

.auth-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--grey-mid);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

/* ---- AUDIT CONTAINER ---- */
.audit-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ---- FILTERS ---- */
.audit-filters {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.audit-filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.audit-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.audit-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-mid);
}

.audit-filter-select {
  padding: 8px 10px;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  width: 100%;
}

.audit-filter-select:focus {
  outline: none;
  border-color: var(--navy);
}

.audit-clear-btn {
  background: none;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  color: var(--grey-mid);
  cursor: pointer;
  align-self: flex-end;
  white-space: nowrap;
}

.audit-clear-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.audit-filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-light);
}

.audit-record-count {
  font-size: 0.82rem;
  color: var(--grey-mid);
}

.audit-refresh-btn {
  background: none;
  border: none;
  font-size: 0.82rem;
  color: var(--navy);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.audit-refresh-btn:hover { opacity: 0.7; }

/* ---- STORE GROUP ---- */
.audit-store-group {
  margin-bottom: 32px;
}

.audit-store-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy);
}

/* ---- CHECK GROUP ---- */
.audit-check-group {
  margin-bottom: 20px;
}

.audit-check-heading {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-check-count {
  background: var(--grey-light);
  color: var(--grey-mid);
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ---- RECORD ---- */
.audit-record {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.audit-record:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
}

.audit-record.expanded {
  border-color: var(--navy);
  box-shadow: var(--shadow);
}

.audit-record-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

.audit-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.status-completed {
  background: #e8f5ee;
  color: var(--green);
}

.status-failed {
  background: #fdecea;
  color: var(--red);
}

.audit-record-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  min-width: 80px;
}

.audit-record-time {
  font-size: 0.88rem;
  color: var(--grey-mid);
  min-width: 40px;
}

.audit-record-name {
  font-size: 0.88rem;
  color: var(--text-dark);
  flex: 1;
}

.audit-record-chevron {
  font-size: 0.7rem;
  color: var(--grey-mid);
  margin-left: auto;
}

/* ---- RESPONSES ---- */
.audit-responses {
  border-top: 1px solid var(--grey-light);
  padding: 16px 18px;
  background: var(--off-white);
}

.response-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--grey-light);
  font-size: 0.85rem;
  align-items: flex-start;
}

.response-row:last-child { border-bottom: none; }

.response-label {
  color: var(--text-dark);
  flex: 1;
  line-height: 1.4;
}

.response-value {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-dark);
}

.val-yes { color: var(--green); }
.val-no  { color: var(--red); }

/* ---- EMPTY STATE ---- */
.audit-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--grey-mid);
}

.audit-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.audit-empty h3 {
  font-family: 'Playfair Display', serif;
  color: var(--navy);
  margin-bottom: 8px;
}

.audit-empty p { font-size: 0.88rem; }
.audit-empty a { color: var(--navy); font-weight: 600; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .audit-filters-row { flex-direction: column; }
  .audit-filter-group { min-width: 100%; }
  .audit-record-summary { gap: 10px; }
}

/* ---- EXPORT BUTTON ---- */
.audit-export-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.audit-export-btn:hover { background: var(--navy-dark); }

/* ---- PHOTO LINK ---- */
.response-photo-link {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.response-photo-link:hover {
  text-decoration: underline;
}

/* ---- PER-RECORD EXPORT ---- */
.record-export-bar {
  padding: 12px 0 4px;
  border-top: 1px solid var(--grey-light);
  margin-top: 8px;
}

.record-export-btn {
  background: none;
  border: 1px solid var(--navy);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s;
}

.record-export-btn:hover {
  background: var(--navy);
  color: var(--white);
}

/* ---- SYNTHETIC RECORD BADGE ---- */
.synthetic-badge {
  font-size: 0.68rem;
  font-weight: 500;
  background: #fff3e0;
  color: var(--amber);
  border: 1px solid #ffe0b2;
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---- MONTH GROUP ---- */
.audit-month-group {
  margin-bottom: 8px;
}

.audit-month-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  transition: background 0.15s;
}

.audit-month-heading:hover {
  background: var(--grey-light);
}

.audit-month-chevron {
  font-size: 0.65rem;
  color: var(--grey-mid);
  width: 12px;
}

.audit-check-group {
  margin-left: 12px;
  margin-bottom: 16px;
}

/* ---- COLLAPSIBLE CHECK HEADING ---- */
.audit-check-group-outer {
  margin-bottom: 8px;
}

.audit-check-heading-collapsible {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 6px;
  transition: background 0.15s;
}

.audit-check-heading-collapsible:hover {
  background: var(--cream);
  border-color: var(--navy);
}

.audit-month-group {
  margin-left: 12px;
  margin-bottom: 6px;
}

.audit-record {
  margin-left: 12px;
}

/* ---- DASHBOARD ---- */
.dashboard {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--navy);
}

.dashboard-period-toggle {
  display: flex;
  gap: 4px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.period-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--grey-mid);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.period-btn.active {
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.period-btn:hover:not(.active) { color: var(--navy); }

/* STAT CARDS */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.dash-card {
  background: var(--off-white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.dash-card-danger { border-color: #f5c0bc; background: #fdecea; }
.dash-card-amber  { border-color: #ffe0b2; background: #fff8e6; }

.dash-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 8px;
}

.dash-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 6px;
}

.dash-card-danger .dash-card-value { color: var(--red); }
.dash-card-amber .dash-card-value  { color: var(--amber); }

.dash-card-sub {
  font-size: 0.72rem;
  color: var(--grey-mid);
  line-height: 1.4;
}

/* DASHBOARD SECTIONS */
.dashboard-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--grey-light);
}

.dashboard-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 14px;
}

/* STORE BREAKDOWN */
.dashboard-stores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dash-store-card {
  background: var(--off-white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.dash-store-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy);
  margin-bottom: 6px;
}

.dash-store-stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.dash-store-rate {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--navy);
  font-weight: 600;
}

.dash-store-detail {
  font-size: 0.75rem;
  color: var(--grey-mid);
}

.dash-progress-bar {
  height: 6px;
  background: var(--grey-light);
  border-radius: 3px;
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* CHART */
.dashboard-chart-wrap {
  position: relative;
  height: 180px;
}

.dash-chart-empty {
  text-align: center;
  padding: 40px;
  color: var(--grey-mid);
  font-size: 0.85rem;
}

/* TOP FAILURES */
.dash-failure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--grey-light);
  font-size: 0.85rem;
}

.dash-failure-row:last-child { border-bottom: none; }

.dash-failure-name { color: var(--text-dark); }

.dash-failure-count {
  font-weight: 700;
  color: var(--red);
  background: #fdecea;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.dash-no-failures {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 500;
  padding: 8px 0;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .dashboard-cards { grid-template-columns: 1fr 1fr; }
  .dashboard-stores { grid-template-columns: 1fr; }
}

/* ---- TODAY'S CHECKS ---- */
.dash-today-store {
  margin-bottom: 16px;
}

.dash-today-store-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 8px;
}

.dash-today-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--grey-light);
  background: var(--white);
}

.dash-today-check.today-completed {
  background: #f0faf4;
  border-color: #b8e0c8;
}

.dash-today-check.today-failed {
  background: #fdecea;
  border-color: #f5c0bc;
}

.dash-today-check.today-open {
  background: #fff8e6;
  border-color: #ffe0b2;
}

.dash-today-check.today-pending {
  background: var(--cream);
  border-color: var(--grey-light);
  opacity: 0.7;
}

.dash-today-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.dash-today-info { flex: 1; }

.dash-today-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.dash-today-check.today-completed .dash-today-name { color: var(--grey-mid); }
.dash-today-check.today-failed .dash-today-name { color: var(--red); }

.dash-today-status {
  font-size: 0.75rem;
  color: var(--grey-mid);
  margin-top: 2px;
}

.dash-today-check.today-failed .dash-today-status { color: var(--red); }
.dash-today-check.today-open .dash-today-status { color: var(--amber); font-weight: 500; }
.dash-today-check.today-completed .dash-today-status { color: var(--green); font-weight: 500; }

.dash-today-closed {
  text-align: center;
  padding: 20px;
  color: var(--grey-mid);
  font-size: 0.85rem;
}

/* ---- YEAR GROUP ---- */
.audit-year-group {
  margin-bottom: 6px;
}

.audit-year-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--off-white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  margin-left: 12px;
  transition: background 0.15s;
  letter-spacing: 0.04em;
}

.audit-year-heading:hover {
  background: var(--cream);
  border-color: var(--navy);
}

.audit-month-group {
  margin-left: 24px;
  margin-bottom: 6px;
}

/* ---- LATE SUBMISSION BADGE (v45) ---- */
.status-late {
  background: #fff8e6;
  color: var(--amber);
}
