/* --------------------------------------------------------------------------
   Schermate di caricamento e accesso
   -------------------------------------------------------------------------- */

.admin-body {
  background: #10091a;
}

.admin-loading,
.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: 22px;
  place-items: center;
}

.admin-loading {
  gap: 14px;
  align-content: center;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-loading p {
  margin: 0;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(100%, 440px);
  padding: 30px;
  border-radius: 30px;
  text-align: center;
}

.back-link {
  display: flex;
  justify-content: flex-start;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.back-link:hover {
  color: white;
}

.login-logo {
  display: block;
  width: 94px;
  height: 94px;
  margin: 28px auto 20px;
  border: 3px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
  object-fit: cover;
}

.login-card h1 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: -0.05em;
}

.login-card > p {
  max-width: 340px;
  margin: 12px auto 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.discord-button {
  display: grid;
  grid-template-columns: 25px 1fr 18px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #5865f2;
  box-shadow:
    0 15px 35px rgba(88, 101, 242, 0.26),
    inset 0 1px rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: left;
  transition: transform 180ms ease, background 180ms ease;
}

.discord-button:hover {
  background: #6975f5;
  transform: translateY(-2px);
}

.discord-button svg {
  width: 25px;
  fill: currentColor;
}

.login-card > small {
  display: block;
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.62rem;
}

.inline-error {
  padding: 11px 13px;
  border: 1px solid rgba(255, 102, 117, 0.28);
  border-radius: 12px;
  color: #ffb1b9;
  background: rgba(255, 72, 93, 0.08);
  font-size: 0.72rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Struttura principale del pannello
   -------------------------------------------------------------------------- */

.admin-dashboard {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: 240px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  height: 100svh;
  flex-direction: column;
  padding: 24px 17px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  background:
    linear-gradient(180deg, rgba(123, 53, 242, 0.06), transparent 30%),
    #130c1d;
}

.admin-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 4px 6px 26px;
}

.admin-brand img {
  width: 39px;
  height: 39px;
  border-radius: 12px;
}

.admin-brand span,
.admin-user__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.admin-brand strong {
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.admin-brand small,
.admin-user small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.58rem;
}

.sidebar-navigation {
  display: grid;
  gap: 5px;
}

.sidebar-navigation button {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.42);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.sidebar-navigation button > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-navigation button:hover,
.sidebar-navigation button.is-active {
  color: white;
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-navigation button.is-active {
  border-color: rgba(153, 90, 250, 0.23);
  background: linear-gradient(90deg, rgba(123, 53, 242, 0.2), rgba(123, 53, 242, 0.04));
}

.sidebar-navigation button.is-active > span {
  color: #cda8ff;
  background: rgba(123, 53, 242, 0.22);
}

.admin-user {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 9px;
  align-items: center;
  margin-top: auto;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-user__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-weight: 800;
}

.admin-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user strong {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user .icon-button {
  width: 30px;
  height: 30px;
}

.admin-workspace {
  min-width: 0;
  padding: 34px clamp(22px, 4vw, 58px) 60px;
}

.workspace-header {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto 30px;
}

.workspace-header h1 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.045em;
}

.workspace-layout {
  display: grid;
  max-width: 1180px;
  grid-template-columns: minmax(480px, 1fr) minmax(285px, 340px);
  gap: clamp(28px, 4vw, 54px);
  align-items: start;
  margin: 0 auto;
}

.editor-column,
.editor-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Moduli e sezioni editor
   -------------------------------------------------------------------------- */

.editor-section {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.025);
}

.editor-section > header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.018);
}

.section-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #c49aff;
  background: rgba(123, 53, 242, 0.14);
}

.editor-section h2,
.editor-heading h2 {
  margin: 0;
  font-size: 0.9rem;
}

.editor-section p,
.editor-heading p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1.5;
}

.editor-section__body {
  display: grid;
  gap: 16px;
  padding: 19px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span,
.color-field > span,
.range-field strong {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 750;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  outline: none;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(6, 3, 10, 0.3);
  font-size: 0.75rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input,
.field select {
  height: 43px;
  padding: 0 12px;
}

.field textarea {
  min-height: 86px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--primary) 65%, white 5%);
  box-shadow: 0 0 0 3px rgba(123, 53, 242, 0.12);
}

