/* =============================================
   ADMIN – design system
   Font: Inter (Google Fonts)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --admin-bg:        #070809;
  --admin-surface:   #0d0f11;
  --admin-surface-2: #121416;
  --admin-border:    rgba(255, 255, 255, .08);
  --admin-border-hi: rgba(255, 255, 255, .14);
  --admin-text:      #e8ede4;
  --admin-muted:     rgba(232, 237, 228, .52);
  --admin-sidebar-w: 240px;

  --radius: 6px;
  --transition: 160ms ease;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

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

/* =============================================
   LOGIN
   ============================================= */

.admin-login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 22%, color-mix(in srgb, var(--brand-accent) 18%, transparent), transparent 34%),
    radial-gradient(circle at 16% 80%, rgba(255,255,255,.045), transparent 28%),
    var(--admin-bg);
}

.admin-login::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.login-shell {
  position: relative;
  width: min(100%, 440px);
}

.login-card {
  position: relative;
  padding: 40px;
  border: 1px solid var(--admin-border-hi);
  background:
    linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.025) 48%, rgba(0,0,0,.18)),
    var(--admin-surface);
  border-radius: 10px;
  box-shadow: 0 32px 90px rgba(0,0,0,.52);
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-accent), transparent);
}

.login-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 42%, transparent);
  border-radius: 10px;
  background:
    radial-gradient(circle at 35% 35%, var(--brand-accent) 0 5px, transparent 6px),
    linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.025));
  box-shadow: 0 0 28px color-mix(in srgb, var(--brand-accent) 22%, transparent);
}

.login-card h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 7vw, 44px);
  letter-spacing: -.045em;
}

.login-card .text-secondary {
  max-width: 31ch;
  margin: 0 0 30px;
  color: rgba(232,237,228,.72);
  font-size: 15px;
  line-height: 1.55;
}

.login-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.login-card .form-label {
  margin: 0;
}

.login-card .form-control {
  min-height: 48px;
  padding: 0 15px;
  border-color: rgba(255,255,255,.12);
  background: rgba(4,5,6,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.login-card .form-control:hover {
  border-color: rgba(255,255,255,.2);
}

.login-card .form-control:-webkit-autofill,
.login-card .form-control:-webkit-autofill:hover,
.login-card .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--admin-text);
  caret-color: var(--admin-text);
  box-shadow: 0 0 0 1000px #101410 inset, 0 0 0 3px color-mix(in srgb, var(--brand-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--brand-accent) 42%, rgba(255,255,255,.16));
}

.login-card .btn {
  min-height: 48px;
  width: 100%;
  margin-top: 8px;
  border-radius: 7px;
}

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

  .login-card {
    padding: 32px 24px;
  }
}

/* =============================================
   KICKER / LABEL
   ============================================= */

.login-kicker,
.admin-kicker {
  margin: 0 0 6px;
  color: var(--brand-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.btn:hover { transform: translateY(-1px); }

.btn-accent {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #050607;
  font-weight: 800;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--brand-accent) 30%, transparent);
}

.btn-accent:hover {
  background: color-mix(in srgb, var(--brand-accent) 88%, #fff);
  border-color: color-mix(in srgb, var(--brand-accent) 88%, #fff);
  color: #050607;
}

.btn-ghost {
  background: transparent;
  color: var(--admin-muted);
}

.btn-ghost:hover {
  border-color: var(--admin-border-hi);
  color: var(--admin-text);
  background: rgba(255,255,255,.05);
}

.btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-danger {
  background: rgba(200,50,50,.15);
  border-color: rgba(200,80,80,.35);
  color: #f08080;
}

.btn-danger:hover {
  background: rgba(200,50,50,.3);
  border-color: rgba(200,80,80,.6);
}

/* =============================================
   FORM CONTROLS
   ============================================= */

.form-control {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  background: rgba(0,0,0,.3);
  color: var(--admin-text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 16%, transparent);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.form-group {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.form-message {
  padding: 11px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
}

.form-message.is-success {
  color: #050607;
  background: var(--brand-accent);
  border-color: var(--brand-accent);
}

.form-message.is-error {
  color: #f4f7f0;
  background: rgba(200,60,60,.16);
  border-color: rgba(220,100,100,.42);
}

/* =============================================
   LAYOUT – shell / sidebar / main
   ============================================= */

.admin-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--admin-sidebar-w) minmax(0, 1fr);
}

/* ---- Sidebar ---- */
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  overflow-y: auto;
  gap: 4px;
}

/* Brand */
.admin-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--brand-accent) 70%, transparent);
  flex-shrink: 0;
}

