/* Agency dashboard additions. Everything else comes from legacy.css, shared with the main dashboard. */

/* ---------- Brand mark ---------- */

.agency-logo {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 22%;
}

/* An uploaded logo is never clipped: no rounded frame, and it keeps its own proportions. */
.agency-logo-image {
  overflow: visible;
  border-radius: 0;
}

.agency-logo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}

/* No logo uploaded (or it failed to load): a branded tile with the agency's initials. */
.agency-logo-placeholder {
  background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent)));
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth .aside .brand .agency-logo-placeholder {
  background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent)));
}

/* Same legacy.css override as the sidebar: it fixes any image in the login brand at 24px tall. */
.auth .aside .brand .agency-logo img {
  height: 100%;
}

.auth .aside .brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-sidebar-brand {
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.6rem 1.3rem;
}

/* legacy.css sizes any image inside .sidebar-brand to 26px tall with a bottom margin (it was made for the platform's own
   logo), which squeezed and offset an agency's logo. The logo sets its own height, so undo that here. */
.agency-sidebar-brand .agency-logo img {
  height: 100%;
  margin-bottom: 0;
}

.agency-sidebar-brand .brand-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  /* legacy.css pushes .brand-name up with an !important bottom margin (made for its own logo image). */
  margin-bottom: 0 !important;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* The aside (and its big logo) is hidden on small screens, so the form shows a mark of its own there. */
.agency-login-mark {
  margin-bottom: 18px;
}

@media (min-width: 941px) {
  .agency-login-mark {
    display: none;
  }
}

/* ---------- Sign-in form ---------- */

.agency-pw-wrap {
  position: relative;
}

.agency-pw-wrap .in {
  padding-right: 2.8rem;
}

.agency-pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.agency-pw-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.in[aria-invalid="true"] {
  border-color: var(--error);
}

.agency-field-error {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--error);
}

/* ---------- Dashboard ---------- */

.agency-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

.agency-hero-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.agency-hero-text b {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.agency-hero-text .sub {
  font-size: 0.86rem;
}

.agency-search {
  max-width: 320px;
  margin-bottom: 20px;
  border-radius: 99px;
}

@media (max-width: 560px) {
  .agency-search {
    max-width: none;
  }
}

/* ---------- Website cards ---------- */

.agency-website-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agency-website-thumb {
  height: 132px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  font-size: 1.5rem;
}

.agency-website-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.agency-website-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.agency-website-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 16px 16px 0 0;
}

.agency-website-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 0;
}

.agency-website-head b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-website-head .pill {
  margin-left: auto;
  flex-shrink: 0;
}

.agency-website-domain {
  margin: 3px 18px 0;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-website-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px 18px;
  font-size: 0.8rem;
}

.agency-website-visit {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.agency-website-visit:hover {
  text-decoration: underline;
}

.agency-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agency-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Website detail ---------- */

.agency-detail-wrap {
  overflow-wrap: anywhere;
}

.agency-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agency-inbox-search {
  max-width: 300px;
  border-radius: 99px;
}

@media (max-width: 560px) {
  .agency-inbox-search {
    max-width: none;
    flex: 1 1 100%;
  }
}
