:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --panel-muted: #fbfaf7;
  --surface: #f1ede5;
  --border: #ded6c9;
  --border-strong: #c8baa4;
  --text: #231f1a;
  --text-soft: #665e53;
  --text-faint: #8a8174;
  --accent: #0f766e;
  --accent-strong: #0c5d57;
  --accent-soft: #dbf2ef;
  --gold: #9a6b1f;
  --gold-soft: #f7e8cf;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #b54708;
  --warning-soft: #fff2df;
  --success: #067647;
  --success-soft: #dff6ec;
  --shadow-lg: 0 22px 50px rgba(35, 31, 26, 0.09);
  --shadow-md: 0 12px 30px rgba(35, 31, 26, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 292px;
  --container: 1320px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.07), transparent 30%),
    radial-gradient(circle at top right, rgba(154, 107, 31, 0.08), transparent 34%),
    linear-gradient(180deg, #f6f3ee 0%, #efebe3 100%);
  color: var(--text);
}

body {
  line-height: 1.5;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

.admin-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(360px, 0.85fr);
}

.auth-showcase {
  padding: 56px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(12, 93, 87, 0.92)),
    linear-gradient(135deg, #0f766e, #0c5d57);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.auth-showcase::before,
.auth-showcase::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-showcase::before {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -80px;
}

.auth-showcase::after {
  width: 260px;
  height: 260px;
  left: -60px;
  bottom: -80px;
}

.auth-showcase-inner,
.auth-panel-wrap {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 10px;
}

.auth-brand h1,
.auth-brand p {
  margin: 0;
}

.auth-brand h1 {
  font-family: "Fraunces", serif;
  font-size: 1.65rem;
  font-weight: 600;
}

.auth-brand p {
  color: rgba(255, 255, 255, 0.78);
}

.auth-copy {
  margin-top: 72px;
  max-width: 620px;
}

.auth-eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.auth-copy h2 {
  margin: 0 0 18px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.02;
  font-weight: 600;
}

.auth-copy p {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.06rem;
}

.auth-feature-list,
.auth-demo-list {
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.auth-feature-list li,
.auth-demo-list li {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.auth-demo-list strong,
.auth-feature-list strong {
  display: block;
  margin-bottom: 4px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
}

.auth-panel-wrap {
  width: min(520px, 100%);
}

.auth-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.auth-card h3 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  font-weight: 600;
}

.auth-card p {
  margin: 0;
  color: var(--text-soft);
}

.auth-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

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

.field {
  display: grid;
  gap: 7px;
}

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

.field label {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-soft);
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select,
.search-inline input,
.search-inline select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field textarea {
  min-height: 132px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus,
.search-inline input:focus,
.search-inline select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.actions,
.toolbar-actions,
.page-actions,
.detail-actions,
.modal-actions,
.stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.btn-secondary {
  background: var(--gold-soft);
  color: #5d4317;
  border-color: #ebd5b3;
}

.btn-soft {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #efc4bf;
}

.link-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.auth-msg,
.inline-msg,
.panel-msg {
  min-height: 24px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.auth-msg.is-error,
.inline-msg.is-error,
.panel-msg.is-error {
  color: var(--danger);
}

.auth-msg.is-success,
.inline-msg.is-success,
.panel-msg.is-success {
  color: var(--success);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: linear-gradient(180deg, #191713 0%, #231f1a 100%);
  color: #f3f0ea;
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 18px;
}

.sidebar .brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .brand-line img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px;
}

.sidebar .brand-line h1,
.sidebar .brand-line p,
.sidebar .profile-mini h2,
.sidebar .profile-mini p {
  margin: 0;
}

.sidebar .brand-line h1,
.page-header h2,
.panel h3,
.modal-card h3 {
  font-family: "Fraunces", serif;
  font-weight: 600;
}

.sidebar .brand-line h1 {
  font-size: 1.2rem;
}

.sidebar .brand-line p,
.sidebar .profile-mini p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
}

.profile-mini {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-mini h2 {
  font-size: 1rem;
}

.nav-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.82);
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-meta {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.52);
}

.main {
  padding: 26px 26px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 18px;
}

.topbar h2,
.topbar p {
  margin: 0;
}

.topbar p {
  color: var(--text-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-grid {
  display: grid;
  gap: 18px;
}

.stats-grid,
.summary-grid,
.cards-grid,
.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.stat-card,
.chart-card,
.table-card,
.empty-card,
.detail-card,
.modal-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}

.panel,
.table-card,
.detail-card,
.empty-card,
.chart-card {
  padding: 20px;
}

.stat-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 239, 0.92));
}

.stat-card small,
.metric-label,
.muted {
  color: var(--text-soft);
}

.stat-card strong,
.metric-value {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  font-weight: 800;
}

.toolbar,
.search-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.toolbar > * {
  flex: 1 1 170px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-header h2 {
  margin: 0;
  font-size: 2rem;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.split-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.9fr);
}

.split-layout.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--surface);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-success,
.pill-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning,
.pill-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger,
.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-neutral,
.pill-neutral {
  background: #f2efe9;
  color: var(--text-soft);
}

.badge-accent,
.pill-accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 92px minmax(0, 1fr) 50px;
  align-items: center;
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  background: #ede8df;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #33a39a);
}

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

.gallery-card,
.media-card {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.gallery-card img,
.media-card img {
  width: 100%;
  height: 112px;
  object-fit: cover;
}

.gallery-card .card-body,
.media-card .card-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  background: var(--panel-muted);
  text-align: center;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(35, 31, 26, 0.42);
  backdrop-filter: blur(12px);
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(90vh, 980px);
  overflow: auto;
  padding: 22px;
}

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 60;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  background: #fff;
  border: 1px solid var(--border);
}

.toast.success {
  border-color: #b9e3d0;
}

.toast.error {
  border-color: #efc4bf;
}

.loader {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 3px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.center-loader {
  min-height: 280px;
  display: grid;
  place-items: center;
}

.muted-note {
  font-size: 0.9rem;
  color: var(--text-soft);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1200px) {
  .stats-grid,
  .summary-grid,
  .cards-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .split-layout.equal {
    grid-template-columns: 1fr;
  }
}

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

  .auth-showcase {
    padding: 32px 24px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }
}

@media (max-width: 720px) {
  .main,
  .auth-panel {
    padding: 18px;
  }

  .field-grid,
  .stats-grid,
  .summary-grid,
  .cards-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