/* Nav section label */
.nav-section-label {
  padding: 10px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(232,237,228,.28);
}

/* Nav links */
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav a,
.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--admin-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.admin-nav a svg,
.logout-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
  background: color-mix(in srgb, var(--brand-accent) 12%, transparent);
  color: var(--brand-accent);
}

.admin-nav a:hover svg,
.admin-nav a.active svg {
  opacity: 1;
}

.admin-nav a.active {
  font-weight: 700;
}

.admin-nav a[aria-disabled="true"] {
  opacity: .38;
  pointer-events: none;
}

.logout-link {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
}

.logout-link:hover {
  color: #f08080;
}

/* ---- Main content ---- */
.admin-main {
  padding: clamp(24px, 3.5vw, 48px) clamp(20px, 4vw, 52px);
}

/* =============================================
   TOPBAR
   ============================================= */

.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-topbar h1 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -.03em;
  line-height: 1;
}

/* =============================================
   METRIC CARDS
   ============================================= */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span,
.metric-card small {
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 12px 0 6px;
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.accent-card {
  border-color: color-mix(in srgb, var(--brand-accent) 36%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

/* =============================================
   PANEL (generic content box)
   ============================================= */

.admin-panel {
  padding: 24px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
}

.admin-panel + .admin-panel {
  margin-top: 16px;
}

.admin-panel h2 {
  font-size: clamp(18px, 2.5vw, 26px);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}

/* =============================================
   MODULE TABS (newsletter nav itd.)
   ============================================= */

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  width: fit-content;
}

.module-tabs a {
  padding: 7px 14px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.module-tabs a:hover {
  color: var(--admin-text);
  background: rgba(255,255,255,.06);
}

.module-tabs a.active {
  color: #050607;
  background: var(--brand-accent);
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-accent) 35%, transparent);
}

/* =============================================
   MODULE LIST (kafelki z linkami)
   ============================================= */

.module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-list span,
.module-list a {
  padding: 8px 14px;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 500;
}

.module-list a:hover {
  color: var(--brand-accent);
  border-color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 8%, transparent);
}

/* =============================================
   PANEL COPY
   ============================================= */

.panel-copy {
  max-width: 700px;
  color: var(--admin-muted);
  font-size: 14px;
  line-height: 1.7;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--brand-accent);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

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

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* =============================================
   TABLE
   ============================================= */

.table-panel {
  display: grid;
  gap: 16px;
}

.table-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px);
  gap: 12px;
}

.table-filters label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.table-filters input,
.table-filters select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  background: rgba(0,0,0,.3);
  color: var(--admin-text);
  font-family: inherit;
  font-size: 13px;
}

.table-filters input:focus,
.table-filters select:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.ajax-table.is-loading { opacity: .5; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: rgba(232,237,228,.82);
}

.admin-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table a {
  color: var(--brand-accent);
  font-weight: 600;
}

.inquiries-table td {
  vertical-align: top;
}

.inquiries-table td > strong,
.inquiries-table td > span:not(.status-pill) {
  display: block;
}

.inquiries-table td > strong {
  color: var(--admin-text);
  font-weight: 800;
}

.inquiries-table td > span:not(.status-pill) {
  margin-top: 3px;
  color: var(--admin-muted);
}

.inquiries-table .status-pill {
  display: inline-flex;
  width: auto;
  min-width: 0;
  margin-top: 0;
  white-space: nowrap;
}

.inquiry-message {
  min-width: 220px;
  max-width: 320px;
  line-height: 1.55;
}

.inquiry-message span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.inquiry-dialog {
  width: min(820px, calc(100vw - 24px));
}

.inquiry-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inquiry-dialog-grid div,
.inquiry-dialog-message {
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
}

