/* ============================================================
   TOKENS
   ============================================================ */
:root{
  --page-bg:#E3EFE6;
  --primary-700:#3F6B52; --primary-500:#6E9C7D; --primary-100:#E3EFE6;
  --gold:#C97B4A; --ink-alt:#1E3327;
  --ink:#24312A; --muted:#6B7C72; --border:#D9E5DC; --surface:#FBFBF7; --surface-alt:#EFF5F0;
  --success-bg:#E4F6EC; --success-text:#1E7A46; --error-bg:#FBE7E7; --error-text:#B23B3B;
  --danger:#9B2F2F;
  --radius-md:14px; --radius-sm:10px;
}
/* ============================================================
   RESET / BASE
   ============================================================ */
*,*::before,*::after{ box-sizing:border-box; }

html{
  width:100%; max-width:100%; overflow-x:hidden;
  -webkit-text-size-adjust:100%; text-size-adjust:100%;
}
body{
  width:100%; max-width:100%; margin:0; overflow-x:hidden;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Arial,sans-serif;
  background:var(--page-bg); color:var(--ink); line-height:1.55;
}
img,picture,svg,video,canvas,iframe{ max-width:100%; height:auto; }
img{ display:block; }
input,select,textarea,button{ max-width:100%; min-width:0; }
textarea{ resize:vertical; overflow-wrap:anywhere; word-break:break-word; }
pre,code{ max-width:100%; overflow-wrap:anywhere; white-space:pre-wrap; }

.page-frame{
  width:100%; max-width:1360px; min-width:0; margin:0 auto;
  background:var(--surface); min-height:100vh; overflow-x:hidden;
}

/* Conteúdo centralizado: evita formulários/cards esticados em telas grandes */
.container{
  width:100%; max-width:1120px; margin:0 auto;
  padding:28px clamp(18px,2vw,32px); min-width:0;
}

/* Use .wide apenas em dashboards, relatórios e tabelas que precisam de mais espaço */
.container.wide{ width:100%; max-width:1240px; margin:0 auto; }

h1{ font-family:'Playfair Display',serif; font-weight:700; font-size:26px; margin:0 0 14px; color:var(--primary-700); }
h2{ font-family:'Playfair Display',serif; font-weight:700; font-size:19px; color:var(--primary-700); }
h3{ font-family:'Playfair Display',serif; font-weight:700; font-size:18px; color:var(--primary-700); }

.card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:26px; min-width:0; overflow:hidden; overflow-wrap:anywhere; }

.alert{ padding:12px 16px; border-radius:var(--radius-sm); margin:0 0 18px; font-weight:600; background:var(--primary-100); color:var(--primary-700); max-width:100%; overflow-wrap:anywhere; }
.alert.success{ background:var(--success-bg); color:var(--success-text); }
.alert.error{ background:var(--error-bg); color:var(--error-text); }

label{ display:block; font-weight:700; font-size:13px; color:var(--primary-700); margin:16px 0 6px; }
input,select,textarea{ width:100%; padding:12px 14px; border:1.5px solid var(--border); border-radius:var(--radius-sm); font:inherit; font-size:16px; min-height:44px; background:var(--surface); color:var(--ink); }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--primary-500); }

.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; background:var(--primary-700); color:#fff; border:0; padding:13px 22px; border-radius:var(--radius-sm); font-weight:700; text-decoration:none; cursor:pointer; font-size:15px; min-height:44px; touch-action:manipulation; max-width:100%; }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn.alt{ background:var(--surface); color:var(--primary-700); border:1.5px solid var(--primary-500); }
.btn.danger{ background:var(--danger); color:#fff; }

.muted{ color:var(--muted); font-size:14px; }

.table{ width:100%; max-width:100%; border-collapse:collapse; }
.table th,.table td{ text-align:left; padding:10px 12px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:top; }
.table th{ background:var(--surface-alt); font-size:12px; text-transform:uppercase; }
.table.compact th,.table.compact td{ padding:8px; font-size:.86rem; }
.mobile-table-scroll{ width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:10px; }
.mobile-table-scroll>.table{ min-width:680px; }
.table-scroll{ width:100%; overflow:auto; max-width:100%; }

.stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:16px; margin:20px 0; }
.stat{ background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius-sm); padding:16px; }
.stat span{ font-size:12px; color:var(--muted); text-transform:uppercase; }
.stat b{ font-size:24px; color:var(--primary-700); }

