/* Reset básico e fontes */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: #f4f1fa;
  color: #1e293b;
  font-size: 14px;
  overflow: hidden;
}

#app-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header Principal */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  padding: 10px 30px;
  border-bottom: 1px solid #dde1e9;
  box-shadow: 0 2px 5px rgba(91, 58, 171, 0.05);
  flex-shrink: 0;
}

.header-content {
  display: flex;
  align-items: center;
}

.header-logo {
  width: 80px; /* Tamanho ajustado para o header */
  height: auto;
  margin-right: 20px;
}

.main-title {
  font-size: 24px;
  color: #5b3aab;
  font-weight: 600;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  color: #5b3aab;
  font-weight: 500;
}

#userName {
  margin-right: 20px;
}

.button-logout {
  background-color: transparent;
  color: #5b3aab;
  border: 1px solid #5b3aab;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.button-logout i {
  margin-right: 8px;
}

.button-logout:hover {
  background-color: #5b3aab;
  color: #fff;
}

/* Container Principal */
.main-container {
  display: flex;
  flex: 1;
  padding: 20px;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar (Coluna da Esquerda) */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(91, 58, 171, 0.07);
  margin-right: 20px;
  align-self: flex-start;
}

.filter-section h3 {
  margin-top: 0;
  font-size: 1.2em;
  color: #5b3aab;
  border-bottom: 1px solid #e8ecf1;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

/* Grupos de Formulário */
.form-group,
.form-group-checkbox {
  margin-bottom: 20px;
}

.form-group label,
.form-group-checkbox label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1e293b;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dde1e9;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
  background-color: #f9fafb;
}

.form-group input[type="text"]::placeholder {
  color: #aaa;
}

.form-group input[type="text"]:focus {
  border-color: #5b3aab;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(91, 58, 171, 0.15);
}

.form-group-checkbox {
  display: flex;
  align-items: center;
}

.form-group-checkbox input[type="checkbox"] {
  margin-right: 10px;
  accent-color: #5b3aab;
}

/* Conteúdo Principal (Coluna da Direita) */
.content {
  flex-grow: 1;
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(91, 58, 171, 0.07);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.content h2 {
  margin: 0;
  font-size: 1.8em;
  color: #5b3aab;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-controls label {
  font-size: 13px;
  color: #64748b;
  margin-right: 5px;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid #dde1e9;
  background-color: #f9fafb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s;
}

.sort-btn:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}

.sort-btn.active {
  background-color: #5b3aab;
  color: white;
  border-color: #5b3aab;
}

.sort-btn i {
  font-size: 12px;
}

/* Lista de Relatórios */
.report-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.report-list li {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 5px;
}

.report-list li:hover {
  background-color: #f4f1fa;
  transform: translateX(5px);
}

.report-list li .report-id {
  font-size: 0.9em;
  color: #5b3aab;
  margin-right: 10px;
  font-weight: bold;
  min-width: 50px;
}

.report-list li .report-name {
  flex-grow: 1;
  color: #1e293b;
  font-weight: 500;
}

/* Badge de formato (PDF/Excel) */
.format-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 10px;
  margin-right: 10px;
}

.format-badge.pdf {
  background-color: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.format-badge.excel {
  background-color: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* --- Estilos do Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 20, 60, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(91, 58, 171, 0.1);
  width: 90%;
  max-width: 550px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background-color: #5b3aab;
  color: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3em;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #fff;
  opacity: 0.8;
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 25px;
  max-height: 60vh;
  overflow-y: auto;
  background-color: #f9fafb;
}

.modal-body .form-group {
  margin-bottom: 20px;
}

.modal-body .form-group label {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.modal-body .form-group input,
.modal-body .form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #dde1e9;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 15px;
  background-color: #fff;
}

.modal-body .form-group input::placeholder {
  color: #aaa;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus {
  border-color: #5b3aab;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(91, 58, 171, 0.2);
}

.checkbox-list-container {
  border: 1px solid #dde1e9;
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 200px;
  overflow-y: auto;
  background-color: #fff;
  text-align: left;
}

.modal-body .checkbox-list-container .checkbox-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: normal;
  color: #1e293b;
}

.checkbox-list-container .checkbox-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  accent-color: #5b3aab;
}

.modal-body .checkbox-list-container .checkbox-item-todos {
  font-weight: 600;
  border-bottom: 1px solid #dde1e9;
  margin-bottom: 4px;
  padding-bottom: 8px;
}

.checkbox-list-placeholder {
  color: #aaa;
  font-size: 14px;
  padding: 5px 0;
  display: block;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #e8ecf1;
  display: flex;
  justify-content: flex-end;
  background-color: #fff;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.button-primary,
.button-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-primary {
  background-color: #5b3aab;
  color: white;
  margin-left: 10px;
}

.button-primary:hover {
  background-color: #4a2d8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 58, 171, 0.3);
}

.button-primary.loading {
  position: relative;
  color: transparent;
  cursor: wait;
}

.button-primary.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.button-secondary {
  background-color: transparent;
  color: #5b3aab;
  border-color: #5b3aab;
}

.button-secondary:hover {
  background-color: #5b3aab;
  color: #fff;
  border-color: #5b3aab;
}

/* --- Alerta Customizado --- */
.alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 20, 60, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: alertFadeIn 0.25s ease;
}

@keyframes alertFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: scale(0.9) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.alert-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(91, 58, 171, 0.2);
  width: 90%;
  max-width: 400px;
  padding: 30px 30px 25px;
  text-align: center;
  animation: alertSlideIn 0.3s ease;
}

.alert-icon-area {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.alert-icon-area i {
  font-size: 28px;
}

.alert-icon-area.alert-type-error {
  background-color: #fdecea;
}

.alert-icon-area.alert-type-error i {
  color: #d32f2f;
}

.alert-icon-area.alert-type-warning {
  background-color: #fff3e0;
}

.alert-icon-area.alert-type-warning i {
  color: #f57c00;
}

.alert-icon-area.alert-type-info {
  background-color: #f4f1fa;
}

.alert-icon-area.alert-type-info i {
  color: #5b3aab;
}

.alert-icon-area.alert-type-success {
  background-color: #e8f5e9;
}

.alert-icon-area.alert-type-success i {
  color: #22a852;
}

.alert-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.alert-message {
  margin: 0 0 22px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Estilo para alertas grandes (observacao de agenda) */
.alert-content.alert-large {
  max-width: 600px;
  padding: 35px 40px 30px;
}

.alert-content.alert-large .alert-title {
  font-size: 22px;
  margin-bottom: 20px;
  color: #5b3aab;
}

.alert-content.alert-large .alert-message {
  font-size: 16px;
  line-height: 1.8;
  text-align: left;
  max-height: 400px;
  overflow-y: auto;
  padding: 15px 20px;
  background: #f8f6fc;
  border-radius: 8px;
  border-left: 4px solid #5b3aab;
}

.alert-ok-button {
  padding: 10px 40px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background-color: #5b3aab;
  transition: all 0.2s;
}

.alert-ok-button:hover {
  background-color: #4a2d8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 58, 171, 0.3);
}

.alert-ok-button:active {
  transform: translateY(0);
}

/* --- Estilos do Login (Novo Design) --- */
.login-page {
  background-color: #edeaf3;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-page .login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(91, 58, 171, 0.1);
  width: 100%;
  max-width: 420px;
  padding: 40px 50px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 80px;
  height: auto;
  margin-bottom: 20px;
}

.login-title {
  color: #5b3aab;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.login-subtitle {
  color: #64748b;
  font-size: 14px;
  margin: 0;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1e293b;
  font-size: 14px;
}

.login-form .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #c4b5de;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 15px;
  background-color: #f8f6fc;
  color: #1e293b;
  transition: all 0.2s;
}

.login-form .form-group input::placeholder {
  color: #888;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: #5b3aab;
  background-color: #f0ecf7;
  box-shadow: 0 0 0 3px rgba(91, 58, 171, 0.15);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: #5b3aab;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background-color: #5b3aab;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-login:hover {
  background-color: #4a2d8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 58, 171, 0.3);
}

.btn-login:disabled {
  background-color: #b8a7d4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e8ecf1;
  text-align: center;
}

.login-footer p {
  color: #888;
  font-size: 12px;
  margin: 0;
}

.login-footer a {
  color: #5b3aab;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.error-message {
  color: #e74c3c;
  background-color: #fdf2f2;
  border: 1px solid #f5c6c6;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
  display: none;
}

/* --- Estilos para o Select Dropdown no Modal --- */
.modal-body .form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%235b3aab%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13%205.1L147.2%20202.7%2018.5%2074.5a17.6%2017.6%200%200%200-24.7%2024.9l130.6%20129.8c6.8%206.7%2017.7%206.7%2024.5%200l130.6-129.8a17.6%2017.6%200%200%200-11.7-29.4z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 15px top 50%;
  background-size: 12px;
}

