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

body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f2f6fa;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  min-width: 180px;
  max-width: 260px;
  background: #005594;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  box-shadow: 2px 0 8px rgba(25, 118, 210, 0.08);
  transition: width 0.2s, min-width 0.2s, max-width 0.2s, transform 0.2s;
  z-index: 10;
}

.sidebar.closed {
  width: 0;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  padding: 0;
  border: none;
  box-shadow: none;
  transition: width 0.2s, min-width 0.2s, max-width 0.2s, transform 0.2s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 8px 16px 8px;
  border-bottom: 1px solid #1560a8;
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 1px;
  text-align: center;
  width: 100%;
}

.sidebar-nav {
  flex: 1;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-left: 4px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #125ea2;
  border-left: 4px solid #fff;
  color: #fff;
}

.sidebar-nav .logout-item {
  padding: 24px 16px;
}

.sidebar-nav .sidebar-logout {
  width: 100%;
  padding: 10px 0;
  background: #fff;
  color: #005594;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav .sidebar-logout:hover {
  background: #e3f0fd;
  color: #125ea2;
}

.main-content {
  flex: 1;
  background: #f4f6fb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-toggle {
  font-size: 1.6rem;
  background: none;
  border: none;
  color: #232946;
  cursor: pointer;
  margin-right: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar-toggle:hover {
  background: #eebbc3;
  color: #232946;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
  }

  .sidebar.closed {
    transform: translateX(-100%);
    width: 0;
    min-width: 0;
    max-width: 0;
    box-shadow: none;
  }

  .main-content {
    padding-top: 0;
  }

  .navbar-logo {
    height: 36px;
    max-width: 220px;
  }
}

.navbar {
  background: #005594;
  color: #fff;
  padding: 0.7rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 12px;
}

.navbar img {
  height: 40px;
  margin-right: 16px;
}

.navbar .navbar-brand {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.navbar button {
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
  padding: 7px 18px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.navbar button:hover {
  background: #fff;
  color: #005594;
}

.container {
  max-width: 1400px;
  width: 98vw;
  margin: 24px auto 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.08);
  padding: 32px 24px 24px 24px;
}

.container h2 {
  color: #005594;
  margin-bottom: 24px;
  font-size: 1.6rem;
  font-weight: 600;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
  margin: 0;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-bottom: 0;
  table-layout: auto;
  font-size: 0.5rem;
  background: #fff;
}

th,
td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
}

.table-responsive thead {
  background: #005594;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

th,
td {
  padding: 16px 12px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  font-size: 1rem;
  vertical-align: middle;
}

th {
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #005594;
  color: #fff;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #f7faff;
}

tbody tr:hover {
  background: #e3f0fd;
}

.status {
  padding: 6px 16px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08);
}

.status.available {
  background: #005594;
}

.status.expired {
  background: #fbc02d;
}

.status.cancelled {
  background: #d32f2f;
}

.status.pending {
  background: #fbc02d;
}

.status.sent {
  background: #3ca169;
}

.status.in_use {
  background: #3ca169;
}

.status.nao-aplicavel {
  background: #fbc02d;
}

.btn-acao {
  background: #005594;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 1rem;
  cursor: pointer;
  margin-right: 6px;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08);
}

.btn-acao img {
  width: 20px;
  height: 20px;
  color: #ccc;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(25, 118, 210, 0.15);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(25, 118, 210, 0.18);
  padding: 28px 24px 18px 24px;
  min-width: 320px;
  max-width: 95vw;
}

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

.modal-title {
  font-size: 1.2rem;
  color: #005594;
  font-weight: 600;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.modal-body .label {
  font-weight: 600;
  color: #005594;
  display: block;
  margin: 6px;
}

#modalDetalhesCupom .modal-body .form-control {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid #b3b3b3;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 1rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #005594;
  cursor: pointer;
}

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

.btn-secondary {
  background: #e0e0e0;
  color: #005594;
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #b3b3b3;
}

.btn-success {
  background: #43a047;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-success:hover {
  background: #357a38;
}

.form-label {
  font-weight: 600;
  color: #005594;
}

.search-bar {
  position: relative;
  width: 100%;
  max-width: auto;
  margin: 8px 0;
}

.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  opacity: 0.6;
}

.search-bar .form-control {
  width: 100%;
  padding: 10px 12px 10px 42px;
  border: 1px solid #b3b3b3;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar .form-control:focus {
  border-color: #005594;
  box-shadow: 0 0 0 1px rgba(0, 85, 148, 0.25);
}

