.admin-shell {
  padding-bottom: 36px;
}

.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.text-button:hover {
  color: var(--cyan);
}

.admin-shell .brand {
  gap: 14px;
}

.admin-shell .brand-wordmark {
  width: min(360px, 48vw);
  height: auto;
}

.admin-brand-badge {
  align-self: center;
  padding: 7px 11px;
  border: 1px solid rgba(95, 35, 0, 0.2);
  border-radius: 999px;
  color: #4a1300;
  background: linear-gradient(145deg, rgba(255, 243, 190, 0.92), rgba(255, 189, 47, 0.72));
  box-shadow: 0 8px 18px rgba(100, 38, 0, 0.12);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-login {
  display: grid;
  min-height: calc(100vh - 132px);
  place-items: center;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(115deg, rgba(42, 23, 6, 0.035) 0 5px, transparent 5px 30px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 235, 176, 0.68)),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(22px, 5vw, 34px);
}

.login-card h1,
.dashboard-heading h1 {
  color: #4a1300;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  text-shadow:
    0 3px 0 rgba(255, 232, 136, 0.86),
    0 6px 0 rgba(110, 27, 0, 0.24),
    0 0 10px rgba(255, 196, 30, 0.28);
}

.login-card label,
.platform-form label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-card input,
.platform-form input,
.platform-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(98, 54, 7, 0.18);
  border-radius: 8px;
  outline: 0;
  padding: 0 13px;
  color: var(--text);
  background: rgba(255, 250, 240, 0.92);
}

.login-card input:focus,
.platform-form input:focus,
.platform-form select:focus {
  border-color: rgba(242, 109, 24, 0.72);
  box-shadow: 0 0 0 3px rgba(242, 109, 24, 0.14);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #3a1200;
  background: linear-gradient(180deg, #ffe267, #ffad10);
  box-shadow: 0 4px 10px rgba(65, 13, 0, 0.18);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  filter: brightness(1.06);
}

.login-card .generate-button {
  width: 100%;
  margin-top: 20px;
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.form-message.success {
  color: var(--lime);
}

.dashboard {
  padding: 36px 0 0;
}

.dashboard-heading {
  align-items: center;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
  padding: 12px;
  border: 2px solid rgba(255, 196, 30, 0.42);
  border-radius: 18px;
  background: rgba(62, 11, 17, 0.72);
  box-shadow: 0 16px 36px rgba(33, 5, 10, 0.2);
}

.admin-tab {
  min-height: 42px;
  border: 2px solid rgba(255, 232, 130, 0.42);
  border-radius: 999px;
  padding: 0 16px;
  color: #351001;
  background: linear-gradient(180deg, #ffe267, #ffad10);
  font-weight: 900;
}

.admin-tab.active {
  color: #fff8da;
  background: linear-gradient(135deg, #5f0000, #b42308, #ff9d10);
  box-shadow: 0 0 22px rgba(255, 173, 16, 0.36);
}

.social-editor {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 16px;
  border: 2px solid rgba(255, 196, 30, 0.34);
  border-radius: 16px;
  background: rgba(62, 11, 17, 0.08);
}

.social-link-form {
  padding: 0;
}

.compact-list {
  margin-top: 12px;
}

.compact-row {
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
}

.platform-form {
  padding: 20px;
  margin: 24px 0;
}

.music-form,
.settings-form {
  margin: 24px 0;
  overflow: hidden;
}

.compact-header {
  align-items: center;
}

.compact-header .eyebrow {
  margin-bottom: 6px;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

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

.music-grid {
  padding: 0 20px 4px;
}

.current-source {
  align-self: center;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding: 0 20px 20px;
}

.inline-actions {
  align-items: center;
  margin-top: 10px;
  padding: 0;
}

.import-panel {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.import-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.import-panel textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(98, 54, 7, 0.18);
  border-radius: 8px;
  outline: 0;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 250, 240, 0.92);
}

.table-card {
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.small-action {
  min-height: 42px;
  min-width: 0;
  padding: 0 14px;
}

.table-header h2 {
  font-size: 1.2rem;
}

.table-header span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.platform-table {
  display: grid;
}

.platform-row {
  display: grid;
  grid-template-columns: 64px minmax(180px, 1.5fr) minmax(130px, 0.9fr) 90px 86px 170px;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(98, 54, 7, 0.12);
}

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

.platform-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 8px;
  color: #05070e;
  background:
    repeating-linear-gradient(115deg, rgba(42, 23, 6, 0.16) 0 5px, transparent 5px 20px),
    linear-gradient(135deg, var(--cyan), var(--pink));
  font-weight: 900;
}

.platform-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-title strong,
.row-title a {
  display: block;
}

.row-title a {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  color: #8a4306;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-muted {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-tags span {
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid rgba(98, 54, 7, 0.16);
  border-radius: 999px;
  color: #603507;
  background: rgba(255, 226, 143, 0.58);
  font-size: 0.76rem;
  font-weight: 900;
}

.status-pill {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: #2d6b1f;
  background: rgba(115, 183, 52, 0.14);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill.inactive {
  color: var(--danger);
  background: rgba(255, 93, 115, 0.12);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.icon-action {
  min-height: 38px;
  border: 1px solid rgba(98, 54, 7, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 250, 240, 0.72);
  font-weight: 800;
}

.icon-action.danger {
  color: var(--danger);
}

@media (max-width: 980px) {
  .form-grid,
  .platform-row {
    grid-template-columns: 1fr;
  }

  .platform-row {
    gap: 8px;
  }

  .row-actions {
    margin-top: 8px;
  }

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

/* Admin soft polish pass */
.admin-shell {
  width: min(100% - 28px, 1240px);
}

.admin-card {
  border: 1px solid rgba(98, 54, 7, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 237, 184, 0.76)),
    var(--panel);
  box-shadow: 0 18px 42px rgba(46, 9, 3, 0.16);
}

.login-card {
  box-shadow: 0 24px 60px rgba(46, 9, 3, 0.2);
}

.login-card h1,
.dashboard-heading h1 {
  color: #3d1306;
  text-shadow: 0 2px 0 rgba(255, 232, 136, 0.74), 0 12px 28px rgba(82, 27, 6, 0.18);
}

.login-card label,
.platform-form label,
.import-panel label {
  color: #54230a;
}

.login-card input,
.platform-form input,
.platform-form select,
.platform-form textarea,
.import-panel textarea {
  border: 1px solid rgba(98, 54, 7, 0.16);
  border-radius: 10px;
  background: rgba(255, 251, 239, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-card input:focus,
.platform-form input:focus,
.platform-form select:focus,
.platform-form textarea:focus,
.import-panel textarea:focus {
  border-color: rgba(242, 109, 24, 0.62);
  box-shadow: 0 0 0 3px rgba(242, 109, 24, 0.12);
}

.admin-tabs {
  position: sticky;
  top: 14px;
  z-index: 8;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 210, 71, 0.28);
  border-radius: 16px;
  background: rgba(58, 17, 9, 0.74);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(33, 5, 10, 0.16);
}

.admin-tab {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  color: #3a1200;
  background: linear-gradient(180deg, #ffe477, #f5a916);
  box-shadow: 0 8px 18px rgba(42, 8, 0, 0.12);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.admin-tab:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.admin-tab.active {
  color: #fff7dc;
  background: linear-gradient(180deg, #853019, #421309);
  box-shadow: 0 0 0 2px rgba(255, 210, 71, 0.22), 0 12px 24px rgba(65, 13, 0, 0.18);
}

.platform-form,
.music-form,
.settings-form {
  margin: 18px 0;
}

.platform-form {
  padding: 18px;
}

.form-grid {
  gap: 12px;
}

.form-actions {
  padding: 0 18px 18px;
}

.generate-button,
.category-button,
.small-action,
.icon-action,
.password-toggle {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(65, 13, 0, 0.12);
}

.generate-button,
.small-action {
  background: linear-gradient(180deg, #ffe477, #f5a916);
}

.category-button,
.icon-action {
  background: rgba(255, 251, 239, 0.86);
}

.table-card {
  border-radius: 16px;
}

.table-header {
  background: rgba(255, 238, 178, 0.36);
}

.table-header h2 {
  color: #3d1306;
}

.platform-row {
  grid-template-columns: 58px minmax(170px, 1.6fr) minmax(120px, 0.8fr) 86px 78px 158px;
  padding: 14px 18px;
  transition: background 160ms ease;
}

.platform-row:hover {
  background: rgba(255, 238, 178, 0.28);
}

.platform-logo {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(98, 54, 7, 0.12);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffe477, #ff8a22);
}

.row-title strong {
  color: #351001;
}

.row-muted,
.table-header span,
.current-source {
  color: #6f3106;
}

.row-tags span,
.status-pill {
  border: 0;
  background: rgba(255, 226, 143, 0.58);
}

.status-pill {
  color: #22703a;
}

.status-pill.inactive {
  color: #a72d1c;
  background: rgba(201, 59, 34, 0.12);
}

.social-editor {
  border: 1px solid rgba(98, 54, 7, 0.13);
  border-radius: 14px;
  background: rgba(255, 238, 178, 0.28);
}

.compact-row {
  border-radius: 12px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 14px;
}

.analytics-card {
  min-height: 110px;
  padding: 18px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.5), transparent 28%),
    linear-gradient(145deg, #fff3bd, #ffb313);
  box-shadow: inset 0 0 0 1px rgba(111, 55, 0, 0.16), 0 12px 22px rgba(107, 52, 0, 0.12);
}

.analytics-card span,
.analytics-date {
  display: block;
  color: #6a2800;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.analytics-card strong {
  display: block;
  margin-top: 8px;
  color: #3d1200;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.analytics-date {
  padding: 0 18px 12px;
}

.analytics-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.analytics-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff6c8;
  background: linear-gradient(145deg, #4b1700, #a54300);
  font-weight: 950;
}

.analytics-switch {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px solid rgba(98, 54, 7, 0.18);
  border-radius: 16px;
  background: rgba(255, 238, 178, 0.32);
}

.permission-box legend {
  padding: 0 8px;
  color: #5c1d00;
  font-weight: 950;
}

.permission-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #431500;
  background: rgba(255, 255, 255, 0.42);
  font-weight: 800;
}

.permission-box input {
  width: 18px;
  height: 18px;
  accent-color: #b95d00;
}

@media (max-width: 980px) {
  .admin-shell {
    width: min(100% - 18px, 720px);
  }

  .admin-tabs {
    position: static;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .admin-tab {
    flex: 0 0 auto;
  }

  .platform-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .platform-row > *:not(.platform-logo):not(.row-title) {
    grid-column: 2;
  }

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

  .analytics-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

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

  .row-actions {
    flex-wrap: wrap;
  }

  .icon-action {
    flex: 1 1 120px;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 20px;
  }

  .login-card h1,
  .dashboard-heading h1 {
    font-size: clamp(1.9rem, 14vw, 3rem);
  }

  .table-header {
    padding: 16px;
  }

  .platform-form,
  .music-grid,
  .import-panel {
    padding-inline: 14px;
  }
}
