*{ box-sizing:border-box; }

:root{
  --sidebar-w: 248px;
  --sidebar-collapsed-w: 72px;
  --sidebar-current-w: var(--sidebar-collapsed-w);
  --topbar-h: 60px;
  --shell-bg: #f1f5f9;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,.08);
  --sidebar-text: #cbd5e1;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,.08);
  --sidebar-active: linear-gradient(135deg, #1d4ed8, #3b82f6);
  --content-bg: #f8fafc;
}

html, body{
  height:100%;
  overflow:hidden;
}

body{
  margin:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0f172a;
  background: var(--shell-bg);
  overflow:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(14,165,233,.10), transparent 28%);
}

/* ================= LOADING OVERLAY GLOBAL ================= */

.core-loading-overlay{
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
  opacity: 1;
  visibility: visible;
  transition: opacity .20s ease, visibility .20s ease;
}

.core-loading-overlay.is-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.core-loading-overlay{
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease, visibility .18s ease;
}

.core-loading-overlay.is-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.core-loader-orbit{
  position: relative;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  animation: coreLoaderFloat 2.2s ease-in-out infinite;
}

.core-loader-center{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  box-shadow:
    0 0 0 6px rgba(59,130,246,.08),
    0 0 22px rgba(96,165,250,.28);
  position: relative;
  z-index: 3;
}

.core-loader-ring{
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(148,163,184,.22);
  box-shadow: inset 0 0 18px rgba(255,255,255,.03);
}

.core-loader-dot{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow:
    0 0 14px rgba(59,130,246,.45),
    0 0 28px rgba(96,165,250,.22);
  transform-origin: 0 0;
  animation: coreLoaderOrbit 1.05s cubic-bezier(.68,-0.08,.32,1.08) infinite;
}

.core-loader-dot::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  filter: blur(8px);
  opacity: .55;
  z-index: -1;
}

@keyframes coreLoaderOrbit{
  0%{
    transform: rotate(0deg) translateX(26px) scale(.92);
  }
  50%{
    transform: rotate(180deg) translateX(26px) scale(1.12);
  }
  100%{
    transform: rotate(360deg) translateX(26px) scale(.92);
  }
}

@keyframes coreLoaderFloat{
  0%, 100%{
    transform: translateY(0);
  }
  50%{
    transform: translateY(-2px);
  }
}

.core-shell{
  flex:1;
  height:100vh;
  display:grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  position:relative;
  z-index:1;
  overflow:hidden;
}

.core-sidebar{
  grid-area: sidebar;
  width: var(--sidebar-collapsed-w);
  background: linear-gradient(180deg, #111827, #0f172a);
  border-right:1px solid var(--sidebar-border);
  display:flex;
  flex-direction:column;
  min-height:0;
  height:100%;
  flex:0 0 var(--sidebar-collapsed-w);
  overflow:hidden;
  transition: width .22s ease, flex-basis .22s ease;
}

.core-sidebar:hover,
body.sidebar-pinned .core-sidebar{
  width: var(--sidebar-w);
  flex-basis: var(--sidebar-w);
}

.core-sidebar:hover,
body.sidebar-pinned .core-sidebar{
  width: var(--sidebar-w);
  flex-basis: var(--sidebar-w);
}

body.sidebar-pinned{
  --sidebar-current-w: var(--sidebar-w);
}

body:not(.sidebar-pinned):has(.core-sidebar:hover){
  --sidebar-current-w: var(--sidebar-w);
}

.sidebar-top{
  height: 42px;
  min-height: 42px;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  padding: 6px 8px 2px;
}

.sidebar-pin-btn{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #e6f0ff;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:12px;
  line-height:1;
  transition: background .18s ease, border-color .18s ease, transform .12s ease, opacity .18s ease;
  opacity: 0;
  pointer-events: none;
}

.core-sidebar:hover .sidebar-pin-btn,
body.sidebar-pinned .sidebar-pin-btn,
.sidebar-pin-btn:focus-visible{
  opacity: 1;
  pointer-events: auto;
}

.sidebar-pin-btn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}

.sidebar-pin-btn:active{
  transform: scale(.97);
}

body.sidebar-pinned .sidebar-pin-btn{
  background: rgba(59,130,246,.20);
  border-color: rgba(96,165,250,.34);
}

.sidebar-nav{
  padding:4px 10px 12px;
  display:grid;
  gap:8px;
}

.sidebar-link{
  width:100%;
  min-height:46px;
  border:0;
  border-radius:16px;
  background:transparent;
  color:var(--sidebar-text);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 14px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  transition:background .18s ease, transform .12s ease, color .18s ease, box-shadow .18s ease, padding .18s ease;
  white-space:nowrap;
  overflow:hidden;
}

.sidebar-link:hover{
  background:var(--sidebar-hover);
  color:var(--sidebar-text-active);
  transform:translateX(2px);
}

.sidebar-link.active{
  background:var(--sidebar-active);
  color:var(--sidebar-text-active);
  box-shadow:0 12px 24px rgba(37,99,235,.22);
}

.core-sidebar:not(:hover) .sidebar-link,
body:not(.sidebar-pinned) .core-sidebar .sidebar-link{
  justify-content:flex-start;
}

body:not(.sidebar-pinned) .core-sidebar:not(:hover) .sidebar-link{
  padding-left: 26px;
  padding-right: 26px;
}

body:not(.sidebar-pinned) .core-sidebar:not(:hover) .sidebar-link .sidebar-text,
body:not(.sidebar-pinned) .core-sidebar:not(:hover) .sidebar-footer,
body:not(.sidebar-pinned) .core-sidebar:not(:hover) .sidebar-lock{
  display:none;
}

body:not(.sidebar-pinned) .core-sidebar:not(:hover) .sidebar-link{
  justify-content:center;
  padding-left: 0;
  padding-right: 0;
}

body:not(.sidebar-pinned) .core-sidebar:not(:hover) .sidebar-secondary{
  padding-left:10px;
  padding-right:10px;
}

.sidebar-ico{
  width:18px;
  text-align:center;
  font-size:16px;
  flex:0 0 18px;
}

.sidebar-text{
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .16s ease, transform .16s ease;
}

.core-sidebar:hover .sidebar-text,
body.sidebar-pinned .sidebar-text{
  opacity: 1;
  transform: translateX(0);
}

.sidebar-lock{
  margin-left:auto;
  font-size:13px;
  opacity:0;
  transition: opacity .16s ease;
}

.core-sidebar:hover .sidebar-lock:not(.hidden),
body.sidebar-pinned .sidebar-lock:not(.hidden){
  opacity:.9;
}

.sidebar-secondary{
  margin-top:auto;
  padding: 0 10px 10px;
  display:grid;
  gap:8px;
}

.sidebar-link-secondary{
  width: 100%;
}

.sidebar-footer{
  margin-top:0;
  padding:18px 16px 20px;
  border-top:1px solid var(--sidebar-border);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  overflow:hidden;
}

