@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #f7f5f0; /* Off-white warm cream */
  --card-bg: #ffffff;
  --card-hover: #faf8f5;
  --accent: #13a6f0;
  --accent-strong: #087fbd;
  --accent-bg: #eaf7fe;
  --accent-glow: rgba(19, 166, 240, 0.18);
  --success: #15803d; /* Forest green */
  --success-bg: rgba(21, 128, 61, 0.08);
  --warning: #b45309;
  --danger: #b91c1c; /* Crimson */
  --text-main: #1d1b18; /* Charcoal with warm tint */
  --text-sec: #706e68; /* Soft warm grey */
  --border: #e6e2da; /* Fine warm grey border */
  --font: 'Outfit', sans-serif;
  --radius-lg: 14px;
  --radius-md: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 1px 3px rgba(29, 27, 24, 0.05), 0 1px 2px rgba(29, 27, 24, 0.02);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body:not(.editor-access) [data-editor-only] {
  display: none !important;
}

header {
  padding: 12px 40px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background-color: rgba(253, 251, 248, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.header-title {
  flex: 0 1 390px;
  min-width: 260px;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.header-title p {
  font-size: 12.5px;
  color: var(--text-sec);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.header-context-card {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.colportor-context {
  min-width: 190px;
  max-width: 300px;
}

.header-context-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-bg);
  font-size: 9px;
}

.calendar-icon {
  font-size: 13px;
  color: var(--accent-strong);
  background: var(--accent-bg);
}

.header-context-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-context-label {
  color: var(--text-sec);
  font-size: 8.5px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

#selected-colportor-label {
  max-width: 235px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-dropdown {
  min-width: 220px;
  position: relative;
}

.period-dropdown-trigger {
  width: 100%;
  min-height: 43px;
  border: 1px solid rgba(8, 127, 189, 0.45);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 20px rgba(8, 127, 189, 0.2);
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.period-dropdown-trigger:hover,
.period-dropdown.open .period-dropdown-trigger {
  border-color: rgba(8, 127, 189, 0.7);
  background: linear-gradient(135deg, #21aff5, #0879b3);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 10px 24px rgba(8, 127, 189, 0.24);
}

.period-dropdown-trigger .header-context-label { color: rgba(255, 255, 255, 0.76); }
.period-dropdown-trigger .calendar-icon { color: #fff; background: rgba(255, 255, 255, 0.17); }

#period-current-label {
  max-width: 155px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  transition: transform 0.2s ease;
}

.period-dropdown.open .select-chevron {
  transform: rotate(180deg);
}

.period-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 130;
  width: 310px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(29, 27, 24, 0.14);
  backdrop-filter: blur(16px);
}

.period-option {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--text-main);
  background: transparent;
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.period-option:hover {
  background: #f5fbff;
}

.period-option.active {
  color: var(--accent-strong);
  background: var(--accent-bg);
}

.period-option-dot {
  width: 7px;
  height: 7px;
  border: 1.5px solid #b8c4cc;
  border-radius: 50%;
}

.period-option.active .period-option-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 166, 240, 0.13);
}

.period-option strong,
.period-option small {
  display: block;
}

.period-option strong {
  font-size: 11.5px;
  font-weight: 680;
}

.period-option small {
  margin-top: 1px;
  color: var(--text-sec);
  font-size: 9.5px;
  font-weight: 400;
}

.period-option-check {
  color: transparent;
  font-size: 12px;
  font-weight: 800;
}

.period-option.active .period-option-check {
  color: var(--accent-strong);
}

.update-badge {
  font-size: 11.5px;
  background: var(--card-bg);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--text-sec);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .header-title {
    flex: none;
    min-width: 0;
  }

  .header-right {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 720px) {
  header {
    padding: 11px 16px;
  }

  .header-title p {
    display: none;
  }

  .header-right {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .header-context-card {
    flex: 1 1 210px;
  }

  .colportor-context {
    max-width: none;
  }

  #selected-colportor-label {
    max-width: calc(100vw - 95px);
  }

  .update-badge {
    flex: 1 1 100%;
    text-align: center;
  }

  .dashboard-container {
    padding: 18px 16px;
  }
}

.update-badge.offline-badge {
  color: var(--warning);
  background: #fff8ed;
  border-color: #f3d7ae;
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 40px;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
  flex-grow: 1;
}

/* Filters Bar */
.filters-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group.colportor-filter-group {
  flex: 1;
  min-width: 350px;
}

.filter-group label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-sec);
}

.filter-control {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.filter-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.date-pickers {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 250px;
}

/* Pill Group (Buttons) */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pill-btn {
  background: var(--bg-color);
  border: 1px solid var(--border);
  color: var(--text-sec);
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  transition: var(--transition);
}

.pill-btn:hover {
  background: var(--card-bg);
  color: var(--text-main);
  border-color: var(--text-sec);
}

.pill-btn.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
}

/* Scrollable Tray for Colportors */
.colportor-tray-wrapper {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-color);
}