/* ============================================================
   TOPBAR E NAVEGAÇÃO (menu hambúrguer consolidado)
   ============================================================ */
.topbar{ display:flex; justify-content:space-between; align-items:center; padding:16px 26px; background:var(--surface); border-bottom:1px solid var(--border); flex-wrap:wrap; gap:12px; width:100%; max-width:100%; }
.brand{ font-family:'Playfair Display',serif; font-weight:700; font-size:20px; color:var(--primary-700); text-decoration:none; display:flex; align-items:center; gap:10px; min-width:0; max-width:100%; overflow-wrap:anywhere; }
.brand img{ flex:0 0 auto; }
.topbar nav{ display:flex; gap:6px; flex-wrap:wrap; min-width:0; }
.topbar nav a{ padding:8px 12px; border-radius:8px; text-decoration:none; color:var(--primary-700); font-weight:600; font-size:14px; white-space:nowrap; min-height:44px; display:inline-flex; align-items:center; touch-action:manipulation; }
.topbar nav a:hover{ background:var(--primary-100); }

.nav-toggle{
  display:none; align-items:center; justify-content:center; gap:8px;
  min-width:46px; min-height:44px; padding:9px 12px;
  border:1px solid var(--border); border-radius:10px;
  background:var(--surface); color:var(--primary-700); font-weight:800;
  cursor:pointer; line-height:1; -webkit-appearance:none; appearance:none;
  touch-action:manipulation;
}
.nav-toggle::before{ content:"☰"; font-size:20px; line-height:1; }
.nav-toggle[aria-expanded="true"]::before{ content:"✕"; }

@media(min-width:821px){
  .topbar .main-nav{ display:flex!important; }
  .nav-toggle{ display:none!important; }

  .mobile-table-scroll>.table,.report-table{ min-width:100%; }
}

/* ============================================================
   IMAGENS DE PRODUTO / GALERIA
   ============================================================ */
.product-grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; }
.product-main-image{
  width:100%; height:auto; max-height:70vh;
  aspect-ratio:auto; object-fit:contain;
  border-radius:14px; background:var(--surface-alt);
}
.product-thumbs{ display:flex; gap:8px; flex-wrap:nowrap; margin-top:10px; max-width:100%; overflow-x:auto; padding-bottom:4px; }
.gallery-thumb-btn{ width:68px; height:68px; flex:0 0 auto; border:2px solid var(--border); background:var(--surface); border-radius:10px; padding:2px; cursor:pointer; }
.gallery-thumb-btn:focus,.gallery-thumb-btn:hover{ border-color:var(--primary-500); outline:none; }
.gallery-thumb-btn img{ width:100%; height:100%; object-fit:cover; border-radius:7px; }
.product-image-placeholder{ aspect-ratio:4/3; display:grid; place-items:center; background:var(--surface-alt); border-radius:14px; color:var(--muted); }
.product-price{ font-size:26px; font-weight:800; color:var(--primary-700); margin:14px 0; }
.option-group{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin:16px 0; }
.option-group legend{ font-weight:800; color:var(--primary-700); padding:0 6px; }
.option-help{ margin:0 0 8px; }
.option-row{ display:flex; align-items:center; gap:9px; font-weight:500; color:var(--ink); margin:8px 0; }
.option-row input{ width:auto; margin:0; }
.option-row small{ color:var(--muted); margin-left:auto; }
.option-counter{ font-size:12px; color:var(--primary-700); font-weight:700; margin-top:7px; }
.product-total-preview{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 12px; padding:13px 15px; margin:18px 0; background:var(--surface-alt); border-radius:12px; }
.product-total-preview strong{ font-size:20px; color:var(--primary-700); }
.product-total-preview small{ grid-column:1/-1; color:var(--muted); }