.btn-op {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: background 0.2s, border-color 0.2s;
}

.btn-op:hover {
  background: #e0e0e0;
  border-color: #bbb;
}

.btn-op:empty {
  background: #f9f9f9;
  color: #aaa;
  border: 1px dashed #ddd;
}

@media (max-width: 1000px) {
  .container {
    padding: 6px 1vw;
    max-width: 100vw;
    width: 100vw;
  }

  .table-responsive {
    width: 100vw;
    margin-left: 0;
    margin-right: 0;
  }

  table {
    font-size: 0.9rem;
    min-width: 100vw;
    width: 100vw;
  }

  th,
  td {
    padding: 8px 4px;
    font-size: 0.9rem;
    max-width: 200px;
  }

  .navbar .navbar-brand {
    font-size: 1rem;
  }
}

@media (max-width: 700px) {
  .container {
    padding: 6px 1vw;
    max-width: 100vw;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 1rem;
    gap: 8px;
  }

  .navbar img {
    margin-bottom: 6px;
  }

  .navbar .navbar-brand {
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .navbar button {
    width: 100%;
    margin-top: 4px;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 18px;
    background: #f7faff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
    padding: 8px 0;
  }

  td {
    padding: 8px 12px;
    text-align: left;
    position: relative;
    font-size: 0.9rem;
    border-bottom: none;
  }

  td:before {
    content: attr(data-label);
    font-weight: 600;
    color: #005594;
    display: block;
    margin-bottom: 2px;
    font-size: 0.9rem;
  }
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pagination-controls .form-label {
  color: #333;
  padding: 4px;
}

.pagination-controls .form-control {
  width: auto;
  padding: 4px;
  border: 1px solid #b3b3b3;
  border-radius: 4px;
  font-size: 0.9rem;
  margin: 0;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.pagination-info {
  margin: 0 12px;
  font-size: 0.9rem;
  color: #333;
}

.hidden {
  display: none !important;
}

.navbar-username {
  color: #fff;
  font-size: 1rem;
  margin-left: auto;
}

.btn-link {
  background: none;
  border: none;
  color: #005594;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.btn-link:hover {
  color: #125ea2;
}

#detalhesCupomBody p {
  margin: 8px 0;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 5px;
  font-size: 1rem;
  color: #005594;
}

.btn-icon:hover {
  color: #125ea2;
}

#modalDetalheCupom .modal-content {
  max-width: 620px;
  width: 95vw;
  border-radius: 12px;
  padding: 28px 24px 18px 24px;
}

/* Cabeçalho */
#modalDetalheCupom .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#modalDetalheCupom .modal-title {
  font-size: 1.25rem;
  color: #005594;
  font-weight: 600;
}

/* Grid do formulário */
#modalDetalheCupom .modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 8px;
}

/* Grupo */
#modalDetalheCupom .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

#modalDetalheCupom .form-group.full {
  grid-column: 1 / -1;
}

/* Label */
#modalDetalheCupom .form-label {
  font-weight: 600;
  color: #005594;
}

/* Inputs */
#modalDetalheCupom .form-control,
#modalDetalheCupom .form-control-textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #b3b3b3;
  padding: 8px 10px;
  font-size: 0.95rem;
  background: #f9fafb;
  outline: none;
}

#modalDetalheCupom .form-control:disabled {
  background: #f3f4f6;
  color: #555;
}

#modalDetalheCupom .form-control:focus,
#modalDetalheCupom .form-control-textarea:focus {
  border-color: #005594;
  box-shadow: 0 0 0 1px rgba(0, 85, 148, 0.25);
  background: #fff;
}

/* Textarea */
#modalDetalheCupom .form-control-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Grupo OP */
#modalDetalheCupom .form-group-op {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Botão de ícone */
#modalDetalheCupom .btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 6px;
  font-size: 1rem;
  color: #005594;
}

#modalDetalheCupom .btn-icon:hover {
  color: #125ea2;
}

/* Footer */
#modalDetalheCupom .modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toggle de Visibilidade */
#modalDetalheCupom .toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

#modalDetalheCupom .toggle-switch {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: #e0e0e0;
  transition: background 0.2s, box-shadow 0.2s;
}

#modalDetalheCupom .toggle-switch .toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#modalDetalheCupom .toggle-switch .toggle-text {
  font-size: 0.9rem;
  color: #333;
}

#modalDetalheCupom .toggle-switch.active {
  background: #005594;
  box-shadow: 0 0 0 1px rgba(0, 85, 148, 0.2);
}

