/* =============================================================== admin.css
   3XL Marketing Studio - administration panel.
   Loaded after main.css so every design token and shared primitive
   (buttons, fields, alerts, badges, pagination) is already available.
   Numbered sections mirror main.css so the two files read as one system.
   ========================================================================= */

/* ------------------------------------------------------- A1. Admin shell */
.admin-body {
  min-height: 100vh;
  background: var(--paper-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.94rem;
  -webkit-font-smoothing: antialiased;
}

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

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

.admin-content {
  flex: 1;
  padding: clamp(1.1rem, 2.4vw, 2rem) clamp(1rem, 3vw, 2.25rem) 3rem;
}

/* --------------------------------------------------------- A2. Side nav */
.sidenav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink);
  color: #d7dbe6;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.85rem 1.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidenav__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.5rem 1.05rem;
  text-decoration: none;
  color: var(--white);
}

.sidenav__brand img {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
}

.sidenav__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.sidenav__brand-text strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.sidenav__brand-text span {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aqua);
}

.sidenav__group {
  margin-bottom: 0.35rem;
}

.sidenav__label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6d7488;
  padding: 0.9rem 0.7rem 0.4rem;
}

.sidenav__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.7rem;
  border-radius: 10px;
  color: #c3c9d8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.sidenav__link svg {
  flex: none;
  opacity: 0.85;
}

.sidenav__link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.sidenav__link.is-active {
  background: var(--brand-grad);
  color: var(--white);
  box-shadow: 0 10px 24px -14px rgba(79, 70, 229, 0.9);
}

.sidenav__link.is-active svg {
  opacity: 1;
}

.sidenav__count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: #eaeefb;
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.45rem;
}

.sidenav__link.is-active .sidenav__count {
  background: rgba(255, 255, 255, 0.26);
}

.sidenav__foot {
  margin-top: auto;
  padding: 1rem 0.7rem 0.2rem;
  border-top: 1px solid var(--line-dark);
  font-size: 0.72rem;
  color: #7c8398;
  line-height: 1.5;
}

.sidenav__sub {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0 0.35rem 1.5rem;
}

.sidenav__sub a {
  font-size: 0.8rem;
  color: #a7aec1;
  text-decoration: none;
  padding: 0.34rem 0.6rem;
  border-radius: 8px;
}

.sidenav__sub a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.sidenav__sub a.is-active {
  color: var(--aqua);
  background: rgba(34, 211, 238, 0.1);
}

/* ---------------------------------------------------------- A3. Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 62px;
  padding: 0.6rem clamp(1rem, 3vw, 2.25rem);
  background: rgba(250, 250, 249, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.topbar__spacer {
  flex: 1;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.4rem 0.3rem 0.35rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  cursor: pointer;
  font: inherit;
}

.user-chip:hover {
  border-color: var(--indigo);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-grad);
  color: var(--white);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-chip__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.user-chip__meta strong {
  font-size: 0.8rem;
  color: var(--ink);
}

.user-chip__meta span {
  font-size: 0.66rem;
  color: var(--slate);
  text-transform: capitalize;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: none;
  z-index: 60;
}

.menu.is-open {
  display: block;
}

.menu__head {
  padding: 0.55rem 0.65rem 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}

.menu__head strong {
  display: block;
  font-size: 0.86rem;
  color: var(--ink);
}

.menu__head span {
  font-size: 0.74rem;
  color: var(--slate);
  word-break: break-all;
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu a:hover,
.menu button:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.menu button.is-danger {
  color: var(--rose);
}

/* --------------------------------------------------------- A4. Page head */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.page-head__eyebrow {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--indigo);
  margin: 0 0 0.3rem;
}

.page-head__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

.page-head__text {
  margin: 0.4rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  max-width: 62ch;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

/* -------------------------------------------------------- A5. Stat tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}

.tile {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

a.tile:hover {
  border-color: rgba(79, 70, 229, 0.45);
  transform: translateY(-2px);
  transition: 0.2s var(--ease);
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand-grad);
  opacity: 0;
}

a.tile:hover::after {
  opacity: 1;
}

.tile__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-grad-soft);
  color: var(--indigo);
  margin-bottom: 0.6rem;
}

.tile__value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.tile__label {
  display: block;
  margin-top: 0.32rem;
  font-size: 0.76rem;
  color: var(--slate);
}

.tile--accent {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.tile--accent .tile__value {
  color: var(--white);
}

.tile--accent .tile__label {
  color: #9aa2b6;
}

.tile--accent .tile__icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--aqua);
}

/* -------------------------------------------------------------- A6. Panel */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.panel__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.panel__body {
  padding: 1.1rem;
}

.panel__body--flush {
  padding: 0;
}

.panel__foot {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
}

.cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

/* ------------------------------------------------------------ A7. Tables */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.toolbar--plain {
  background: none;
}

.toolbar .field {
  flex: 1 1 200px;
  max-width: 320px;
}

.toolbar .field input,
.toolbar .field select {
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}

.toolbar__spacer {
  flex: 1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost--danger {
  color: var(--rose);
  border-color: rgba(244, 63, 94, 0.4);
}

.btn-ghost--danger:hover {
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.07);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 640px;
}

.dtable th,
.dtable td {
  padding: 0.72rem 1.1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.dtable thead th {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  background: var(--paper);
  white-space: nowrap;
}

.dtable tbody tr:hover {
  background: #fbfbfa;
}

.dtable tbody tr:last-child td {
  border-bottom: 0;
}

.dtable a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.dtable a:hover {
  color: var(--indigo);
  text-decoration: underline;
}

.dtable .cell-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--slate);
  font-weight: 400;
}

.dtable .cell-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.dtable .is-unread td:first-child {
  box-shadow: inset 3px 0 0 var(--indigo);
}

.dtable .is-unread .row-title {
  font-weight: 700;
}

.row-title {
  display: block;
  color: var(--ink);
}

.icon-btn-sm {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate);
  text-decoration: none;
}

.icon-btn-sm:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.icon-btn-sm.is-danger:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: rgba(244, 63, 94, 0.06);
}

.dtable .thumb {
  width: 54px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}

.thumb-empty {
  width: 54px;
  height: 40px;
  border-radius: 6px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.6rem;
  background: var(--paper);
}

.pagination {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--line);
  justify-content: center;
}

/* --------------------------------------------------------------- A8. Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  border-bottom: 1px solid var(--line);
  padding: 0 1.1rem;
  background: var(--paper);
}

.tabs a {
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover {
  color: var(--ink);
}

.tabs a.is-active {
  color: var(--indigo);
  border-bottom-color: var(--indigo);
}

.tabs__spacer {
  flex: 1;
}

/* ------------------------------------------------------- A9. Admin forms */
.form-body {
  display: grid;
  gap: 1.15rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.15rem;
}

.form-grid--full {
  grid-template-columns: 1fr;
}

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

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  margin: 0;
}

fieldset > legend {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0 0.45rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.87rem;
  color: var(--text);
  cursor: pointer;
}

.check input[type='checkbox'],
.check input[type='radio'] {
  width: 18px;
  height: 18px;
  margin-top: 0.1rem;
  accent-color: var(--indigo);
  flex: none;
  cursor: pointer;
}

.check small {
  display: block;
  color: var(--slate);
  font-size: 0.76rem;
  margin-top: 0.12rem;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.4rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.fieldset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.25rem;
}

.hint-box {
  font-size: 0.8rem;
  color: var(--slate);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  line-height: 1.55;
}

.mono-input {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.image-field {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.image-field__preview {
  width: 132px;
  height: 90px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  flex: none;
}

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

.image-field__controls {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
}

.file-input {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  color: var(--slate);
}

.file-input::file-selector-button {
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  margin-right: 0.6rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

/* --------------------------------------------------------- A10. Badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  text-transform: capitalize;
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status--on {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.status--off {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.28);
}

.status--draft {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.32);
}

.status--archived {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
}

.status--live {
  color: var(--indigo-600);
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.pill--count {
  background: var(--indigo-100);
  border-color: rgba(79, 70, 229, 0.28);
  color: var(--indigo-600);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--text-soft);
  text-decoration: none;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.filter-pill.is-active span {
  color: var(--aqua);
}

/* ----------------------------------------------------- A11. Enquiry view */
.detail-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0.55rem 1rem;
  font-size: 0.88rem;
  margin: 0;
}

.detail-list dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  padding-top: 0.15rem;
}

.detail-list dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}