.sidebar-footer-text{
  font-size:12px;
  font-weight:800;
  color:#cbd5e1;
  opacity:.9;
}

.sidebar-footer-logo{
  height:20px;
  width:auto;
  display:block;
  opacity:.95;
}

.sidebar-footer-sub{
  font-size:11px;
  font-weight:700;
  color:#94a3b8;
}

.core-main-area{
  grid-area: main;
  min-width:0;
  min-height:0;
  height:100%;
  display:flex;
  flex-direction:column;
  background: var(--content-bg);
  overflow:hidden;
}

/* ================= TOPBAR ================= */
.topbar{
  grid-area: topbar;
  position:relative;
  z-index:30;
  height:var(--topbar-h);
  min-height:var(--topbar-h);
  max-height:var(--topbar-h);
  padding:0 16px 0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  background: linear-gradient(180deg, #111827, #0f172a);
  color:#e6f0ff;
  border-bottom:1px solid rgba(255,255,255,.06);
  box-shadow: 0 8px 20px rgba(2,12,20,.14);
  overflow:hidden;
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  height:100%;
  position:relative;
  z-index:2;
}

.topbar-left{
  min-width:180px;
}

.topbar-logo-core{
  height: 30px;
  width: auto;
  display:block;
  opacity:.98;
}

.topbar-core-logo-btn{
  padding: 0;
  margin: 0;
}

.topbar-center{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  pointer-events:auto;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  height:100%;
  margin-left:auto;
}

.hello{
  font-size:14px;
  font-weight:700;
  opacity:.92;
  white-space:nowrap;
}

.divider{
  width:1px;
  height:26px;
  background: rgba(230,240,255,.22);
  margin:0 2px;
}

.topbar-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(230,240,255,.14);
  background: rgba(255,255,255,.05);
  color:#e6f0ff;
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size:16px;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}

.topbar-icon:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(230,240,255,.22);
}

.topbar-icon:active{
  transform: scale(.98);
}

.topbar-mobile-menu-btn{
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #e6f0ff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}

.topbar-mobile-menu-btn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}

.topbar-mobile-menu-btn:active{
  transform: scale(.96);
}

/* ================= APP ================= */
#app{
  flex:1 1 auto;
  width:100%;
  max-width:none;
  margin:0;
  padding:24px;
  overflow-y:auto;
  overflow-x:hidden;
  min-height:0;
}

.topbar-logo-btn{
  appearance:none;
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  line-height:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.topbar-logo-store{
  height: 44px;
  width: auto;
  max-height: 44px;
  display:block;
  opacity:.98;
}

.topbar-logo-btn{
  appearance:none;
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  line-height:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.topbar-logo-btn:focus-visible{
  outline:2px solid rgba(255,255,255,.35);
  outline-offset:4px;
  border-radius:10px;
}

.topbar-logo-btn img{
  display:block;
  background:transparent;
}

#btnLogout{
  display:flex;
  align-items:center;
  justify-content:center;
}

#btnLogout .icon-power{
  display:block;
  line-height:1;
  transform:translateY(1px);
  font-size:19px;
}

/* grade 2x2 dos cards grandes */
.hero-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* cards grandes estilo mock */
.hero-card{
  position:relative;
  border-radius: 22px;
  padding: 22px;
  min-height: 170px;

  /* borda branca grossa + sombra */
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, .12);
  overflow:hidden;
}
.hero-card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 22px;
  box-shadow: inset 0 0 0 10px rgba(255,255,255,.75);
  pointer-events:none;
}

.hero-inner{
  position:relative;
  height:100%;
  border-radius: 18px;
  padding: 22px 22px;
  overflow:hidden;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}

.hero-title{
  font-size:42px;
  line-height:1;
  font-weight:900;
  letter-spacing:.2px;
  color: rgba(255,255,255,.94);
  margin:0 0 14px;
  text-shadow: 0 10px 20px rgba(0,0,0,.18);
}

.hero-action{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 0;
  cursor:pointer;
  font-weight:800;
  color: rgba(255,255,255,.95);
  background: rgba(0,0,0,.22);
  box-shadow: 0 10px 18px rgba(0,0,0,.16);
}
.hero-action:active{ transform: scale(.99); }

.hero-illu{
  width: 180px;
  height: 120px;
  border-radius: 18px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  display:grid; place-items:center;
  font-size: 44px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* cores dos 4 cards */
.hero-green .hero-inner{
  background: linear-gradient(135deg, #1e9b67, #7ddc9c);
}
.hero-orange .hero-inner{
  background: linear-gradient(135deg, #e67b2f, #f2b14a);
}
.hero-blue .hero-inner{
  background: linear-gradient(135deg, #1f6bb8, #4db7ff);
}
.hero-purple .hero-inner{
  background: linear-gradient(135deg, #5b57d6, #8b86ff);
}

/* ================= CARDS DE BAIXO ================= */
.bottom-grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.small-card{
  background: rgba(255,255,255,.86);
  border-radius: 18px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, .10);
  border: 1px solid rgba(15, 23, 42, .08);
  padding: 16px 16px 18px;
  min-height: 130px;
}

.small-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  color:#1e293b;
  margin-bottom: 10px;
}
.small-title .ico{
  width:34px; height:34px;
  border-radius: 12px;
  display:grid; place-items:center;
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(15, 23, 42, .08);
}

.hr{
  height:1px;
  background: rgba(15, 23, 42, .10);
  margin: 10px 0 12px;
}

.small-row{
  display:flex;
  justify-content:space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  font-weight:700;
  color:#334155;
}
.small-row:last-child{ border-bottom:none; }

.quick-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-btn{
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 22px rgba(15, 23, 42, .08);
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  font-weight:900;
  color:#1f2937;
}
.quick-btn .mini-ico{
  width:44px; height:44px;
  border-radius: 16px;
  display:grid; place-items:center;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.18);
  font-size:22px;
}

.notify{
  height: 84px;
  display:grid;
  place-items:center;
  color:#64748b;
  font-style: italic;
  font-weight:700;
}
.notify .bell{
  font-size: 22px;
  opacity:.7;
}

/* ================= RESPONSIVO ================= */
@media (max-width: 860px){
  .hero-grid{ grid-template-columns: 1fr; }
  .bottom-grid{ grid-template-columns: 1fr; }
  .hero-illu{ width: 150px; }
  .hero-title{ font-size: 38px; }
}
@media (max-width: 520px){
  .hello{ display:none; }
  .hero-illu{ display:none; } /* no celular foca no botão */
  .hero-title{ font-size: 34px; }
}


#btnGoHome{
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  transition: transform .06s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
}

#btnGoHome:hover{
  background: rgba(255,255,255,.08);
  box-shadow: 0 10px 18px rgba(0,0,0,.10);
}

#btnGoHome:active{
  transform: scale(.98);
  background: rgba(255,255,255,.10);
}

/* Logout: centralização perfeita do símbolo ⏻ */
#btnLogout{
  display:flex;                 /* em vez de grid */
  align-items:center;
  justify-content:center;
}

