@import "tailwindcss";

@source "../../views";
@source "../../javascript";

/* No global smooth scrolling: it makes Hotwire Native's scroll RESTORATION
   animate on back-navigation (a visible "quick scroll" from the top to your
   saved position on the feed). Restoration must be instant. If a specific
   interaction wants smooth scrolling, opt in there with scrollTo({behavior}). */

body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #f43f5e);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}
.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.gradient-text {
  background: linear-gradient(to right, #7c3aed, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.timeline-line {
  position: relative;
}
.timeline-line::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #7c3aed, #f43f5e);
  border-radius: 2px;
}

/* Admin console */
.admin-body {
  --admin-ink: #1b191e;
  --admin-muted: #77737d;
  --admin-line: #e8e6eb;
  --admin-purple: #7c3aed;
  --admin-green: #147a52;
  --admin-red: #c93845;
  min-height: 100vh;
  margin: 0;
  background: #f7f7f9;
  color: var(--admin-ink);
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 220px;
  display: flex;
  flex-direction: column;
  padding: 22px 12px 14px;
  border-right: 1px solid var(--admin-line);
  background: #fff;
}

.admin-sidebar__brand {
  padding: 0 12px 20px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-sidebar__brand strong {
  display: block;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(110deg, #7c3aed, #b72bc7, #e94176);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admin-sidebar__brand span {
  display: block;
  margin-top: 5px;
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 3px;
  padding-top: 16px;
}

.admin-nav__label {
  padding: 16px 11px 6px;
  color: #a19da6;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-nav__item {
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border-radius: 7px;
  color: #625e67;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.admin-nav__item:hover { background: #f7f5fa; }
.admin-nav__item.is-active { background: #f0ebff; color: #5b21b6; }
.admin-nav__item svg { width: 17px; height: 17px; }

.admin-nav__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #fbe7ea;
  color: var(--admin-red);
  font-size: 10px;
  font-weight: 750;
  line-height: 20px;
  text-align: center;
}

.admin-sidebar__footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--admin-line);
}

.admin-main {
  min-height: 100vh;
  padding-left: 220px;
}

.admin-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px 30px 60px;
}

.admin-page--wide { width: min(1380px, 100%); }

.admin-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-page__header h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.admin-page__header p { margin: 5px 0 0; color: var(--admin-muted); font-size: 13px; }

.admin-flash {
  width: min(1180px, calc(100% - 60px));
  margin: 18px auto 0;
  padding: 11px 14px;
  border: 1px solid;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}