#modalDetalheCupom .toggle-switch.active .toggle-text {
  color: #fff;
}

/* Responsivo */
@media (max-width: 700px) {
  #modalDetalheCupom .modal-content {
    max-width: 95vw;
    padding: 22px 16px 16px 16px;
  }

  #modalDetalheCupom .modal-form {
    grid-template-columns: 1fr;
  }
}

#modalEdicaoCupom .modal-content {
  max-width: 620px;
  width: 95vw;
  border-radius: 12px;
  padding: 28px 24px 18px 24px;
}

/* Cabeçalho */
#modalEdicaoCupom .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#modalEdicaoCupom .modal-title {
  font-size: 1.25rem;
  color: #005594;
  font-weight: 600;
}

/* Grid do formulário */
#modalEdicaoCupom .modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 8px;
}

/* Grupo */
#modalEdicaoCupom .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

#modalEdicaoCupom .form-group.full {
  grid-column: 1 / -1;
}

/* Label */
#modalEdicaoCupom .form-label {
  font-weight: 600;
  color: #005594;
}

/* Inputs */
#modalEdicaoCupom .form-control,
#modalEdicaoCupom .form-control-textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #b3b3b3;
  padding: 8px 10px;
  font-size: 0.95rem;
  background: #f9fafb;
  outline: none;
}

#modalEdicaoCupom .form-control:disabled {
  background: #f3f4f6;
  color: #555;
}

#modalEdicaoCupom .form-control:focus,
#modalEdicaoCupom .form-control-textarea:focus {
  border-color: #005594;
  box-shadow: 0 0 0 1px rgba(0, 85, 148, 0.25);
  background: #fff;
}

/* Textarea */
#modalEdicaoCupom .form-control-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Grupo OP */
#modalEdicaoCupom .form-group-op {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Botão de ícone */
#modalEdicaoCupom .btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 6px;
  font-size: 1rem;
  color: #005594;
}

#modalEdicaoCupom .btn-icon:hover {
  color: #125ea2;
}

/* Footer */
#modalEdicaoCupom .modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toggle de Visibilidade */
#modalEdicaoCupom .toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

#modalEdicaoCupom .toggle-switch {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: #e0e0e0;
  transition: background 0.2s, box-shadow 0.2s;
}

#modalEdicaoCupom .toggle-switch .toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#modalEdicaoCupom .toggle-switch .toggle-text {
  font-size: 0.9rem;
  color: #333;
}

#modalEdicaoCupom .toggle-switch.active {
  background: #005594;
  box-shadow: 0 0 0 1px rgba(0, 85, 148, 0.2);
}

#modalEdicaoCupom .toggle-switch.active .toggle-text {
  color: #fff;
}

/* Responsivo */
@media (max-width: 700px) {
  #modalEdicaoCupom .modal-content {
    max-width: 95vw;
    padding: 22px 16px 16px 16px;
  }

  #modalEdicaoCupom .modal-form {
    grid-template-columns: 1fr;
  }
}

/* Estilos para o formulário de filtro e botão de exportação */
.controls-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.btn-export {
  background-color: #1d6f42;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-export img {
  width: 20px;
  height: 20px;
  color: #ccc;
}

.btn-export:hover {
  background-color: #175935;
}

.filter-form {
  background-color: #f7faff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  border: 1px solid #e0e0e0;
}

.filter-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.filter-form .form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 150px;
}

.filter-form .form-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #005594;
}

.filter-form .form-control {
  padding: 8px 12px;
  border: 1px solid #b3b3b3;
  border-radius: 4px;
  font-size: 1rem;
}

.filter-form .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 10px;
}

.btn-primary {
  background-color: #005594;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary:hover {
  background-color: #004477;
}

.filter-toggle-content {
  display: flex;
  align-items: center;
}

.filter-toggle-content img {
  width: 20px;
  height: 20px;
}

.filter-icon {
  margin-right: 8px;
}

.filter-toggle-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s;
  margin-bottom: 16px;
  /* Adicionado para separar do formulário */
}

.filter-toggle-button:hover {
  background-color: #e0e0e0;
}

.filter-toggle-button .arrow-icon {
  transition: transform 0.3s ease;
  display: inline-block;
}

.filter-toggle-button.expanded .arrow-icon {
  transform: rotate(90deg);
}

.filter-toggle-button img {
  width: 20px;
  height: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  width: 100%;
}

.header-actions h2 {
  margin: 0;
}