.inquiry-dialog-grid span,
.inquiry-dialog-message span {
  display: block;
  margin-bottom: 5px;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.inquiry-dialog-grid strong {
  color: var(--admin-text);
}

.inquiry-dialog-grid a {
  color: var(--brand-accent);
}

.inquiry-dialog-message p {
  margin: 0;
  color: rgba(232,237,228,.86);
  line-height: 1.7;
  white-space: normal;
}

.inquiry-dialog-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .inquiry-dialog-grid {
    grid-template-columns: 1fr;
  }

  .inquiry-dialog-actions {
    justify-content: stretch;
  }

  .inquiry-dialog-actions form,
  .inquiry-dialog-actions .btn {
    width: 100%;
  }
}

/* =============================================
   STATUS PILL
   ============================================= */

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--admin-border-hi);
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-pill.is-active {
  border-color: var(--brand-accent);
  color: #050607;
  background: var(--brand-accent);
}

.status-pill.is-pending {
  border-color: rgba(255,255,255,.2);
  color: var(--admin-text);
  background: rgba(255,255,255,.06);
}

.status-pill.is-muted {
  border-color: rgba(255,255,255,.12);
  color: rgba(232,237,228,.42);
  background: rgba(255,255,255,.025);
}

/* =============================================
   EMPTY STATE
   ============================================= */

.empty-state {
  display: grid;
  gap: 6px;
  padding: 32px;
  border: 1px dashed var(--admin-border-hi);
  border-radius: var(--radius);
  color: var(--admin-muted);
  text-align: center;
}

.empty-state strong { color: var(--admin-text); font-size: 15px; }

/* =============================================
   DIALOG
   ============================================= */

.admin-dialog {
  width: min(600px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  background: transparent;
  color: var(--admin-text);
}

.admin-dialog::backdrop {
  background: rgba(0,0,0,.74);
  backdrop-filter: blur(10px);
}

.dialog-card {
  display: block;
  padding: clamp(22px, 4vw, 32px);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--brand-accent) 14%, transparent), transparent 32%),
    linear-gradient(160deg, var(--admin-surface-2), var(--admin-bg));
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dialog-heading h2 {
  font-size: clamp(22px, 4vw, 36px);
  letter-spacing: -.03em;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  color: var(--admin-text);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.icon-button:hover {
  color: var(--brand-accent);
  border-color: var(--brand-accent);
}

.dialog-card textarea.form-control {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.dialog-card .form-message { margin-bottom: 12px; }

.session-dialog {
  width: min(920px, calc(100vw - 24px));
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-grid div,
.modal-section {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.035);
}

.detail-grid div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.detail-grid span,
.clean-list span {
  color: var(--admin-muted);
  font-size: 12px;
}

.detail-grid strong {
  color: var(--admin-text);
  font-size: 14px;
}

.modal-section {
  margin-top: 10px;
  padding: 14px;
}

.modal-section h3 {
  margin: 0 0 8px;
  color: var(--brand-accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-section p {
  margin: 0;
  color: var(--admin-muted);
}

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

.clean-list li {
  display: grid;
  gap: 2px;
}

.inline-link {
  color: var(--brand-accent);
  font-weight: 700;
  text-decoration: none;
}

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

/* =============================================
   SETTINGS
   ============================================= */

.settings-panel { max-width: 720px; }

/* =============================================
   TEMPLATE GRID
   ============================================= */

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

.template-card {
  display: grid;
  gap: 8px;
  min-height: 180px;
  padding: 20px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  color: var(--admin-text);
  text-decoration: none;
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  transition: border-color var(--transition), box-shadow var(--transition);
}

.template-card:hover {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent) 20%, transparent);
}

.template-card span {
  color: var(--brand-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.template-card strong {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.template-card small {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-editor { max-width: 1020px; }

/* =============================================
   FORM GRID / SEGMENTED / BUTTON ROW
   ============================================= */

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

/* =============================================
   OFFERS
   ============================================= */

.offer-form {
  max-width: 1180px;
}

.offer-inline-dates {
  gap: 10px;
}

.offer-items-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--admin-border);
}

.offer-items {
  display: grid;
  gap: 14px;
}

.offer-item {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

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

.offer-item-head strong {
  font-size: 14px;
  font-weight: 800;
}

.offer-item-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(90px, 120px) minmax(140px, 180px) minmax(140px, 180px);
  gap: 12px;
}

.offer-item textarea {
  min-height: 72px;
}

.offer-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.offer-settings {
  display: grid;
  gap: 14px;
}

.offer-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--admin-text);
  font-weight: 700;
}

.offer-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-accent);
}