/* ============================================================
   PRODUÇÃO
   ============================================================ */
.production-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:18px; }
.production-card{ padding:18px; }
.status-chip{ display:inline-flex; padding:5px 9px; border-radius:999px; background:var(--primary-100); color:var(--primary-700); font-size:12px; font-weight:800; }

/* ============================================================
   DASHBOARD EXECUTIVO
   ============================================================ */
.dashboard-kpis{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:16px; margin:18px 0; }
.kpi-card{ display:block; background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:18px; text-decoration:none; color:inherit; box-shadow:0 5px 18px rgba(31,79,109,.10); }
.kpi-card span{ display:block; font-size:.86rem; color:var(--muted); }
.kpi-card b{ display:block; font-size:1.6rem; margin:7px 0; color:var(--primary-700); }
.kpi-card small{ color:var(--muted); }
.dashboard-grid{ display:grid; gap:18px; margin:18px 0; }
.dashboard-grid-2{ grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr)); }
.dashboard-grid-3{ grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); }
.dashboard-panel{ min-width:0; }
.dashboard-panel h2{ margin-top:0; }
.panel-title{ display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.bar-chart{ height:265px; display:flex; align-items:flex-end; gap:7px; padding:28px 4px 0; border-bottom:1px solid var(--border); overflow:hidden; }
.bar-col{ height:100%; flex:1; min-width:20px; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:5px; }
.bar-col .bar{ width:72%; max-width:34px; background:linear-gradient(180deg,var(--primary-500),var(--primary-700)); border-radius:8px 8px 2px 2px; min-height:2px; }
.bar-col span{ font-size:.67rem; color:var(--muted); white-space:nowrap; }
.bar-value{ font-size:.62rem; color:var(--muted); min-height:14px; white-space:nowrap; }
.hbar-list{ display:grid; gap:13px; }
.hbar-label{ display:flex; justify-content:space-between; font-size:.86rem; margin-bottom:4px; }
.hbar-track,.mini-progress{ height:9px; background:var(--primary-100); border-radius:999px; overflow:hidden; }
.hbar-fill,.mini-progress span{ display:block; height:100%; background:var(--primary-500); border-radius:999px; }
.agenda-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; padding:9px 0; border-bottom:1px solid var(--border); }
.agenda-row .mini-progress{ grid-column:1/-1; }
.metric-lines{ display:grid; gap:2px; }
.metric-lines>div{ display:flex; justify-content:space-between; gap:16px; padding:11px 0; border-bottom:1px solid var(--border); }
.quick-actions{ display:flex; gap:9px; flex-wrap:wrap; max-width:100%; }

/* ============================================================
   RELATÓRIOS
   ============================================================ */
.filters-grid{ display:grid; grid-template-columns:minmax(260px,2fr) repeat(2,minmax(180px,1fr)) auto; gap:14px; align-items:end; width:100%; }
.filters-grid label{ display:grid; gap:6px; }
.export-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; max-width:100%; }
.report-kpis{ margin:16px 0; }
.report-table{ min-width:760px; }
.report-table th{ white-space:nowrap; position:sticky; top:0; background:var(--surface); z-index:1; }
.report-table td{ white-space:nowrap; }

/* ============================================================
   ÁREA DO CLIENTE
   ============================================================ */
