:root{
  --bg:#f3f4f6;
  --card:#ffffff;
  --text:#374151;
  --muted:#6b7280;
  --line:#e5e7eb;
  --blue:#1fb6d9;
  --orange:#ef6c1d;
  --purple:#6d56ad;
  --navy:#2c3e50;
  --shadow:0 8px 24px rgba(0,0,0,.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}

.rm-topbar{
  background:#fff;
  border-bottom:1px solid var(--line);
}

.rm-topbar-inner{
  max-width:1400px;
  margin:0 auto;
  padding:18px 22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.rm-brand{
  display:flex;
  align-items:center;
  gap:14px;
}

.rm-brand-logo{
  width:52px;
  height:52px;
  border-radius:12px;
  background:#2563eb;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  font-weight:bold;
}

.rm-brand-text strong{
  display:block;
  font-size:20px;
  color:#1f2937;
}

.rm-brand-text span{
  display:block;
  color:#2563eb;
  font-size:18px;
  font-weight:bold;
  letter-spacing:.04em;
}

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

.rm-top-actions a{
  padding:10px 14px;
  border-radius:10px;
  color:#4b5563;
  font-weight:bold;
}

.rm-top-actions a:hover{
  background:#f3f4f6;
}

.rm-container{
  max-width:1400px;
  margin:0 auto;
  padding:24px 22px 40px;
}

.rm-home-top{
  display:grid;
  grid-template-columns:1.15fr 1fr;
  gap:24px;
  margin-bottom:28px;
}

.rm-welcome{
  background:#fff;
  border-radius:18px;
  padding:28px;
  box-shadow:var(--shadow);
}

.rm-welcome h1{
  margin:0 0 10px;
  font-size:42px;
  color:#23324a;
}

.rm-welcome p{
  margin:0;
  font-size:19px;
  color:var(--muted);
}

.rm-stats{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}

.rm-stat-card{
  background:#fff;
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
  gap:16px;
}

.rm-stat-card small{
  display:block;
  color:var(--muted);
  margin-bottom:4px;
  font-size:14px;
}

.rm-stat-card strong{
  font-size:30px;
  color:#23324a;
}

.rm-stat-icon{
  width:62px;
  height:62px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  color:#fff;
  flex-shrink:0;
}

.rm-stat-icon.blue{background:#2563eb}
.rm-stat-icon.green{background:#16a34a}
.rm-stat-icon.orange{background:#f59e0b}

.rm-sections{
  display:grid;
  grid-template-columns:1.3fr 1fr 1fr;
  gap:24px;
}

.rm-section-title{
  font-size:16px;
  font-weight:bold;
  margin-bottom:14px;
  letter-spacing:.04em;
}

.blue-text{color:#1d4ed8}
.orange-text{color:#ea580c}
.purple-text{color:#6d56ad}

.rm-tile-grid{
  display:grid;
  gap:6px;
}

.rm-tile-grid-4{
  grid-template-columns:repeat(4, 1fr);
}

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

.rm-tile{
  min-height:120px;
  color:#fff;
  padding:14px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  transition:.18s;
  box-shadow:var(--shadow);
}

.rm-tile:hover{
  transform:translateY(-2px);
  filter:brightness(1.03);
}

.rm-tile.blue{background:var(--blue)}
.rm-tile.orange{background:var(--orange)}
.rm-tile.purple{background:var(--purple)}

.rm-tile-icon{
  font-size:34px;
  margin-bottom:12px;
  line-height:1;
}

.rm-tile-label{
  font-size:14px;
  font-weight:bold;
  line-height:1.3;
}

.rm-footer{
  text-align:center;
  padding:18px;
  color:#6b7280;
  font-size:14px;
}

/* páginas internas */
.page-title{
  margin:0 0 18px;
  font-size:30px;
  color:#23324a;
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

.card{
  background:#fff;
  border-radius:18px;
  padding:20px;
  box-shadow:var(--shadow);
}

.card-title{
  margin:0 0 16px;
  font-size:18px;
  color:#23324a;
}

.form-row{
  display:grid;
  grid-template-columns:1fr 160px 140px auto;
  gap:12px;
}

.input,
select{
  width:100%;
  height:46px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:0 14px;
  outline:none;
  background:#fff;
}

.input:focus,
select:focus{
  border-color:#60a5fa;
}

.btn{
  border:none;
  border-radius:12px;
  height:46px;
  padding:0 18px;
  cursor:pointer;
  font-weight:bold;
}

.btn-primary{
  background:#2563eb;
  color:#fff;
}

.btn-light{
  background:#eef2ff;
  color:#1e3a8a;
}

.btn-danger{
  background:#dc2626;
  color:#fff;
}

.table-wrap{
  overflow:auto;
}

.table{
  width:100%;
  border-collapse:collapse;
}

.table th,
.table td{
  padding:14px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

.table th{
  font-size:13px;
  color:var(--muted);
  text-transform:uppercase;
}

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:bold;
}

.badge-ok{
  background:#dcfce7;
  color:#166534;
}

.badge-low{
  background:#fee2e2;
  color:#991b1b;
}

.search-box{
  margin-bottom:14px;
}

.product-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:420px;
  overflow:auto;
}

.product-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  cursor:pointer;
}

.product-item:hover{
  background:#f8fbff;
  border-color:#bfdbfe;
}

.product-name{
  font-weight:bold;
}

.product-meta{
  color:var(--muted);
  font-size:13px;
  margin-top:4px;
}

.cart-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.cart-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
}

.cart-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.qty-btn{
  width:34px;
  height:34px;
  border:none;
  border-radius:10px;
  cursor:pointer;
  background:#e5e7eb;
  font-weight:bold;
}

.qty{
  min-width:24px;
  text-align:center;
  font-weight:bold;
}

.total-box{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.total-value{
  font-size:28px;
  font-weight:bold;
  color:#0f172a;
}

.footer-actions{
  margin-top:18px;
  display:flex;
  justify-content:flex-end;
}

.empty{
  color:var(--muted);
  padding:16px 0;
}

@media (max-width: 1200px){
  .rm-sections{
    grid-template-columns:1fr;
  }
}

@media (max-width: 950px){
  .rm-home-top{
    grid-template-columns:1fr;
  }

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

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

@media (max-width: 700px){
  .rm-tile-grid-4,
  .rm-tile-grid-3{
    grid-template-columns:repeat(2, 1fr);
  }

  .rm-welcome h1{
    font-size:30px;
  }

  .rm-topbar-inner{
    flex-direction:column;
    align-items:flex-start;
  }
}


/* Destaque do módulo Vendas / PDV */
.rm-tile.tile-vendas-destaque{
  grid-column: span 2;
  min-height: 150px;
  background: linear-gradient(135deg,#06b6d4,#0284c7);
}

.rm-tile.tile-vendas-destaque .rm-tile-icon{
  font-size: 54px;
}

.rm-tile.tile-vendas-destaque .rm-tile-label{
  font-size: 22px;
}

@media (max-width:700px){
  .rm-tile.tile-vendas-destaque{
    grid-column: span 2;
    min-height: 140px;
  }
}

.rm-tile.tile-vendas-destaque{
  grid-column: span 2 !important;
  min-height: 160px !important;
  background: linear-gradient(135deg,#06b6d4,#0284c7) !important;
}

.rm-tile.tile-vendas-destaque .rm-tile-icon{
  font-size: 58px !important;
}

.rm-tile.tile-vendas-destaque .rm-tile-label{
  font-size: 24px !important;
}

@media (max-width:700px){
  .rm-tile.tile-vendas-destaque{
    grid-column: span 2 !important;
  }
}


.rm-tile-grid-2{
  grid-template-columns:repeat(2, 1fr);
}


.tile-big{
  grid-column: span 2;
  min-height: 150px;
  font-size: 18px;
}

.tile-big .rm-tile-icon{
  font-size: 42px;
}

.tile-big .rm-tile-label{
  font-size: 16px;
}

@media (max-width:700px){
  .tile-big{
    grid-column: span 2;
  }
}


.stock-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.stock-form label{
  font-weight:bold;
  color:#374151;
  font-size:14px;
}

.stock-form select{
  height:46px;
}


.produtos-form{
  grid-template-columns:1fr 1.4fr 140px 120px auto;
}

@media (max-width: 950px){
  .produtos-form{
    grid-template-columns:1fr;
  }
}


.login-body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f3f4f6;
  padding:20px;
}

.login-box{
  width:100%;
  max-width:420px;
  background:#fff;
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:32px;
}

.login-box h2{
  margin:0 0 8px;
  font-size:28px;
  color:#23324a;
  text-align:center;
}

.login-box p{
  margin:0 0 24px;
  text-align:center;
  color:#6b7280;
}

.login-box form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.login-box label{
  font-weight:bold;
  color:#374151;
  font-size:14px;
}

.login-error{
  background:#fee2e2;
  color:#991b1b;
  padding:12px;
  border-radius:12px;
  margin-bottom:16px;
  text-align:center;
  font-weight:bold;
}


.rm-brand-img{
  width:52px;
  height:52px;
  object-fit:cover;
  border-radius:12px;
  background:#fff;
  border:1px solid #e5e7eb;
}

.rm-brand-img{
    width:64px !important;
    height:64px !important;
    min-width:64px !important;
    min-height:64px !important;
    max-width:64px !important;
    max-height:64px !important;
    border-radius:50% !important;
    object-fit:cover !important;
    background:#fff !important;
    border:2px solid #e5e7eb !important;
    padding:3px !important;
}

/* Ajuste cabeçalho mercado compacto */
.rm-topbar{
    padding: 0 0 10px !important;
}

.rm-topbar-inner{
    padding: 14px 30px 10px !important;
}

.rm-brand-img,
.rm-brand-logo{
    width: 64px !important;
    height: 64px !important;
}

.rm-brand-text strong{
    font-size: 24px !important;
}

.rm-brand-text span{
    font-size: 20px !important;
}

.rm-menu-bar{
    max-width: 1650px !important;
    margin: 0 auto !important;
    min-height: 46px !important;
}