.offer-summary-card {
  position: sticky;
  top: 20px;
  padding: 18px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--brand-accent) 12%, transparent), transparent 34%),
    linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}

.offer-summary-card dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.offer-summary-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--admin-border);
}

.offer-summary-card div:last-child {
  border-bottom: none;
}

.offer-summary-card dt,
.offer-summary-card dd {
  margin: 0;
}

.offer-summary-card dt {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.offer-summary-card dd {
  color: var(--admin-text);
  font-weight: 800;
}

.offer-summary-card .is-total dd {
  color: var(--brand-accent);
  font-size: 22px;
}

.segmented-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.segmented-row label {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.segmented-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-row span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.segmented-row span:hover { color: var(--admin-text); background: rgba(255,255,255,.05); }

.segmented-row input:checked + span {
  color: #050607;
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  font-weight: 700;
}

.repeater-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(110px, .3fr) minmax(120px, .35fr) minmax(150px, .4fr);
  gap: 10px;
  margin-bottom: 10px;
}

.cost-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, .35fr) minmax(220px, .8fr);
  gap: 10px;
  margin-bottom: 10px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-help-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
  color: var(--admin-muted);
  font-size: 13px;
}

.settings-help-box strong {
  color: var(--admin-text);
  font-size: 14px;
}

.settings-help-box code {
  color: var(--brand-accent);
  font-weight: 800;
}

.gallery-message-preview {
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.7;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.actions-cell form { margin: 0; }

/* =============================================
   CODE / TOKENS
   ============================================= */

.code-textarea {
  font-family: 'Fira Code', Consolas, 'SFMono-Regular', Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.token-box {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(0,0,0,.2);
  font-size: 13px;
  color: var(--admin-muted);
}

.token-box strong { color: var(--brand-accent); font-weight: 700; }

/* =============================================
   COLOR SETTINGS
   ============================================= */

.color-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 200px);
  gap: 10px;
}

.form-control-color {
  width: 80px;
  height: 42px;
  padding: 3px;
  border-radius: var(--radius);
  cursor: pointer;
}

.hex-input {
  height: 42px;
  font-weight: 700;
  letter-spacing: .06em;
}

.accent-preview {
  margin-top: 20px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 74% 28%, color-mix(in srgb, var(--brand-accent) 52%, transparent), transparent 36%),
    linear-gradient(135deg, var(--admin-bg), var(--admin-surface-2));
  border: 1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent);
}

.accent-preview span {
  color: var(--brand-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.accent-preview strong {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
}

/* =============================================
   FORM SECTIONS (formularze wielosekcyjne)
   ============================================= */

.form-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--admin-border);
}

.form-section:first-child { padding-top: 0; }
.form-section:last-child  { padding-bottom: 0; border-bottom: none; }

.form-section-header {
  margin-bottom: 20px;
}

.form-section-header h2 {
  font-size: 18px;
  letter-spacing: -.02em;
  margin-bottom: 0;
}

.form-section-sub {
  margin: 20px 0 12px;
}

.form-section-sub h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text);
  margin: 0 0 4px;
}

.form-section-hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--admin-muted);
  line-height: 1.5;
}

/* =============================================
   REPEATER ROWS (pakiety, koszty, refy)
   ============================================= */

.repeater-head {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.repeater-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.repeater-head--2 { grid-template-columns: 1fr 1fr; }
.repeater-head--3 { grid-template-columns: 2fr 1fr 1.5fr; }
.repeater-head--4 { grid-template-columns: 2fr .8fr 1fr 1.2fr; }

.repeater-row {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.repeater-row--2 { grid-template-columns: 1fr 1fr; }
.repeater-row--3 { grid-template-columns: 2fr 1fr 1.5fr; }
.repeater-row--4 { grid-template-columns: 2fr .8fr 1fr 1.2fr; }

.repeater-row .form-control {
  /* niższy min-height w wierszach repeatera */
  min-height: 40px;
}

/* =============================================
   DETAIL GRID (modal podglądu sesji)
   ============================================= */

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

.detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
}

.detail-grid span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.detail-grid strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text);
}

/* =============================================
   MODAL SECTIONS
   ============================================= */

.modal-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
}

