*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 15px; }

body {
  background: #f0f2f5;
  color: #1a1a2e;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon img {
  height: 80px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

.logo-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: #c0392b;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  border-radius: 8px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #1a1a2e;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: #555;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: #1a1a2e;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2c3e6b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

/* ── LAYOUT ── */
.layout {
  display: flex;
  min-height: calc(100vh - 90px);
}

/* ── SIDEBAR ── */
.sidebar {
  width: 270px;
  min-width: 270px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  color: #1a1a2e;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.filter-icon { color: #888; font-size: 13px; }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  color: #1a1a2e;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  background: #fafafa;
  transition: border-color .15s;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: #2c3e6b;
  background: #fff;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.date-range {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-lbl {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

.date-sub input {
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  color: #1a1a2e;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  background: #fafafa;
  width: 100%;
  transition: border-color .15s;
}

.date-sub input:focus {
  border-color: #2c3e6b;
  background: #fff;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.btn-apply {
  width: 100%;
  padding: 11px;
  background: #c0392b;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
  -webkit-transition: background .15s;
  -moz-transition: background .15s;
  -ms-transition: background .15s;
  -o-transition: background .15s;
}

.btn-apply:hover { background: #a93226; }

.btn-clear {
  width: 100%;
  padding: 11px;
  background: #fff;
  color: #444;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
  -webkit-transition: background .15s;
  -moz-transition: background .15s;
  -ms-transition: background .15s;
  -o-transition: background .15s;
}

.btn-clear:hover { background: #f5f5f5; }

/* ── MAIN ── */
main {
  flex: 1;
  padding: 28px 32px;
  overflow: auto;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

/* ── STATS ── */
.stats-row {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.stat-card {
  flex: 1;
  padding: 22px 28px;
  border-left: 4px solid #1e2d50;
}

.stat-card + .stat-card {
  border-left: 1px solid #e0e0e0;
}

.stat-alerg {
  border-left: 4px solid #e74c3c !important;
}

.stat-nao {
  border-left: 4px solid #27ae60 !important;
}

.stat-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 26px;
  height: 26px;
  color: #aaa;
  flex-shrink: 0;
}

.icon-red { color: #e74c3c; }
.icon-green { color: #27ae60; }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1;
}

.stat-value.red { color: #e74c3c; }
.stat-value.green { color: #27ae60; }

/* ── TABELA ── */
.table-wrap {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

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

thead th {
  background: #2c3e6b;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.sort-arrow {
  opacity: .5;
  font-size: 11px;
  margin-left: 4px;
}

tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background .1s;
}

tbody tr:hover { background: #f7f9fc; }

tbody td {
  padding: 13px 16px;
  font-size: 14px;
  white-space: nowrap;
  color: #1a1a2e;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
}

.badge-alergenico {
  background: #fdecea;
  color: #c0392b;
}

.badge-nao {
  background: #eafaf1;
  color: #1e8449;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #aaa;
  font-size: 15px;
}

/* ── FOOTER TABELA ── */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.per-page {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #555;
}

.per-page select {
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #1a1a2e;
  cursor: pointer;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn {
  width: 34px;
  height: 34px;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  color: #444;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
  -webkit-transition: background .1s;
  -moz-transition: background .1s;
  -ms-transition: background .1s;
  -o-transition: background .1s;
}

.page-btn:hover:not(:disabled) { background: #f0f0f0; }

.page-btn:disabled {
  opacity: .35;
  cursor: default;
}

#page-numbers {
  display: flex;
  gap: 5px;
  align-items: center;
}

.page-num {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: background .1s;
  -webkit-transition: background .1s;
  -moz-transition: background .1s;
  -ms-transition: background .1s;
  -o-transition: background .1s;
}

.page-num:hover { background: #f0f0f0; }

.page-num.active {
  background: #2c3e6b;
  border-color: #2c3e6b;
  color: #fff;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }
