/* Rainbow Radio Wales — admin station control room (matches the website) */

:root {
  --purple: #9900ff;
  --purple-dark: #7a00d0;
  --purple-soft: #f5ebff;
  --blue: #1b2fd6;
  --ink: #14151a;
  --copy: #41454e;
  --muted: #71757f;
  --bg: #fbfbfd;
  --card: #ffffff;
  --soft: #f4f5fa;
  --line: #e4e6ed;
  --line-strong: #d5d8e2;
  --danger: #c0284a;
  --ok: #0f8a52;
  --radius: 14px;
  --radius-lg: 20px;
  --display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.12);
  --side: 262px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--copy);
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 26px;
  font-weight: 800;
}

h2 {
  font-size: 19px;
  font-weight: 700;
}

h3 {
  font-size: 16px;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

code {
  background: var(--soft);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
}

.rainbow-rule {
  height: 5px;
  background: linear-gradient(90deg, #ff3d7f, #ff8a3d, #ffd83d, #4bdc7a, #3dd2ff, #7a5cff, #ff3d7f);
}

/* ------------------------------------------------------------ shell */

.admin-shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: calc(100vh - 5px);
}

.admin-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 5px);
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 22px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 40;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid var(--line);
}

.side-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  flex: none;
}

.side-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.side-brand-text {
  display: grid;
  line-height: 1.2;
}

.side-brand-text strong {
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}

.side-brand-text em {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 16px;
  flex: 1;
}

.side-group {
  display: grid;
  gap: 3px;
}

.side-label {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9a9eaa;
  padding: 0 10px 5px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--copy);
  font-weight: 500;
  font-size: 14.5px;
  transition: background 0.16s ease, color 0.16s ease;
}

.side-link svg {
  color: #8c909c;
  flex: none;
}

.side-link:hover {
  background: var(--soft);
  color: var(--ink);
}

.side-link.is-active {
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 700;
}

.side-link.is-active svg {
  color: var(--purple);
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 3px;
}

.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(20px, 3vw, 38px) 14px;
  background: rgba(251, 251, 253, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
}

.admin-heading {
  min-width: 0;
}

.admin-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 4px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.admin-content {
  padding: 6px clamp(20px, 3vw, 38px) 60px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.admin-notice {
  margin: 0 clamp(20px, 3vw, 38px) 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ebfaf1;
  border: 1px solid #bfeed4;
  color: #0b6b40;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 500;
}

.admin-notice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

/* ------------------------------------------------------------ buttons */

.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 17px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
  white-space: nowrap;
}

.btn-admin:hover {
  border-color: #b9bdcc;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.btn-admin-primary {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.btn-admin-primary:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  box-shadow: 0 8px 20px rgba(153, 0, 255, 0.28);
}

.btn-admin-danger {
  color: var(--danger);
  border-color: #f0c2cd;
  background: #fff7f9;
}

.btn-admin-danger:hover {
  background: #ffeef2;
  border-color: #e39fb0;
}

.btn-admin-xs {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.admin-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  padding: 11px 10px;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
}

.admin-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

/* ------------------------------------------------------------ panels */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 17.5px;
}

.panel-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

.panel-intro {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  max-width: 70ch;
}

.panel-link {
  color: var(--purple);
  font-weight: 600;
  font-size: 13.5px;
}

.panel-link:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 5px;
}

/* ------------------------------------------------------------ dashboard */

.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 22px;
  background: linear-gradient(115deg, #fff 0%, #f7f1ff 55%, #eef2ff 100%);
  border: 1px solid #e8e0f8;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

.dash-hero-copy h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 6px 0 8px;
}