.modal-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.modal-section p {
  margin: 0;
  font-size: 13px;
  color: var(--admin-text);
  line-height: 1.55;
}

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

.clean-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
}

.clean-list li strong { color: var(--admin-text); }
.clean-list li span  { color: var(--admin-muted); }

.inline-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--brand-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-name-link {
  color: var(--brand-accent);
  font-weight: 800;
  text-decoration: none;
}

.admin-name-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.share-link-list label {
  display: grid;
  grid-template-columns: minmax(160px, .35fr) minmax(280px, 1fr);
  gap: 10px;
  align-items: center;
}

.share-link-list span {
  display: grid;
  gap: 2px;
}

.share-link-list small {
  color: var(--admin-muted);
}

.schedule-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.schedule-slot,
.ref-stats-grid article {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
}

.schedule-slot {
  min-height: 150px;
  padding: 14px;
}

.schedule-slot.is-full {
  border-color: color-mix(in srgb, var(--brand-accent) 42%, var(--admin-border));
}

.schedule-slot header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--brand-accent);
}

.schedule-slot p {
  margin: 0;
  color: var(--admin-muted);
}

.schedule-person {
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-top: 1px solid var(--admin-border);
}

.schedule-person:first-of-type {
  border-top: none;
}

.schedule-person span,
.schedule-person small {
  color: var(--admin-muted);
  font-size: 12px;
}

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

.ref-stats-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.ref-stats-grid span {
  color: var(--brand-accent);
  font-size: 22px;
  font-weight: 900;
}

.ref-stats-grid small {
  color: var(--admin-muted);
}

.package-auto-summary {
  display: grid;
  gap: 4px;
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.035);
}

.package-auto-summary strong {
  color: var(--brand-accent);
}

.package-auto-summary span {
  color: var(--admin-muted);
  font-size: 13px;
}

.media-assign-bar {
  align-items: end;
  margin: 16px 0;
}

.media-assign-submit {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.media-upload-status {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.035);
}

.media-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--admin-text);
}

.media-progress-head strong {
  color: var(--brand-accent);
}

.media-progress-head span,
.media-upload-status small,
.media-upload-queue {
  color: var(--admin-muted);
  font-size: 12px;
}

.media-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.media-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--brand-accent) 55%, transparent);
  transition: width 120ms ease;
}

.media-folder-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.media-folder {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
}

.media-folder header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.media-folder h3 {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.media-folder header > span {
  color: var(--admin-muted);
  font-size: 12px;
  white-space: nowrap;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.media-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  cursor: pointer;
}

.media-card:hover {
  border-color: color-mix(in srgb, var(--brand-accent) 55%, var(--admin-border));
}

.media-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-accent);
}

.media-card:has(input:checked) {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent) 70%, transparent);
}

.media-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: #050607;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.media-card small {
  color: var(--admin-muted);
  font-size: 12px;
}

.media-delete-btn {
  width: fit-content;
  padding: 7px 10px;
}

/* =============================================
   SOCIAL MEDIA
   ============================================= */

.social-compose {
  display: grid;
  gap: 14px;
}

.social-caption {
  min-height: 180px;
  padding-top: 12px;
  resize: vertical;
}

.social-channel-row {
  margin-bottom: 0;
}

.social-post-table td:first-child {
  min-width: 280px;
}

.social-post-table td:first-child strong,
.social-post-table td:first-child small,
.social-error,
.social-meta-ids,
.social-channel-list,
.social-queue-list article,
.social-connection-row {
  display: grid;
  gap: 4px;
}

.social-post-table td:first-child strong {
  color: var(--admin-text);
  font-size: 13px;
}

.social-post-table td:first-child small,
.social-meta-ids,
.social-error {
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.45;
}

.social-error {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(220,100,100,.34);
  border-radius: var(--radius);
  color: #f0a0a0;
  background: rgba(200,60,60,.12);
  white-space: pre-line;
}

.social-preview-dialog {
  width: min(980px, calc(100vw - 24px));
}

.social-preview-layout {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.social-preview-image,
.social-preview-empty {
  display: block;
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: #050607;
}

.social-preview-image img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #050607;
}

.social-preview-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--admin-muted);
  font-size: 13px;
}

.social-preview-content {
  min-width: 0;
}

.social-preview-details {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.social-preview-content .modal-section p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.social-channel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.social-channel-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--admin-border-hi);
  border-radius: 999px;
  color: var(--admin-text);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.social-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

.social-connection-panel {
  position: sticky;
  top: 24px;
}

.social-connection-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--admin-border);
}

.social-connection-row span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.social-connection-row strong {
  color: var(--brand-accent);
  font-size: 13px;
}

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

.social-queue-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
}

.social-queue-list strong {
  overflow-wrap: anywhere;
}

.social-queue-list span {
  color: var(--admin-muted);
  font-size: 12px;
}

.social-note {
  margin-bottom: 16px;
}

.social-ai-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.social-ai-box .form-group {
  margin-bottom: 0;
}

.social-ai-box small {
  align-self: center;
  color: var(--admin-muted);
  font-size: 12px;
}

.social-ai-box small.is-error {
  color: #f0a0a0;
}

.social-ai-planner {
  display: grid;
  gap: 18px;
}

.social-ai-planner-head,
.social-ai-dropzone,
.social-ai-card {
  display: grid;
  gap: 16px;
}

.social-ai-planner-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.social-ai-status {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.social-ai-status span {
  display: inline-flex;
  justify-content: space-between;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  color: var(--brand-accent);
  font-size: 12px;
  font-weight: 800;
}

.social-ai-dropzone {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 18px;
  border: 1px dashed var(--admin-border-hi);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.social-ai-dropzone.is-dragover {
  border-color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 6%, transparent);
}

.social-ai-dropzone div {
  display: grid;
  gap: 4px;
}

.social-ai-dropzone strong {
  color: var(--admin-text);
}

.social-ai-dropzone span,
.social-ai-card small,
.social-ai-actions small {
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.45;
}

.social-ai-card small.is-error,
.social-ai-actions small.is-error {
  color: #f0a0a0;
}

.social-ai-items {
  display: grid;
  gap: 14px;
}

.social-ai-card {
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.social-ai-card-media {
  display: grid;
  gap: 10px;
  align-content: start;
}

.social-ai-card canvas {
  width: 100%;
  max-height: 440px;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  background: #050607;
}

.social-ai-card canvas:active {
  cursor: grabbing;
}

.social-ai-card-fields {
  min-width: 0;
}

.social-ai-actions {
  align-items: center;
}

.social-ai-progress {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.social-ai-progress-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.social-ai-progress-head strong {
  color: var(--admin-text);
  font-size: 14px;
}

.social-ai-progress-head span {
  color: var(--brand-accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.social-ai-progress-bar {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: #050607;
}

.social-ai-progress-bar span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--brand-accent) 45%, transparent);
  transition: width .25s ease;
}

.social-ai-step-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.social-ai-step {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.social-ai-step.is-done {
  border-color: color-mix(in srgb, var(--brand-accent) 65%, var(--admin-border));
  color: var(--admin-text);
}

.social-ai-step.is-active {
  border-color: var(--brand-accent);
  background: var(--brand-accent);
  color: #050607;
  box-shadow: 0 0 18px color-mix(in srgb, var(--brand-accent) 32%, transparent);
}

.social-ai-step.is-error {
  border-color: rgba(220, 90, 90, .75);
  color: #f0a0a0;
}

.social-upload-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px dashed var(--admin-border-hi);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.social-upload-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.social-upload-copy span {
  color: var(--brand-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.social-upload-copy strong {
  overflow-wrap: anywhere;
  color: var(--admin-text);
  font-size: 14px;
}

.social-upload-copy small {
  color: var(--admin-muted);
  font-size: 12px;
}

.social-upload-copy small.is-error {
  color: #f0a0a0;
}

.social-upload-box img {
  grid-column: 1 / -1;
  width: min(240px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: #050607;
}

.social-cropper {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-border);
}

.social-cropper-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.social-ratio-row {
  margin-bottom: 0;
}

.social-ratio-row span {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.social-zoom-control {
  display: grid;
  grid-template-columns: auto minmax(140px, 220px);
  gap: 10px;
  align-items: center;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.social-zoom-control input {
  accent-color: var(--brand-accent);
}

.social-cropper canvas {
  width: min(420px, 100%);
  max-height: 520px;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--admin-border-hi);
  border-radius: var(--radius);
  background: #050607;
}

.social-cropper canvas:active {
  cursor: grabbing;
}

/* =============================================
   RESPONSIVE
   ============================================= */

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

  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
  }

  .admin-brand {
    padding-bottom: 12px;
    border-bottom: none;
    margin-bottom: 0;
    width: 100%;
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
  }

  .logout-link {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
  }

  .nav-section-label { display: none; }

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

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-filters    { grid-template-columns: 1fr; }
  .template-grid    { grid-template-columns: 1fr; }
  .form-grid-2      { grid-template-columns: 1fr; }
  .offer-item-grid,
  .offer-summary-layout { grid-template-columns: 1fr; }
  .offer-summary-card { position: static; }
  .social-settings-grid { grid-template-columns: 1fr; }
  .social-preview-layout { grid-template-columns: 1fr; }
  .social-preview-details { grid-template-columns: 1fr; }
  .social-ai-planner-head,
  .social-ai-dropzone,
  .social-ai-card { grid-template-columns: 1fr; }
  .social-ai-progress-head { align-items: flex-start; flex-direction: column; }
  .social-ai-step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid      { grid-template-columns: 1fr 1fr; }
  .schedule-board,
  .ref-stats-grid   { grid-template-columns: 1fr 1fr; }
  .share-link-list label { grid-template-columns: 1fr; }
  .repeater-head,
  .repeater-row     { grid-template-columns: 1fr !important; }
  .module-tabs      { width: 100%; }
  .social-upload-box { grid-template-columns: 1fr; }
  .social-zoom-control { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .schedule-board,
  .ref-stats-grid { grid-template-columns: 1fr; }
  .social-ai-step-list { grid-template-columns: 1fr; }
}

/* =============================================
   GALLERIES LIST (AJAX)
   ============================================= */

.table-filters {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
}

.galleries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    transition: background 140ms ease, border-color 140ms ease;
}

.gallery-row:hover {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.12);
}

.gr-main {
    flex: 1;
    min-width: 0;
}

.gr-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.gr-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-base);
    letter-spacing: -0.01em;
}

.gr-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.5;
}