/* --- Responsividade Mobile --- */
@media (max-width: 768px) {
  /* Login Mobile */
  .login-page .login-container {
    padding: 15px;
  }

  .login-card {
    padding: 30px 25px;
    border-radius: 10px;
  }

  .login-logo {
    width: 70px;
    margin-bottom: 15px;
  }

  .login-title {
    font-size: 20px;
  }

  .login-subtitle {
    font-size: 13px;
  }

  .login-form .form-group input {
    padding: 12px 14px;
    font-size: 16px; /* Previne zoom no iOS */
  }

  .btn-login {
    padding: 14px;
    font-size: 16px;
  }

  .login-footer {
    margin-top: 20px;
    padding-top: 15px;
  }

  /* Header Mobile */
  .main-header {
    padding: 10px 15px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-logo {
    width: 60px;
    margin-right: 10px;
  }

  .main-title {
    font-size: 18px;
  }

  #userName {
    display: none;
  }

  .button-logout {
    padding: 6px 12px;
    font-size: 13px;
  }

  .button-logout i {
    margin-right: 5px;
  }

  /* Container Mobile */
  .main-container {
    flex-direction: column;
    padding: 10px;
  }

  .sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
    padding: 15px;
  }

  .content {
    padding: 15px;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .content h2 {
    font-size: 1.4em;
  }

  .sort-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .sort-controls label {
    width: 100%;
    margin-bottom: 5px;
  }

  .sort-btn {
    flex: 1;
    justify-content: center;
    padding: 10px;
  }

  /* Lista de Relatórios Mobile */
  .report-list li {
    padding: 12px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .report-list li .report-id {
    font-size: 0.85em;
    min-width: 45px;
  }

  .report-list li .report-name {
    font-size: 0.9em;
  }

  .format-badge {
    margin-left: auto;
    margin-right: 0;
  }

  /* Modal Mobile */
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header {
    padding: 12px 15px;
  }

  .modal-header h3 {
    font-size: 1.1em;
  }

  .modal-body {
    padding: 15px;
    max-height: 50vh;
  }

  .modal-body .form-group input,
  .modal-body .form-group select {
    padding: 12px;
    font-size: 16px; /* Previne zoom no iOS */
  }

  .modal-footer {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }

  .button-primary,
  .button-secondary {
    width: 100%;
    margin-left: 0;
    padding: 14px;
  }

  .button-primary {
    order: -1; /* Botão principal primeiro */
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 25px 20px;
  }

  .login-logo {
    width: 60px;
  }

  .login-title {
    font-size: 18px;
  }

  .login-form .form-group {
    margin-bottom: 15px;
  }

  .report-list li {
    padding: 10px 8px;
  }

  .report-list li .report-name {
    width: 100%;
    order: 1;
    margin-top: 5px;
  }
}

/* ==================== MINI CARRINHO ==================== */
.mini-cart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001; /* Acima dos modais (agenda-modal-overlay tem z-index 1000) */
  pointer-events: auto; /* Garantir que recebe cliques */
}

.mini-cart * {
  pointer-events: auto;
}

.mini-cart-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-cart-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.mini-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mini-cart-badge.empty {
  display: none;
}

/* ==================== BOTAO CARRINHO DENTRO DO MODAL ==================== */
.modal-cart-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.modal-cart-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-cart-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.modal-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.modal-cart-badge.empty {
  display: none;
}