.scrollable-tray {
  max-height: 105px;
  overflow-y: auto;
  padding: 8px;
  margin-top: 0;
  align-content: flex-start;
}

/* Search suggestions box */
.search-suggest-container {
  position: relative;
  width: 100%;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-sec);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.clear-btn:hover {
  color: var(--text-main);
}

.suggestions-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 110;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.suggestion-item {
  padding: 9px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

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

.suggestion-item:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

.header-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-sec);
  margin-left: 6px;
}

/* Minimalist and Friendly Summary Row */
.report-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 2.2fr;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #fff 0%, #fdf9f2 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.overview-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overview-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--success);
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(21, 128, 61, 0.18);
}

.overview-heading h2 {
  font-size: 15px;
  letter-spacing: -0.2px;
}

.overview-heading p {
  margin-top: 3px;
  color: var(--text-sec);
  font-size: 11.5px;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr));
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background: var(--card-bg);
}

.overview-metric {
  min-width: 0;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 1px solid var(--border);
}

.overview-metric:first-child {
  border-left: 0;
}

.today-emphasis {
  background: var(--success-bg);
}

.previous-day {
  background: #faf9f7;
}

.overview-value {
  font-size: 21px;
  line-height: 1;
  font-weight: 750;
  color: var(--text-main);
}

.today-emphasis .overview-value {
  color: var(--success);
}

.warning-value {
  color: var(--danger);
}

.overview-label {
  font-size: 9.5px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.summary-item {
  flex: 1;
  min-width: 130px;
  background: var(--card-bg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.summary-number {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.summary-symbol {
  color: var(--accent);
  font-size: 17px;
  margin-right: 3px;
}

@media (max-width: 900px) {
  .report-overview {
    grid-template-columns: 1fr;
  }

  .overview-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-metric,
  .overview-metric:first-child {
    border: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }
}

.summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sec);
  text-align: center;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.85fr 1.15fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.grid-col-left, .grid-col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.card-subtitle {
  margin-top: 4px;
  color: var(--text-sec);
  font-size: 11px;
  line-height: 1.4;
}

.ranking-card-header {
  align-items: flex-start;
  gap: 12px;
}

.ranking-tabs,
.chart-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-color);
}

.ranking-tab,
.chart-tab {
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--text-sec);
  background: transparent;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
  transition: var(--transition);
}

.ranking-tab:hover,
.chart-tab:hover {
  color: var(--text-main);
}

.ranking-tab.active,
.chart-tab.active {
  color: var(--text-main);
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(29, 27, 24, 0.09);
}

.chart-card-header {
  align-items: flex-start;
  gap: 12px;
}

.chart-tab[hidden],
.ranking-tab[hidden] {
  display: none !important;
}

.content-changed {
  animation: content-change 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes content-change {
  0% {
    opacity: 0.38;
    transform: translateY(3px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.insight-card-header {
  align-items: flex-start;
  gap: 12px;
}

.insight-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

#insight-colportor-name {
  font-size: 15px;
  line-height: 1.25;
}

.insight-period-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 20px;
  color: var(--accent);
  background: var(--accent-bg);
  font-size: 9.5px;
  font-weight: 700;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.insight-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-color);
}

.insight-value {
  display: block;
  color: var(--text-main);
  font-size: 20px;
  line-height: 1;
  font-weight: 750;
}

.insight-label {
  display: block;
  margin-top: 5px;
  color: var(--text-sec);
  font-size: 9px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.insight-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #c9eafd;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fdff, var(--accent-bg));
}

.insight-highlight-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 14px;
}

.insight-highlight-label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-sec);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#insight-top-book {
  display: block;
  color: var(--text-main);
  font-size: 11.5px;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .ranking-card-header,
  .insight-card-header {
    flex-direction: column;
  }

  .ranking-tabs {
    width: 100%;
  }

  .ranking-tab {
    flex: 1;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }
}

/* Charts Containers */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.chart-empty-state {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px dashed #cfe7f5;
  border-radius: 11px;
  color: var(--text-sec);
  background: linear-gradient(145deg, #fbfeff, #f4fbff);
  text-align: center;
}

.chart-empty-state[hidden] {
  display: none !important;
}

.chart-empty-state > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 11px;
  color: var(--accent-strong);
  background: var(--accent-bg);
  font-size: 17px;
}

