:root {
  --rose-25: #fffafa;
  --rose-50: #fff4f7;
  --rose-100: #fde4eb;
  --rose-200: #f6c7d2;
  --rose-300: #d995a6;
  --gold: #d7a545;
  --gold-light: #f5d27a;
  --gold-dark: #9c6b1f;
  --ink: #4b3f47;
  --muted: #8b7a82;
  --line: rgba(178, 105, 125, 0.22);
  --card: rgba(255, 250, 250, 0.86);
  --shadow: 0 28px 80px rgba(117, 58, 76, 0.16);
  --danger: #b2414f;
  --success: #537a5d;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 12%, rgba(255,255,255,.9), transparent 30%),
    linear-gradient(135deg, #fff7f9 0%, #fde3e8 48%, #fff4f0 100%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .68; cursor: not-allowed; }
.hidden { display: none !important; }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .82fr) minmax(540px, 1.18fr);
  gap: clamp(18px, 3vw, 38px);
  padding: clamp(18px, 3vw, 38px);
}

.admin-hero, .admin-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.admin-hero {
  display: flex;
  min-height: calc(100vh - 76px);
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(135deg, rgba(255,255,255,.82), rgba(255,244,247,.82)),
    radial-gradient(circle at 10% 85%, rgba(248, 196, 207, .85), transparent 42%);
}

.admin-hero::before, .admin-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  opacity: .32;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.admin-hero::before {
  left: 24px;
  bottom: 24px;
  border-left: 2px solid rgba(216,165,69,.44);
  border-bottom: 2px solid rgba(216,165,69,.44);
  border-radius: 0 0 0 38px;
}
.admin-hero::after {
  right: -30px;
  top: -30px;
  border-right: 2px solid rgba(216,165,69,.38);
  border-top: 2px solid rgba(216,165,69,.38);
  border-radius: 0 38px 0 0;
}
.hero-decoration {
  position: absolute;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(217,149,166,.26);
  border-radius: 46% 54% 42% 58%;
  pointer-events: none;
}
.hero-decoration-one { top: 8%; right: -70px; transform: rotate(18deg); }
.hero-decoration-two { bottom: 8%; left: -78px; transform: rotate(-22deg); }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-copy h1, .dashboard-header h2, .login-card h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--gold-dark);
}
.hero-copy h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); line-height: .98; }
.hero-copy p { max-width: 520px; color: var(--muted); font-size: 1.06rem; line-height: 1.82; }
.hero-card {
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid rgba(216, 165, 69, .34);
  border-radius: 26px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 18px 44px rgba(117, 58, 76, .10);
}
.flower-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-dark);
  background: linear-gradient(135deg, #fff, #fff2d5);
  border: 1px solid rgba(216,165,69,.38);
}
.hero-card strong { display: block; margin-bottom: 8px; }
.hero-card p { margin: 0; color: var(--muted); line-height: 1.65; }

.admin-panel { min-height: calc(100vh - 76px); }
.login-view { min-height: 100%; display: grid; place-items: center; padding: 28px; }
.login-card {
  width: min(460px, 100%);
  padding: 38px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.82);
  background: rgba(255,255,255,.78);
  box-shadow: 0 22px 62px rgba(117,58,76,.12);
}
.login-card h2, .dashboard-header h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.muted { color: var(--muted); line-height: 1.65; }
.stack-form { display: grid; gap: 12px; margin-top: 24px; }
.stack-form label { font-weight: 800; color: var(--ink); }
input, select {
  min-height: 46px;
  border: 1px solid rgba(178,105,125,.24);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  outline: none;
  padding: 0 16px;
}
input:focus, select:focus { border-color: rgba(216,165,69,.66); box-shadow: 0 0 0 4px rgba(216,165,69,.12); }
.alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(178,65,79,.22);
  background: rgba(254,226,226,.86);
  color: var(--danger);
}
.primary-button, .ghost-button {
  min-height: 46px;
  border-radius: 16px;
  padding: 0 18px;
  font-weight: 900;
  border: none;
}
.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 14px 32px rgba(172,114,38,.18);
}
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  color: var(--ink);
}
.ghost-button.danger { color: var(--danger); }

