:root {
  --primary: #2c3e50; /* Cinza escuro elegante */
  --secondary: #95a5a6; /* Prata */
  --success: #27ae60;
  --danger: #e74c3c;
  --background: #f8f9fa;
  --surface: #ffffff;
  --text: #333333;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: var(--background); color: var(--text); display: flex; flex-direction: column; height: 100vh; }

/* Header */
header { background: var(--surface); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.user-info h1 { font-size: 1.2rem; color: var(--primary); }
.user-role { font-size: 0.8rem; color: var(--secondary); }
.status { padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.status.online { background: #d4edda; color: #155724; }
.status.offline { background: #f8d7da; color: #721c24; }

/* Scan Section */
.scan-section { padding: 20px; }
#barcodeInput { width: 100%; padding: 15px; font-size: 1.1rem; border: 2px solid #ddd; border-radius: 8px; outline: none; transition: border 0.3s; }
#barcodeInput:focus { border-color: var(--primary); }

/* Cart Section */
.cart-section { flex: 1; overflow-y: auto; padding: 0 20px; }
.cart-list { list-style: none; }
.cart-item { background: var(--surface); padding: 15px; margin-bottom: 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.item-info { display: flex; flex-direction: column; }
.item-name { font-weight: bold; }
.item-price { color: var(--secondary); font-size: 0.9rem; }
.btn-remove { background: none; border: none; color: var(--danger); font-size: 1.5rem; padding: 5px 10px; cursor: pointer; }

/* Summary */
.summary-section { background: var(--surface); padding: 20px; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); border-top-left-radius: 15px; border-top-right-radius: 15px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 1.1rem; }
.total-row { font-size: 1.4rem; font-weight: bold; color: var(--primary); margin-top: 10px; padding-top: 10px; border-top: 1px solid #ddd; }
.discount-row { color: var(--danger); }

/* Buttons */
.action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.btn { padding: 15px; border: none; border-radius: 8px; font-size: 1rem; font-weight: bold; cursor: pointer; text-transform: uppercase; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--success); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-danger { background: var(--danger); color: white; margin-top: 10px; }
.btn-pay { background: var(--primary); color: white; width: 100%; margin-bottom: 10px; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: flex-end; z-index: 100; transition: opacity 0.3s; }
.modal.hidden { display: none; opacity: 0; pointer-events: none; }
.modal-content { background: var(--surface); width: 100%; padding: 20px; border-top-left-radius: 15px; border-top-right-radius: 15px; text-align: center; }
.modal-content h2 { margin-bottom: 20px; color: var(--primary); }
/* --- ESTILOS COMPLEMENTARES DASHBOARD & GRIDS --- */

.dashboard-header {
  background: var(--surface);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e1e8ed;
}

.dashboard-header h2 {
  font-size: 1.2rem;
  color: var(--primary);
}

.badge-role {
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  display: inline-block;
  margin-top: 4px;
}

/* Cores dos Badges de Cargo */
.role-admin { background-color: #8e44ad; }
.role-gerente { background-color: #2980b9; }
.role-vendedora { background-color: #27ae60; }
.role-folguista { background-color: #d35400; }

.btn-logout {
  background: none;
  border: 1px solid #ccc;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
}

.dashboard-main {
  padding: 20px;
  flex: 1;
}

.section-title {
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}

/* Grid Responsivo Mobile-First */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Colunas em celulares */
  gap: 15px;
}

@media(min-width: 768px) {
  .modules-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 Colunas em tablets/desktops */
  }
}

.module-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 25px 15px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.03);
  border: 1px solid #eaf0f6;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.module-card:active {
  transform: scale(0.96);
  background-color: #f1f3f5;
}

.module-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.module-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}