.chart-empty-state strong {
  color: var(--text-main);
  font-size: 12.5px;
}

.chart-empty-state small {
  font-size: 10px;
}

.products-analysis {
  display: flex;
  gap: 20px;
}

@media (max-width: 768px) {
  .products-analysis {
    flex-direction: column;
  }
}

.chart-container-half {
  flex: 1.1;
  position: relative;
  height: 280px;
}

.products-list-container {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.products-list-container h3 {
  font-size: 11px;
  color: var(--text-sec);
  text-transform: uppercase;
  font-weight: 700;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 12px;
}

.product-item-name {
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.product-item-qty {
  font-weight: 700;
  color: var(--accent);
}

/* Tables */
.table-container {
  max-height: 330px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 8px 10px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-sec);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 9px 10px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr.clickable-row {
  cursor: pointer;
  transition: var(--transition);
}

tr.clickable-row:hover td {
  background: var(--accent-bg);
  color: var(--accent);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-color);
}

tr:nth-child(1) .rank-badge { background: #fef3c7; color: #b45309; }
tr:nth-child(2) .rank-badge { background: #f1f5f9; color: #475569; }
tr:nth-child(3) .rank-badge { background: #ffedd5; color: #c2410c; }

/* Date Navigator Controls */
.date-nav-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.date-navigator-controls {
  display: flex;
  gap: 6px;
  width: 100%;
}

.nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--font);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.nav-btn:hover {
  background: var(--card-hover);
  border-color: var(--text-sec);
}

.today-btn {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
}

.today-btn:hover {
  filter: brightness(0.95);
}

.inline-date {
  flex: 1;
  padding: 6px 10px;
}

/* Presence Container */
.presence-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

@media (max-width: 480px) {
  .presence-container {
    grid-template-columns: 1fr;
  }
}

.presence-column {
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.presence-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-sec);
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-indicator.green { background-color: var(--success); }
.dot-indicator.red { background-color: var(--danger); }

.count-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 800;
}

.count-badge.green { background: var(--success-bg); color: var(--success); }
.count-badge.red { background: rgba(185, 28, 28, 0.08); color: var(--danger); }

.presence-scroll-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.presence-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.presence-item:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}

.presence-icon {
  font-size: 12px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

.period-dropdown-trigger:focus-visible,
.period-option:focus-visible,
.pill-btn:focus-visible,
.ranking-tab:focus-visible,
.chart-tab:focus-visible,
.nav-btn:focus-visible {
  outline: 3px solid var(--accent-glow);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  header {
    padding: 9px 12px;
    gap: 7px;
    min-height: 0;
  }

  .header-title {
    flex: none;
    min-height: 0;
    width: 100%;
    padding-right: 92px;
  }

  .header-title h1 {
    font-size: 16.5px;
    line-height: 1.2;
  }

  .header-right {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
    align-items: stretch;
    gap: 6px;
  }

  .header-context-card {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 9px;
  }

  .colportor-context,
  .period-dropdown {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .period-dropdown-trigger {
    min-height: 39px;
  }

  .header-context-icon {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
    border-radius: 6px;
  }

  .header-context-label {
    font-size: 7px;
    letter-spacing: 0.45px;
  }

  #selected-colportor-label,
  #period-current-label {
    max-width: 100%;
    font-size: 10px;
  }

  .select-chevron {
    font-size: 12px;
  }

  .period-dropdown-menu {
    right: 0;
    width: min(310px, calc(100vw - 24px));
    max-height: 66vh;
    overflow-y: auto;
  }

  .update-badge,
  .update-badge.offline-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 4px 7px;
    border: 1px solid rgba(21, 128, 61, 0.2);
    border-radius: 8px;
    color: var(--success);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    font-size: 8.5px;
    line-height: 1.2;
    font-weight: 650;
  }

  .update-badge.offline-badge {
    max-width: 108px;
    overflow: hidden;
    color: var(--warning);
    border-color: rgba(180, 83, 9, 0.22);
    background: #fffaf2;
    text-overflow: ellipsis;
  }

  .dashboard-container {
    gap: 14px;
    padding: 14px 10px;
  }

  .filters-bar {
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
  }

  .filter-group.colportor-filter-group,
  .date-pickers {
    width: 100%;
    min-width: 0;
  }

  .filter-control {
    min-width: 0;
    font-size: 16px;
  }

  .scrollable-tray {
    max-height: 122px;
    padding: 6px;
  }

  .pill-group {
    gap: 5px;
  }

  .pill-btn {
    padding: 6px 9px;
    font-size: 10.5px;
  }

  .report-overview {
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
  }

  .overview-icon {
    width: 33px;
    height: 33px;
    font-size: 16px;
  }

  .overview-metric {
    padding: 11px;
  }

  .overview-metric:last-child {
    grid-column: 1 / -1;
  }

  .overview-value {
    font-size: 18px;
  }

  .summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-item {
    min-width: 0;
    padding: 12px 5px;
  }

  .summary-number {
    font-size: 17px;
  }

  .summary-symbol {
    display: none;
  }

  .summary-label {
    font-size: 8px;
    line-height: 1.25;
  }

  .dashboard-grid,
  .grid-col-left,
  .grid-col-right {
    gap: 14px;
  }

  .dashboard-card {
    padding: 14px;
    border-radius: 12px;
  }

  .card-header {
    margin-bottom: 12px;
  }

  .chart-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-tabs {
    width: 100%;
  }

  .chart-tab {
    flex: 1;
  }

  .chart-container {
    height: 220px;
  }

  .chart-container-half {
    height: 230px;
  }

  .products-list {
    max-height: 210px;
  }

  .product-item-name {
    max-width: calc(100vw - 105px);
  }

  th,
  td {
    padding: 8px 6px;
  }

  th {
    font-size: 9px;
  }

  td {
    font-size: 11px;
  }

  .date-navigator-controls {
    flex-wrap: wrap;
  }

  .inline-date {
    min-width: 150px;
  }
}

@media (max-width: 390px) {
  .header-context-icon {
    display: none;
  }

  .period-dropdown-menu {
    right: -2px;
  }

  .overview-heading p,
  .card-subtitle {
    display: none;
  }

  .date-nav-header .card-subtitle {
    display: block;
  }

  .update-badge,
  .update-badge.offline-badge {
    display: none;
  }

  .header-title {
    padding-right: 0;
  }

  .header-title h1 {
    font-size: 14.5px;
    letter-spacing: -0.25px;
  }

  .insight-period-badge {
    align-self: flex-start;
  }
}

/* Authentication */
body.auth-locked > .app-header,
body.auth-locked > .dashboard-container,
body.auth-locked > .modal-backdrop {
  display: none;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 12%, rgba(19, 166, 240, 0.14), transparent 30%),
    radial-gradient(circle at 88% 84%, rgba(8, 127, 189, 0.12), transparent 34%),
    linear-gradient(145deg, #f7fbfd 0%, #f5f3ee 55%, #eef8fd 100%);
}

.login-gate[hidden] {
  display: none !important;
}

.login-ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  animation: ambient-float 9s ease-in-out infinite alternate;
}

