:root {
  --emerald: #0b4d3b;
  --deep: #07352c;
  --deepest: #04271f;
  --gold: #d8a56f;
  --gold-light: #edc99f;
  --cream: #f2e7d7;
  --paper: #fffdfa;
  --ink: #17342c;
  --muted: #66736e;
  --line: #dfded8;
  --danger: #a53b3b;
  --success: #19734f;
  --shadow: 0 20px 60px rgba(4, 39, 31, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-family: Georgia, "Times New Roman", serif; color: var(--ink); background: #f5f4ef; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% 0%, rgba(216,165,111,.17), transparent 30rem), #f7f6f2; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.space-top { margin-top: 20px; }
.space-top-large { margin-top: 28px; }

.topbar { height: 88px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; background: var(--deep); border-bottom: 1px solid rgba(216,165,111,.35); }
.brand img { display: block; width: 150px; height: 200px; object-fit: contain; }
.quiet-link { color: var(--cream); text-decoration: none; font: 600 .82rem/1 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.quiet-link:hover { color: var(--gold-light); }
.page-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 58px 0 70px; }
.auth-layout { min-height: 620px; display: grid; grid-template-columns: 1.05fr .85fr; gap: clamp(34px, 7vw, 100px); align-items: center; }
.welcome-copy { max-width: 590px; }
.eyebrow { display: inline-flex; align-items: center; color: var(--emerald); font: 700 .76rem/1.3 Arial, sans-serif; letter-spacing: .2em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 20px; font-size: clamp(2.6rem, 6vw, 5.3rem); font-weight: 400; line-height: .98; letter-spacing: -.04em; color: var(--deep); }
h2 { margin-bottom: 10px; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 400; color: var(--deep); }
h3 { font-size: 1.15rem; color: var(--deep); }
p { font: 400 1rem/1.65 Arial, sans-serif; color: var(--muted); }
.welcome-copy > p { max-width: 520px; font-size: 1.08rem; }
.check-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 15px; font: 600 .95rem/1.4 Arial, sans-serif; }
.check-list li { display: flex; align-items: center; gap: 11px; }
.check-list li::before { content: "✦"; color: var(--gold); font-size: 1.2rem; }

.panel { background: rgba(255,253,250,.96); border: 1px solid rgba(216,165,111,.34); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-panel { padding: clamp(22px, 4vw, 42px); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin-bottom: 30px; background: #ecece7; border-radius: 12px; }
.segmented button { min-height: 44px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font: 700 .85rem/1 Arial, sans-serif; }
.segmented button.active { background: white; color: var(--deep); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.form-stack { display: grid; gap: 17px; }
.form-stack label { display: grid; gap: 8px; color: var(--deep); font: 700 .85rem/1.2 Arial, sans-serif; }
.optional { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid #d7d9d5; border-radius: 10px; padding: 11px 13px; outline: none; background: white; color: var(--ink); font: 400 .95rem/1.3 Arial, sans-serif; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(11,77,59,.12); }
input:disabled { background: #f0f0ec; color: var(--muted); }
.field-note { margin: -7px 0 0; font-size: .8rem; }
.button { min-height: 46px; border: 0; border-radius: 10px; padding: 11px 18px; cursor: pointer; font: 700 .86rem/1 Arial, sans-serif; letter-spacing: .03em; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { color: var(--cream); background: var(--emerald); }
.button.primary:hover { background: var(--deep); }
.button.secondary { color: var(--deep); background: transparent; border: 1px solid rgba(7,53,44,.25); }
.button.danger { color: white; background: var(--danger); }
.button.small { min-height: 36px; padding: 8px 12px; font-size: .76rem; }
.message { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); margin: 0; padding: 15px 18px; border-radius: 12px; color: white; background: var(--success); box-shadow: 0 14px 40px rgba(0,0,0,.2); }
.message.error { background: var(--danger); }

.member-view { display: grid; gap: 28px; }
.member-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.member-heading h1 { margin: 8px 0 7px; font-size: clamp(2.2rem, 5vw, 4rem); }
.member-heading p { margin: 0; }
.member-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
.member-tabs button { min-height: 42px; white-space: nowrap; padding: 10px 17px; border: 1px solid #dadbd7; border-radius: 999px; background: white; color: var(--muted); cursor: pointer; font: 700 .84rem/1 Arial, sans-serif; }
.member-tabs button.active { color: var(--cream); border-color: var(--emerald); background: var(--emerald); }
.loyalty-card { position: relative; overflow: hidden; min-height: 420px; padding: clamp(28px, 5vw, 58px); color: var(--cream); background: linear-gradient(135deg, #0c5642, var(--deep) 62%, #04251e); border: 1px solid rgba(216,165,111,.7); border-radius: 28px; box-shadow: 0 28px 70px rgba(7,53,44,.28); }
.loyalty-card::before { content: "✦"; position: absolute; right: -40px; top: -125px; color: rgba(216,165,111,.10); font-size: 25rem; line-height: 1; }
.loyalty-brand { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid rgba(242,231,215,.2); }
.loyalty-brand img { width: clamp(190px, 28vw, 330px); height: 112px; object-fit: contain; object-position: left center; }
.loyalty-brand span { font: 600 .84rem/1.3 Arial, sans-serif; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.stamps { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 2.2vw, 22px); width: min(720px, 100%); margin: 34px auto; }
.stamp { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(242,231,215,.42); border-radius: 50%; color: rgba(242,231,215,.72); font: 700 1rem/1 Arial, sans-serif; background: rgba(255,255,255,.035); }
.stamp.filled { color: var(--deep); border-color: var(--gold-light); background: linear-gradient(145deg, var(--gold-light), var(--gold)); box-shadow: 0 8px 22px rgba(0,0,0,.2); font-size: 1.5rem; }
.card-progress { position: relative; display: flex; justify-content: space-between; gap: 20px; font-family: Arial, sans-serif; }
.card-progress span { color: rgba(242,231,215,.75); text-align: right; }
.reward-card { display: flex; align-items: center; gap: 22px; margin-top: 22px; padding: 24px; border: 1px solid var(--gold); border-radius: var(--radius); background: #fff8ee; }
.reward-card h2, .reward-card p { margin-bottom: 4px; }
.reward-icon { display: grid; place-items: center; flex: 0 0 64px; height: 64px; border-radius: 50%; color: var(--deep); background: var(--gold); font-size: 2rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin: 5px 0 0; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-column > .panel, .profile-form { padding: 25px; }
.data-list { display: grid; gap: 10px; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 18px; border: 1px solid #dedfda; border-radius: 12px; background: white; font-family: Arial, sans-serif; }
.data-row > div { display: grid; gap: 5px; }
.data-row span, .data-row time { color: var(--muted); font-size: .82rem; }
.row-end { justify-items: end; }
.badge { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 999px; color: #665f59 !important; background: #ece9e4; font: 700 .7rem/1 Arial, sans-serif; text-transform: uppercase; }
.badge.completed, .badge.available { color: #126143 !important; background: #dff3e9; }
.badge.cancelled, .badge.returned { color: #8c3030 !important; background: #f9dfdf; }
.badge.redeemed { color: #725022 !important; background: #f7e9d1; }
.stamp-mini { color: var(--emerald) !important; font-weight: 700; }
.empty-state { padding: 34px; border: 1px dashed #c9cbc6; border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center; font: 400 .9rem/1.5 Arial, sans-serif; }
.profile-form { max-width: 620px; }
.footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 28px; padding: 27px 20px; color: rgba(242,231,215,.8); background: var(--deepest); font: 500 .78rem/1.4 Arial, sans-serif; }
.footer a { text-decoration: none; }

/* Administração */
.admin-body { background: #f1f2ee; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #0f6550, var(--deep) 60%); }
.admin-login-card { width: min(460px, 100%); padding: 38px; }
.admin-login-card img { display: block; width: 210px; height: 95px; object-fit: contain; margin: -6px auto 18px; }
.admin-app { min-height: 100vh; display: grid; grid-template-columns: 265px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; color: var(--cream); background: var(--deep); border-right: 1px solid rgba(216,165,111,.28); }
.admin-sidebar img { width: 180px; height: 82px; object-fit: contain; margin: 0 auto 7px; }
.admin-sidebar > span { margin-bottom: 24px; color: var(--gold-light); text-align: center; font: 700 .65rem/1 Arial, sans-serif; letter-spacing: .2em; }
.admin-nav { display: grid; gap: 6px; }
.admin-nav button, .admin-logout { width: 100%; min-height: 43px; padding: 11px 13px; border: 0; border-radius: 9px; color: rgba(242,231,215,.72); background: transparent; text-align: left; cursor: pointer; font: 600 .86rem/1 Arial, sans-serif; }
.admin-nav button:hover, .admin-nav button.active { color: var(--deep); background: var(--gold-light); }
.admin-logout { margin-top: auto; border: 1px solid rgba(242,231,215,.2); text-align: center; }
.admin-main { min-width: 0; padding: 30px clamp(18px, 4vw, 48px) 60px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.admin-header h1 { margin: 4px 0 0; font-size: clamp(2rem, 4vw, 3rem); }
.admin-user { text-align: right; font: 600 .8rem/1.5 Arial, sans-serif; color: var(--muted); }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { width: 100%; min-height: 128px; padding: 20px; border: 1px solid #dddeda; border-radius: 14px; background: white; color: inherit; text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 26px rgba(7,53,44,.10); }
.stat-card:focus-visible { outline: 3px solid rgba(216,165,111,.45); outline-offset: 2px; }
.stat-card span { display: block; min-height: 34px; color: var(--muted); font: 600 .8rem/1.35 Arial, sans-serif; }
.stat-card strong { display: block; color: var(--deep); font-size: 2rem; font-weight: 400; }
.stat-card small { display: block; margin-top: 8px; color: var(--green); font: 700 .68rem/1 Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .55fr); gap: 20px; }
.admin-panel { padding: 22px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar h2 { margin: 0; font-size: 1.7rem; }
.toolbar input, .toolbar select { width: min(320px, 100%); }
.table-wrap { overflow-x: auto; border: 1px solid #dedfda; border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; font: 400 .82rem/1.35 Arial, sans-serif; }
th, td { padding: 13px 14px; border-bottom: 1px solid #ecece8; text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f7f7f3; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.inline-form .full { grid-column: 1 / -1; }
.inline-form h3 { grid-column: 1 / -1; margin: 0; }
.check-control { display: flex !important; grid-template-columns: 20px 1fr; align-items: center; font-weight: 500 !important; }
.check-control input { width: 18px; min-height: 18px; height: 18px; margin: 0; }
.actions select { width: auto; min-width: 150px; }
.help-card { padding: 20px; border-left: 4px solid var(--gold); background: #fff8ed; }
.help-card p:last-child { margin-bottom: 0; }
.mobile-menu { display: none; }

dialog { width: min(620px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(2,25,19,.7); }
.dialog-content { padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-head h2 { margin: 0; }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; background: #ecece7; }
.dashboard-detail-content { max-height: calc(100vh - 30px); overflow-y: auto; }
.dashboard-detail-content .data-row { gap: 18px; }
.dashboard-detail-content .row-end { min-width: 120px; }

@media (max-width: 960px) {
  .auth-layout, .two-column, .admin-grid { grid-template-columns: 1fr; }
  .auth-layout { padding-top: 20px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-app { display: block; }
  .admin-sidebar { position: fixed; z-index: 80; left: 0; top: 0; width: min(285px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 50px rgba(0,0,0,.3); }
  .admin-sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
}

@media (max-width: 620px) {
  .topbar { height: 74px; padding: 0 16px; }
  .brand img { width: 125px; height: 54px; }
  .quiet-link { font-size: .68rem; }
  .page-shell { width: min(100% - 26px, 1180px); padding: 34px 0 48px; }
  .auth-layout { gap: 32px; }
  .welcome-copy h1 { font-size: 3.25rem; }
  .member-heading { align-items: flex-start; }
  .loyalty-card { min-height: 0; padding: 22px; border-radius: 20px; }
  .loyalty-brand { align-items: flex-start; flex-direction: column; }
  .loyalty-brand img { width: 210px; height: 85px; }
  .loyalty-brand span { text-align: left; }
  .stamps { grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 24px auto; }
  .stamp { font-size: .8rem; }
  .stamp.filled { font-size: 1.05rem; }
  .card-progress { flex-direction: column; gap: 6px; }
  .card-progress span { text-align: left; }
  .reward-card { align-items: flex-start; }
  .reward-icon { flex-basis: 48px; height: 48px; }
  .data-row { align-items: flex-start; }
  .row-end { justify-items: end; }
  .footer { justify-content: flex-start; }
  .admin-main { padding: 18px 13px 45px; }
  .admin-header { align-items: flex-start; }
  .admin-user { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 108px; padding: 15px; }
  .stat-card strong { font-size: 1.65rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .full, .inline-form h3 { grid-column: auto; }
}