.gr-meta strong {
    color: rgba(244, 247, 240, 0.8);
    font-weight: 600;
}

.gr-sep {
    opacity: 0.4;
}

.gr-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.gr-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.gr-stat-item strong {
    font-size: 20px;
    font-weight: 900;
    color: var(--brand-accent);
    line-height: 1;
}

.gr-stat-item span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.gr-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-accent {
    background: color-mix(in srgb, var(--brand-accent) 15%, transparent);
    color: var(--brand-accent);
    border: 1px solid color-mix(in srgb, var(--brand-accent) 30%, transparent);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-ready {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.36);
}

.badge-info {
    background: rgba(14, 165, 233, 0.16);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.34);
}

.badge-draft {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(232, 237, 228, 0.68);
    border: 1px dashed rgba(255, 255, 255, 0.18);
}

.gallery-title-link {
    color: var(--admin-text);
    text-decoration: none;
}

.gallery-title-link:hover {
    color: var(--brand-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =============================================
   GALLERY DETAILS
   ============================================= */

.gallery-detail-hero {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.gallery-detail-hero article {
    display: grid;
    gap: 8px;
    min-height: 126px;
    padding: 18px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}

.gallery-detail-hero span,
.gallery-detail-hero small {
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.gallery-detail-hero strong {
    color: #fff;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 900;
    letter-spacing: -.04em;
    line-height: 1;
}

.gallery-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.gallery-client-grid {
    margin-bottom: 14px;
}

.gallery-detail-notes {
    display: grid;
    gap: 10px;
}

.gallery-detail-notes div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.03);
}

.gallery-detail-notes span {
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.gallery-detail-notes strong {
    color: var(--admin-text);
    font-size: 13px;
    line-height: 1.55;
}

.gallery-status-form {
    display: grid;
    gap: 10px;
}

.gallery-money-box {
    display: grid;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--admin-border);
}

.gallery-money-box dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.gallery-money-box div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--admin-border);
}

.gallery-money-box div:last-child {
    border-bottom: none;
}

.gallery-money-box dt,
.gallery-money-box dd {
    margin: 0;
}

.gallery-money-box dt {
    color: var(--admin-muted);
    font-size: 12px;
}