.login-ambient-one {
  top: -120px;
  left: -80px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(19, 166, 240, 0.18);
  box-shadow: inset 0 0 80px rgba(19, 166, 240, 0.06);
}

.login-ambient-two {
  right: -100px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(8, 127, 189, 0.13);
  animation-delay: -3s;
}

@keyframes ambient-float {
  to { transform: translate3d(18px, -14px, 0) scale(1.04); }
}

.login-card {
  position: relative;
  width: min(100%, 430px);
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 90px rgba(29, 58, 74, 0.15), 0 3px 12px rgba(29, 27, 24, 0.05);
  backdrop-filter: blur(22px);
  animation: login-enter 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes login-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-shake {
  animation: login-shake 280ms ease;
}

@keyframes login-shake {
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
  80% { transform: translateX(-2px); }
}

.login-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #24b3f7, var(--accent-strong));
  box-shadow: 0 12px 26px rgba(19, 166, 240, 0.25);
  font-size: 20px;
  font-weight: 800;
}

.login-eyebrow,
.finance-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-card > h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.7px;
}

.login-card > p:not(.login-error) {
  margin-top: 8px;
  color: var(--text-sec);
  font-size: 13px;
  line-height: 1.5;
}

.login-field {
  display: block;
  margin-top: 25px;
}

.login-field > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--text-main);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.login-input-wrap {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  transition: var(--transition);
}

.login-input-wrap:focus-within {
  border-color: rgba(19, 166, 240, 0.7);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.login-lock {
  color: var(--accent-strong);
  font-size: 18px;
}

.login-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-main);
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
}

.toggle-password {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--text-sec);
  background: transparent;
  cursor: pointer;
}

.toggle-password:hover { background: var(--accent-bg); color: var(--accent-strong); }

.remember-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.remember-option:hover { border-color: var(--border); background: #fbfdfe; }
.remember-option input { position: absolute; opacity: 0; pointer-events: none; }

.remember-control {
  width: 34px;
  height: 20px;
  position: relative;
  border-radius: 20px;
  background: #d7d7d4;
  transition: var(--transition);
}

.remember-control::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: var(--transition);
}