#btnLogout .icon-power{
  display:block;
  line-height: 1;               /* mata baseline esquisita */
  transform: translateY(1px);   /* ajuste visual fino (pode ser 0px ou 2px) */
  font-size: 19px;
}

.tabs{
  display:flex;
  gap:8px;
  margin-bottom:14px;
}

.tab-btn{
  flex:1;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  font-weight:900;
  cursor:pointer;
}

.tab-btn.active{
  background:#0ea5e9;
  color:#fff;
  border:none;
}

.settings-list{
  margin-top:12px;
  display:grid;
  gap:8px;
}

.settings-item{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:900;
}

.settings-actions button{
  margin-left:6px;
}

.tabs{
  display:flex;
  gap:8px;
  margin-bottom:14px;
}

.tab-btn{
  flex:1;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  font-weight:900;
  cursor:pointer;
}

.tab-btn.active{
  background:#0ea5e9;
  color:#fff;
  border:none;
}

.settings-list{
  margin-top:12px;
  display:grid;
  gap:8px;
}

.settings-item{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:900;
}

.settings-actions button{
  margin-left:6px;
}

/* =========================
 CONFIGURAÇÕES DO SISTEMA
========================= */

.admin-auth input,
.form input,
.form select {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.15);
  padding: 0 12px;
  margin-bottom: 10px;
}

.system-config {
  width: min(640px, 100%);
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.config-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.tab {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: #0ea5e9;
  color: white;
}

.config-content {
  margin-top: 10px;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
}

.actions button {
  margin-left: 6px;
}

.btn-primary.small {
  height: 36px;
  padding: 0 14px;
}

.error-text {
  margin-top: 8px;
  color: #ef4444;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.hidden {
  display: none;
}

.form-box {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.list-box {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.btn-add {
  margin-top: 8px;
}

.btn-save {
  margin-top: 10px;
  width: fit-content;
}

.grid-rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ===== Config Modal: visual CORE ===== */
.system-config{
  width: min(760px, calc(100% - 24px));
  border-radius: 22px;
  padding: 16px;
}

.config-tabs{ gap: 10px; }

.tab{
  height: 42px;
  border-radius: 16px;
  font-weight: 950;
  transition: .15s ease;
}
.tab:not(.active):hover{
  background: rgba(148,163,184,.20);
}
.tab.active{
  box-shadow: 0 18px 30px rgba(14,165,233,.18);
}

.btn-primary.small,
.btn-add,
.btn-save{
  border: 0;
  border-radius: 16px;
  font-weight: 950;
  cursor: pointer;
  transition: .15s ease;
}

.btn-add{
  height: 38px;
  padding: 0 14px;
  background: rgba(22,163,74,.12);
  color: #166534;
  border: 1px solid rgba(22,163,74,.28);
}
.btn-add:hover{ background: rgba(22,163,74,.18); }

.btn-save{
  height: 40px;
  padding: 0 16px;
  background: linear-gradient(135deg,#16a34a,#4ade80);
  color:#fff;
  box-shadow: 0 18px 30px rgba(22,163,74,.18);
}
.btn-save:hover{ transform: translateY(-1px); }

.form-box input,
.form-box select{
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 0 12px;
  font-weight: 900;
  outline: none;
  background: rgba(255,255,255,.92);
}
.form-box input:focus,
.form-box select:focus{
  border-color: rgba(14,165,233,.55);
  box-shadow: 0 0 0 3px rgba(14,165,233,.14);
}

.grid-rates{ grid-template-columns: repeat(3, 1fr); }

.list-box{
  margin-top: 14px;
}

.list-item{
  border-radius: 18px;
  padding: 12px 12px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}

.list-item .meta{
  color: #64748b;
  font-weight: 900;
  font-size: 12px;
  margin-top: 4px;
}

.actions{
  display:flex;
  gap: 8px;
}

/* botões ícones */
.icon-action{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  transition: .15s ease;
  font-weight: 950;
}

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

.icon-action.edit{
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.26);
  color: #1d4ed8;
}

.icon-action.del{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.26);
  color: #b91c1c;
}

/* garantir que nada estoura no modal */
.system-config,
.system-config *{
  box-sizing: border-box;
}

.system-config{
  width: min(900px, calc(100% - 24px)); /* aumenta a “caixona” */
}

.form-box,
.list-box,
.grid-rates{
  width: 100%;
  max-width: 100%;
}

/* MUITO importante em grid: permitir encolher */
.grid-rates > input,
.form-box input,
.form-box select{
  min-width: 0;
}

/* se quiser, deixa 4 colunas em telas grandes */
@media (min-width: 900px){
  .grid-rates{
    grid-template-columns: repeat(4, 1fr);
  }
}

/* em telas menores volta pra 2 colunas */
@media (max-width: 650px){
  .grid-rates{
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-rates input::placeholder{
  font-size: 12px;
}

/* ===== MODAIS GLOBAIS (blindado contra CSS das páginas) ===== */
.core-overlay.core-hidden{ display:none !important; }


.core-overlay{
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2,6,23,.55) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
}

.core-modal{
  width: min(760px, calc(100% - 24px)) !important;
  border-radius: 22px !important;
  background: rgba(255,255,255,.96) !important;
  border: 1px solid rgba(15,23,42,.12) !important;
  box-shadow: 0 30px 80px rgba(2,6,23,.35) !important;
  padding: 14px !important;
}

/* ===== Padronizar botões do MODAL ADMIN (em qualquer página) ===== */
#adminAuthOverlay .modal-actions{
  display:flex !important;
  gap: 12px !important;
  margin-top: 12px !important;
}

#adminAuthOverlay .modal-actions button{
  height: 44px !important;
  border-radius: 16px !important;
  font-weight: 950 !important;
  cursor: pointer !important;
  padding: 0 16px !important;
  border: 1px solid rgba(15,23,42,.12) !important;
}

/* Cancelar */
#adminAuthOverlay .btn-ghost{
  flex: 1 !important;
  background: rgba(255,255,255,.92) !important;
  color:#0f172a !important;
}

/* Entrar */
#adminAuthOverlay .btn-primary{
  flex: 1.2 !important;
  border: 0 !important;
  color:#fff !important;
  background: linear-gradient(135deg,#16a34a,#4ade80) !important;
  box-shadow: 0 18px 30px rgba(22,163,74,.18) !important;
}

/* Garantir que o card do admin sempre tenha o mesmo tamanho */
#adminAuthOverlay .admin-auth{
  width: min(620px, calc(100% - 24px)) !important;
}

/* ===== Padronizar dentro do Config do Sistema ===== */
#systemConfigOverlay .btn-add,
#systemConfigOverlay .btn-save,
#systemConfigOverlay .icon-action{
  all: unset;
  box-sizing: border-box;
}

/* re-aplicar o visual */
#systemConfigOverlay .btn-add{
  display:inline-flex;
  align-items:center;
  height:38px;
  padding:0 14px;
  border-radius:16px;
  font-weight:950;
  cursor:pointer;
  background: rgba(22,163,74,.12);
  color:#166534;
  border: 1px solid rgba(22,163,74,.28);
}