/* ==================== MODAL DO CARRINHO ==================== */
#cartModal,
#checkoutModal,
.cart-choice-overlay {
  z-index: 10010 !important; /* Acima de todos os outros modais */
  background-color: rgba(30, 20, 60, 0.7) !important;
}

.cart-modal {
  width: 600px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.cart-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 200px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  transition: all 0.2s ease;
}

.cart-item:hover {
  border-color: #8b5cf6;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.cart-item-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.cart-item-type.consulta {
  background: #dbeafe;
  color: #1e40af;
}

.cart-item-type.exame {
  background: #fef3c7;
  color: #92400e;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.cart-item-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.cart-item-info {
  display: grid;
  gap: 8px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.cart-item-row i {
  width: 16px;
  color: #8b5cf6;
}

.cart-item-row strong {
  color: #1e293b;
}

.cart-item-datetime {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.cart-item-datetime span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.cart-item-datetime i {
  color: #8b5cf6;
}

.cart-item-classif {
  margin-top: 8px;
}

.cart-item-classif select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  background: white;
  cursor: pointer;
}

.cart-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.cart-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.cart-empty p {
  font-size: 16px;
  margin-bottom: 8px;
  color: #64748b;
}

.cart-modal-footer {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

.cart-summary {
  font-size: 14px;
  color: #64748b;
}

.cart-actions {
  display: flex;
  gap: 12px;
}

.cart-actions .btn-secondary,
.cart-actions .btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.cart-actions .btn-secondary {
  background: white;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.cart-actions .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.cart-actions .btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border: none;
  color: white;
}

.cart-actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.cart-actions .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== MODAL DE CHECKOUT ==================== */
.checkout-modal {
  width: 650px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.checkout-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.checkout-summary {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.checkout-summary h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-summary-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  font-size: 13px;
}

.checkout-summary-item .item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkout-summary-item .item-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.checkout-summary-item .item-badge.consulta {
  background: #dbeafe;
  color: #1e40af;
}

.checkout-summary-item .item-badge.exame {
  background: #fef3c7;
  color: #92400e;
}

.checkout-summary-item .item-datetime {
  color: #8b5cf6;
  font-weight: 600;
}

.checkout-patient-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-patient-section h4 i {
  color: #8b5cf6;
}

.checkout-validation {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

.checkout-validation.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.checkout-validation.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

.checkout-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

.checkout-modal-footer .btn-secondary,
.checkout-modal-footer .btn-primary {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.checkout-modal-footer .btn-secondary {
  background: white;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.checkout-modal-footer .btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
}

.checkout-modal-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== CHECKOUT MODAL ENHANCED ==================== */
.checkout-modal-enhanced {
  width: 750px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.checkout-modal-body-enhanced {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkout-items-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-item-card {
  background: linear-gradient(145deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.checkout-item-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.checkout-item-card .item-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.checkout-item-card .item-badge.consulta {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: white;
}

.checkout-item-card .item-badge.exame {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.checkout-item-price {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.checkout-item-price i {
  font-size: 10px;
}

.checkout-item-price .item-price-value {
  color: white;
}

.checkout-item-price .item-price-value.valor-indisponivel {
  opacity: 0.8;
  font-weight: 500;
}

.checkout-item-estab {
  font-size: 15px;
  font-weight: 700;
  color: #5b3aab;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-item-estab i {
  color: #8b5cf6;
}

.checkout-item-datetime {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.checkout-item-datetime .datetime-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.checkout-item-datetime .datetime-item i {
  color: #8b5cf6;
}

.checkout-item-professional {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1e293b;
}

.checkout-item-professional i {
  color: #8b5cf6;
}

.checkout-item-specialty {
  font-size: 13px;
  color: #64748b;
  margin-left: 24px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkout-item-specialty i {
  color: #a78bfa;
}

.checkout-item-retorno-info {
  margin-top: 8px;
  padding: 6px 10px;
  background: #e0f2fe;
  border-radius: 6px;
  font-size: 12px;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkout-patient-section-enhanced {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}

.checkout-patient-section-enhanced .section-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-patient-section-enhanced .section-title i {
  color: #8b5cf6;
}

.checkout-patient-section-enhanced .section-title small {
  font-weight: 400;
  color: #94a3b8;
}

.checkout-patient-section-enhanced .patient-search-wrap {
  position: relative;
  width: 100%;
}

.checkout-patient-section-enhanced .patient-search-wrap input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: white;
  transition: all 0.2s;
  box-sizing: border-box;
}

.checkout-patient-section-enhanced .patient-search-wrap input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.checkout-patient-section-enhanced .patient-search-wrap input::placeholder {
  color: #94a3b8;
}

.checkout-patient-section-enhanced .patient-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.checkout-patient-section-enhanced .patient-search-results .patient-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.checkout-patient-section-enhanced .patient-search-results .patient-result-item:hover {
  background: #f8fafc;
}

.checkout-patient-section-enhanced .patient-search-results .patient-result-item:last-child {
  border-bottom: none;
}

.patient-selected-enhanced {
  margin-top: 12px;
}

.checkout-classif-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}

.checkout-classif-section .section-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-classif-section .section-title i {
  color: #8b5cf6;
}

.checkout-classif-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.checkout-classif-select:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.retorno-warning {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.retorno-warning.blocked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.checkout-obs-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}

.checkout-obs-section .section-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-obs-section .section-title i {
  color: #8b5cf6;
}

.checkout-obs-section .section-title small {
  font-weight: 400;
  color: #94a3b8;
}

.checkout-obs-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
  transition: all 0.2s;
}

.checkout-obs-textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.checkout-obs-textarea::placeholder {
  color: #94a3b8;
}

/* Patient card dentro do checkout modal */
.patient-selected-enhanced {
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.patient-selected-enhanced .patient-card-header {
  padding: 14px 16px;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.patient-selected-enhanced .patient-card-badges {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #f1f5f9;
}

.patient-selected-enhanced .patient-card-contact {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #f1f5f9;
}

.patient-selected-enhanced .patient-card-cupons {
  padding: 12px 16px;
  background: #faf5ff;
}

/* ==================== BOTAO ADICIONAR AO CARRINHO ==================== */
.ss-slot-btn.in-cart {
  background: #10b981 !important;
  color: white !important;
  position: relative;
}

.ss-slot-btn.in-cart::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: -6px;
  right: -6px;
  background: white;
  color: #10b981;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Toast de confirmacao */
.cart-toast {
  position: fixed;
  bottom: 100px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 10002; /* Acima do mini-cart */
  animation: slideInCart 0.3s ease;
}

.cart-toast i {
  color: #10b981;
}

.cart-toast i.fa-exclamation-circle {
  color: #f59e0b;
}

.cart-toast i.fa-times-circle {
  color: #ef4444;
}

@keyframes slideInCart {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==================== MODAL DE ESCOLHA CARRINHO ==================== */
.cart-choice-modal {
  width: 450px;
  max-width: 95vw;
}

.cart-choice-body {
  padding: 20px;
}

.cart-choice-slot-info {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.cart-choice-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.cart-choice-badge.consulta {
  background: #dbeafe;
  color: #1e40af;
}

.cart-choice-badge.exame {
  background: #fef3c7;
  color: #92400e;
}

.cart-choice-slot-info strong {
  font-size: 15px;
  color: #1e293b;
}

.cart-choice-datetime {
  font-size: 14px;
  color: #8b5cf6;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: center;
}

.cart-choice-datetime i {
  margin-right: 4px;
}

.cart-choice-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-choice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cart-choice-btn i {
  font-size: 28px;
}

.cart-choice-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.cart-choice-desc {
  font-size: 12px;
  color: #64748b;
}

.cart-choice-single {
  border-color: #10b981;
}

.cart-choice-single:hover {
  background: #f0fdf4;
  border-color: #10b981;
}

.cart-choice-single i {
  color: #10b981;
}

.cart-choice-multi {
  border-color: #8b5cf6;
}

.cart-choice-multi:hover {
  background: #f5f3ff;
  border-color: #8b5cf6;
}

.cart-choice-multi i {
  color: #8b5cf6;
}