.remember-option input:checked + .remember-control { background: var(--accent); }
.remember-option input:checked + .remember-control::after { transform: translateX(14px); }
.remember-option strong,
.remember-option small { display: block; }
.remember-option strong { font-size: 11px; font-weight: 650; }
.remember-option small { margin-top: 2px; color: var(--text-sec); font-size: 9.5px; }

.login-error {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--danger);
  background: rgba(185, 28, 28, 0.06);
  font-size: 10.5px;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 24px rgba(19, 166, 240, 0.23);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.login-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(19, 166, 240, 0.28); }
.login-submit:disabled { cursor: wait; opacity: 0.7; }
.login-submit.loading span:last-child { animation: login-arrow 800ms ease infinite alternate; }
@keyframes login-arrow { to { transform: translateX(4px); } }

.login-security {
  display: block;
  margin-top: 17px;
  color: #92908a;
  font-size: 9px;
  text-align: center;
}

.logout-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-sec);
  background: var(--card-bg);
  font-family: var(--font);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}

.logout-btn:hover { color: var(--danger); border-color: rgba(185, 28, 28, 0.25); background: #fff8f8; }

/* Financial analysis */
.summary-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-summary-item { background: linear-gradient(145deg, #f8fdff, var(--accent-bg)); }
.finance-summary-item .summary-number { color: var(--accent-strong); }
.finance-summary-item .summary-symbol { font-size: 10px; }

.finance-section {
  padding: 22px;
  overflow: hidden;
}

.finance-header { align-items: flex-start; gap: 16px; }
.finance-header h2 { font-size: 16px; }

.price-settings-btn {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-sec);
  background: var(--card-bg);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: var(--transition);
}

.price-settings-btn:hover { color: var(--accent-strong); border-color: rgba(19, 166, 240, 0.35); background: var(--accent-bg); }

.finance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

.finance-metric {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid var(--border);
}

.finance-metric:last-child { border-right: 0; }
.finance-metric.primary { background: linear-gradient(145deg, #f8fdff, var(--accent-bg)); }
.finance-metric-label { display: block; color: var(--text-sec); font-size: 8.5px; font-weight: 700; letter-spacing: 0.45px; text-transform: uppercase; }
.finance-metric strong { display: block; margin-top: 6px; overflow: hidden; color: var(--text-main); font-size: 20px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.finance-metric.primary strong { color: var(--accent-strong); font-size: 24px; }
.finance-metric small { display: block; margin-top: 6px; overflow: hidden; color: var(--text-sec); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }

.finance-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.finance-chart-panel,
.finance-ranking-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfcfb;
}

.finance-ranking-panel { background: var(--bg-color); }
.finance-ranking-panel .finance-panel-heading h3 { font-size: 14.5px; }
.finance-ranking-panel .finance-panel-heading p { font-size: 11px; }

.finance-panel-heading h3 { font-size: 12px; }
.finance-panel-heading p { margin-top: 3px; color: var(--text-sec); font-size: 9.5px; }
.finance-chart-container { position: relative; height: 285px; margin-top: 12px; }

.finance-ranking-table-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 7px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text-sec); font-size: 8px; font-weight: 700; letter-spacing: 0.45px; text-transform: uppercase; }
.finance-ranking-table-head span:last-child { text-align: right; }
.finance-ranking-list { display: flex; flex-direction: column; }
.finance-ranking-item { width: 100%; min-height: 38px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; color: var(--text-main); background: transparent; text-align: left; font-family: var(--font); cursor: pointer; transition: var(--transition); }
.finance-ranking-item:not(:disabled):hover { background: rgba(19, 166, 240, 0.08); }
.finance-ranking-item:disabled { cursor: default; }
.finance-rank-position { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--text-sec); background: rgba(255, 255, 255, 0.72); font-size: 8.5px; font-weight: 750; }
.finance-ranking-item:nth-child(1) .finance-rank-position { color: #b45309; background: #fef3c7; }
.finance-ranking-item:nth-child(2) .finance-rank-position { color: #475569; background: #f1f5f9; }
.finance-ranking-item:nth-child(3) .finance-rank-position { color: #c2410c; background: #ffedd5; }
.finance-rank-copy { min-width: 0; }
.finance-rank-copy strong,
.finance-rank-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-rank-copy strong { font-size: 10.5px; font-weight: 600; }
.finance-rank-copy small { margin-top: 1px; color: var(--text-sec); font-size: 8px; }
.finance-rank-value { color: var(--accent-strong); font-size: 10.5px; font-weight: 750; white-space: nowrap; }
.finance-list-empty { padding: 30px 10px; color: var(--text-sec); font-size: 10px; text-align: center; }

.finance-unpriced { margin-top: 12px; padding: 10px; border: 1px solid #f1dfc8; border-radius: 9px; background: #fffaf2; }
.finance-unpriced > strong { display: block; margin-bottom: 7px; color: var(--warning); font-size: 8.5px; text-transform: uppercase; }
.finance-unpriced-list,
#finance-unpriced-list { display: flex; flex-wrap: wrap; gap: 5px; }
#finance-unpriced-list span { padding: 4px 6px; border-radius: 6px; color: #7c5627; background: rgba(180, 83, 9, 0.07); font-size: 8.5px; }
#finance-unpriced-list strong { margin-left: 3px; }

/* Price editor */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; background: rgba(22, 31, 36, 0.48); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none !important; }
.price-modal-card { width: min(100%, 680px); max-height: min(86vh, 820px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 20px; background: var(--card-bg); box-shadow: 0 28px 80px rgba(18, 30, 38, 0.28); animation: login-enter 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.price-modal-header { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.price-modal-header h2 { font-size: 18px; }
.price-modal-header p { margin-top: 4px; color: var(--text-sec); font-size: 10px; }
.modal-close-btn { width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-sec); background: var(--bg-color); font-size: 20px; cursor: pointer; }
#price-form { min-height: 0; display: flex; flex-direction: column; }
.price-editor-list { min-height: 0; overflow-y: auto; padding: 8px 22px 18px; }
.price-editor-section h3 { position: sticky; top: 0; z-index: 1; padding: 12px 0 8px; color: var(--text-sec); background: var(--card-bg); font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; }
.price-editor-section.extra-prices { margin-top: 10px; }
.price-editor-row { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.price-editor-row > span:first-child { min-width: 0; }
.price-editor-row strong,
.price-editor-row small { display: block; }
.price-editor-row strong { font-size: 11px; }
.price-editor-row small { margin-top: 2px; color: var(--text-sec); font-size: 8.5px; }
.price-input-wrap { width: 142px; flex: 0 0 142px; display: flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.price-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.price-input-wrap > span { color: var(--text-sec); font-size: 9px; font-weight: 700; }
.price-input-wrap input { width: 100%; min-height: 36px; border: 0; outline: 0; color: var(--text-main); background: transparent; font-family: var(--font); font-size: 12px; font-weight: 650; text-align: right; }
.price-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fbfbfa; }
.price-save-status { margin-right: auto; color: var(--success); font-size: 9.5px; }
.primary-btn,
.secondary-btn { min-height: 36px; padding: 0 12px; border-radius: 9px; font-family: var(--font); font-size: 10px; font-weight: 700; cursor: pointer; }
.primary-btn { border: 0; color: #fff; background: var(--accent-strong); }
.secondary-btn { border: 1px solid var(--border); color: var(--text-sec); background: #fff; }

@media (max-width: 900px) {
  .finance-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-content { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .logout-btn {
    position: static;
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 39px;
    align-self: stretch;
    border-radius: 9px;
    font-size: 13px;
  }
  .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .finance-section { padding: 14px; }
  .finance-header { flex-direction: row; }
  .finance-header .card-subtitle { display: block; }
  .finance-metrics { grid-template-columns: 1fr; }
  .finance-metric { padding: 12px; }
  .finance-metric { border-right: 0; border-bottom: 1px solid var(--border); }
  .finance-metric:last-child { border-bottom: 0; }
  .finance-metric strong { font-size: 16px; }
  .finance-metric.primary strong { font-size: 19px; }
  .finance-chart-panel,
  .finance-ranking-panel { padding: 12px; }
  .finance-chart-container { height: 235px; }
  .login-gate { padding: 14px; }
  .login-card { padding: 28px 22px; border-radius: 20px; }
  .login-card > h1 { font-size: 24px; }
  .price-modal-card { max-height: 92vh; border-radius: 16px; }
  .price-modal-header,
  .price-editor-list,
  .price-modal-actions { padding-left: 14px; padding-right: 14px; }
  .price-modal-actions { flex-wrap: wrap; }
  .price-save-status { width: 100%; margin: 0 0 3px; }
}

@media (max-width: 390px) {
  .finance-header h2 { font-size: 13px; }
  .price-settings-btn span:last-child { display: none; }
  .finance-metrics { grid-template-columns: 1fr; }
  .finance-metric { border-right: 0; border-bottom: 1px solid var(--border); }
  .finance-metric:last-child { border-bottom: 0; }
  .price-editor-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .price-input-wrap { width: 100%; flex-basis: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Visual feedback mode */
.feedback-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 190;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(19, 166, 240, 0.3);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 30px rgba(8, 127, 189, 0.27);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.feedback-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(8, 127, 189, 0.32); }
.feedback-launcher-icon { font-size: 14px; }
.feedback-count-badge { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; color: var(--accent-strong); background: #fff; font-size: 9px; }
.feedback-count-badge[hidden] { display: none !important; }
body.auth-locked .feedback-launcher,
body.auth-locked .feedback-toolbar,
body.auth-locked .feedback-pins { display: none !important; }

.feedback-toolbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 460;
  width: min(calc(100% - 28px), 560px);
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 17px;
  background: rgba(24, 31, 35, 0.94);
  box-shadow: 0 20px 50px rgba(23, 34, 42, 0.28);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  animation: feedback-toolbar-enter 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.feedback-toolbar:not([hidden]) { display: flex; }
@keyframes feedback-toolbar-enter { from { opacity: 0; transform: translate(-50%, 12px) scale(0.98); } }
.feedback-live-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #36c982; box-shadow: 0 0 0 5px rgba(54, 201, 130, 0.12); }
.feedback-toolbar-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.feedback-toolbar-copy strong { color: #fff; font-size: 11px; }
.feedback-toolbar-copy small { margin-top: 1px; color: rgba(255, 255, 255, 0.62); font-size: 8.5px; }
.feedback-toolbar-summary { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 11px; color: #fff; background: rgba(255, 255, 255, 0.08); font-family: var(--font); font-size: 9.5px; font-weight: 650; cursor: pointer; }
.feedback-toolbar-summary.has-notes { border-color: rgba(19, 166, 240, 0.5); background: rgba(19, 166, 240, 0.2); }
.feedback-toolbar-summary span { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 999px; color: #162027; background: #fff; font-size: 8.5px; }
.feedback-toolbar-close { width: 34px; height: 34px; flex: 0 0 34px; border: 0; border-radius: 10px; color: rgba(255, 255, 255, 0.7); background: transparent; font-size: 20px; cursor: pointer; }
.feedback-toolbar-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

body.feedback-review-mode * { cursor: crosshair; }
body.feedback-review-mode #feedback-toolbar *,
body.feedback-review-mode #feedback-compose-modal *,
body.feedback-review-mode #feedback-summary-shell *,
body.feedback-review-mode .feedback-pin { cursor: pointer; }
.feedback-target-outline { position: fixed; z-index: 440; border: 2px solid var(--accent); border-radius: 10px; background: rgba(19, 166, 240, 0.055); box-shadow: 0 0 0 4px rgba(19, 166, 240, 0.13); pointer-events: none; transition: left 90ms ease, top 90ms ease, width 90ms ease, height 90ms ease; }
.feedback-target-outline[hidden],
.feedback-summary-shell[hidden],
.feedback-compose-backdrop[hidden],
.feedback-toolbar[hidden],
.feedback-launcher[hidden] { display: none !important; }
.feedback-target-outline::after { content: 'Clique para comentar'; position: absolute; right: -2px; bottom: calc(100% + 6px); padding: 5px 8px; border-radius: 7px; color: #fff; background: var(--accent-strong); box-shadow: var(--shadow); font-size: 8px; font-weight: 700; white-space: nowrap; }
.feedback-target-outline.feedback-locate-pulse { animation: feedback-locate 800ms ease; }
@keyframes feedback-locate { 50% { box-shadow: 0 0 0 14px rgba(19, 166, 240, 0.18); } }
.feedback-pins { position: fixed; inset: 0; z-index: 445; pointer-events: none; }
.feedback-pin { position: fixed; width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--accent-strong); box-shadow: 0 5px 14px rgba(8, 127, 189, 0.34); font-family: var(--font); font-size: 9px; font-weight: 800; pointer-events: auto; }

.feedback-compose-backdrop { z-index: 700; }
.feedback-compose-card { width: min(100%, 520px); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 19px; background: var(--card-bg); box-shadow: 0 28px 80px rgba(18, 30, 38, 0.28); animation: login-enter 280ms cubic-bezier(0.22, 1, 0.36, 1); }
.feedback-compose-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px 8px; }
.feedback-compose-step { color: var(--accent-strong); font-size: 9px; font-weight: 750; letter-spacing: 0.55px; text-transform: uppercase; }
.feedback-selected-target { display: flex; align-items: center; gap: 10px; margin: 2px 17px 15px; padding: 11px 12px; border: 1px solid rgba(19, 166, 240, 0.24); border-radius: 11px; background: var(--accent-bg); }
.feedback-selected-target > span:first-child { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-strong); background: #fff; }
.feedback-selected-target small,
.feedback-selected-target strong { display: block; }
.feedback-selected-target small { color: var(--text-sec); font-size: 8px; font-weight: 650; text-transform: uppercase; }
.feedback-selected-target strong { margin-top: 2px; color: var(--text-main); font-size: 11px; }
.feedback-note-field { display: block; padding: 0 17px; }
.feedback-note-field > span { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 700; }
.feedback-note-field textarea { width: 100%; min-height: 130px; resize: vertical; padding: 12px; border: 1px solid var(--border); border-radius: 11px; outline: 0; color: var(--text-main); background: #fff; font-family: var(--font); font-size: 11px; line-height: 1.5; transition: var(--transition); }
.feedback-note-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.feedback-note-field textarea.feedback-field-error { animation: login-shake 280ms ease; border-color: var(--danger); }
.feedback-compose-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding: 13px 17px; border-top: 1px solid var(--border); background: #fbfbfa; }

.feedback-summary-shell { position: fixed; inset: 0; z-index: 680; }
.feedback-summary-scrim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(22, 31, 36, 0.46); backdrop-filter: blur(5px); }
.feedback-summary-panel { position: absolute; top: 0; right: 0; width: min(100%, 560px); height: 100%; display: flex; flex-direction: column; background: var(--card-bg); box-shadow: -22px 0 70px rgba(22, 31, 36, 0.2); animation: feedback-panel-enter 300ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes feedback-panel-enter { from { transform: translateX(35px); opacity: 0; } }
.feedback-summary-header { display: flex; justify-content: space-between; gap: 18px; padding: 23px 22px 17px; border-bottom: 1px solid var(--border); }
.feedback-summary-header h2 { margin-top: 3px; font-size: 19px; }
.feedback-summary-header p { margin-top: 4px; color: var(--text-sec); font-size: 9.5px; }
.feedback-summary-list { min-height: 0; flex: 1; overflow-y: auto; padding: 14px 22px; }
.feedback-summary-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.feedback-item-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-strong); background: var(--accent-bg); font-size: 9px; font-weight: 800; }
.feedback-item-copy { min-width: 0; }
.feedback-item-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.feedback-item-copy p { margin-top: 5px; color: var(--text-sec); font-size: 10px; line-height: 1.45; white-space: pre-wrap; }
.feedback-item-location { display: block; margin-top: 6px; overflow: hidden; color: #9a9892; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.feedback-item-actions { display: flex; gap: 4px; }
.feedback-item-actions button { width: 27px; height: 27px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-sec); background: #fff; font-size: 11px; cursor: pointer; }
.feedback-item-actions button:hover { color: var(--accent-strong); border-color: rgba(19, 166, 240, 0.3); background: var(--accent-bg); }
.feedback-empty-state { min-height: 360px; display: grid; place-content: center; justify-items: center; padding: 30px; color: var(--text-sec); text-align: center; }
.feedback-empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--accent-strong); background: var(--accent-bg); font-size: 20px; }
.feedback-empty-state strong { margin-top: 13px; color: var(--text-main); font-size: 13px; }
.feedback-empty-state p { max-width: 250px; margin-top: 5px; font-size: 10px; line-height: 1.45; }
.feedback-summary-footer { display: flex; align-items: center; gap: 9px; padding: 14px 22px 18px; border-top: 1px solid var(--border); background: #fbfbfa; }
.feedback-clear-btn { min-height: 36px; padding: 0 10px; border: 0; color: var(--text-sec); background: transparent; font-family: var(--font); font-size: 9.5px; cursor: pointer; }
.feedback-clear-btn:not(:disabled):hover { color: var(--danger); }
.feedback-clear-btn.awaiting-confirmation { color: var(--danger); font-weight: 700; }
.feedback-clear-btn:disabled { opacity: 0.4; cursor: default; }
.feedback-copy-btn { min-height: 40px; flex: 1; }
.feedback-copy-btn:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 720px) {
  .feedback-launcher { right: 12px; bottom: 12px; min-height: 39px; padding: 0 12px; }
  .feedback-toolbar { bottom: 10px; width: calc(100% - 20px); }
  .feedback-toolbar-copy small { display: none; }
  .feedback-toolbar-summary { padding: 0 9px; }
  .feedback-summary-panel { width: 100%; }
  .feedback-summary-header { padding: 18px 15px 14px; }
  .feedback-summary-list { padding: 8px 15px; }
  .feedback-summary-footer { padding: 12px 15px 15px; }
  .feedback-summary-item { grid-template-columns: 27px minmax(0, 1fr); }
  .feedback-item-actions { grid-column: 2; }
  .feedback-compose-card { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-toolbar,
  .feedback-summary-panel,
  .feedback-compose-card,
  .feedback-target-outline { animation: none !important; transition: none !important; }
}