.admin-flash--alert { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.admin-flash--notice { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

.admin-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
  color: #514d56;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.admin-button:hover { background: #f8f7f9; }
.admin-button--primary { border-color: var(--admin-purple); background: var(--admin-purple); color: #fff; }
.admin-button--danger { border-color: #e7a8ae; background: #fff6f7; color: var(--admin-red); }
.admin-button--warning { border-color: #e5bd96; background: #fff9f0; color: #9a4d0a; }

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-kpi {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.admin-kpi:hover { border-color: #d8d3dd; }

.admin-kpi__label { color: var(--admin-muted); font-size: 11px; font-weight: 700; }
.admin-kpi__value { display: block; margin-top: 8px; font-size: 31px; font-weight: 800; line-height: 1; }
.admin-kpi__detail { display: block; margin-top: 7px; color: var(--admin-green); font-size: 10px; font-weight: 650; }
.admin-kpi__value--attention, .admin-kpi__detail--attention { color: var(--admin-red); }

.admin-secondary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.admin-secondary-stat { padding: 13px 16px; border-right: 1px solid var(--admin-line); }
.admin-secondary-stat:last-child { border-right: 0; }
.admin-secondary-stat strong { display: block; font-size: 18px; }
.admin-secondary-stat span { color: var(--admin-muted); font-size: 10px; }

.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, .75fr);
  gap: 14px;
}

.admin-panel {
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.admin-panel__header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-panel__header h2 { margin: 0; font-size: 13px; }
.admin-live { display: inline-flex; align-items: center; gap: 6px; color: var(--admin-green); font-size: 10px; font-weight: 700; }
.admin-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #21a36c; }

.admin-activity-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-activity-row:last-child { border-bottom: 0; }

.admin-activity-row__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f5f2fa;
}

.admin-activity-row__icon svg { width: 16px; height: 16px; }
.admin-activity-row__copy { min-width: 0; }
.admin-activity-row__copy strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-activity-row time { color: var(--admin-muted); font-size: 10px; white-space: nowrap; }

.admin-audit-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-audit-row:last-child { border-bottom: 0; }
.admin-audit-row strong { display: block; font-size: 11px; }
.admin-audit-row span, .admin-audit-row small { display: block; margin-top: 3px; color: var(--admin-muted); font-size: 9px; line-height: 1.35; }

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-search {
  width: min(360px, 100%);
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}

.admin-select {
  height: 38px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
  color: #5e5a63;
  font-size: 12px;
  font-weight: 650;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--admin-line);
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--admin-line);
  color: var(--admin-ink);
  white-space: nowrap;
}

.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfafd; }
.admin-table__actions-heading, .admin-table__actions { width: 76px; text-align: right !important; }

.admin-row-actions {
  position: relative;
  display: inline-block;
  text-align: left;
}

.admin-row-actions summary {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border-radius: 50%;
  color: #625e67;
  cursor: pointer;
  list-style: none;
}

.admin-row-actions summary::-webkit-details-marker { display: none; }
.admin-row-actions summary:hover { background: #f1f0f3; }
.admin-row-actions summary svg { width: 18px; height: 18px; }

.admin-row-actions__menu {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 30;
  width: 170px;
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(25, 20, 32, .16);
}

.admin-table tbody tr:nth-last-child(-n + 2) .admin-row-actions__menu {
  top: auto;
  bottom: 36px;
}

.admin-row-actions__form { margin: 0; }

.admin-row-actions__item {
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  background: #fff;
  color: #3f3b43;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.admin-row-actions__form:last-child .admin-row-actions__item { border-bottom: 0; }
.admin-row-actions__item:hover { background: #f8f7f9; }
.admin-row-actions__item--danger { color: var(--admin-red); }

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--admin-muted);
  font-size: 11px;
}

.admin-pagination__links { display: flex; gap: 6px; }
.admin-pagination__page { display: inline-flex; align-items: center; padding: 0 6px; font-weight: 650; }

.admin-empty {
  padding: 42px 20px;
  color: var(--admin-muted);
  font-size: 13px;
  text-align: center;
}

.admin-status {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 10px;
  background: #e8f6ef;
  color: var(--admin-green);
  font-size: 9px;
  font-weight: 750;
}

.admin-status--admin { background: #efe9ff; color: var(--admin-purple); }
.admin-status--suspended { background: #fbe7ea; color: var(--admin-red); }

.admin-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 1px 10px;
  border-bottom: 2px solid transparent;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-tabs__item.is-active { border-color: var(--admin-purple); color: var(--admin-purple); }
.admin-tabs__item span { min-width: 20px; padding: 2px 6px; border-radius: 10px; background: #efedf1; font-size: 9px; text-align: center; }
.admin-tabs__item.is-active span { background: #efe9ff; }

.admin-report-list { display: grid; gap: 14px; }

.admin-report {
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.admin-report__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-report__header strong { display: block; font-size: 14px; }
.admin-report__header div > span { display: block; margin-top: 4px; color: var(--admin-muted); font-size: 10px; }

.admin-report__content {
  display: grid;
  grid-template-columns: 220px minmax(230px, 1fr) 190px;
  gap: 18px;
  padding: 16px;
}

.admin-report__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 7px;
  aspect-ratio: 16 / 9;
  background: #f1f0f3;
}

.admin-report__photos div { position: relative; display: grid; place-items: center; color: var(--admin-muted); font-size: 10px; }
.admin-report__photos div + div { border-left: 1px solid #fff; }
.admin-report__photos div.is-reported { outline: 3px solid var(--admin-red); outline-offset: -3px; z-index: 1; }
.admin-report__photos img { width: 100%; height: 100%; object-fit: cover; }

.admin-report__details {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  margin: 0;
  font-size: 11px;
}

.admin-report__details dt { color: var(--admin-muted); }
.admin-report__details dd { margin: 0; font-weight: 650; }

.admin-report__context {
  padding-left: 16px;
  border-left: 1px solid var(--admin-line);
}

.admin-report__context strong, .admin-report__context span { display: block; }
.admin-report__context strong { margin-bottom: 8px; font-size: 11px; }
.admin-report__context span { margin-top: 6px; color: var(--admin-muted); font-size: 10px; line-height: 1.35; }

.admin-report__missing { display: grid; place-items: center; min-height: 100px; padding: 15px; border-radius: 7px; background: #f3f2f5; color: var(--admin-muted); font-size: 11px; text-align: center; }

.admin-report__actions, .admin-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-report__actions { padding: 12px 16px; border-top: 1px solid var(--admin-line); }
.admin-report__actions form, .admin-inline-actions form { margin: 0; }

@media (max-width: 1080px) {
  .admin-report__content { grid-template-columns: 180px minmax(220px, 1fr); }
  .admin-report__context { grid-column: 1 / -1; padding: 12px 0 0; border-top: 1px solid var(--admin-line); border-left: 0; }
}

@media (max-width: 900px) {
  .admin-sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
  }
  .admin-sidebar__brand, .admin-sidebar__footer, .admin-nav__label { display: none; }
  .admin-nav { display: flex; overflow-x: auto; padding: 0; }
  .admin-nav__item { min-width: max-content; }
  .admin-main { padding-left: 0; }
  .admin-page { padding: 22px 16px 50px; }
  .admin-kpis { grid-template-columns: repeat(2, 1fr); }
  .admin-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .admin-report__content { grid-template-columns: 1fr; }
  .admin-report__context { grid-column: 1; }
}
