/* ===== BASE STYLES ===== */

/* Import Inter font for admin area */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #FDFDFD;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: #343A46;
}

p {
  font-size: 14px;
  color: #6D717A;
}

h2 {
  font-size: 20px;
}

:root {
  --primary-green: #34AE69;
  --secondary-green: #5ECA8E;
  --light-green: #90E5BD;
  --white-green: #f5fbf7;
  --black: #000000;
  --dark-grey: #343A46;
  --secondary-grey: #6D717A;
  --secondary-grey-alpha: #6d717ae7;
  --light-grey: #D9D9D9;
  --white-grey: #F8F9FA;
  --white-grey-alpha: #f8f9faa3;
  --white: #FFFFFF;
  --white-alpha: #ffffffa1;
  --light-grey-alpha: #ececec;
  --font-primary: 'Montserrat', sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

svg {
  display: inline-block;
  vertical-align: middle;
}

/* Estilos para mensagem de erro de acesso */
.error-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.error-card {
  background: white;
  padding: 60px 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 500px;
  margin: 20px;
}

.error-icon {
  margin-bottom: 20px;
}

.error-card h1 {
  margin: 0 0 20px 0;
  font-size: 28px;
  color: #dc3545;
}

.error-card p {
  margin: 10px 0;
  font-size: 16px;
  color: #666;
  line-height: 1.6;
}

/* Mensagem de sucesso */
.success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 15px;
  margin: 20px;
  border-radius: 5px;
  text-align: center;
  font-weight: 600;
}

/* Feedback message styles */
.feedback-message {
  padding: 60px 40px;
  margin: 40px auto;
  max-width: 600px;
  border-radius: 16px;
  text-align: center;
  animation: slideDown 0.3s ease-out;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-message.success {
  background: #FFFFFF;
  /* box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08); */
}

.feedback-message.error {
  background: #FFFFFF;
  /* border: 2px solid #dc3545; */
  /* box-shadow: 0 2px 20px rgba(220, 53, 69, 0.15); */
}

.feedback-logo {
  width: 200px;
  height: auto;
  margin-bottom: 30px;
}

.feedback-text {
  font-size: 20px;
  font-weight: 600;
  color: #343A46;
  margin-bottom: 30px;
  line-height: 1.5;
}

.feedback-message.error .feedback-text {
  color: #721c24;
}

.feedback-message .success-button {
  text-decoration: none;
}

.feedback-message .success-button button {
  min-width: 250px;
  padding: 15px 30px;
  font-size: 16px;
}

.page-header {
  position: relative;
  min-height: 220px;
  padding: 2rem;
  background-image: url("../modulo-60-banner.webp");
  background-size: cover;
  background-position: 50% 70%;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Overlay para garantir legibilidade */
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(27, 25, 34, 0.4);
}

/* Conteúdo central */
.header-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.header-content h1 {
  color: var(--white);
  margin: 0 0 0.5rem;
  font-size: 24px;
  font-weight: 600;
  opacity: 0.95;
  letter-spacing: 0.04em;
}

.header-content p {
  color: var(--white);
  margin: 0;
  font-size: 14px;
  opacity: 0.95;
}

/* Logotipo */
.header-logo {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 1;
}

.header-logo img {
  height: 40px;
  width: auto;
}

.container {
  max-width: 960px;
  margin: 2rem auto 6rem;
  padding: 0 1rem;
  display: grid;
  gap: 1.5rem;
}

.card {
  background: white;
  border-radius: 30px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card.highlight {
  border-left: 4px solid var(--secondary-green);
  ;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-content p {
  margin: 0.25rem 0;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}


.actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.secondary-btn {
  margin-top: 0.75rem;
  padding: 10px 16px;
  background: #e0e7ff;
  border-radius: 8px;
}

.primary-btn {
  padding: 10px 16px;
  background: var(--secondary-green);
  border: 2px solid var(--secondary-green);
  color: var(--white);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
}

.danger-btn {
  color: #dc2626;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgb(255 255 255 / 78%);
  padding: 1rem;
  display: flex;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

/* CONTACTOS */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  display: grid;
  gap: 0.75rem;
  border: 1px dashed rgba(0, 0, 0, 0.09);
  border-radius: 10px;
  padding: 1rem;
}

.contact-type {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contact-type .icon-action {
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.contact-type .icon-action:hover {
  opacity: 1;
  transform: scale(1.05);
}

.type-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  display: inline-block;
  background: var(--secondary-green);
  color: var(--white-green);
}

.contact-card label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #6b7280;
  gap: 0.25rem;
}

.contact-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.05);
}

.icon-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.icon-action img {
  width: 20px;
  height: 20px;
}

.icon-action:hover {
  transform: scale(1.05);
}


.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--white-green);
  color: var(--secondary-green);
  font-size: 13px;
  font-weight: 500;
}