.field input:disabled,
.field select:disabled,
.color-field input:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.42;
}

.field select option {
  background: #1c1327;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.color-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.color-field input[type="color"] {
  width: 100%;
  height: 43px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(6, 3, 10, 0.3);
  cursor: pointer;
}

.range-field {
  display: grid;
  gap: 10px;
}

.range-field > span {
  display: flex;
  justify-content: space-between;
}

.range-field output {
  color: #c397ff;
  font-size: 0.68rem;
  font-weight: 800;
}

.range-field input {
  width: 100%;
  accent-color: var(--primary);
}

.form-submit {
  justify-self: end;
  min-width: 150px;
}

.editor-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 1px 11px;
}

/* --------------------------------------------------------------------------
   Lista contenuti
   -------------------------------------------------------------------------- */

.items-list {
  display: grid;
  gap: 10px;
}

.editor-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.028);
  transition: opacity 180ms ease, border-color 180ms ease;
}

.editor-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.editor-item.is-hidden {
  opacity: 0.48;
}

.editor-item__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(123, 53, 242, 0.14);
  font-size: 1.1rem;
}

.editor-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-item__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.editor-item__copy small {
  color: #b981ff;
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.editor-item__copy strong,
.editor-item__copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-item__copy strong {
  font-size: 0.76rem;
}

.editor-item__copy span {
  color: var(--text-soft);
  font-size: 0.64rem;
}

.editor-item__actions {
  display: flex;
  gap: 4px;
}

.editor-item__actions .icon-button,
.editor-item > .icon-button {
  width: 32px;
  height: 32px;
  font-size: 0.84rem;
}

.editor-item__actions button:disabled {
  cursor: default;
  opacity: 0.2;
}

.empty-state {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  color: var(--text-soft);
  text-align: center;
}

.empty-state strong {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.68rem;
}

/* --------------------------------------------------------------------------
   Libreria immagini
   -------------------------------------------------------------------------- */

.upload-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 17px;
  border: 1px dashed rgba(171, 112, 255, 0.34);
  border-radius: 18px;
  background: rgba(123, 53, 242, 0.045);
}

.upload-box label {
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 2px 12px;
  align-items: center;
  cursor: pointer;
}

.upload-icon {
  display: grid;
  width: 45px;
  height: 45px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 13px;
  color: #c59cff;
  background: rgba(123, 53, 242, 0.16);
  font-size: 1.2rem;
}

.upload-box strong {
  font-size: 0.75rem;
}

.upload-box small {
  color: var(--text-soft);
  font-size: 0.62rem;
}

.upload-box input[type="file"] {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 0.68rem;
}

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

.asset-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.asset-card img {
  width: 64px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.asset-card > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.asset-card strong {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.58rem;
}

/* --------------------------------------------------------------------------
   Anteprima telefono
   -------------------------------------------------------------------------- */

.preview-column {
  position: sticky;
  top: 28px;
}

.preview-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.preview-phone {
  width: min(100%, 340px);
  height: min(680px, calc(100vh - 95px));
  min-height: 520px;
  margin: 0 auto;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 40px;
  background: #2b2331;
  box-shadow:
    0 38px 90px rgba(0, 0, 0, 0.38),
    inset 0 1px rgba(255, 255, 255, 0.18);
}

.preview-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 32px;
  scrollbar-width: none;
}

.preview-screen::-webkit-scrollbar {
  display: none;
}

.preview-screen::after {
  position: absolute;
  z-index: 20;
  top: 8px;
  left: 50%;
  width: 72px;
  height: 20px;
  content: "";
  border-radius: 20px;
  background: #100b15;
  transform: translateX(-50%);
}

.preview-screen .color-orb {
  width: 280px;
  filter: blur(55px);
}

.preview-screen .background-grid {
  background-size: 38px 38px;
}

.preview-screen .background-photo {
  z-index: 0;
}

.preview-screen .color-orb {
  z-index: 1;
}

.preview-screen .background-grid,
.preview-screen .background-ribbon {
  z-index: 2;
}

.preview-screen .background-ribbon {
  width: 280px;
  height: 76px;
}