#systemConfigOverlay .btn-save{
  display:inline-flex;
  align-items:center;
  height:40px;
  padding:0 16px;
  border-radius:16px;
  font-weight:950;
  cursor:pointer;
  border:0;
  color:#fff;
  background: linear-gradient(135deg,#16a34a,#4ade80);
  box-shadow: 0 18px 30px rgba(22,163,74,.18);
}

#systemConfigOverlay .icon-action{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  font-weight:950;
}

#systemConfigOverlay .icon-action.edit{
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.26);
  color: #1d4ed8;
}
#systemConfigOverlay .icon-action.del{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.26);
  color: #b91c1c;
}

/* =========================
   CHAT GLOBAL (Topbar + Modal)
========================= */

.chat-btn{
  position: relative;
}

.chat-badge{
  position: absolute;
  top: 7px;
  right: 7px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444; /* vermelho */
  box-shadow: 0 0 0 2px rgba(12,36,58,1); /* aro pra destacar no fundo azul */
}

/* Modal do chat */
.chat-modal{
  width: min(720px, calc(100% - 24px)) !important;
  padding: 14px !important;
}

.chat-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-title .t1{
  font-weight: 950;
  font-size: 18px;
  color: #0f172a;
}

.chat-title .t2{
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.chat-list{
  height: min(55vh, 460px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.chat-msg{
  display:flex;
  gap: 10px;
  align-items:flex-start;
}

.chat-avatar{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  font-weight: 950;
  color:#0b1b2b;
  background: linear-gradient(135deg, rgba(59,130,246,1), rgba(147,197,253,1));
  flex: 0 0 auto;
}

.chat-bubble{
  flex: 1;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: #fff;
  padding: 10px 12px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}

.chat-meta{
  display:flex;
  gap: 8px;
  align-items:baseline;
  font-weight: 950;
  color:#0f172a;
  margin-bottom: 6px;
}

.chat-meta .time{
  font-weight: 900;
  font-size: 12px;
  color:#64748b;
}

.chat-text{
  white-space: pre-wrap;
  font-weight: 800;
  color:#1f2937;
  line-height: 1.25;
}

.chat-compose{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  align-items:center;
}

.chat-compose input{
  flex: 1;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 0 12px;
  font-weight: 900;
  outline: none;
  background: rgba(255,255,255,.92);
}

.chat-compose input:focus{
  border-color: rgba(14,165,233,.55);
  box-shadow: 0 0 0 3px rgba(14,165,233,.14);
}

.chat-compose .btn-primary{
  height: 44px;
  border-radius: 16px;
  font-weight: 950;
  padding: 0 16px;
  border: 0;
  cursor: pointer;
  color:#fff;
  background: linear-gradient(135deg,#16a34a,#4ade80);
  box-shadow: 0 18px 30px rgba(22,163,74,.18);
}

.chat-foot{
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  color:#64748b;
}

/* ===== Topbar mínima no LOGIN ===== */
body.is-login .topbar-right{
  display:none !important;
}

body.is-login .topbar-right{
  display:none !important;
}

.chat-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* ===== Modal: Limpar chat ===== */
.chat-clear-modal{
  width: min(520px, calc(100% - 24px)) !important;
  padding: 14px !important;
}

.chat-clear-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chat-clear-title{
  font-weight: 950;
  font-size: 18px;
  color:#0f172a;
}

.chat-clear-sub{
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  color:#64748b;
}

.chat-clear-body{
  display:grid;
  gap: 8px;
}

.chat-clear-label{
  font-size: 12px;
  font-weight: 900;
  color:#334155;
}

#chatClearPass{
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 0 12px;
  font-weight: 900;
  outline: none;
  background: rgba(255,255,255,.92);
}

#chatClearPass:focus{
  border-color: rgba(239,68,68,.55);
  box-shadow: 0 0 0 3px rgba(239,68,68,.14);
}

.chat-clear-error{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,.22);
  background: rgba(239,68,68,.08);
  color:#b91c1c;
  font-weight: 950;
  font-size: 12px;
}

.chat-clear-warn{
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(245,158,11,.22);
  background: rgba(245,158,11,.10);
  color:#92400e;
  font-weight: 900;
  font-size: 12px;
}

.chat-clear-actions{
  margin-top: 12px;
  display:flex;
  justify-content:center;
  gap: 12px;
}

.chat-clear-actions .btn-ghost,
.chat-clear-actions .btn-danger{
  flex: 0 0 auto;
  width: 180px;
  height: 44px;
  border-radius: 14px;
  font-weight: 950;
  cursor: pointer;
}

.chat-clear-actions .btn-ghost{
  border: 1px solid rgba(15,23,42,.14);
  background:#fff;
  color:#0f172a;
}

.chat-clear-actions .btn-danger{
  border: 0;
  color:#fff;
  background: linear-gradient(135deg, #ef4444, #fb7185);
  box-shadow: 0 14px 26px rgba(239,68,68,.20);
}

.topbar-logo-center{
  height: 30px; /* destaque principal */
  width: auto;
  opacity: .98;
}

.topbar-logo-left{
  height: 50px;   /* ⬅️ tamanho ideal */
  width: auto;
  display: block;
}

/* botão invisível (sem fundo branco) */
.topbar-logo-btn{
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* evita aquele “quadrado” de foco feio, mas mantém acessibilidade */
.topbar-logo-btn:focus-visible{
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 4px;
  border-radius: 10px;
}

/* garante que as imagens não criem caixa branca */
.topbar-logo-btn img{
  display: block;
  background: transparent;
}


.topbar-icon-btn{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}

.topbar-icon-btn:hover{
  background: rgba(255,255,255,.16);
}

.topbar-icon-btn:active{
  transform: scale(.96);
}

/* ===== Topbar: ícones padrão (garante cursor e visual) ===== */
.topbar-icon{
  cursor: pointer !important;
  user-select: none;
}

/* botão Home segue exatamente o padrão */
.topbar-icon.home-btn{
  cursor: pointer !important;
}

/* se algum CSS global estiver matando botão */
button.topbar-icon{
  appearance: none;
  border: 0;
  background: transparent;
}

@media (max-width: 980px){
  .topbar-center{
    display:none;
  }

  .topbar-left{
  min-width:180px;
  justify-content:flex-start;
  padding-left:0;
}
}

@media (max-width: 720px){
  :root{
    --sidebar-collapsed-w: 64px;
  }

  .topbar-user-meta{
    display:none;
  }

  #app{
    padding:16px;
  }

.topbar-mobile-menu-btn{
  display: inline-flex;
}

.topbar-left{
  gap: 8px;
}

body.mobile-menu-open .core-sidebar{
  transform: translateX(0);
}

body.mobile-menu-open::after{
  content: "";
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(2,6,23,.34);
  z-index: 70;
}

}

.rate-field{
  display: grid;
  gap: 6px;
}

.rate-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  color: #475569;
  padding-left: 2px;
}

.rate-toggle input[type="checkbox"]{
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
  cursor: pointer;
}

.form-box input.is-disabled-rate{
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  border-color: rgba(148,163,184,.20);
  cursor: not-allowed;
  box-shadow: none;
}

.form-box input.is-disabled-rate::placeholder{
  color: #94a3b8;
}

#btnChatClear{
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,.18);
  background: rgba(239,68,68,.08);
  color: #b91c1c;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: .15s ease;
  box-shadow: 0 8px 18px rgba(239,68,68,.08);
}