.message-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 0.9rem;
}

.note {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  background: var(--white);
  margin-bottom: 0.7rem;
}

.note__head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.74rem;
  color: var(--slate);
  margin-bottom: 0.35rem;
}

.note__head strong {
  color: var(--ink);
}

.note p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* --------------------------------------------------------- A12. Activity */
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed li {
  display: flex;
  gap: 0.75rem;
  padding: 0.62rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.85rem;
}

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

.feed__icon {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-grad-soft);
  color: var(--indigo);
}

.feed__body {
  min-width: 0;
}

.feed__body strong {
  color: var(--ink);
}

.feed__time {
  display: block;
  font-size: 0.73rem;
  color: var(--slate);
  margin-top: 0.1rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.quick-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
}

.quick-links a:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

/* ------------------------------------------------------------ A13. Media */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 0.9rem;
  padding: 1.1rem;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.media-card__img {
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}

.media-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card__body {
  padding: 0.55rem 0.65rem 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.media-card__name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.35;
}

.media-card__meta {
  font-size: 0.68rem;
  color: var(--slate);
}

.media-card__actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.dropzone {
  margin: 1.1rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  color: var(--slate);
  font-size: 0.87rem;
  transition: 0.2s var(--ease);
}

.dropzone.is-hot {
  border-color: var(--indigo);
  background: rgba(79, 70, 229, 0.06);
  color: var(--indigo-600);
}

.dropzone strong {
  color: var(--ink);
}

.dropzone__progress {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 0.75rem;
  display: none;
}

.dropzone__progress.is-visible {
  display: block;
}

.dropzone__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand-grad);
  transition: width 0.2s linear;
}

/* ----------------------------------------------------------- A14. Login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(79, 70, 229, 0.4), transparent 60%),
    radial-gradient(760px 460px at 92% 6%, rgba(34, 211, 238, 0.2), transparent 62%),
    var(--ink);
}

.login-card {
  width: min(430px, 100%);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow-lg);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
}

.login-card__brand img {
  width: 42px;
  height: 42px;
}

.login-card__brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.login-card__brand span {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--indigo);
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.login-card > p {
  margin: 0 0 1.2rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.login-card form {
  display: grid;
  gap: 0.9rem;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.2rem;
}

.login-foot {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--slate);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.login-foot a {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 600;
}

/* ------------------------------------------------ A15. Flash & bulk bar */
.bulk-bar {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 30;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid var(--line-dark);
}

.bulk-bar.is-visible {
  display: flex;
  flex-wrap: wrap;
}

.bulk-bar strong {
  font-size: 0.82rem;
}

.bulk-bar .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--white);
}

.bulk-bar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--white);
}

.bulk-bar .btn-ghost--danger {
  color: #fda4af;
}

.alert__close {
  margin-left: auto;
  flex: none;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.alert__close:hover {
  opacity: 1;
}

.alert span {
  flex: 1;
}

body.confirm-open {
  overflow: hidden;
}

/* ------------------------------------------------------- A16. Responsive */
@media (max-width: 1080px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidenav {
    position: fixed;
    inset: 0 auto 0 0;
    width: 268px;
    z-index: 90;
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.45);
  }

  body.nav-open .sidenav {
    transform: translateX(0);
  }

  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 18, 0.5);
    z-index: 80;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .topbar__title {
    font-size: 0.92rem;
  }

  .user-chip__meta {
    display: none;
  }

  .page-head {
    align-items: flex-start;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .detail-list dd {
    margin-bottom: 0.55rem;
  }

  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidenav,
  a.tile {
    transition: none;
  }
}