.gallery-money-box dd {
    color: var(--admin-text);
    font-weight: 800;
}

.gallery-money-box .is-strong dd {
    color: var(--brand-accent);
    font-size: 22px;
}

.gallery-processing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.gallery-processing-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.03);
    cursor: pointer;
}

.gallery-processing-card:hover {
    border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--admin-border));
}

.gallery-processing-card.is-processed {
    border-color: var(--brand-accent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-accent) 55%, transparent);
}

.gallery-processing-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-accent);
}

.gallery-processing-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    background: #050607;
}

.gallery-processing-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-processing-card strong {
    min-width: 0;
    overflow: hidden;
    color: var(--admin-text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-processing-card small {
    color: var(--admin-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.gallery-processing-check {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.gallery-processing-card.is-processed .gallery-processing-check {
    border-color: var(--brand-accent);
    color: #050607;
    background: var(--brand-accent);
}

@media (max-width: 900px) {
    .gallery-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .gr-stats {
        width: 100%;
        padding: 16px 0;
        border-left: none;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        justify-content: flex-start;
    }
    .gr-actions {
        width: 100%;
        flex-direction: row;
    }
    .gr-actions .btn {
        flex: 1;
    }
    .gallery-detail-hero,
    .gallery-detail-layout {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   WP STYLE MEDIA LIBRARY
   ============================================= */

.media-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 200ms ease, border-color 200ms ease;
    cursor: pointer;
}

.media-item:hover {
    border-color: var(--brand-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.5);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-item-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(0deg, rgba(5,6,7,0.95) 0%, rgba(5,6,7,0.6) 70%, transparent 100%);
    padding: 30px 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 200ms ease;
}

.media-item:hover .media-item-overlay {
    opacity: 1;
}

.media-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-right: 8px;
}

.media-item-name {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-item-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

.media-item-source {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: var(--brand-accent);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-delete-media {
    color: rgba(255,255,255,0.5);
    padding: 4px;
    margin: -4px;
    height: auto;
    border-radius: 4px;
    transition: color 150ms ease, background 150ms ease;
}

.btn-delete-media:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* DROPZONE */
.media-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.015);
    border-radius: var(--radius);
    padding: 60px 24px;
    text-align: center;
    transition: all 200ms ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.media-dropzone:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.media-dropzone.is-dragover {
    border-color: var(--brand-accent);
    background: color-mix(in srgb, var(--brand-accent) 5%, transparent);
}

.gallery-upload-dropzone {
    display: grid;
    gap: 14px;
    padding: 34px 22px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.018);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.gallery-upload-dropzone:hover,
.gallery-upload-dropzone.is-dragover {
    border-color: var(--brand-accent);
    background: color-mix(in srgb, var(--brand-accent) 5%, transparent);
}

.gallery-upload-dropzone-content {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

.gallery-upload-dropzone-content strong {
    color: var(--admin-text);
    font-size: 16px;
}

.gallery-upload-dropzone-content span,
.gallery-upload-dropzone-content small {
    color: var(--admin-muted);
    font-size: 12px;
}

.delivery-upload-zone {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px dashed var(--admin-border-hi);
    border-radius: var(--radius);
    background: rgba(255,255,255,.025);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, opacity .18s ease;
}

.delivery-upload-zone.is-dragover {
    border-color: var(--brand-accent);
    background: color-mix(in srgb, var(--brand-accent) 10%, transparent);
}

.delivery-upload-zone.is-uploading {
    opacity: .72;
    pointer-events: none;
}

.delivery-upload-zone div {
    display: grid;
    gap: 4px;
}

.delivery-upload-zone strong {
    color: var(--admin-text);
    font-size: 14px;
}

.delivery-upload-zone span,
[data-delivery-upload-message] {
    color: var(--admin-muted);
    font-size: 12px;
    line-height: 1.45;
}

[data-delivery-upload-message].is-error {
    color: #ff8b8b;
}

.delivery-upload-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.delivery-upload-item {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.03);
}

.delivery-upload-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: #050607;
}

.delivery-upload-item strong {
    min-width: 0;
    color: var(--admin-text);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.delivery-upload-item small {
    color: var(--admin-muted);
    font-size: 11px;
}

@media (max-width: 860px) {
    .delivery-upload-zone {
        grid-template-columns: 1fr;
    }
}