.add-btn img {
  width: 14px;
}

.address-empty {
  border: 1px dashed rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--secondary-grey);
}

.address-card {
  position: relative;
  border: 1px dashed rgba(0, 0, 0, 0.09);
  border-radius: 10px;
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.address-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.address-empty p {
  margin-bottom: 1rem;
}

.address-actions {
  position: absolute;
  right: 0.6rem;
  display: flex;
  gap: 0.3rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.address-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.address-location {
  display: flex;
  align-items: center;
  height: 28px;
  font-size: 12px;
  font-weight: 500;
  color: var(--white-grey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: #5ECA8E;
  padding: 5px 12px;
  border-radius: 30px;
}

.address-actions {
  display: flex;
  gap: 0.3rem;
}


/*floating label*/
.floating-label {
  position: relative;
}

.floating-label span {
  position: absolute;
  top: -0.45rem;
  left: 0.9rem;
  padding: 0 0.4rem;
  background: white;
  font-size: 0.7rem;
  color: #6b7280;
  pointer-events: none;
}

.floating-label input {
  padding: 0.75rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: transparent;
}

.textarea-label {
  margin-top: 1rem;
  display: block;
}

.textarea-label textarea {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  background: transparent;
}

.textarea-label textarea:focus {
  outline: none;
  border-color: var(--secondary-green);
}

.textarea-label textarea:focus+span,
.textarea-label textarea:not(:placeholder-shown)+span {
  color: var(--secondary-green);
}

.textarea-label textarea {
  min-height: 120px;
}

/* ===== HEADER LOGO – MOBILE (CENTRADO SEM QUEBRAR LAYOUT) ===== */
@media (max-width: 768px) {

  .header-logo {
    position: absolute;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
  }

  .header-logo img {
    height: 48px;
  }

  .header-content {
    padding-top: 3.5rem;
    /* espaço visual para o logo */
  }
}

/* ===== CONTACTOS – DESKTOP LARGO ===== */
@media (min-width: 1200px) {
  .contacts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}


/*modal eliminar*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal h3 {
  margin-bottom: 8px;
}

.modal p {
  font-size: 14px;
  color: #555;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-secondary {
  background: var(--white-grey);
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--dark-grey);
  font-weight: 500;
}

.btn-danger {
  background: var(--secondary-green);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
}

/*modal form*/

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 45px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.btn-primary {
  background: var(--white);
  color: var(--secondary-green);
  border: 2px solid var(--secondary-green);
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
}

.modal .floating-label {
  width: 100%;
}

.modal .floating-label input {
  width: 100%;
  box-sizing: border-box;
}

.modal .form-row {
  display: flex;
  gap: 12px;
}

.modal .form-row .floating-label {
  flex: 1;
}

.modal .floating-label span {
  background: #fff;
  padding: 0 6px;
}


.modal input:focus {
  outline: none;
  border-color: var(--secondary-green);
  background: white;
}


/*Para adicionar tipo de contacto*/
.type-input {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  display: inline-block;
  background: var(--white);
  color: var(--secondary-grey-alpha);
  border: 2px solid var(--secondary-green);
  width: 100%;
}

.type-input::placeholder {
  color: var(--secondary-grey-alpha);
  text-transform: none;
  opacity: 0.5;
}

input:focus {
  outline: none;
  border-color: var(--secondary-green);
  background: white;
}


/*arrow*/
.type-input::-webkit-calendar-picker-indicator {
  display: none !important;
}

.type-input::-webkit-list-button {
  display: none;
}


/*error message*/
.error-message {
  display: none;
  color: #d32f2f;
  font-size: 0.75rem;
  margin-top: 4px;
}

input.invalid {
  border-color: #d32f2f;
}

/*checkboxes*/
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--secondary-grey-alpha)
}

.checkbox a {
  color: var(--secondary-green);
  font-weight: 600;
  text-decoration: none;
}

input[type="checkbox"] {
  accent-color: var(--secondary-green);
}


.modal-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
}

/* ===== ADMIN AREA STYLES ===== */

