
:root{
  --ink:#17100c;
  --brown:#3c2115;
  --gold:#efad3b;
  --red:#dc1c2e;
  --green:#168b51;
  --paper:#f7f2ed;
  --line:#eadfd8;
  --muted:#7d6f66;
  --shadow:0 18px 48px rgba(48,27,16,.12);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  font-family:Roboto,Arial,sans-serif;
  color:#2b1d15;
  background:
    radial-gradient(circle at 8% 0,rgba(239,173,59,.13),transparent 26rem),
    linear-gradient(180deg,#f8f4f0,#efe8e3);
  padding-bottom:82px;
}
a{text-decoration:none;color:inherit}
button,input{font:inherit}
.client-top{
  position:sticky;top:0;z-index:30;
  min-height:78px;padding:10px clamp(14px,4vw,34px);
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  color:#fff;
  background:linear-gradient(120deg,#0d0906,#32190e);
  border-bottom:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.client-brand{display:flex;align-items:center;gap:11px}
.client-brand img{width:56px;height:56px;object-fit:cover;border-radius:15px}
.client-brand strong{display:block;font-family:Oswald,sans-serif;letter-spacing:.04em}
.client-brand small{display:block;color:#d7c6bb;font-size:.68rem;letter-spacing:.12em;margin-top:2px}
.client-order-link{
  min-height:44px;padding:0 17px;display:inline-flex;align-items:center;
  border-radius:14px;background:linear-gradient(135deg,#e51b2f,#b90d1d);
  font-weight:900;box-shadow:0 9px 22px rgba(220,28,46,.25)
}
.client-main{width:min(1160px,calc(100% - 28px));margin:22px auto}
.client-hero{
  min-height:190px;padding:28px;
  display:flex;align-items:center;justify-content:space-between;gap:24px;
  color:#fff;border-radius:28px;overflow:hidden;
  background:
    radial-gradient(circle at 90% 0,rgba(239,173,59,.28),transparent 24rem),
    linear-gradient(135deg,#17100c,#4b2818);
  box-shadow:var(--shadow)
}
.client-hero small,.panel-head small,.access-copy small{
  color:var(--gold);font-weight:900;letter-spacing:.11em
}
.client-hero h1{margin:5px 0;font:700 clamp(2rem,5vw,3.3rem) Oswald;text-transform:uppercase}
.client-hero p{margin:0;color:#daccc2}
.client-avatar{
  width:106px;height:106px;flex:0 0 106px;border-radius:30px;
  display:grid;place-items:center;font:700 36px Oswald;
  color:#1d130c;background:linear-gradient(145deg,#ffd47d,#e39320);
  box-shadow:0 17px 38px rgba(0,0,0,.25)
}
.access-card{
  margin-top:16px;padding:24px;display:grid;grid-template-columns:1fr 420px;gap:28px;align-items:center;
  border-radius:24px;background:#fff;border:1px solid rgba(58,33,19,.08);box-shadow:var(--shadow)
}
.access-copy h2,.panel-head h2{margin:5px 0 7px;font:700 28px Oswald;text-transform:uppercase}
.access-copy p{margin:0;color:var(--muted);line-height:1.55}
.access-form,.profile-form{display:grid;gap:13px}
.access-form label,.profile-form label{display:grid;gap:6px;color:#62544a;font-size:.82rem;font-weight:800}
.access-form input,.profile-form input{
  min-height:51px;width:100%;padding:0 14px;border:1px solid #ddcfc6;border-radius:13px;background:#fff
}
.access-form input:focus,.profile-form input:focus{outline:0;border-color:#d8972e;box-shadow:0 0 0 4px rgba(239,173,59,.13)}
.access-form button,.profile-form button{
  min-height:52px;border:0;border-radius:14px;color:#fff;
  background:linear-gradient(135deg,#21130c,#59301c);font-weight:900;cursor:pointer
}
.client-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}
.client-kpis article{
  min-height:112px;padding:17px;border-radius:19px;background:#fff;
  border:1px solid rgba(55,31,18,.07);box-shadow:0 10px 28px rgba(46,26,15,.08)
}
.client-kpis span{display:block;color:#75665d;font-size:.77rem;font-weight:800}
.client-kpis strong{display:block;margin:9px 0 4px;font-size:1.5rem}
.client-kpis small{color:#9b8d84}
.client-tabs{
  position:sticky;top:89px;z-index:20;display:grid;grid-template-columns:repeat(4,1fr);gap:7px;
  padding:7px;margin:16px 0;border-radius:17px;background:rgba(255,255,255,.94);
  backdrop-filter:blur(12px);box-shadow:0 10px 26px rgba(47,27,16,.08)
}
.client-tabs button{
  min-height:47px;border:0;border-radius:12px;background:transparent;color:#74655c;font-weight:900;cursor:pointer
}
.client-tabs button.active{color:#fff;background:linear-gradient(135deg,#1e120c,#54301c)}
.client-panel{display:none;padding:22px;border-radius:23px;background:#fff;box-shadow:var(--shadow)}
.client-panel.active{display:block}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:17px}
.panel-head a{
  padding:10px 14px;border-radius:12px;color:#fff;background:#19110c;font-size:.82rem;font-weight:900
}
.client-orders{display:grid;gap:12px}
.client-order-card{
  padding:17px;border:1px solid #eadfd8;border-radius:18px;background:#fcfaf8
}
.order-card-top{display:flex;justify-content:space-between;gap:15px;align-items:flex-start}
.order-card-top small{display:block;color:#8e7e74;margin-top:4px}
.order-status{
  display:inline-flex;padding:7px 10px;border-radius:999px;background:#fff0c9;color:#72520a;
  font-size:.72rem;font-weight:900;white-space:nowrap
}
.order-items{margin:13px 0;padding:12px;border-radius:13px;background:#fff;border:1px solid #eee5df;color:#65564d}
.order-items p{margin:5px 0}
.order-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}
.order-card-bottom strong{font-size:1.12rem}
.order-buttons{display:flex;gap:8px;flex-wrap:wrap}
.order-buttons a,.order-buttons button{
  min-height:39px;padding:0 12px;border:0;border-radius:11px;color:#fff;background:#2a1a12;font-weight:900;cursor:pointer
}
.order-buttons button{background:#168b51}
.profile-form{grid-template-columns:repeat(2,1fr)}
.profile-form button{grid-column:1/-1}
.favorites-box{padding:24px;border:1px dashed #d8c8be;border-radius:18px;text-align:center;color:#786a61}
.client-actions{display:flex;justify-content:flex-end;gap:10px;margin:15px 0}
.client-actions button{
  min-height:43px;padding:0 15px;border:1px solid #d8c8bf;border-radius:12px;background:#fff;color:#4b382d;font-weight:900
}
.client-actions .danger{color:#a91a26;border-color:#e7b8bc}
.empty-client{padding:38px 18px;text-align:center;color:#786a61}
.empty-client a{display:inline-flex;margin-top:13px;padding:11px 15px;border-radius:12px;color:#fff;background:#20130c;font-weight:900}
.client-bottom-nav{
  position:fixed;z-index:100;left:0;right:0;bottom:0;
  min-height:70px;padding:7px 12px calc(7px + env(safe-area-inset-bottom));
  display:grid;grid-template-columns:repeat(4,1fr);
  background:rgba(255,255,255,.97);border-top:1px solid #e8ddd5;
  box-shadow:0 -12px 35px rgba(42,23,13,.12);backdrop-filter:blur(12px)
}
.client-bottom-nav a{display:grid;place-items:center;gap:2px;color:#6a5a50}
.client-bottom-nav a.active{color:#b25a16}
.client-bottom-nav span{font-size:21px}
.client-bottom-nav small{font-size:.67rem;font-weight:900}
.client-toast{
  position:fixed;z-index:200;left:50%;bottom:92px;max-width:calc(100% - 28px);
  padding:12px 17px;border-radius:999px;color:#fff;background:#111;
  box-shadow:0 14px 36px rgba(0,0,0,.28);opacity:0;visibility:hidden;
  transform:translate(-50%,12px);transition:.2s;font-weight:900
}
.client-toast.show{opacity:1;visibility:visible;transform:translate(-50%,0)}
@media(max-width:840px){
  .access-card{grid-template-columns:1fr}
  .client-kpis{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:620px){
  .client-top{min-height:66px}
  .client-brand img{width:45px;height:45px}
  .client-order-link{font-size:.77rem;padding:0 12px}
  .client-main{width:calc(100% - 20px);margin-top:12px}
  .client-hero{min-height:154px;padding:20px;border-radius:22px}
  .client-avatar{width:76px;height:76px;flex-basis:76px;border-radius:23px;font-size:27px}
  .access-card,.client-panel{padding:16px;border-radius:19px}
  .client-tabs{top:76px;overflow-x:auto;display:flex}
  .client-tabs button{min-width:106px;padding:0 10px}
  .profile-form{grid-template-columns:1fr}
  .profile-form button{grid-column:auto}
  .order-card-top,.order-card-bottom{align-items:flex-start;flex-direction:column}
}

/* V46 — autenticação e fidelidade Supabase */
.auth-box{min-width:0}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:5px;border-radius:14px;background:#f2ebe6;margin-bottom:14px}.auth-tabs button{min-height:43px;border:0;border-radius:10px;background:transparent;font-weight:900;color:#77675d}.auth-tabs button.active{background:#fff;color:#27170f;box-shadow:0 5px 14px rgba(50,28,17,.1)}
.auth-form{display:none}.auth-form.active{display:grid}.text-button{background:transparent!important;color:#6f594d!important;box-shadow:none!important;min-height:34px!important}.privacy-note{color:#8b7b71;line-height:1.4}.auth-message{min-height:20px;margin:10px 0 0;font-size:.84rem;font-weight:800}.auth-message.error{color:#b51b2b}.auth-message.success{color:#168b51}.guest-link{display:inline-flex;margin-top:15px;padding:11px 15px;border:1px solid #d9cbc2;border-radius:12px;font-weight:900;color:#4c382c;background:#fff}.points-card{background:linear-gradient(145deg,#fff7df,#fff)!important;border-color:#edd18d!important}.points-card strong{color:#9a5a05}.loyalty-explain{margin:0 0 16px;padding:15px 17px;border-radius:15px;background:#fff8df;border:1px solid #efd799;color:#65502e;line-height:1.5}.movement{display:flex;align-items:center;justify-content:space-between;gap:15px}.movement small,.movement time{display:block;color:#887970;margin-top:5px}.local-note{padding:11px 13px;border-radius:12px;background:#f6f0eb;color:#78685e;margin-bottom:10px;font-size:.83rem}.client-tabs{grid-template-columns:repeat(3,1fr)}
@media(max-width:620px){.auth-tabs{position:static}.movement{align-items:flex-start}.client-tabs button{min-width:90px}}

/* Garante que login e painel nunca apareçam ao mesmo tempo.
   O atributo hidden precisa prevalecer sobre display:grid da access-card. */
[hidden]{display:none!important}

/* V65 — cartões de informações mais compactos na área do cliente */
.client-kpis{
  gap:8px;
  margin:12px 0;
}
.client-kpis article{
  min-height:78px;
  padding:11px 13px;
  border-radius:14px;
  box-shadow:0 6px 16px rgba(46,26,15,.06);
}
.client-kpis span{
  font-size:.69rem;
}
.client-kpis strong{
  margin:5px 0 2px;
  font-size:1.18rem;
  line-height:1.1;
}
.client-kpis small{
  font-size:.69rem;
}
@media(max-width:620px){
  .client-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }
  .client-kpis article{
    min-height:72px;
    padding:10px 11px;
    border-radius:13px;
  }
  .client-kpis strong{
    font-size:1.08rem;
  }
}


/* V70 — login social com Google */
.google-login-button{
  width:100%;min-height:52px;padding:0 16px;border:1px solid #d6cbc3;border-radius:14px;
  display:flex;align-items:center;justify-content:center;gap:12px;background:#fff;color:#34251d;
  font:800 .94rem Roboto,Arial,sans-serif;cursor:pointer;box-shadow:0 6px 18px rgba(50,28,17,.07);
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease
}
.google-login-button:hover{transform:translateY(-1px);border-color:#bfaea3;box-shadow:0 9px 22px rgba(50,28,17,.11)}
.google-login-button:disabled{opacity:.7;cursor:wait;transform:none}
.google-icon{width:22px;height:22px;display:grid;place-items:center;flex:0 0 22px}
.google-icon svg{display:block;width:22px;height:22px}
.auth-divider{display:flex;align-items:center;gap:12px;margin:14px 0;color:#9a8b82;font-size:.75rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.auth-divider::before,.auth-divider::after{content:"";height:1px;flex:1;background:#e7ddd7}
.auth-divider span{white-space:nowrap}


/* V95 — histórico detalhado + troca de pontos por produtos */
.client-tabs{grid-template-columns:repeat(4,1fr)}
.order-items{display:grid;gap:7px}
.order-items p{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding-bottom:7px;border-bottom:1px solid #f0e7e1}
.order-items p:last-child{padding-bottom:0;border-bottom:0}
.order-items p b{font-size:.88rem;color:#443128}
.order-items p span{white-space:nowrap;color:#79685e;font-size:.84rem}
.order-items-empty{font-size:.82rem;color:#8d7c72}
.rewards-head p{margin:4px 0 0;color:#85736a;font-size:.86rem}
.rewards-balance{min-width:130px;padding:11px 14px;border-radius:14px;background:#fff7df;border:1px solid #ecd188;text-align:right}
.rewards-balance span{display:block;color:#80633b;font-size:.72rem;font-weight:900}
.rewards-balance strong{display:block;margin-top:3px;color:#995a05;font-size:1.25rem}
.rewards-toolbar{margin-bottom:12px}
.rewards-toolbar input{width:100%;min-height:48px;padding:0 14px;border:1px solid #ddcfc6;border-radius:13px;background:#fff}
.rewards-toolbar input:focus{outline:0;border-color:#d8972e;box-shadow:0 0 0 4px rgba(239,173,59,.13)}
.rewards-message{margin:0 0 14px;color:#7d6f66;font-size:.82rem;font-weight:800}
.rewards-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.reward-card{display:grid;grid-template-columns:96px 1fr;min-height:132px;overflow:hidden;border:1px solid #eadfd8;border-radius:18px;background:#fcfaf8}
.reward-card img{width:96px;height:100%;min-height:132px;object-fit:cover;background:#eee}
.reward-copy{padding:12px;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.reward-copy small{color:#8a766b;font-size:.72rem;font-weight:800}
.reward-copy h3{margin:4px 0 7px;font-size:.96rem;line-height:1.2}
.reward-copy strong{color:#9a5a05;font-size:.88rem}
.reward-copy button{width:100%;min-height:38px;margin-top:auto;border:0;border-radius:11px;background:linear-gradient(135deg,#168b51,#0b6d3d);color:#fff;font-weight:900;cursor:pointer}
.reward-copy button:disabled{background:#ddd4cf;color:#8d817a;cursor:not-allowed}
.reward-available{border-color:#d7c78c;background:linear-gradient(145deg,#fffdf7,#fff8e7)}
@media(max-width:920px){.rewards-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){
  .client-tabs button{min-width:104px}
  .rewards-grid{grid-template-columns:1fr}
  .rewards-head{align-items:flex-start}
  .rewards-balance{min-width:110px}
  .reward-card{grid-template-columns:88px 1fr}
  .reward-card img{width:88px;min-height:126px}
}