.dash-hero-copy p {
  color: var(--copy);
  max-width: 52ch;
  font-size: 14.5px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--purple);
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.dash-hero-live {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.dash-hero-live strong {
  font-family: var(--display);
  font-size: 17px;
  color: var(--ink);
}

.dash-hero-live span {
  font-size: 13px;
  color: var(--muted);
}

.dash-hero-live .text-link {
  color: var(--purple);
  font-weight: 600;
  font-size: 13px;
  margin-top: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
}

.pill-live {
  background: #ffe9f1;
  color: #c3125a;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2d6f;
  box-shadow: 0 0 0 0 rgba(255, 45, 111, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(255, 45, 111, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 45, 111, 0);
  }
}

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

.panel-span {
  grid-column: 1 / -1;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 2px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
  background: #fff;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.stat-value {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.dash-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.dash-list li:last-child {
  border-bottom: 0;
}

.dash-list strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.dash-list span {
  font-size: 12.5px;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.layout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  counter-reset: layout;
}

.layout-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.layout-list li.is-hidden {
  opacity: 0.5;
  text-decoration: line-through;
}

/* ------------------------------------------------------------ status + badges */

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-published {
  background: #e9f9f0;
  color: #0b7a45;
}

.status-draft {
  background: #f1f2f6;
  color: #636776;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--purple-soft);
  color: var(--purple-dark);
  white-space: nowrap;
}

.badge-soft {
  display: inline-flex;
  margin-left: 8px;
  background: #fff5d6;
  color: #8a5b00;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--copy);
}

.chip span {
  background: var(--soft);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  color: var(--muted);
}

.chip-link:hover {
  border-color: var(--purple);
  color: var(--purple-dark);
}

.chip-link.is-active {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple-dark);
}

/* ------------------------------------------------------------ homepage builder */

.component-list {
  display: grid;
  gap: 12px;
}

.component-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.component-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

.component-card.is-hidden {
  background: #fcfcfe;
  opacity: 0.72;
}

.component-order {
  display: grid;
  gap: 5px;
  align-content: start;
}

.order-btn {
  width: 30px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}

.order-btn:hover:not(:disabled) {
  border-color: var(--purple);
  color: var(--purple);
}

.order-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.component-main {
  min-width: 0;
}

.component-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.component-main h3 {
  font-size: 15.5px;
  margin-bottom: 2px;
}

.component-preview {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.component-controls {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.component-controls form {
  margin: 0;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px dashed #cfc3e8;
  background: #faf7ff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.hero-note strong {
  color: var(--ink);
  font-size: 14px;
}

.hero-note p {
  font-size: 12.5px;
  color: var(--muted);
}

.hero-note .btn-admin {
  margin-left: auto;
}

.empty-panel {
  text-align: center;
  padding: 42px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-panel h3 {
  margin-bottom: 6px;
}

.empty-panel p {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 16px;
  font-size: 14px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.type-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.type-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(153, 0, 255, 0.12);
}

.type-card strong {
  font-family: var(--display);
  font-size: 15px;
  color: var(--ink);
}

.type-card p {
  font-size: 13px;
  color: var(--muted);
}

.type-card .text-link {
  color: var(--purple);
  font-weight: 600;
  font-size: 12.5px;
  margin-top: 4px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px;
  align-items: start;
}

/* ------------------------------------------------------------ tables */

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

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

.admin-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--soft);
  padding: 11px 14px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-table td {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: #fcfcff;
}

.row-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 14.5px;
}

.row-title:hover {
  color: var(--purple);
}

.row-sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.cell-meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions form {
  display: inline-block;
  margin-left: 6px;
}

.cell-empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 14px;
}

/* ------------------------------------------------------------ forms */

.admin-form {
  display: grid;
  gap: 18px;
}

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

.field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='url'],
.field input[type='number'],
.field input[type='date'],
.field input[type='time'],
.field input[type='password'],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(153, 0, 255, 0.12);
}

.code-input {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px !important;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
  cursor: pointer;
}

.check-field input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--purple);
  flex: none;
}

.check-field span {
  display: grid;
  font-size: 13.5px;
  color: var(--ink);
}

.check-field em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.image-field {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfcfe;
}

