/* Reportly - app additions: client list, license panel, dialogs, empty state. */

/* ---------- Trial pill in the app bar ---------- */
.trial-pill {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.trial-pill:hover { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.14); }
.trial-pill[data-tier="ok"] { border-color: rgba(217, 242, 107, 0.5); color: #e7f7b4; }
.trial-pill[data-tier="low"] { border-color: rgba(255, 196, 120, 0.55); color: #ffd9a6; }
.trial-pill[data-tier="ended"] { border-color: rgba(255, 160, 150, 0.5); color: #ffc9c2; }

/* ---------- Export pair + auto summary ---------- */
.btn--export-html { display: inline-flex; align-items: center; gap: 6px; }
.btn--export-html svg { flex: none; opacity: 0.9; }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.comment-head .field-label { margin-bottom: 6px; }
.comment-auto {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  padding: 2px 4px;
  margin-bottom: 6px;
}
.comment-auto::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b6bccb;
  margin-right: 6px;
  vertical-align: 1px;
}
.comment-auto[aria-pressed="true"] { color: var(--brand); }
.comment-auto[aria-pressed="true"]::before { background: var(--brand); }
.comment-auto:hover { color: var(--ink); background: #f2f1ec; }

@media (max-width: 760px) {
  .appbar__right .btn--export-html { display: none; }
}

/* ---------- Client list ---------- */
.field-group--clients { border-top: 0; padding-top: 0; margin-top: 18px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.group-head h2 { margin-bottom: 0; }

.client-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.client-item { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.client-row {
  flex: 1;
  min-width: 0;
  padding-right: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fbfaf7;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.client-row:hover { background: #fff; border-color: #dcd8cf; }
.client-row.is-active { background: #fff; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.client-row__mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  flex: none;
}
.client-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.client-row__text b { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row__meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row__del {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9aa3b4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.client-row__del:hover { color: #a32218; border-color: #e7c4c0; background: #fdf4f3; }

/* ---------- Small controls ---------- */
.mini-btn {
  border: 1px solid #d8d5cc;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.mini-btn:hover { border-color: #b9b4a8; }
.mini-btn--quiet { border-color: transparent; color: var(--muted); }
.mini-btn--quiet:hover { border-color: #d8d5cc; background: #fdfcfa; }
.mini-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.logo-field { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.logo-preview {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: #1746b0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  flex: none;
}
.logo-preview.has-image { background-color: #fff; }

.tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.storage-line { font-size: 11px; color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }
.link-btn { display: inline-block; margin-top: 10px; }
.link-btn + .link-btn { margin-left: 14px; }
.link-btn--danger { color: #a32218; }
.link-btn--danger:hover { color: #7f1a12; }
.link-btn[hidden] { display: none; }

/* ---------- Stage ---------- */
.stage__note { max-width: 820px; margin: 14px auto 0; font-size: 11.5px; color: #6f6a5e; text-align: center; line-height: 1.5; }

.rep-empty { padding: 64px 22px; text-align: center; }
.rep-empty__tag { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rep-empty h2 { font-family: var(--font-display); font-size: 24px; margin: 8px 0 10px; letter-spacing: -0.03em; }
.rep-empty p { color: var(--muted); font-size: 13px; max-width: 44ch; margin: 0 auto; line-height: 1.6; }
.rep-empty__actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

.rep__logo--img { background: #fff !important; border: 1px solid #e6e8ef; overflow: hidden; padding: 4px; }
.rep__logo--img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- Dialogs ---------- */
body.is-modal { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__scrim { position: absolute; inset: 0; background: rgba(11, 18, 32, 0.55); }
.modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-lg);
  outline: none;
}
.modal__panel--sm { width: min(440px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal__head h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.03em; margin-top: 4px; }
.modal__close { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal__close:hover { color: var(--ink); }
.modal__lede { margin-top: 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.modal__text { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal__foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.modal__foot .hint { margin-top: 0; }

.toggle {
  display: inline-flex;
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px;
  gap: 2px;
  margin: 16px 0 18px;
}
.toggle button {
  border: 0;
  background: transparent;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.toggle button em { font-style: normal; font-size: 11px; color: #0b7a4b; margin-left: 4px; font-weight: 700; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fdfcfa;
}
.plan-card.is-picked { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: #fff; }
.plan-card__name { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.plan-card__price { line-height: 1.1; }
.plan-card__price b { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.03em; }
.plan-card__price span { font-size: 11.5px; color: var(--muted); }
.plan-card__sub { font-size: 11px; color: var(--muted); min-height: 15px; }
.plan-card__clients { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.plan-card .btn { margin-top: auto; }
.plan-card .btn--block { padding: 9px 10px; font-size: 12.5px; }

/* One-time Founding Lifetime offer inside the plan panel. */
.founding-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(120deg, #0b1220, #16233b 65%, #1c3157);
  color: #fff;
}
.founding-offer[hidden] { display: none; }
.founding-offer__tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
}
.founding-offer__line { margin-top: 4px; font-size: 12.5px; color: rgba(255, 255, 255, 0.78); }
.founding-offer__line b { font-size: 15px; color: #fff; }
.founding-offer .btn { flex: none; }

.license-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }.license-box h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.license-box .hint { margin-top: 10px; }
.license-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.license-row input {
  width: 100%;
  border: 1px solid #d8d5cc;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fdfcfa;
  color: var(--ink);
}
.license-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 91, 224, 0.12); background: #fff; }
.license-status { margin-top: 10px; font-size: 12.5px; min-height: 18px; color: var(--muted); line-height: 1.5; }
.license-status[data-tone="error"] { color: #a32218; }
.license-status[data-tone="ok"] { color: #0b7a4b; }
.license-current { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: #fbfaf7; }
.license-current__row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; }
.license-current__row span { color: var(--muted); }
.license-current__row b { font-weight: 600; word-break: break-all; text-align: right; }
.license-current .link-btn { margin-top: 8px; }

.btn--danger { --btn-bg: #a32218; --btn-fg: #fff; --btn-border: transparent; }
.btn--danger:hover { --btn-bg: #87160f; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .plans { grid-template-columns: 1fr; }
  .plan-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 10px; }
  .plan-card .btn { margin-top: 0; margin-left: auto; }
  .plan-card__clients { margin-bottom: 0; }
}

@media (max-width: 980px) {
  .appbar__right .btn--ghost { display: inline-flex; }
  .appbar__right .appbar__wide { display: none; }
  .trial-pill { font-size: 11.5px; padding: 6px 10px; }
  .client-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .client-item { flex: none; }
  .client-row { min-width: 168px; max-width: 220px; }
  .client-row__del { display: none; }
  .client-item .client-row { border-color: #e4e0d6; }
  .stage__note { padding: 0 12px; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal__panel { max-height: calc(100vh - 24px); border-radius: 16px 16px 12px 12px; }
}

@media (max-width: 620px) {
  .appbar { gap: 6px; padding: 0 10px; }
  .appbar__left { flex: 0 1 auto; min-width: 0; }
  .app-brand { font-size: 15px; }
  .appbar__right { gap: 6px; flex: 0 1 auto; min-width: 0; }
  .appbar__right .btn--sm { padding: 8px 10px; font-size: 12.5px; }
  .appbar__right #exportPdfTop { display: none; }
  .appbar__right .btn--ghost#licenseBtn { display: inline-flex; border-color: rgba(255,255,255,0.28); color: #fff; }
  .trial-pill { max-width: 164px; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; padding: 6px 9px; }
  .plans { grid-template-columns: 1fr; }
  .plan-card { flex-direction: column; align-items: stretch; }
  .plan-card .btn { margin-left: 0; margin-top: 6px; }
  .license-row { grid-template-columns: 1fr; }
  .license-row .btn { width: 100%; }
  .modal__panel { padding: 20px 16px 18px; }
  .modal__panel--sm { width: 100%; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .btn { width: 100%; }
}

@media (max-width: 400px) {
  .app-brand { font-size: 0; gap: 0; }
  .trial-pill { max-width: 150px; font-size: 11px; padding: 6px 8px; }
  .appbar__right .btn--sm { padding: 8px 9px; }
}

/* ---------- Print ---------- */
@media print {
  .stage__note,
  .modal,
  .trial-pill { display: none !important; }
  .rep-empty { display: none !important; }
}