/* Admin Layout */
body.admin-layout {
  background: #f5f5f5;
  display: flex;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 260px;
  background: #000000;
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: width 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  /* Esconder scrollbar mas manter funcionalidade */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Esconder scrollbar para Chrome, Safari e Opera */
.admin-sidebar::-webkit-scrollbar {
  display: none;
}

.admin-sidebar.collapsed {
  width: 70px;
}

.admin-sidebar.collapsed .sidebar-logo {
  width: 45px;
  margin: 0 auto;
}

.admin-sidebar.collapsed .sidebar-logo #Layer_1 > g:first-child {
  display: none;
}

.admin-sidebar.collapsed .menu-item span {
  display: none;
}

.admin-sidebar.collapsed .menu-item {
  padding: 15px 0;
  justify-content: center;
  position: relative;
  gap: 0;
}

.admin-sidebar.collapsed .menu-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  background: #2d3748;
  color: white;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 9999;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Seta do tooltip */
.admin-sidebar.collapsed .menu-item:hover::before {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #2d3748;
  z-index: 9999;
  pointer-events: none;
  animation: tooltipFadeIn 0.2s ease-out;
}

.admin-sidebar.collapsed .menu-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.admin-sidebar.collapsed .sidebar-footer {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.admin-sidebar svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
}

.sidebar-header {
  padding: 30px 20px;
  background: #000000;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: padding 0.3s ease;
}

.admin-sidebar.collapsed .sidebar-header {
  padding: 30px 10px;
}

.sidebar-logo {
  height: auto;
  max-width: 100%;
  transition: opacity 0.3s ease;
}

.sidebar-logo-full {
  width: 140px;
  display: block;
}

.sidebar-logo-icon {
  width: 45px;
  display: none;
}

.admin-sidebar.collapsed .sidebar-logo-full {
  display: none;
}

.admin-sidebar.collapsed .sidebar-logo-icon {
  display: block;
  margin: 0 auto;
}

.sidebar-menu {
  padding: 20px 0;
  flex: 1;
  overflow-y: auto;
  /* Esconder scrollbar mas manter funcionalidade */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE e Edge */
}

/* Esconder scrollbar no Chrome/Safari/Opera */
.sidebar-menu::-webkit-scrollbar {
  display: none;
}

.menu-separator {
  height: 1px;
  background: #1a1a1a;
  margin: 15px 20px;
}

.menu-section-title {
  padding: 15px 25px 8px 25px;
  color: #7f8c8d;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: opacity 0.3s ease, height 0.3s ease, padding 0.3s ease;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 25px;
  color: #ecf0f1;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.menu-item span {
  font-size: 13px;
  white-space: nowrap;
  transition: opacity 0.3s ease, width 0.3s ease;
}

.menu-item:hover {
  background: #1a1a1a;
  border-left-color: #667eea;
}

.menu-item.active {
  background: #1a1a1a;
  border-left-color: #667eea;
  color: white;
}

.menu-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
  display: inline-block;
  overflow: hidden;
}

.menu-item svg,
.menu-item .menu-icon {
  width: 20px;
  height: 20px;
}

.menu-item:hover .menu-icon {
  transform: scale(1.05);
}

.menu-item.active .menu-icon {
  stroke: #667eea;
}

.sidebar-footer {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 12px;
  border-top: 1px solid #1a1a1a;
  background: #000000;
  flex-shrink: 0;
}

/* Admin Main Content */
.admin-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.admin-main.sidebar-collapsed {
  margin-left: 70px;
}

.admin-header {
  background: white;
  padding: 20px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.admin-header h2 {
  font-size: 20px;
  color: #333;
  margin: 0;
  font-weight: 600;
  flex: 1;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  transition: background 0.3s;
  color: #333;
}

.sidebar-toggle:hover {
  background: #f0f0f0;
}

.sidebar-toggle svg {
  width: 24px;
  height: 24px;
}

.btn-logout {
  background: #dc3545;
  color: white;
  padding: 8px 16px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
  border: none;
  cursor: pointer;
  font-size: 13px;
}

.btn-logout:hover {
  background: #c82333;
}

/* User Menu */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  padding: 8px 15px;
  border-radius: 25px;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}

.user-menu-toggle:hover {
  background: #f8f9fa;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
}

.user-role {
  font-size: 11px;
  color: #666;
  line-height: 1.2;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  display: none;
  z-index: 1000;
}

.user-menu-dropdown.active {
  display: block;
}

.user-menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
  font-size: 14px;
}

.user-menu-dropdown a:first-child {
  border-radius: 8px 8px 0 0;
}

.user-menu-dropdown a:last-child {
  border-radius: 0 0 8px 8px;
  color: #dc3545;
}

.user-menu-dropdown a:hover {
  background: #f8f9fa;
}

.user-menu-dropdown a svg {
  width: 18px;
  height: 18px;
}

.admin-content {
  padding: 30px 40px;
  flex: 1;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #667eea;
}

.stat-card.success {
  border-left-color: #28a745;
}

.stat-card.warning {
  border-left-color: #ffc107;
}

.stat-card.info {
  border-left-color: #17a2b8;
}

.stat-card h3 {
  color: #666;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.stat-card .stat-label {
  font-size: 11px;
  color: #999;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 20px;
}

.content-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-card h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  font-weight: 600;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 5px;
  margin-bottom: 20px;
  border-left: 4px solid;
  font-size: 13px;
}

.alert-success {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.alert-error {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.alert-warning {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.alert-info {
  background: #d1ecf1;
  border-color: #17a2b8;
  color: #0c5460;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.toolbar-left {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  width: 300px;
  font-family: 'Inter', 'Montserrat', sans-serif;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  font-family: 'Inter', 'Montserrat', sans-serif;
  cursor: pointer;
}

/* Admin Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
  font-family: 'Inter', 'Montserrat', sans-serif;
}

/* .btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
} */

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

/* .btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
} */

.btn-lg {
  padding: 15px 30px;
  font-size: 16px;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s;
}

.btn-icon:hover {
  transform: scale(1.2);
}

/* Tables */
.table-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #f8f9fa;
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: #999;
}

/* Badges */
.badge {
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-error {
  background: #f8d7da;
  color: #721c24;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-draft {
  background: #e7e8ea;
  color: #495057;
  border: 1px dashed #6c757d;
}

.badge-secondary {
  background: #e2e3e5;
  color: #383d41;
}

/* Code */
.guid-code {
  background: #f4f4f4;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 12px;
  color: #333;
}

/* Admin Modal */
body.admin-layout .modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

body.admin-layout .modal.active {
  display: block !important;
}

body.admin-layout .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 10px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  margin: 0 !important;
}

body.admin-layout .modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.admin-layout .modal-header h3 {
  margin: 0;
  font-size: 17px;
  border: none;
  padding: 0;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.close-btn:hover {
  color: #333;
}

body.admin-layout .modal-content form {
  padding: 30px;
}

/* Admin Forms */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  font-family: 'Inter', 'Montserrat', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #999;
  font-size: 11px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

/* Import Form Styles */
.import-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #17a2b8;
}

.import-info h4 {
  margin: 0 0 15px 0;
  color: #17a2b8;
  font-size: 14px;
  font-weight: 600;
}

.import-info p {
  margin: 0 0 10px 0;
  color: #495057;
}

.import-info ul {
  margin: 10px 0;
  padding-left: 20px;
}

.import-info li {
  margin: 8px 0;
  color: #495057;
  line-height: 1.6;
}

.import-info li strong {
  color: #212529;
  font-weight: 600;
}

.import-info em {
  display: block;
  margin-top: 10px;
  color: #6c757d;
  font-style: italic;
}

.warning-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px;
  background: #fff3cd;
  border-radius: 5px;
  border: 1px solid #ffc107;
  margin: 15px 0;
}

.warning-checkbox input[type="checkbox"] {
  margin-top: 3px;
}

.warning-checkbox span {
  color: #856404;
  font-weight: 600;
}

.warning-text {
  display: block;
  margin-top: 8px;
  color: #dc3545;
  font-size: 12px;
  font-weight: 600;
}

.form-group input[type="file"] {
  border: 2px dashed #ddd;
  padding: 15px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s;
}

.form-group input[type="file"]:hover {
  border-color: #17a2b8;
  background: #e7f6f8;
}

.form-group small {
  display: block;
  margin-top: 8px;
  color: #6c757d;
  font-size: 12px;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

/* Filter Panel */
.filter-panel {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.filter-form {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* Report Tabs */
.report-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.tab {
  padding: 15px 25px;
  text-decoration: none;
  color: #666;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.tab:hover {
  color: #667eea;
}

.tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

/* Chart List */
.chart-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chart-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #333;
}

.chart-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: #667eea;
  border-radius: 4px;
  transition: width 0.5s;
}

.chart-bar-fill.success {
  background: #28a745;
}

/* Settings */
.settings-form {
  max-width: 1000px;
}

.settings-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.settings-section h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.info-item {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 3px solid #667eea;
}

.info-item.error {
  border-left-color: #dc3545;
  color: #dc3545;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 13px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  margin-bottom: 15px;
  opacity: 0.3;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Admin Responsive - REMOVIDO: Regra antiga substituída pela lógica mobile com hamburger */
  
  .content-grid {
    grid-template-columns: 1fr;
  }
  
  .search-input {
    width: 100%;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .admin-sidebar,
  .admin-header,
  .filter-panel,
  .toolbar,
  .btn {
    display: none;
  }
  
  .admin-main {
    margin-left: 0;
  }
}
/* Import Progress Overlay */
.import-progress-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.import-progress-overlay.active {
  display: flex;
}

.import-progress-content {
  background: white;
  padding: 40px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.import-progress-content h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 24px;
}

.import-progress-content p {
  margin: 0 0 20px 0;
  color: #666;
  font-size: 16px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar.indeterminate {
  width: 100%;
  background: linear-gradient(90deg, transparent, #4CAF50, transparent);
  background-size: 200% 100%;
  animation: indeterminateAnimation 1.5s linear infinite;
}

@keyframes indeterminateAnimation {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.import-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
}

.pagination-info {
  color: #666;
  font-size: 12px;
}

.pagination-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pagination-controls .btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  min-width: auto;
}

.pagination-controls .btn-sm.active {
  background-color: #2c5aa0;
  color: white;
  font-weight: bold;
  pointer-events: none;
}

.pagination-current {
  padding: 5px 15px;
  color: #333;
  font-size: 12px;
  font-weight: 500;
}
/* ================================
   MENU MOBILE COM HAMBURGER
   ================================ */

/* Botão Hamburger */
.mobile-menu-toggle {
  display: none; /* Visível apenas em mobile */
  position: fixed;
  top: 20px;
  left: 15px;
  z-index: 9999;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 5px;
  transition: background 0.3s ease;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}

.mobile-menu-toggle:hover {
  background: #f0f0f0;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Animação do hamburger para X */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Botão Fechar (X) dentro do sidebar */
.mobile-menu-close {
  display: none; /* Visível apenas em mobile */
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.mobile-menu-close:hover {
  background: #1a1a1a;
  border-color: #667eea;
  color: #667eea;
}

/* Backdrop escuro */
.menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9997;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-backdrop.active {
  display: block;
  opacity: 1;
}

/* Media Query: MOBILE (< 768px) */
@media (max-width: 768px) {
  /* Mostrar botão hamburger */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Esconder botão sidebar-toggle em mobile */
  .sidebar-toggle {
    display: none !important;
  }
  
  /* Adicionar padding ao título do header para não sobrepor o botão hamburger */
  .admin-header h2 {
    padding-left: 50px;
  }
  
  /* IMPORTANTE: Forçar sidebar a mostrar textos em mobile, ignorando classe collapsed */
  .admin-sidebar .menu-item span,
  .admin-sidebar.collapsed .menu-item span {
    display: block !important;
  }
  
  .admin-sidebar .menu-item,
  .admin-sidebar.collapsed .menu-item {
    justify-content: flex-start !important;
    padding: 15px 25px !important;
    gap: 15px !important;
  }
  
  .mobile-menu-close {
    display: block;
  }
  
  /* Sidebar escondido por padrão em mobile */
  .admin-sidebar,
  .admin-sidebar.collapsed {
    position: fixed !important;
    width: 280px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 9998 !important;
  }
  
  /* Sidebar visível quando mobile-open */
  .admin-sidebar.mobile-open,
  .admin-sidebar.collapsed.mobile-open {
    transform: translateX(0) !important;
  }
  
  /* Conteúdo principal ocupa toda a largura */
  .admin-main {
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* Backdrop ativo quando menu aberto */
  .menu-backdrop.active {
    display: block;
  }
  
  /* Ajustes no header do sidebar */
  .sidebar-header {
    padding-right: 50px; /* Espaço para o botão X */
  }
  
  /* Submenus em mobile: expandir inline */
  .admin-sidebar .submenu,
  .admin-sidebar.collapsed .submenu {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }
  
  .admin-sidebar .submenu-item,
  .admin-sidebar.collapsed .submenu-item {
    padding: 12px 20px 12px 50px !important;
    border-left: 3px solid transparent !important;
  }
  
  .admin-sidebar .submenu-chevron,
  .admin-sidebar.collapsed .submenu-chevron {
    display: block !important;
  }
}

/* Media Query: DESKTOP (> 768px) */
@media (min-width: 769px) {
  /* Esconder elementos mobile */
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .mobile-menu-close {
    display: none !important;
  }
  
  .menu-backdrop {
    display: none !important;
  }
  
  /* Sidebar comportamento desktop normal */
  .admin-sidebar {
    transform: translateX(0) !important;
  }
}