:root {
  --brand: #0d6efd;
  --brand-dark: #0a58ca;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --gray-50: #f8f9fa;
  --gray-100: #e9ecef;
  --gray-200: #dee2e6;
  --gray-600: #6c757d;
  --gray-900: #212529;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
}

/* Topbar moderna */
.topbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.topbar button {
  background: var(--brand);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
  transition: all 0.2s;
}

.topbar button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

/* Cards */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h3, .card h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

/* Form controls */
input.form-control,
textarea.form-control,
select.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem; /* Evita zoom no iOS */
  transition: all 0.2s;
  margin-bottom: 1rem;
  -webkit-appearance: none;
  appearance: none;
}

input.form-control:focus,
textarea.form-control:focus,
select.form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-900);
  font-size: 0.95rem;
}
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary {
  background: var(--brand);
  color: white;
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #157347;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gray-200);
  color: var(--gray-900);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-600);
}

/* Ticket items */
.ticket-item {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  cursor: pointer;
  min-height: 48px; /* Touch-friendly */
  display: flex;
  align-items: center;
}

.ticket-item:hover,
.ticket-item:active {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Touch feedback para mobile */
@media (hover: none) {
  .ticket-item:active {
    background: var(--gray-50);
    transform: scale(0.98);
  }
}

.ticket-item .title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.ticket-item .meta {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

.badge-status {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-concluido {
  background: #d1fae5;
  color: #065f46;
}

.badge-pendente {
  background: #fef3c7;
  color: #92400e;
}

.badge-nao_concluido {
  background: #fee2e2;
  color: #991b1b;
}

.badge-ninguem_local {
  background: #f3f4f6;
  color: #374151;
}

.badge-aberto {
  background: #dbeafe;
  color: #1e40af;
}

/* Login page */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  padding: 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  color: var(--gray-900);
}

.login-header p {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.95rem;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none; /* Inicialmente escondido */
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  min-width: 280px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Mobile-first: Modal full screen em telas pequenas */
@media (max-width: 640px) {
  .modal {
    padding: 0;
  }
  
  .modal-content {
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    padding: 1rem;
  }
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  padding: 0;
  width: 32px;
  height: 32px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.manager-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }
.text-muted { color: var(--gray-600); }
.text-small { font-size: 0.85rem; }

.d-flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

/* Imagens responsivas */
img {
  max-width: 100%;
  height: auto;
}

/* Modal de imagem expandida */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  cursor: zoom-out;
}

.image-modal.active,
.image-modal[style*="display: flex"] {
  display: flex !important;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
}

.image-modal-close:hover {
  background: white;
  transform: scale(1.1);
}

.thumbnail-image {
  transition: transform 0.2s, box-shadow 0.2s;
}

.thumbnail-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  /* Mobile: Layout em coluna única */
  .manager-layout {
    grid-template-columns: 1fr;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  /* Mobile: Topbar compacta */
  .topbar {
    padding: 0.75rem 1rem;
  }
  
  .topbar .brand {
    font-size: 1rem;
  }
  
  .topbar .user-info {
    gap: 0.5rem;
  }
  
  .topbar .user-info span {
    display: none; /* Esconde nome do usuário em mobile */
  }
  
  /* Mobile: Buttons menores */
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  /* Mobile: Cards com menos padding */
  .card {
    padding: 1rem;
  }
  
  .card h3 {
    font-size: 1.1rem;
  }
  
  /* Mobile: Container com menos padding */
  .container {
    padding: 0.75rem;
  }
  
  /* Mobile: Login card full width */
  .login-card {
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  /* Mobile: Ticket items compactos */
  .ticket-item {
    padding: 0.75rem;
  }
  
  .ticket-item .title {
    font-size: 0.95rem;
  }
  
  .ticket-item .meta {
    font-size: 0.75rem;
  }
  
  /* Mobile: Forms */
  input.form-control,
  textarea.form-control,
  select.form-select {
    font-size: 16px; /* Evita zoom no iOS */
  }
  
  /* Mobile: Badges menores */
  .badge-status {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Extra small devices (phones em landscape) */
@media (max-width: 480px) {
  .topbar .brand {
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .d-flex.justify-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
  
  .d-flex.justify-between > button {
    width: 100%;
  }
}