.dashboard-view { padding: clamp(20px, 3vw, 34px); }
.dashboard-header {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.metric-card, .block-card {
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 24px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 16px 38px rgba(117,58,76,.08);
}
.metric-card { padding: 20px; }
.metric-card span { display: block; color: var(--muted); font-weight: 800; font-size: .84rem; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; margin-top: 8px; color: var(--gold-dark); font-size: 2.15rem; }
.action-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
.block-card { padding: 22px; }
.block-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.block-title h3, .table-toolbar h3 { margin: 0 0 4px; font-size: 1.06rem; }
.block-title p, .table-toolbar p { margin: 0; color: var(--muted); line-height: 1.55; }
.mini-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #fff2d5);
  color: var(--gold-dark);
  font-weight: 900;
  border: 1px solid rgba(216,165,69,.35);
}
.inline-form, .copy-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.status-message { min-height: 22px; margin: 12px 0 0; font-weight: 700; }
.status-message.success { color: var(--success); }
.status-message.error { color: var(--danger); }
.table-card { padding: 0; overflow: hidden; }
.table-toolbar {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-end;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 15px 18px; border-bottom: 1px solid rgba(178,105,125,.14); text-align: left; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,246,248,.62); }
td { color: var(--ink); }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-weight: 900; font-size: .8rem; }
.badge.active { color: #426d4d; background: rgba(119, 166, 130, .18); }
.badge.inactive { color: #9b5360; background: rgba(217,149,166,.2); }
.row-actions { display: flex; gap: 8px; }
.small-button { min-height: 34px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.82); color: var(--ink); font-weight: 800; padding: 0 12px; }
.small-button.danger { color: var(--danger); }
.empty-cell { text-align: center; color: var(--muted); padding: 28px; }

@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-hero { min-height: auto; }
}
@media (max-width: 680px) {
  .admin-shell { padding: 10px; }
  .admin-hero, .admin-panel { border-radius: 24px; }
  .dashboard-header, .table-toolbar { flex-direction: column; align-items: stretch; }
  .metrics-grid, .action-grid { grid-template-columns: 1fr; }
  .inline-form, .copy-row { grid-template-columns: 1fr; }
  .filters { justify-content: stretch; }
  .filters input, .filters select { width: 100%; }
}

.admin-lock { display: inline-flex; margin-left: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(216,165,69,.14); color: var(--gold-dark); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }

/* =========================================================
   Ajustes responsivos finais - apenas visual
   Mantém JS, IDs, forms, rotas e integração intactos.
   ========================================================= */

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  overflow-x: hidden;
}

.admin-shell {
  min-height: 100svh;
}

.admin-hero,
.admin-panel {
  min-height: min(920px, calc(100svh - clamp(36px, 6vw, 76px)));
}

.login-view {
  min-height: 100%;
}

.login-card {
  max-height: calc(100svh - 64px);
  overflow-y: auto;
  scrollbar-width: thin;
}

input,
select,
.primary-button,
.ghost-button,
.small-button {
  touch-action: manipulation;
}

@media (min-width: 1440px) {
  .admin-shell {
    grid-template-columns: minmax(380px, .88fr) minmax(560px, 1.12fr);
    max-width: 1540px;
    margin-inline: auto;
  }
}

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: minmax(300px, .75fr) minmax(470px, 1.25fr);
    gap: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
  }
}

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

  .admin-hero,
  .admin-panel {
    min-height: auto;
  }

  .admin-hero {
    padding: 28px;
  }

  .login-view {
    min-height: auto;
    padding: 24px;
  }

  .login-card {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 12px;
    gap: 12px;
  }

  .admin-hero {
    padding: 22px;
    border-radius: 24px;
  }

  .admin-panel {
    border-radius: 24px;
  }

  .hero-copy p {
    font-size: .96rem;
    line-height: 1.6;
  }

  .hero-card {
    padding: 18px;
  }

  .login-view {
    padding: 16px;
  }

  .login-card {
    width: 100%;
    padding: 24px 20px;
    border-radius: 24px;
  }

  .stack-form {
    gap: 10px;
    margin-top: 18px;
  }

  input,
  select,
  .primary-button,
  .ghost-button {
    min-height: 44px;
  }

  .dashboard-view {
    padding: 16px;
  }

  .metrics-grid {
    gap: 10px;
  }

  .metric-card,
  .block-card {
    border-radius: 20px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-card strong {
    font-size: 1.8rem;
  }

  .block-card {
    padding: 18px;
  }
}

@media (max-width: 420px) {
  .admin-shell {
    padding: 8px;
  }

  .admin-hero {
    padding: 18px 16px;
  }

  .hero-copy h1,
  .login-card h2,
  .dashboard-header h2 {
    font-size: clamp(1.65rem, 8vw, 2.1rem);
  }

  .hero-card {
    display: none;
  }

  .login-view {
    padding: 12px;
  }

  .login-card {
    padding: 20px 16px;
  }

  th,
  td {
    padding: 12px 14px;
  }
}

@media (max-height: 720px) and (max-width: 760px) {
  .admin-hero {
    display: none;
  }

  .admin-panel {
    min-height: calc(100svh - 16px);
  }

  .login-view {
    min-height: calc(100svh - 16px);
  }
}