/* ==================================================== A17. Site Editor */
.se-devices {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.se-devices__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.se-devices__btn.is-active {
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.se-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 1rem;
  align-items: start;
  margin-top: 0.5rem;
}

/* ------------------------------------------------------- preview pane */
.se-preview {
  position: sticky;
  top: 1rem;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  perspective: 1400px;
}

.se-preview__chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #1c1f26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.se-preview__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a3f4a;
}

.se-preview__dot:nth-child(1) { background: #ff5f57; }
.se-preview__dot:nth-child(2) { background: #febc2e; }
.se-preview__dot:nth-child(3) { background: #28c840; }

.se-preview__url {
  flex: 1;
  margin-left: 0.6rem;
  font-size: 0.7rem;
  font-family: var(--font-mono, monospace);
  color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.22rem 0.65rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-preview__reload {
  flex: none;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.se-preview__reload:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

.se-preview__stage {
  display: grid;
  place-items: center;
  padding: 1rem;
  min-height: 420px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(232, 35, 42, 0.08), transparent 60%),
    #0f1117;
  transition: transform 0.55s var(--ease);
}

.se-layout.is-flipping .se-preview__stage {
  transform: rotateY(90deg) scale(0.97);
}

.se-preview__device {
  width: 100%;
  max-width: 100%;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  transition: width 0.5s var(--ease), border-radius 0.5s var(--ease);
  transform-origin: center center;
}

.se-preview__device--desktop {
  aspect-ratio: 16 / 10;
}

.se-preview__device--mobile {
  width: 375px;
  max-width: 100%;
  height: 700px;
  border-radius: 26px;
  border: 6px solid #2a2d35;
  box-shadow:
    0 0 0 2px #44474f,
    0 24px 60px rgba(0, 0, 0, 0.55);
}

.se-preview__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--white);
  transform-origin: top center;
}

/* Mobile preview: real phone-width iframe inside the bezel */
.se-preview__device--mobile .se-preview__frame {
  width: 375px;
  height: 700px;
  max-width: 100%;
}

/* -------------------------------------------------------- editor pane */
.se-editor {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 7.5rem);
  position: sticky;
  top: 1rem;
}

.se-editor__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.85rem;
  flex: none;
}

.se-editor__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0 1rem;
  scrollbar-width: thin;
}

.se-editor__foot {
  flex: none;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.se-editor__foot .btn {
  width: 100%;
  justify-content: center;
}

/* ----------------------------------------------------------- sections */
.se-fold {
  border-bottom: 1px solid var(--line);
}

.se-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.78rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
  transition: background 0.15s;
}

.se-fold > summary::-webkit-details-marker {
  display: none;
}

.se-fold > summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid var(--slate);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s var(--ease);
  flex: none;
}

.se-fold[open] > summary::before {
  transform: rotate(90deg);
}

.se-fold > summary:hover {
  background: var(--paper);
}

.se-fold__count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--slate);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.08rem 0.5rem;
}

.se-fold__body {
  padding: 0.25rem 1rem 1rem;
}

.se-hint {
  font-size: 0.74rem;
  color: var(--slate);
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.se-hint code {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

/* ----------------------------------------------------------- repeaters */
.se-repeat {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.se-repeat__row {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 2.1rem 0.7rem 0.7rem;
  margin: 0;
  background: var(--paper);
}

.se-repeat__row legend {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--indigo);
  padding: 0 0.3rem;
}

.se-repeat__row .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.se-repeat__row--slim {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.55rem 2.1rem 0.55rem 0.55rem;
}

.se-repeat__row--slim .field {
  flex: 1;
  margin: 0;
}

.se-repeat__row textarea {
  width: 100%;
  font-size: 0.8rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  resize: vertical;
  background: var(--white);
  color: var(--ink);
}

.se-repeat__del {
  position: absolute;
  top: 0.55rem;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.se-repeat__del:hover {
  background: rgba(220, 38, 38, 0.18);
}

/* -------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .se-layout {
    grid-template-columns: 1fr;
  }

  .se-preview {
    position: relative;
    top: 0;
  }

  .se-editor {
    position: relative;
    top: 0;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .se-preview__stage {
    min-height: 300px;
    padding: 0.6rem;
  }

  .se-preview__device--mobile {
    width: 280px;
  }
}
