:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #eef3f8;
  --text: #17202a;
  --muted: #657383;
  --line: #dce5ee;
  --primary: #176f63;
  --primary-dark: #0f5149;
  --accent: #c9952f;
  --danger: #c84d4d;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", Arial, sans-serif;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 111, 99, 0.94), rgba(18, 57, 83, 0.9)),
    url("https://images.unsplash.com/photo-1521791136064-7986c2920216?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-panel {
  width: min(100%, 430px);
  padding: 36px;
  border-radius: 8px;
  background: var(--surface);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  margin-bottom: 20px;
}

.brand-mark i {
  font-size: 34px;
}

.login-panel h1,
.section-heading h2,
.modal h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: 2.1rem;
  font-weight: 700;
}

.login-panel p,
.section-heading p {
  color: var(--muted);
}

.full-button {
  width: 100%;
  margin-top: 8px;
}

.btn,
.btn-large,
.btn-small {
  background-color: var(--primary);
  border-radius: 6px;
}

.btn:hover,
.btn-large:hover,
.btn-small:hover {
  background-color: var(--primary-dark);
}

.topbar {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 0 var(--line);
}

.topbar .brand-logo,
.topbar ul a,
.topbar .sidenav-trigger {
  color: var(--text);
}

.topbar .brand-logo {
  left: 28px;
  transform: none;
  font-size: 1.35rem;
  font-weight: 700;
}

.content-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

.section-heading p {
  margin: 8px 0 0;
}

.icon-action {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--primary);
}

.metric-grid {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.metric-card {
  min-height: 150px;
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-card i {
  color: var(--primary);
  font-size: 32px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

.metric-card strong {
  font-size: 2.3rem;
  line-height: 1;
}

.dashboard-list-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-list-card {
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dashboard-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dashboard-list-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.dashboard-list-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.dashboard-list-header i {
  color: var(--primary);
  font-size: 30px;
}

.dashboard-list {
  display: grid;
  gap: 8px;
}

.dashboard-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.dashboard-list-item:first-child {
  border-top: 0;
}

.dashboard-list-item strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.25;
}

.dashboard-list-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-list-total {
  min-width: 46px;
  text-align: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #dff4ef;
  color: var(--primary-dark);
  font-weight: 700;
}

.table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 18px 18px 0;
  background: var(--surface);
}

.search-field {
  width: min(100%, 360px);
  margin: 0;
}

.responsive-table-wrap {
  overflow-x: auto;
}

table {
  min-width: 860px;
}

.estabelecimento-table {
  min-width: 1220px;
}

.voucher-table {
  min-width: 1040px;
}

thead {
  background: var(--surface-muted);
}

th {
  color: #344554;
  font-weight: 700;
}

td,
th {
  white-space: nowrap;
}

.actions-column {
  width: 136px;
  text-align: right;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions .btn-flat {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}

.row-actions .edit-action {
  color: var(--primary);
}

.row-actions .delete-action {
  color: var(--danger);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-width: 68px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-chip.ativo,
.status-chip.disponivel,
.status-chip.liberado {
  background: #dff4ef;
  color: var(--primary-dark);
}

.status-chip.solicitado {
  background: #fff1d6;
  color: #8a5a00;
}

.status-chip.inativo {
  background: #f6dfdf;
  color: #943434;
}

.perfil-chip {
  display: inline-flex;
  align-items: center;
  min-width: 88px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
}

.perfil-chip.admin {
  background: #fff1d6;
  color: #8a5a00;
}

.perfil-chip.associado {
  background: #e4edf8;
  color: #24517f;
}

.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.pagination-wrap span {
  color: var(--muted);
  font-size: 0.92rem;
}

.pagination-wrap .btn-flat {
  color: var(--primary);
}

.modal {
  border-radius: 8px;
  max-height: 88%;
}

.modal.modal-wide {
  width: min(94%, 980px);
}

.modal h3 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.modal-context {
  color: var(--muted);
  margin: -12px 0 22px;
}

.modal .modal-footer {
  padding: 12px 24px;
  height: auto;
  border-top: 1px solid var(--line);
}

.empty-row {
  color: var(--muted);
  text-align: center;
  padding: 26px;
}

.ios-install-hint {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  box-shadow: var(--shadow);
}

.ios-install-hint span {
  line-height: 1.35;
}

.ios-install-hint button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 992px) {
  .topbar .brand-logo {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 600px) {
  .login-panel {
    padding: 26px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .section-heading .btn {
    width: 100%;
  }

  .table-toolbar {
    justify-content: stretch;
  }

  .search-field {
    width: 100%;
  }

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