#btnChatClear:hover{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.28);
  transform: translateY(-1px);
}

#btnChatClear:active{
  transform: scale(.98);
}

/* ================= LOGIN ================= */

.login-wrapper{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.login-box{
  width:100%;
  max-width:360px;
  background:#fff;
  padding:24px;
  border-radius:20px;
  box-shadow:0 20px 40px rgba(0,0,0,.1);
  display:flex;
  flex-direction:column;
  gap:12px;
  text-align:center;
}

.login-logo{
  height:50px;
  margin:0 auto 10px;
}

.login-box input{
  height:44px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.15);
  padding:0 12px;
  font-weight:700;
}

.btn-login{
  height:44px;
  border-radius:14px;
  border:0;
  background:#16a34a;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.btn-admin{
  height:38px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.15);
  background:#fff;
  font-weight:800;
  cursor:pointer;
}

body.is-login .core-sidebar{
  display: none !important;
}

body.is-login .topbar{
  display: none !important;
}

body.is-login .core-main-area{
  width: 100% !important;
  height: 100vh !important;
}

body.is-login #app{
  padding: 0 !important;
}

body.is-login .core-sidebar,
body.is-login .topbar{
  display:none !important;
}

body.is-login .core-main-area{
  width:100% !important;
  margin:0 !important;
}

body.is-login #app{
  padding:0 !important;
}

/* =========================
   ÁREA ADMINISTRATIVA (USUÁRIOS)
========================= */

.admin-users-modal{
  width:min(980px, calc(100% - 24px)) !important;
  padding:20px !important;
  border-radius:24px !important;
}

.admin-users-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.admin-users-head-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.admin-users-title{
  font-size:30px;
  font-weight:950;
  color:#0f172a;
  line-height:1;
}

.admin-users-subtitle{
  margin-top:8px;
  font-size:13px;
  font-weight:800;
  color:#64748b;
}

.admin-users-body{
  display:grid;
  gap:16px;
}

.admin-users-list{
  display:grid;
  gap:12px;
  max-height:62vh;
  overflow:auto;
  padding-right:4px;
}

.admin-user-row{
  display:grid;
  grid-template-columns: 64px 1fr auto;
  gap:16px;
  align-items:center;
  padding:16px;
  border-radius:20px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  box-shadow:0 12px 24px rgba(15,23,42,.06);
}

.admin-user-avatar{
  width:64px;
  height:64px;
  border-radius:20px;
  overflow:hidden;
  background:linear-gradient(135deg, #1d4ed8, #60a5fa);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:950;
  font-size:24px;
}

.admin-user-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.admin-user-main{
  min-width:0;
}

.admin-user-name{
  font-size:18px;
  font-weight:950;
  color:#0f172a;
}

.admin-user-email{
  margin-top:4px;
  font-size:13px;
  font-weight:800;
  color:#64748b;
  word-break:break-word;
}

.admin-user-badges{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.admin-user-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.admin-user-action{
  height:40px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  font-weight:950;
  cursor:pointer;
}

.admin-user-action.primary{
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  border:none;
  color:#fff;
}

.admin-user-action.danger{
  background:rgba(239,68,68,.10);
  border:1px solid rgba(239,68,68,.22);
  color:#b91c1c;
}

.admin-user-action.warn{
  background:rgba(245,158,11,.10);
  border:1px solid rgba(245,158,11,.22);
  color:#92400e;
}

.admin-form-field{
  display:grid;
  gap:8px;
}

.admin-form-field label{
  font-size:12px;
  font-weight:900;
  color:#475569;
}

.admin-form-field input,
.admin-form-field select{
  width:100%;
  height:46px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.12);
  background:#f8fafc;
  padding:0 14px;
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  outline:none;
}

.admin-form-field input:focus,
.admin-form-field select:focus{
  border-color:rgba(37,99,235,.42);
  background:#fff;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

.admin-user-form-modal{
  width:min(760px, calc(100% - 24px)) !important;
  padding:20px !important;
  border-radius:24px !important;
}

.admin-user-form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-top:8px;
}

.admin-delete-modal{
  width:min(520px, calc(100% - 24px)) !important;
  padding:20px !important;
  border-radius:24px !important;
}

#adminUsersFeedback,
#adminUserFormFeedback{
  padding:12px 14px;
  border-radius:14px;
  font-size:13px;
  font-weight:900;
}

.admin-feedback-success{
  background:rgba(34,197,94,.12);
  color:#166534;
  border:1px solid rgba(34,197,94,.18);
}

.admin-feedback-error{
  background:rgba(239,68,68,.10);
  color:#b91c1c;
  border:1px solid rgba(239,68,68,.18);
}

@media (max-width: 860px){
  .admin-user-row{
    grid-template-columns:1fr;
    align-items:flex-start;
  }

  .admin-user-actions{
    justify-content:flex-start;
  }

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

.admin-users-top-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.admin-primary-btn{
  height:42px;
  padding:0 16px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  color:#fff;
  font-size:13px;
  font-weight:950;
  cursor:pointer;
  box-shadow:0 14px 28px rgba(37,99,235,.18);
}

.admin-primary-btn:hover{
  filter:brightness(1.03);
}

.admin-users-toolbar{
  margin:12px 0 16px;
}

.admin-users-search{
  width:100%;
  height:46px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background:#f8fafc;
  padding:0 14px;
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  outline:none;
}

.admin-users-search:focus{
  border-color:rgba(37,99,235,.42);
  background:#fff;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

.admin-users-feedback{
  margin-bottom:12px;
  padding:12px 14px;
  border-radius:14px;
  font-size:13px;
  font-weight:900;
}

.admin-users-feedback--error{
  background:rgba(239,68,68,.10);
  color:#991b1b;
  border:1px solid rgba(239,68,68,.14);
}

.admin-users-loading,
.admin-users-empty{
  padding:18px;
  border-radius:16px;
  border:1px dashed rgba(15,23,42,.12);
  background:rgba(248,250,252,.92);
  color:#475569;
  font-size:14px;
  font-weight:800;
}

.admin-users-list{
  display:grid;
  gap:12px;
}

.admin-user-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.admin-user-row__main{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.admin-user-row__avatar{
  width:46px;
  height:46px;
  border-radius:14px;
  background:linear-gradient(135deg,#2563eb,#60a5fa);
  color:#fff;
  font-weight:950;
  display:grid;
  place-items:center;
  flex:0 0 auto;
}

.admin-user-row__meta{
  min-width:0;
}

.admin-user-row__name{
  font-size:16px;
  font-weight:950;
  color:#0f172a;
}

.admin-user-row__email{
  margin-top:4px;
  font-size:13px;
  font-weight:800;
  color:#64748b;
  word-break:break-word;
}

.admin-user-row__badges{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.admin-role-badge,
.admin-status-badge{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:950;
}

.admin-role-badge{
  color:#1d4ed8;
  background:rgba(59,130,246,.12);
  border:1px solid rgba(59,130,246,.18);
}

.admin-status-badge--active{
  color:#166534;
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.18);
}

.admin-status-badge--blocked{
  color:#991b1b;
  background:rgba(239,68,68,.10);
  border:1px solid rgba(239,68,68,.14);
}

.admin-user-row__actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.admin-action-btn{
  min-width:96px;
  height:38px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color:#0f172a;
  font-size:13px;
  font-weight:950;
  cursor:pointer;
}

.admin-action-btn:hover{
  background:#f8fafc;
}

@media (max-width: 760px){
  .admin-user-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .admin-user-row__actions{
    width:100%;
  }

  .admin-action-btn{
    flex:1;
  }
}

/* =========================
   ADMIN USERS — AJUSTE FINO VISUAL
========================= */

.admin-users-modal{
  width:min(1020px, calc(100% - 24px)) !important;
  padding:24px !important;
  border-radius:28px !important;
}

.admin-users-head{
  margin-bottom:14px;
}

.admin-users-title{
  font-size:28px;
  font-weight:950;
  letter-spacing:-.02em;
}

.admin-users-subtitle{
  font-size:13px;
  font-weight:800;
  color:#64748b;
}

.admin-users-top-actions{
  gap:12px;
}

.admin-primary-btn{
  height:44px;
  padding:0 18px;
  border:0;
  border-radius:16px;
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  color:#fff;
  font-size:14px;
  font-weight:950;
  cursor:pointer;
  box-shadow:0 18px 30px rgba(37,99,235,.20);
  transition:transform .12s ease, box-shadow .18s ease, filter .18s ease;
}

.admin-primary-btn:hover{
  filter:brightness(1.03);
  box-shadow:0 22px 34px rgba(37,99,235,.24);
}

.admin-primary-btn:active{
  transform:scale(.99);
}

.admin-users-search{
  height:48px;
  border-radius:16px;
  padding:0 16px;
}

.admin-user-row{
  padding:18px;
  border-radius:20px;
}

.admin-user-row__avatar{
  width:50px;
  height:50px;
  border-radius:16px;
  font-size:20px;
}

.admin-user-row__name{
  font-size:17px;
}

.admin-user-row__actions{
  gap:8px;
}

.admin-action-btn{
  min-width:104px;
  height:40px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color:#0f172a;
  font-size:13px;
  font-weight:950;
  cursor:pointer;
  transition:transform .12s ease, background .18s ease, border-color .18s ease;
}

.admin-action-btn:hover{
  background:#f8fafc;
  border-color:rgba(15,23,42,.18);
}

.admin-action-btn:active{
  transform:scale(.99);
}

.admin-action-btn--edit{
  background:rgba(59,130,246,.10);
  border-color:rgba(59,130,246,.18);
  color:#1d4ed8;
}

.admin-action-btn--warn{
  background:rgba(245,158,11,.10);
  border-color:rgba(245,158,11,.20);
  color:#92400e;
}

.admin-action-btn--danger{
  background:rgba(239,68,68,.10);
  border-color:rgba(239,68,68,.18);
  color:#b91c1c;
}

.admin-user-form-modal{
  width:min(760px, calc(100% - 24px)) !important;
  padding:24px !important;
  border-radius:28px !important;
}

.admin-user-form-grid{
  display:grid;
  gap:16px;
  margin-top:12px;
}

.admin-user-form-grid--create{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.admin-form-field{
  display:grid;
  gap:8px;
}

.admin-form-field label{
  font-size:12px;
  font-weight:900;
  color:#475569;
}

.admin-form-field input,
.admin-form-field select{
  width:100%;
  height:48px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.10);
  background:#f8fafc;
  padding:0 14px;
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.admin-form-field input:focus,
.admin-form-field select:focus{
  border-color:rgba(37,99,235,.42);
  background:#fff;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

#adminUserFormFeedback{
  margin-top:12px;
  margin-bottom:6px;
}

#adminUserFormOverlay .modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:18px;
}

#adminUserFormOverlay .btn-ghost,
#adminUserFormOverlay .btn-primary{
  min-width:132px;
  height:44px;
  border-radius:16px;
  font-size:14px;
  font-weight:950;
  cursor:pointer;
}

#adminUserFormOverlay .btn-ghost{
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  color:#0f172a;
}

#adminUserFormOverlay .btn-primary{
  border:0;
  color:#fff;
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  box-shadow:0 18px 30px rgba(37,99,235,.18);
}

@media (max-width: 760px){
  .admin-user-form-grid--create{
    grid-template-columns:1fr;
  }

  #adminUserFormOverlay .modal-actions{
    flex-direction:column;
  }

  #adminUserFormOverlay .btn-ghost,
  #adminUserFormOverlay .btn-primary{
    width:100%;
  }
}

.admin-user-form-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:12px;
  margin-top:24px;
  flex-wrap:wrap;
}

.admin-btn{
  min-height:44px;
  padding:0 18px;
  border-radius:14px;
  font-weight:800;
  font-size:15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  cursor:pointer;
}

.admin-btn-ghost{
  background:#fff;
  border:1px solid rgba(15,23,42,.12);
  color:#0f172a;
}

.admin-btn-primary{
  border:0;
  color:#fff;
  background:linear-gradient(135deg, #2563eb, #3b82f6);
}

.admin-btn-reset{
  min-width:180px;
}

/* =========================
   PERFIL DO USUÁRIO (TOPBAR + MODAL)
========================= */

.topbar-profile-trigger{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:40px;
  padding:6px 10px 6px 6px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:#e6f0ff;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, transform .12s ease;
}

.topbar-profile-trigger:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.20);
}

.topbar-profile-trigger:active{
  transform:scale(.99);
}

.topbar-user-avatar{
  width:36px;
  height:36px;
  border-radius:12px;
  overflow:hidden;
  flex:0 0 36px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#2563eb,#60a5fa);
  color:#fff;
  font-size:14px;
  font-weight:950;
  line-height:1;
}

.topbar-user-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
}

.topbar-user-meta{
  display:flex;
  align-items:center;
  min-width:0;
}

.topbar-user-meta .hello{
  margin:0;
  font-size:14px;
  font-weight:850;
  color:#f8fafc;
  white-space:nowrap;
}

.profile-modal{
  width:min(760px, calc(100% - 24px)) !important;
  padding:24px !important;
  border-radius:28px !important;
}

.profile-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.profile-title{
  font-size:28px;
  font-weight:950;
  color:#0f172a;
  line-height:1;
}

.profile-subtitle{
  margin-top:8px;
  font-size:13px;
  font-weight:800;
  color:#64748b;
}

.profile-form{
  display:grid;
  gap:18px;
}

.profile-avatar-section{
  display:grid;
  justify-items:center;
  gap:14px;
  padding:12px 0 4px;
}

.profile-avatar-preview{
  width:92px;
  height:92px;
  border-radius:24px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#2563eb,#60a5fa);
  color:#fff;
  font-size:28px;
  font-weight:950;
  box-shadow:0 16px 28px rgba(37,99,235,.18);
}

.profile-avatar-preview img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.profile-avatar-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}

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

.profile-actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:4px;
  flex-wrap:wrap;
}

@media (max-width: 760px){
  .topbar-user-meta .hello{
    max-width:140px;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .profile-form-grid{
    grid-template-columns:1fr;
  }

  .profile-actions{
    flex-direction:column;
  }

  .profile-actions .admin-btn{
    width:100%;
  }
}

.sidebar-lock{
  margin-left:auto;
  font-size:13px;
  opacity:.9;
}

.sidebar-link.is-locked{
  opacity:.55;
  filter:grayscale(.18);
  cursor:not-allowed;
}

.sidebar-link.is-locked:hover{
  background:transparent;
  color:var(--sidebar-text);
  transform:none;
}

/* =========================================
   MOBILE / TABLET LAYER — SEM AFETAR DESKTOP
========================================= */

/* -------- TABLET -------- */
@media (max-width: 1024px){
  :root{
    --topbar-h: 56px;
    --sidebar-w: 228px;
    --sidebar-collapsed-w: 68px;
  }

  #app{
    padding: 18px;
  }

  .topbar{
    padding: 0 12px 0 8px;
  }

  .topbar-left{
    min-width: 120px;
  }

  .topbar-logo-core{
    height: 26px;
  }

  .topbar-logo-store{
    height: 36px;
    max-height: 36px;
  }

  .topbar-profile-trigger{
    min-height: 36px;
    padding: 4px 8px 4px 4px;
    border-radius: 14px;
  }

  .topbar-user-avatar{
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex: 0 0 32px;
  }

  .topbar-user-meta .hello{
    font-size: 13px;
  }

  .topbar-icon{
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 15px;
  }

  .divider{
    height: 22px;
  }

  .sidebar-link{
    min-height: 42px;
    border-radius: 14px;
    font-size: 13px;
  }

  .sidebar-ico{
    font-size: 15px;
  }

  .sidebar-footer{
    padding: 14px 12px 16px;
  }

  .sidebar-footer-logo{
    height: 18px;
  }

  .core-loader-orbit{
    width: 66px;
    height: 66px;
  }

  .core-loader-ring{
    inset: 9px;
  }

  .core-loader-dot{
    width: 11px;
    height: 11px;
    margin: -5.5px 0 0 -5.5px;
  }

  .core-modal{
    width: min(94vw, 760px) !important;
    max-height: calc(100vh - 28px);
    overflow: auto;
  }

  .profile-modal,
  .admin-user-form-modal,
  .admin-users-modal,
  .system-config,
  .chat-modal{
    width: min(94vw, 900px) !important;
    max-height: calc(100vh - 28px) !important;
    overflow: auto !important;
  }

  .admin-btn,
  .admin-primary-btn,
  .admin-action-btn,
  .btn-add,
  .btn-save,
  .btn-login,
  .btn-admin{
    min-height: 42px;
  }

  .admin-form-field input,
  .admin-form-field select,
  .admin-users-search,
  .chat-compose input,
  #chatClearPass,
  .login-box input,
  .form-box input,
  .form-box select{
    min-height: 44px;
  }
}