.account-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr)); gap:16px; }
.account-card{ display:flex; flex-direction:column; gap:5px; padding:18px; border:1px solid var(--border); border-radius:var(--radius-md); text-decoration:none; color:var(--ink); background:var(--surface); }
.account-card b{ color:var(--primary-700); font-size:16px; }
.account-card span{ color:var(--muted); font-size:13px; }
.inline-actions{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; max-width:100%; }
.inline-actions form,.quick-actions form,.export-actions form{ margin:0; min-width:0; }
.form-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:16px; width:100%; min-width:0; }
.check-row{ display:flex; align-items:flex-start; gap:9px; font-weight:500; color:var(--ink); }
.check-row input{ width:auto; margin-top:4px; }

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout-form label{ margin-top:14px; }
@media(min-width:721px){
  .checkout-form{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 14px; }
  .checkout-form>input[type=hidden],.checkout-form>p,.checkout-form>#frete_info,.checkout-form>.checkout-submit,.checkout-form>textarea{ grid-column:1/-1; }
}
@media(max-width:720px){
  .checkout-submit{ position:sticky; bottom:8px; z-index:5; box-shadow:0 4px 16px rgba(0,0,0,.14); }
}

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.pagination{ display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:18px 0; max-width:100%; }
.pagination span{ font-size:13px; color:var(--muted); }

/* ============================================================
   NOTEBOOK / DESKTOP / MONITORES GRANDES
   ============================================================ */