.image-preview {
  width: 132px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-controls {
  display: grid;
  gap: 8px;
  align-content: start;
}

.image-controls input[type='file'] {
  font-size: 12.5px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.form-actions-sticky {
  position: sticky;
  bottom: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.form-error {
  background: #fff3f5;
  border: 1px solid #f3c3ce;
  color: #a5183a;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.settings-group {
  margin-bottom: 0;
}

/* ------------------------------------------------------------ media */

.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fcfcfe;
}

.upload-form input[type='file'] {
  font-size: 13.5px;
  color: var(--copy);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.media-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.media-item img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  background: var(--soft);
}

.media-item figcaption {
  padding: 10px 11px;
  display: grid;
  gap: 7px;
}

.media-name {
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-path {
  width: 100%;
  font-size: 11.5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--muted);
  background: var(--soft);
}

/* ------------------------------------------------------------ auth */

.auth-body {
  background: radial-gradient(1200px 600px at 50% -10%, #f4e9ff 0%, #fbfbfd 55%);
  min-height: 100vh;
}

.auth-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(30px, 7vw, 80px) 22px 60px;
  display: grid;
  gap: 20px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  text-align: left;
}

.auth-brand img {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}

.auth-brand h1 {
  font-size: 20px;
}

.auth-brand p {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px;
  display: grid;
  gap: 16px;
}

.auth-panel h2 {
  font-size: 22px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--body);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(153, 0, 255, 0.12);
}

.auth-error {
  background: #fff3f5;
  border: 1px solid #f3c3ce;
  color: #a5183a;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
}

.auth-hint {
  font-size: 13px;
  color: var(--muted);
}

.auth-hint a {
  color: var(--purple);
  font-weight: 600;
}

.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.auth-foot a {
  color: var(--purple);
  font-weight: 600;
}

/* ------------------------------------------------------------ article editor */

.editor {
  display: grid;
  gap: 0;
}

.editor-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--soft);
}

.editor-btn {
  border: 1px solid transparent;
  background: #fff;
  border-radius: 7px;
  padding: 5px 9px;
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.3;
}

.editor-btn:hover {
  border-color: var(--purple);
  color: var(--purple-dark);
}

.editor-sep {
  width: 1px;
  background: var(--line-strong);
  margin: 2px 4px;
}

.editor textarea {
  border-radius: 0 0 10px 10px !important;
  border-top: 1px solid var(--line) !important;
  min-height: 380px;
  font-size: 14.5px !important;
  line-height: 1.7 !important;
}

/* ------------------------------------------------------------ AI panel */

.ai-panel {
  border: 1px solid #e3d4fb;
  background: linear-gradient(120deg, #fbf7ff 0%, #f4f6ff 100%);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}

.ai-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ai-badge {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 8px;
  padding: 5px 8px;
  flex: none;
}

.ai-head h3 {
  font-size: 15.5px;
  margin-bottom: 2px;
}

.ai-head p {
  font-size: 13px;
  color: var(--muted);
  max-width: 62ch;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ai-output {
  border-top: 1px dashed #d9c9f3;
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.ai-output[hidden] {
  display: none;
}

.ai-output pre {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--copy);
  white-space: pre-wrap;
}

.ai-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ------------------------------------------------------------ media picker */

.media-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 21, 26, 0.55);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 60;
}

.media-modal[hidden] {
  display: none;
}

.media-modal-panel {
  width: min(880px, 100%);
  max-height: 84vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
}

.media-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.media-pick {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.media-pick:hover {
  border-color: var(--purple);
  box-shadow: 0 6px 16px rgba(153, 0, 255, 0.16);
}

.media-pick img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
  background: var(--soft);
}

.media-pick span {
  display: block;
  padding: 7px 9px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1020px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    max-width: 86vw;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: var(--shadow-lg);
  }

  .admin-side.is-open {
    transform: translateX(0);
  }

  .admin-menu-btn {
    display: flex;
  }

  .dash-hero,
  .dash-grid,
  .split-grid,
  .form-grid,
  .image-field {
    grid-template-columns: 1fr;
  }

  .component-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .component-controls {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 22px;
  }

  .admin-topbar {
    padding: 16px 18px 10px;
  }

  .admin-content {
    padding: 4px 18px 50px;
  }

  .admin-notice {
    margin: 0 18px 6px;
  }

  .panel {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .dash-hero {
    padding: 20px 18px;
  }

  .admin-table {
    min-width: 540px;
  }
}

/* studio cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini-stat {
  border: 1px solid var(--line, #e4e6ed);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fcfcfe;
  display: grid;
  gap: 3px;
}

.mini-stat span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #71757f);
  font-weight: 700;
}

.mini-stat strong {
  font-size: 15px;
  color: var(--ink, #14151a);
}