/* -------- MOBILE -------- */
@media (max-width: 720px){
  :root{
    --topbar-h: 54px;
    --sidebar-collapsed-w: 0px;
  }

  .core-shell{
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }

  .core-sidebar{
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 80;
    width: min(82vw, 280px);
    height: auto;
    transform: translateX(-100%);
    transition:
      transform .22s ease,
      width .22s ease,
      flex-basis .22s ease;
    box-shadow: 16px 0 40px rgba(2,6,23,.28);
  }

  body.sidebar-pinned .core-sidebar,
  .core-sidebar:hover{
    transform: translateX(0);
  }

  .core-main-area{
    grid-area: main;
    height: 100%;
    min-height: 0;
  }

  .topbar{
    padding: 0 10px;
    gap: 10px;
  }

  .topbar-left{
    min-width: auto;
  }

  .topbar-logo-core{
  height: 20px;
}

  .topbar-center{
    display: none !important;
  }

  .topbar-right{
    gap: 8px;
  }

  .topbar-profile-trigger{
    padding: 4px;
    min-height: 34px;
    border-radius: 12px;
  }

  .topbar-user-meta{
    display: none !important;
  }

  .topbar-user-avatar{
    width: 30px;
    height: 30px;
    border-radius: 9px;
    flex: 0 0 30px;
  }

  .topbar-icon{
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 14px;
  }

  .divider{
    height: 18px;
    margin: 0;
  }

  #app{
    padding: 14px;
  }

  .sidebar-top{
    height: 44px;
    min-height: 44px;
    padding: 8px 8px 4px;
  }

  .sidebar-pin-btn{
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 11px;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-nav{
    padding: 6px 10px 12px;
  }

  .sidebar-link{
    min-height: 44px;
    font-size: 13px;
  }

  .sidebar-text{
    opacity: 1;
    transform: none;
  }

  .sidebar-footer{
    display: flex;
  }

  /* fundo escuro quando o menu estiver aberto/fixado */
  body.sidebar-pinned::after{
  content: "";
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(2,6,23,.34);
  z-index: 70;
  pointer-events: none;
}

  .core-loading-overlay{
    padding: 20px;
  }

  .core-loader-orbit{
    width: 60px;
    height: 60px;
  }

  .core-loader-ring{
    inset: 8px;
  }

  .core-loader-center{
    width: 12px;
    height: 12px;
  }

  .core-loader-dot{
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
  }

  .core-modal{
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 20px !important;
    padding: 14px !important;
  }

  .admin-users-modal,
  .admin-user-form-modal,
  .profile-modal,
  .chat-modal,
  .system-config{
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 20px !important;
    padding: 16px !important;
  }

  .admin-users-head,
  .profile-head,
  .chat-head{
    gap: 12px;
    margin-bottom: 14px;
  }

  .admin-users-title,
  .profile-title{
    font-size: 22px;
  }

  .admin-users-subtitle,
  .profile-subtitle{
    font-size: 12px;
  }

  .admin-users-top-actions,
  .profile-actions,
  .admin-user-form-actions,
  .chat-actions{
    flex-wrap: wrap;
  }

  .admin-primary-btn,
  .admin-btn,
  .admin-action-btn,
  .btn-add,
  .btn-save,
  .btn-login,
  .btn-admin,
  .chat-compose .btn-primary,
  .chat-clear-actions .btn-ghost,
  .chat-clear-actions .btn-danger{
    min-height: 44px;
    width: 100%;
  }

  .admin-user-row{
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .admin-user-row__main{
    width: 100%;
  }

  .admin-user-row__actions{
    width: 100%;
  }

  .admin-action-btn{
    flex: 1 1 100%;
    min-width: 0;
  }

  .admin-user-form-grid,
  .admin-user-form-grid--create,
  .profile-form-grid{
    grid-template-columns: 1fr !important;
  }

  .chat-list{
    height: min(48vh, 420px);
  }

  .chat-compose{
    flex-direction: column;
    align-items: stretch;
  }

  .chat-clear-actions{
    flex-direction: column;
    align-items: stretch;
  }

  .grid-rates{
    grid-template-columns: 1fr !important;
  }

  .form-box,
  .list-box{
    gap: 12px;
  }

  .login-wrapper{
    padding: 14px;
  }

  .login-box{
    max-width: 100%;
    border-radius: 18px;
    padding: 20px;
  }
}

/* -------- MOBILE PEQUENO -------- */
@media (max-width: 520px){
  #app{
    padding: 12px;
  }

  .topbar{
    padding: 0 8px;
  }

  .topbar-logo-core{
    height: 22px;
  }

  .topbar-icon{
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .topbar-user-avatar{
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .core-modal,
  .admin-users-modal,
  .admin-user-form-modal,
  .profile-modal,
  .chat-modal,
  .system-config{
    width: calc(100vw - 12px) !important;
    max-height: calc(100vh - 12px) !important;
    border-radius: 18px !important;
    padding: 12px !important;
  }

  .admin-users-title,
  .profile-title{
    font-size: 20px;
  }

  .admin-users-search,
  .admin-form-field input,
  .admin-form-field select,
  .chat-compose input,
  #chatClearPass,
  .login-box input{
    font-size: 16px;
  }

  .sidebar-link{
    border-radius: 13px;
  }
}

/* =========================================================
   MOBILE FINAL OVERRIDE — versão segura por cima do zip atual
   cola no FINAL do style.css
========================================================= */

@media (max-width: 720px){
  :root{
    --topbar-h: 54px;
  }

  .topbar{
    padding: 0 10px;
  }

  .topbar-left{
    min-width: 0;
    gap: 8px;
  }

  .topbar-mobile-menu-btn{
    display: inline-flex !important;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex: 0 0 32px;
  }

  .topbar-logo-core{
    height: 24px;
  }

  .topbar-center{
  display: flex !important;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 92px;
  overflow: hidden;
  pointer-events: none;
}

  .topbar-center .topbar-logo-btn{
    pointer-events: auto;
  }

  .topbar-logo-store{
  height: 22px !important;
  max-height: 22px !important;
  width: auto;
  display: block;
}

  .topbar-right{
    gap: 8px;
    margin-left: auto;
  }

  .topbar-profile-trigger{
    padding: 4px !important;
    min-height: 34px;
  }

  .topbar-user-meta{
    display: none !important;
  }

  .topbar-user-avatar{
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
  }

  .topbar-icon{
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 14px;
  }

  .divider{
    height: 18px;
    margin: 0;
  }

  .core-shell{
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }

  .core-main-area{
    grid-area: main;
    min-height: 0;
    height: 100%;
  }

  .core-sidebar{
    position: fixed !important;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 80;
    width: min(84vw, 300px) !important;
    height: auto !important;
    transform: translateX(-100%);
    box-shadow: 16px 0 40px rgba(2,6,23,.28);
    overflow-y: auto;
    overflow-x: hidden;
  }

  body.mobile-menu-open .core-sidebar{
    transform: translateX(0) !important;
  }

  body.mobile-menu-open::after{
    content: "";
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(2,6,23,.34);
    z-index: 70;
  }

  .sidebar-top{
    height: 46px;
    min-height: 46px;
    padding: 8px 8px 4px;
    align-items: flex-start;
  }

  .sidebar-pin-btn{
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 11px;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.mobile-menu-open .core-sidebar .sidebar-nav{
    padding: 8px 10px 12px;
  }

  body.mobile-menu-open .core-sidebar .sidebar-link{
    justify-content: flex-start !important;
    align-items: center;
    min-height: 44px;
    padding: 0 14px !important;
    gap: 12px;
    font-size: 13px;
  }

  body.mobile-menu-open .core-sidebar .sidebar-ico{
    width: 18px;
    min-width: 18px;
    text-align: center;
    font-size: 15px;
    flex: 0 0 18px;
  }

  body.mobile-menu-open .core-sidebar .sidebar-text{
    display: inline !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.mobile-menu-open .core-sidebar .sidebar-secondary{
    padding-left: 10px !important;
    padding-right: 10px !important;
    gap: 8px;
  }

  body.mobile-menu-open .core-sidebar .sidebar-footer{
    display: flex !important;
    align-items: flex-start;
    padding: 14px 12px 16px !important;
  }

  body.mobile-menu-open .core-sidebar .sidebar-footer-text,
  body.mobile-menu-open .core-sidebar .sidebar-footer-logo,
  body.mobile-menu-open .core-sidebar .sidebar-footer-sub{
    display: block !important;
  }

  #app{
    padding: 14px;
  }

  .core-modal,
  .admin-users-modal,
  .admin-user-form-modal,
  .profile-modal,
  .chat-modal,
  .system-config{
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 20px !important;
    padding: 14px !important;
  }

  .admin-user-form-grid,
  .admin-user-form-grid--create,
  .profile-form-grid{
    grid-template-columns: 1fr !important;
  }

  .admin-users-top-actions,
  .profile-actions,
  .admin-user-form-actions,
  .chat-actions,
  .chat-compose,
  .chat-clear-actions{
    flex-wrap: wrap;
  }

  .admin-primary-btn,
  .admin-btn,
  .admin-action-btn,
  .btn-add,
  .btn-save,
  .btn-login,
  .btn-admin,
  .chat-compose .btn-primary,
  .chat-clear-actions .btn-ghost,
  .chat-clear-actions .btn-danger{
    width: 100%;
    min-height: 44px;
  }

  .chat-list{
    height: min(48vh, 420px);
  }

  .login-wrapper{
    padding: 14px;
  }

  .login-box{
    max-width: 100%;
    padding: 20px;
    border-radius: 18px;
  }
}

@media (max-width: 520px){
  #app{
    padding: 12px;
  }

  .topbar{
    padding: 0 8px;
  }

  .topbar-logo-core{
  height: 18px;
}

  .topbar-logo-store{
  height: 20px !important;
  max-height: 20px !important;
}

  .core-sidebar{
    width: min(88vw, 300px) !important;
  }

  .core-modal,
  .admin-users-modal,
  .admin-user-form-modal,
  .profile-modal,
  .chat-modal,
  .system-config{
    width: calc(100vw - 12px) !important;
    max-height: calc(100vh - 12px) !important;
    border-radius: 18px !important;
    padding: 12px !important;
  }

  .admin-users-title,
  .profile-title{
    font-size: 20px;
  }
}