#preview-profile {
  position: relative;
  z-index: 3;
}

/* --------------------------------------------------------------------------
   Finestra modifica contenuto
   -------------------------------------------------------------------------- */

.item-dialog {
  width: min(590px, calc(100% - 32px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  color: var(--text-main);
  background: #1b1225;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.58);
}

.item-dialog::backdrop {
  background: rgba(5, 2, 9, 0.74);
  backdrop-filter: blur(9px);
}

.item-dialog form {
  display: grid;
  gap: 15px;
  padding: 21px;
}

.item-dialog header,
.item-dialog footer {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.item-dialog header {
  margin-bottom: 2px;
}

.item-dialog h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.item-dialog footer {
  justify-content: flex-end;
  margin-top: 5px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.color-field--dialog input[type="color"] {
  height: 43px;
}

.visibility-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.visibility-field > span {
  display: flex;
  flex-direction: column;
}

.visibility-field strong {
  font-size: 0.72rem;
}

.visibility-field small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.61rem;
}

.visibility-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.mobile-navigation {
  display: none;
}

.mobile-logout {
  display: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .admin-dashboard {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .workspace-layout {
    grid-template-columns: minmax(420px, 1fr) 285px;
    gap: 26px;
  }

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

@media (max-width: 820px) {
  .admin-dashboard {
    display: block;
  }

  .admin-sidebar,
  .preview-column {
    display: none;
  }

  .admin-workspace {
    padding: 24px 16px 100px;
  }

  .workspace-header {
    margin-bottom: 22px;
  }

  .workspace-header .section-kicker {
    display: none;
  }

  .workspace-header .secondary-button {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .workspace-header .secondary-button span {
    font-size: 1rem;
  }

  .workspace-header .mobile-logout {
    display: inline-flex;
  }

  .workspace-layout {
    display: block;
  }

  .mobile-navigation {
    position: fixed;
    z-index: 40;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px;
    background: rgba(25, 16, 35, 0.9);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(22px);
  }

  .mobile-navigation button {
    display: flex;
    min-height: 50px;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    color: var(--text-soft);
    background: transparent;
    font-size: 0.8rem;
  }

  .mobile-navigation button span {
    font-size: 0.58rem;
    font-weight: 750;
  }

  .mobile-navigation button.is-active {
    color: white;
    background: rgba(123, 53, 242, 0.24);
  }

  .toast {
    right: 16px;
    bottom: 82px;
    left: 16px;
    text-align: center;
  }
}

@media (max-width: 580px) {
  .login-card {
    padding: 24px 20px;
    border-radius: 25px;
  }

  .form-grid--two,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .editor-heading {
    align-items: flex-start;
  }

  .editor-heading .primary-button {
    padding: 0 12px;
    white-space: nowrap;
  }

  .editor-item {
    grid-template-columns: 44px minmax(0, 1fr) 34px;
    gap: 9px;
  }

  .editor-item__icon {
    width: 44px;
    height: 44px;
  }

  .editor-item__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
  }

  .editor-item__actions .icon-button {
    width: 38px;
  }

  .upload-box {
    grid-template-columns: 1fr;
  }

  .upload-box .primary-button {
    width: 100%;
  }

  .item-dialog {
    width: 100%;
    max-height: 94vh;
    max-height: 94svh;
    margin: auto 0 0;
    border-radius: 23px 23px 0 0;
  }
}

/* --------------------------------------------------------------------------
   Editor avanzato, social e statistiche
   -------------------------------------------------------------------------- */

.form-grid--three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.social-editor-list {
  display: grid;
  gap: 9px;
  margin-bottom: 13px;
}

.social-editor-row {
  display: grid;
  grid-template-columns: 115px minmax(100px, 0.7fr) minmax(180px, 1.4fr) 120px 24px 34px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.social-editor-row input,
.social-editor-row select {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(12, 7, 19, 0.46);
  font-size: 0.66rem;
}

.social-editor-row .social-visible {
  height: 18px;
  accent-color: var(--primary);
}

.editor-item__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.editor-item__badges small {
  padding: 3px 6px;
  border: 1px solid rgba(171, 112, 255, 0.2);
  border-radius: 999px;
  color: #d7bdff;
  background: rgba(123, 53, 242, 0.1);
  font-size: 0.5rem;
  line-height: 1;
}

.editor-item.is-group {
  border-color: color-mix(in srgb, var(--secondary) 34%, transparent);
  background: linear-gradient(135deg, rgba(255, 138, 52, 0.08), rgba(123, 53, 242, 0.04));
}

.editor-item.is-group-member {
  width: calc(100% - 22px);
  margin-left: 22px;
  border-left: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
}

.editor-item__icon svg {
  width: 22px;
  height: 22px;
}

.item-dialog {
  width: min(720px, calc(100% - 32px));
}

.item-options {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.item-options summary {
  padding: 13px 15px;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  list-style-position: inside;
}

.item-options[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(123, 53, 242, 0.07);
}

.item-options__body {
  display: grid;
  gap: 13px;
  padding: 15px;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
  max-height: 154px;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(7, 4, 12, 0.28);
}

.icon-search-field {
  margin-top: 2px;
}

.icon-picker > .empty-state {
  grid-column: 1 / -1;
  min-height: 90px;
}

.icon-picker button {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-picker button:hover,
.icon-picker button.is-selected {
  border-color: color-mix(in srgb, var(--secondary) 65%, white);
  color: white;
  background: color-mix(in srgb, var(--primary) 24%, transparent);
  transform: translateY(-2px);
}

.icon-picker svg {
  width: 21px;
  height: 21px;
}

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

.stats-summary article,
.stats-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(25, 15, 36, 0.48);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.stats-summary article {
  display: flex;
  min-height: 105px;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px;
}

.stats-summary small {
  color: var(--text-soft);
  font-size: 0.64rem;
  font-weight: 700;
}

.stats-summary strong {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.stats-summary article > span {
  color: var(--text-soft);
  font-size: 0.56rem;
}

.stats-summary__live {
  border-color: rgba(98, 230, 168, 0.25) !important;
  background:
    radial-gradient(circle at 90% 0, rgba(98, 230, 168, 0.14), transparent 48%),
    rgba(25, 15, 36, 0.55) !important;
}

.stats-summary__live small {
  color: #9cf1c7;
}

.stats-summary__live small i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(98, 230, 168, 0.75);
  animation: live-dot 1.8s ease-in-out infinite;
}

.analytics-filters {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.analytics-filters label,
.stats-metric-select {
  display: grid;
  gap: 5px;
}

.analytics-filters label span,
.stats-metric-select span {
  color: var(--text-soft);
  font-size: 0.56rem;
  font-weight: 750;
}

.analytics-filters input,
.stats-metric-select select {
  height: 39px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(12, 7, 19, 0.48);
  font-size: 0.65rem;
}

.analytics-presets {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 39px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.analytics-presets button {
  height: 31px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 750;
}

.analytics-presets button.is-active {
  color: white;
  background: rgba(123, 53, 242, 0.3);
}

.stats-card {
  margin-bottom: 14px;
  padding: 18px;
}

.stats-card h3 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.stats-card__header {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stats-card__header h3 {
  margin-bottom: 4px;
}

.stats-card__header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.62rem;
}

.analytics-chart-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 100%, rgba(123, 53, 242, 0.09), transparent 58%),
    rgba(7, 4, 12, 0.28);
}

#stats-chart {
  display: block;
  width: 100%;
  min-width: 520px;
  height: 250px;
  overflow: visible;
}

#stats-chart .chart-grid-line {
  stroke: rgba(255, 255, 255, 0.075);
  stroke-width: 1;
}

#stats-chart .chart-axis-label,
#stats-chart .chart-date-label {
  fill: rgba(255, 255, 255, 0.38);
  font: 500 10px var(--font-body);
}

#stats-chart .chart-area {
  fill: color-mix(in srgb, var(--primary) 18%, transparent);
  animation: chart-area-in 650ms ease-out both;
}

#stats-chart .chart-line {
  fill: none;
  stroke: url(#analytics-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--secondary) 35%, transparent));
  animation: chart-line-in 850ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#stats-chart .chart-point {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: chart-point-in 420ms 500ms ease-out both;
}

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

.analytics-ranking {
  display: grid;
  gap: 12px;
}

.analytics-ranking article {
  display: grid;
  gap: 7px;
}

.analytics-ranking article > div:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.analytics-ranking strong {
  font-size: 0.66rem;
}

.analytics-ranking span {
  color: var(--text-soft);
  font-size: 0.52rem;
  text-align: right;
}

.analytics-ranking article > div:last-child {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.analytics-ranking i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.analytics-note {
  margin: -5px 0 14px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 184, 99, 0.18);
  border-radius: 10px;
  color: #ffc889;
  background: rgba(255, 138, 52, 0.07);
  font-size: 0.55rem;
  line-height: 1.5;
}

.stats-links {
  display: grid;
  gap: 10px;
}

.stats-links article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
}

.stats-links strong,
.stats-links span {
  font-size: 0.68rem;
}

.stats-links span {
  color: var(--text-soft);
}

.stats-links article > div {
  height: 6px;
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.stats-links i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

@media (max-width: 1120px) {
  .social-editor-row {
    grid-template-columns: 110px 1fr 1.5fr 34px;
  }

  .social-editor-row .social-icon,
  .social-editor-row .social-visible {
    display: none;
  }
}

@keyframes live-dot {
  50% { opacity: 0.45; transform: scale(0.75); }
}

@keyframes chart-line-in {
  from { stroke-dashoffset: 1; }
}

@keyframes chart-area-in {
  from { opacity: 0; }
}

@keyframes chart-point-in {
  from { opacity: 0; transform: scale(0); }
}

@media (max-width: 820px) {
  .mobile-navigation {
    grid-template-columns: repeat(4, 1fr);
  }

  .analytics-filters {
    grid-template-columns: 1fr 1fr auto;
  }

  .analytics-presets {
    grid-column: 1 / -1;
  }
}

@media (max-width: 580px) {
  .form-grid--three,
  .analytics-breakdowns {
    grid-template-columns: 1fr;
  }

  .stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-card__header {
    flex-direction: column;
  }

  .analytics-filters {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-filters .primary-button {
    grid-column: 1 / -1;
  }

  .icon-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .social-editor-row {
    grid-template-columns: 1fr 34px;
  }

  .social-editor-row .social-platform,
  .social-editor-row .social-label,
  .social-editor-row .social-url {
    grid-column: 1 / -1;
  }

  .social-editor-row .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  .stats-summary article {
    min-height: 82px;
  }

  .admin-workspace {
    padding-right: 10px;
    padding-left: 10px;
  }

  .workspace-header {
    gap: 10px;
    align-items: center;
  }

  .workspace-header h1 {
    font-size: 1.45rem;
  }

  .editor-section__body {
    padding: 14px;
  }

  .item-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100svh - 8px);
    margin: auto 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .item-dialog form {
    gap: 13px;
    padding: 16px 13px max(18px, env(safe-area-inset-bottom));
  }

  .item-dialog header {
    position: sticky;
    z-index: 2;
    top: -16px;
    margin: -16px -13px 0;
    padding: 15px 13px 12px;
    background: rgba(27, 18, 37, 0.96);
    backdrop-filter: blur(18px);
  }

  .item-dialog footer {
    position: sticky;
    z-index: 2;
    bottom: -18px;
    margin: 3px -13px 0;
    padding: 12px 13px max(18px, env(safe-area-inset-bottom));
    background: rgba(27, 18, 37, 0.96);
    backdrop-filter: blur(18px);
  }

  .item-dialog footer button {
    min-width: 0;
    flex: 1;
  }

  .social-editor-row {
    grid-template-columns: minmax(0, 1fr) auto 38px;
  }

  .social-editor-row .social-platform,
  .social-editor-row .social-label,
  .social-editor-row .social-url {
    display: block;
    grid-column: 1 / -1;
  }

  .social-editor-row .social-icon {
    display: block;
    grid-column: 1;
  }

  .social-editor-row .social-visible {
    display: block;
    grid-column: 2;
  }

  .social-editor-row .icon-button {
    grid-column: 3;
    grid-row: auto;
  }

  .analytics-chart-wrap {
    margin-inline: -8px;
    padding: 4px 8px 8px;
  }

}