@media(min-width:821px) and (max-width:1366px){
  .page-frame{ max-width:1220px; }
  .container{ max-width:1040px; padding-left:24px; padding-right:24px; }
  .container.wide{ max-width:1160px; padding-left:24px; padding-right:24px; }
  .dashboard-grid-3{ grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
  .dashboard-grid-2{ grid-template-columns:repeat(auto-fit,minmax(380px,1fr)); }
}

@media(min-width:1367px){
  .page-frame{ max-width:1360px; }
  .container{ max-width:1120px; }
  .container.wide{ max-width:1240px; }
  .dashboard-kpis{ grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
  .dashboard-grid-3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-grid-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media(min-width:1800px){
  .page-frame{ max-width:1440px; }
  .container{ max-width:1180px; }
  .container.wide{ max-width:1320px; }
  .card{ padding:28px; }
}

/* ============================================================
   RESPONSIVO — breakpoints consolidados
   ============================================================ */
@media(max-width:1024px){
  .container,.container.wide{ padding-left:18px; padding-right:18px; }
  .dashboard-grid-3{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-grid-2{ grid-template-columns:1fr; }
  .filters-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .product-grid{ gap:20px; }
}

@media(max-width:980px){
  .dashboard-grid-3{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .dashboard-grid-2{ grid-template-columns:1fr; }
  .bar-value{ display:none; }
}

@media(max-width:820px){
  .topbar{
    display:grid; grid-template-columns:minmax(0,1fr) auto;
    align-items:center; gap:10px 12px; padding:12px 16px;
  }
  .topbar .brand{ width:100%; overflow:hidden; text-overflow:ellipsis; }
  .nav-toggle{ display:inline-flex; position:relative; z-index:30; justify-self:end; width:auto; flex:0 0 auto; }
  .topbar .main-nav{
    display:none; grid-column:1/-1; width:100%; max-width:100%;
    flex-direction:column; gap:2px; margin:0; padding:8px 0 0;
    border-top:1px solid var(--border); max-height:70vh; overflow-y:auto; overflow-x:hidden;
  }
  .topbar .main-nav.is-open{ display:flex; }
  .topbar .main-nav a,.topbar .main-nav span{
    width:100%; max-width:100%; padding:11px 12px; margin:0;
    white-space:normal; overflow-wrap:anywhere; border-radius:8px;
  }
  .topbar .main-nav a{ background:var(--surface); border:1px solid transparent; }
  .topbar .main-nav a:hover,.topbar .main-nav a:focus{ border-color:var(--border); outline:none; }
  .topbar .main-nav .muted{ padding:10px 12px; }

  .container,.container.wide{ padding:20px 16px; }
  .card{ padding:18px; }
  h1{ font-size:24px; }
  .stats{ grid-template-columns:1fr 1fr; }
  .dashboard-grid-3,.dashboard-kpis{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-actions,.inline-actions,.export-actions{ align-items:stretch; }
  .quick-actions .btn,.inline-actions .btn{ flex:1 1 auto; }
  .product-grid{ grid-template-columns:1fr; }
  .report-table,.mobile-table-scroll>.table{ min-width:680px; }
  .checkout-form{ display:block!important; }
  .checkout-form>*{ width:100%; }

  html,body,.page-frame,.container,.container.wide,main,section,article,aside,
  header,footer,nav,form,fieldset,.card,.dashboard-panel,.kpi-card,
  .account-card,.option-group,.product-total-preview,
  p,span,div,li,td,th,label,legend,strong,b,small{
    color:var(--ink)!important; -webkit-text-fill-color:var(--ink)!important;
  }
  .muted,.help,.option-help,.option-counter,.pagination span,
  .kpi-card span,.kpi-card small,.topbar .main-nav .muted{
    color:var(--muted)!important; -webkit-text-fill-color:var(--muted)!important;
  }
  a,.topbar .main-nav a{
    color:var(--primary-700)!important; -webkit-text-fill-color:var(--primary-700)!important;
  }
  .topbar .main-nav a{ background:var(--surface)!important; }
  input,select,textarea{
    color:var(--ink)!important; -webkit-text-fill-color:var(--ink)!important;
    background:var(--surface)!important; opacity:1!important;
  }
  input::placeholder,textarea::placeholder{
    color:var(--muted)!important; -webkit-text-fill-color:var(--muted)!important; opacity:1!important;
  }
  .table th{ color:var(--ink)!important; -webkit-text-fill-color:var(--ink)!important; background:var(--surface-alt)!important; }
  .table td{ color:var(--ink)!important; -webkit-text-fill-color:var(--ink)!important; background:var(--surface)!important; }
  .alert,.alert *{ color:var(--ink)!important; -webkit-text-fill-color:var(--ink)!important; }
  .btn,button.btn,input[type="submit"],input[type="button"]{ color:#fff!important; -webkit-text-fill-color:#fff!important; }
  .btn.alt,button.btn.alt{ color:var(--primary-700)!important; -webkit-text-fill-color:var(--primary-700)!important; }
}

@media(max-width:720px){
  .product-detail{ padding:18px; }
  .gallery-thumb-btn{ width:58px; height:58px; }
}

@media(max-width:640px){
  #produto-grid{ grid-template-columns:1fr!important; }
  .production-grid{ grid-template-columns:1fr; }
  .table{ display:block; overflow-x:auto; white-space:nowrap; }
  .dashboard-grid-3{ grid-template-columns:1fr; }
  .dashboard-kpis{ grid-template-columns:1fr 1fr; }
  .kpi-card{ padding:14px; }
  .kpi-card b{ font-size:1.25rem; }
  .bar-chart{ height:210px; gap:3px; }
  .bar-col span{ font-size:.58rem; transform:rotate(-45deg); transform-origin:center; margin-bottom:6px; }
  .panel-title{ display:block; }
  .table.compact{ min-width:0; }
  .filters-grid{ grid-template-columns:1fr!important; }
  .filters-grid label:first-child{ grid-column:1/-1; }
  .export-actions .btn{ flex:1 1 100%; }
  .form-grid{ grid-template-columns:1fr; }
  .account-grid{ grid-template-columns:1fr; }

  .container,.container.wide{ width:100%; padding:16px 12px; }
  .topbar{ padding:10px 12px; }
  .topbar .brand{ font-size:18px; max-width:100%; }
  .topbar .brand img{ max-width:84px!important; max-height:30px!important; }
  .card{ padding:15px; border-radius:12px; }
  h1{ font-size:clamp(22px,7vw,28px); line-height:1.15; overflow-wrap:anywhere; }
  h2{ font-size:clamp(18px,5vw,23px); line-height:1.2; }
  .stats,.dashboard-kpis{ grid-template-columns:1fr; }
  .btn{ width:100%; padding:12px 14px; white-space:normal; text-align:center; }
  .btn+.btn{ margin-top:6px; }
  .inline-actions,.quick-actions,.export-actions{ display:grid; grid-template-columns:1fr; width:100%; gap:8px; }
  .inline-actions>*,.quick-actions>*,.export-actions>*{ width:100%; max-width:100%; }
  .product-total-preview{ grid-template-columns:1fr; }
  .product-total-preview strong{ justify-self:start; }
  .option-row{ display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; gap:7px 9px; flex-wrap:wrap; }
  .option-row small{ grid-column:2; margin-left:0; width:auto; }
  .mobile-table-scroll>.table{ min-width:620px; }
  input[type="checkbox"],input[type="radio"]{ min-height:auto; }
  .product-main-image{ max-height:none; }
  .product-thumbs{ gap:6px; }
  .gallery-thumb-btn{ width:56px; height:56px; }
  .pagination{ display:grid; grid-template-columns:1fr; }
  .pagination .btn{ width:100%; }
  .pagination span{ text-align:center; }
  footer.container .card{ display:grid!important; grid-template-columns:1fr!important; gap:16px!important; }
  .checkout-submit{ position:static!important; width:100%; }
  .report-table,.mobile-table-scroll>.table{ min-width:620px; }
  .bar-chart{ overflow-x:auto; overflow-y:hidden; }
}

@media(max-width:560px){
  .page-frame{ width:100%; min-width:0; }
}

@media(max-width:430px){
  .topbar{ grid-template-columns:minmax(0,1fr) auto; }
  .nav-toggle{ padding:8px 10px; font-size:13px; }
  .dashboard-kpis,.stats{ grid-template-columns:1fr!important; }
  .report-table,.mobile-table-scroll>.table{ min-width:560px; }
  .table th,.table td{ padding:8px 7px; font-size:13px; }
  .card{ padding:12px; }
  .product-price{ font-size:22px; }
}

@media(max-width:360px){
  .container,.container.wide{ padding-left:8px; padding-right:8px; }
  .topbar{ padding:8px; }
  .topbar .brand{ font-size:15px; }
  .topbar .brand img{ max-width:68px!important; }
  .nav-toggle{ font-size:12px; padding:7px 8px; }
  .card{ padding:10px; }
  .report-table,.mobile-table-scroll>.table{ min-width:520px; }
}

@media(orientation:landscape) and (max-height:500px){
  .topbar .main-nav{ max-height:62vh; }
}

@media(hover:none){
  .topbar nav a:hover,.gallery-thumb-btn:hover{ background:inherit; }
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{ scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}

@supports(padding:max(0px)){
  body{ padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right); }
}

@-moz-document url-prefix(){
  @media(max-width:820px){
    *{ text-shadow:none!important; }
    body,body *{ text-rendering:optimizeLegibility; }
    p,span,div,li,td,th,label,legend,small,strong,b{ opacity:1!important; }
  }
}

/* ============================================================
   AUTENTICAÇÃO — LOGIN / RECUPERAR SENHA / ACESSO ADMIN
   ============================================================ */

.auth-page{
  min-height:100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(31,79,109,.10), transparent 32%),
    radial-gradient(circle at 85% 90%, rgba(62,122,158,.10), transparent 30%),
    var(--page-bg);
}

.auth-page .page-frame{
  max-width:none;
  min-height:100vh;
  background:transparent;
}

.auth-container{
  width:100%;
  max-width:520px;
  min-height:calc(100vh - 90px);
  margin:0 auto;
  padding:48px 20px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.auth-card{
  width:100%;
  max-width:460px;
  margin:0 auto;
  padding:34px 34px 30px;
  background:var(--surface);
  border:1px solid rgba(31,79,109,.16);
  border-radius:20px;
  box-shadow:0 18px 50px rgba(22,55,75,.10);
  overflow:visible;
}

.auth-logo,
.auth-brand{
  display:flex;
  justify-content:center;
  align-items:center;
  margin:0 auto 22px;
  text-align:center;
}

.auth-logo img,
.auth-brand img{
  width:auto;
  max-width:180px;
  max-height:76px;
  object-fit:contain;
}

.auth-card h1,
.auth-card h2{
  margin:0 0 8px;
  text-align:center;
  color:var(--primary-700);
}

.auth-card h1{
  font-size:clamp(26px,3vw,32px);
  line-height:1.15;
}

.auth-card .muted,
.auth-subtitle{
  display:block;
  margin:0 auto 24px;
  text-align:center;
  line-height:1.5;
}

.auth-form{
  width:100%;
}

.auth-form label{
  margin:14px 0 7px;
  font-size:13px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"],
.auth-form select{
  width:100%;
  min-height:50px;
  padding:12px 14px;
  border:1.5px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  color:var(--ink);
  font-size:16px;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-form input:focus,
.auth-form select:focus{
  border-color:var(--primary-500);
  box-shadow:0 0 0 4px rgba(62,122,158,.12);
  background:#fff;
}

.auth-form input::placeholder{
  color:var(--muted);
  opacity:1;
}

.auth-form .btn,
.auth-submit{
  width:100%;
  min-height:50px;
  margin-top:20px;
  border-radius:12px;
  font-size:15px;
}

.auth-links{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px 16px;
  margin-top:16px;
  flex-wrap:wrap;
  font-size:14px;
}

.auth-links a{
  color:var(--primary-700);
  font-weight:700;
  text-decoration:none;
}

.auth-links a:hover,
.auth-links a:focus{
  text-decoration:underline;
}

.auth-footer{
  margin-top:24px;
  padding-top:18px;
  border-top:1px solid var(--border);
  text-align:center;
  font-size:13px;
  color:var(--muted);
}

.auth-card .alert{
  margin-bottom:18px;
  border-radius:12px;
  font-size:14px;
}

.auth-password-row{
  position:relative;
}

.auth-password-row input{
  padding-right:50px!important;
}

.auth-password-toggle{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:38px;
  height:38px;
  min-height:38px;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--primary-700);
  cursor:pointer;
}

@supports selector(.container:has(form input[type="password"])){
  @media(min-width:821px){
    .container:not(.wide):has(form input[type="password"]){
      max-width:560px;
      padding-top:48px;
      padding-bottom:48px;
    }

    .container:not(.wide):has(form input[type="password"]) > .card{
      max-width:480px;
      margin-left:auto;
      margin-right:auto;
      padding:32px;
      border-radius:20px;
      box-shadow:0 18px 50px rgba(22,55,75,.10);
    }

    .container:not(.wide):has(form input[type="password"]) form{
      width:100%;
    }

    .container:not(.wide):has(form input[type="password"]) input[type="email"],
    .container:not(.wide):has(form input[type="password"]) input[type="text"],
    .container:not(.wide):has(form input[type="password"]) input[type="password"]{
      min-height:50px;
    }
  }
}

@media(max-width:820px){
  .auth-container{
    max-width:100%;
    min-height:calc(100vh - 70px);
    padding:28px 16px;
  }

  .auth-card{
    max-width:500px;
    padding:26px 22px 24px;
    border-radius:18px;
  }

  .auth-logo img,
  .auth-brand img{
    max-width:150px;
    max-height:64px;
  }

  .auth-links{
    justify-content:center;
    text-align:center;
  }
}

@media(max-width:480px){
  .auth-page{
    background:var(--page-bg);
  }

  .auth-container{
    min-height:auto;
    padding:18px 10px 26px;
    align-items:flex-start;
  }

  .auth-card{
    width:100%;
    padding:22px 16px 20px;
    border-radius:15px;
    box-shadow:0 8px 24px rgba(22,55,75,.08);
  }

  .auth-card h1{
    font-size:26px;
  }

  .auth-form input[type="text"],
  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="tel"],
  .auth-form select,
  .auth-form .btn,
  .auth-submit{
    min-height:48px;
  }

  .auth-links{
    display:grid;
    grid-template-columns:1fr;
  }
}

@-moz-document url-prefix(){
  .auth-form input,
  .auth-form select{
    opacity:1!important;
    color:var(--ink)!important;
    -webkit-text-fill-color:var(--ink)!important;
    background:var(--surface)!important;
  }

  .auth-form input::placeholder{
    color:var(--muted)!important;
    -webkit-text-fill-color:var(--muted)!important;
    opacity:1!important;
  }
}