
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

/* NAVBAR */
.navbar {
  background: #1a237e; color: #fff; display: flex; align-items: center;
  padding: 0 20px; height: 52px; gap: 16px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.nav-brand { font-size: 18px; font-weight: 700; margin-right: 16px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  color: rgba(255,255,255,0.8); text-decoration: none; padding: 6px 14px;
  border-radius: 6px; font-size: 13px; transition: all .2s;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.2); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-badge {
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  text-transform: uppercase;
}
.user-admin { background: #ff6f00; }
.user-operador { background: #0277bd; }
.user-cliente { background: #2e7d32; }
.btn-logout {
  background: rgba(255,255,255,0.15); color: #fff; text-decoration: none;
  padding: 5px 12px; border-radius: 6px; font-size: 12px; transition: .2s;
}
.btn-logout:hover { background: rgba(255,0,0,0.4); }

/* CONTAINER */
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* PAGE HEADER */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 700; color: #1a237e; }

/* CARD */
.card {
  background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  padding: 20px; margin-bottom: 16px;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
  border: none; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: .2s;
}
.btn-primary { background: #1a237e; color: #fff; }
.btn-primary:hover { background: #283593; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #388e3c; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #d32f2f; }
.btn-warning { background: #e65100; color: #fff; }
.btn-warning:hover { background: #f57c00; }
.btn-secondary { background: #546e7a; color: #fff; }
.btn-secondary:hover { background: #607d8b; }
.btn-outline { background: transparent; border: 1px solid #1a237e; color: #1a237e; }
.btn-outline:hover { background: #1a237e; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* INPUTS */
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 14px; outline: none; transition: .2s;
}
input:focus, select:focus, textarea:focus { border-color: #1a237e; box-shadow: 0 0 0 3px rgba(26,35,126,.1); }
label { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: block; color: #555; }
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #1a237e; color: #fff; padding: 10px 12px; text-align: left;
  font-size: 12px; font-weight: 600; white-space: nowrap; position: sticky; top: 0;
}
td { padding: 8px 12px; border-bottom: 1px solid #eee; font-size: 13px; }
tr:hover td { background: #f5f7ff; }
tr.selected td { background: #e8eaf6; }

/* BADGES */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info { background: #e3f2fd; color: #0277bd; }

/* ALERTS */
.alert {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 14px;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.alert-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid #2e7d32; }
.alert-danger { background: #ffebee; color: #b71c1c; border-left: 4px solid #c62828; }
.alert-info { background: #e3f2fd; color: #01579b; border-left: 4px solid #0277bd; }

/* MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 24px; width: 500px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: #1a237e; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* SEARCH BAR */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-end; }
.search-bar input { max-width: 340px; }

/* TOOLBAR */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* LOGIN */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 36px; width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 28px; font-weight: 800; color: #1a237e; }
.login-logo p { color: #888; font-size: 13px; margin-top: 4px; }
.login-card .form-group { margin-bottom: 18px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

/* DASHBOARD CARDS */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.dash-card {
  background: #fff; border-radius: 12px; padding: 24px 20px; text-align: center;
  text-decoration: none; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: .2s; border: 2px solid transparent;
}
.dash-card:hover { border-color: #1a237e; transform: translateY(-2px); }
.dash-card .icon { font-size: 40px; margin-bottom: 12px; }
.dash-card .label { font-size: 15px; font-weight: 700; color: #1a237e; }
.dash-card .desc { font-size: 12px; color: #888; margin-top: 4px; }

/* CHECKBOX */
.cb-col { width: 36px; text-align: center; }
input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* PRODUTO IMG */
.prod-img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; border: 1px solid #eee; }
.no-img { width: 40px; height: 40px; background: #eee; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: #bbb; font-size: 18px; }

/* SPINNER */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid #ccc; border-top-color: #1a237e; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 20px; color: #aaa; }
.empty-state .icon { font-size: 52px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* PERMISSIONS CHECKBOXES */
.perm-list { display: flex; flex-wrap: wrap; gap: 10px; }
.perm-item { display: flex; align-items: center; gap: 6px; background: #f5f5f5; padding: 6px 12px; border-radius: 6px; font-size: 13px; }
.perm-item input { width: auto; }

/* TOAST */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #323232; color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; display: none; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  max-width: 320px;
}
#toast.success { background: #2e7d32; }
#toast.error { background: #c62828; }

@media (max-width: 768px) {
  .navbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .nav-links { order: 3; width: 100%; }
  .container { padding: 10px; }
  .form-row { flex-direction: column; }
}
