* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background: #0f172a;
  color: #e2e8f0;
}

/* ===== TOPBAR ===== */
.topbar {
  background: #111827;
  height: 70px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #38bdf8;
}

/* ===== NAV ===== */
nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #cbd5e1;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  transition: 0.2s ease;
}

nav a:hover {
  background: #1f2937;
  color: white;
}

nav a.highlight {
  background: #2563eb;
  color: white;
  font-weight: 600;
}

nav a.highlight:hover {
  background: #1d4ed8;
}

nav a.logout {
  background: #7f1d1d;
  color: #fecaca;
}

nav a.logout:hover {
  background: #991b1b;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

/* ===== CARD PRINCIPAL ===== */
.content-card {
  background: #111827;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ===== FLASH ===== */
.flash-area {
  margin-bottom: 20px;
}

.flash {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 500;
}

.flash.success {
  background: #064e3b;
  color: #34d399;
}

.flash.error {
  background: #7f1d1d;
  color: #f87171;
}

.flash.warning {
  background: #78350f;
  color: #facc15;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #111827;
  padding: 25px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transition: 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card h3 {
  font-size: 32px;
  margin-bottom: 5px;
}

.stat-card p {
  font-size: 14px;
  opacity: 0.8;
}

/* CORES DOS STATUS */
.stat-card.aberto { border-top: 4px solid #facc15; }
.stat-card.andamento { border-top: 4px solid #38bdf8; }
.stat-card.finalizado { border-top: 4px solid #22c55e; }
.stat-card.suspenso { border-top: 4px solid #f97316; }
.stat-card.recusado { border-top: 4px solid #ef4444; }

/* ===== CARD ===== */
.card {
  background: #111827;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 18px;
}

/* ===== TABELA ===== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #1f2937;
}

th {
  padding: 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #38bdf8;
}

td {
  padding: 14px;
  border-bottom: 1px solid #1f2937;
}

tr:hover {
  background: #1a2235;
}

/* ===== BADGE ===== */
.badge {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge.aberto { background: #78350f; color: #facc15; }
.badge.andamento { background: #1e3a8a; color: #38bdf8; }
.badge.finalizado { background: #064e3b; color: #22c55e; }
.badge.suspenso { background: #7c2d12; color: #f97316; }
.badge.recusado { background: #7f1d1d; color: #ef4444; }

/* ===== BOTÃO MINI ===== */
.btn-mini {
  background: #2563eb;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
}

.btn-mini:hover {
  background: #1d4ed8;
}

.empty {
  text-align: center;
  padding: 20px;
  opacity: 0.6;
}

/* ===== TICKET HEADER ===== */
.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.ticket-description {
  margin-bottom: 20px;
  opacity: 0.85;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.ticket-meta-grid div {
  background: #1f2937;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.ticket-meta-grid strong {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 4px;
}

/* ===== STATUS CHIP ===== */
.status-chip {
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== ATTACHMENTS ===== */
.attachments {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.attachment {
  background: #1f2937;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  color: #38bdf8;
  transition: 0.2s;
}

.attachment:hover {
  background: #2563eb;
  color: white;
}

/* ===== FORM GRID ===== */
.form-grid {
  display: grid;
  gap: 18px;
}

.btn-primary {
  background: #2563eb;
  color: white;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* ===== TIMELINE ===== */
.timeline {
  list-style: none;
  padding-left: 0;
}

.timeline li {
  background: #1f2937;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.timeline small {
  opacity: 0.6;
}

.log-detail {
  opacity: 0.8;
  font-size: 14px;
}

.empty {
  opacity: 0.6;
}

/* ===== FILTROS ===== */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 15px;
}

.filters-grid label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 6px;
}

.filters-grid span {
  font-weight: 600;
  font-size: 13px;
  opacity: 0.8;
}

.btn-row {
  display: flex;
  align-items: end;
  gap: 10px;
}

/* ===== BOTÕES ===== */
.btn-primary {
  background: #2563eb;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #374151;
  color: #e5e7eb;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #4b5563;
}

/* ===== TABELA AJUSTADA ===== */
table th {
  text-align: left;
  padding: 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #1f2937;
  color: #38bdf8;
}

table td {
  padding: 14px;
  border-bottom: 1px solid #1f2937;
}

tr:hover {
  background: #1a2235;
}

/* ===== LOGIN ===== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 75vh;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #111827;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h2 {
  margin-bottom: 8px;
  color: #38bdf8;
}

.login-header p {
  font-size: 14px;
  opacity: 0.7;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 18px;
}

.form-grid span {
  font-weight: 600;
  font-size: 13px;
  opacity: 0.8;
}

.btn-full {
  width: 100%;
  margin-top: 10px;
}

.login-info {
  margin-top: 25px;
  font-size: 13px;
  opacity: 0.7;
}

.login-info p {
  margin-bottom: 8px;
}

.dev-info {
  font-size: 12px;
  opacity: 0.6;
}

/* ===== FORM GRID 2 COLUNAS ===== */
.form-grid-2 {
  display: grid;
  gap: 25px;
}

.form-section {
  background: #1f2937;
  padding: 20px;
  border-radius: 12px;
}

.form-section h3 {
  margin-bottom: 15px;
  font-size: 15px;
  color: #38bdf8;
}

.form-section label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.form-section span {
  font-weight: 600;
  font-size: 13px;
  opacity: 0.8;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.full-width {
  grid-column: 1 / -1;
}

/* ===== BOTÕES ===== */
.btn-large {
  padding: 14px 20px;
  font-size: 15px;
  width: 100%;
}

/* ===== PRIMEIRO ACESSO ===== */
.first-access-card {
  max-width: 500px;
}

.first-access-card .login-header h2 {
  color: #facc15; /* Destaque mais sério */
}

.first-access-card .login-header p {
  font-size: 14px;
  opacity: 0.75;
}

/* Inputs mais visíveis */
.first-access-card input {
  background: #1f2937;
  border: 1px solid #374151;
  padding: 12px;
  border-radius: 8px;
  color: white;
}

.first-access-card input:focus {
  border-color: #2563eb;
  outline: none;
}

/* Botão */
.first-access-card .btn-primary {
  margin-top: 10px;
  padding: 14px;
  font-weight: 600;
}

/* ===== GRID ADMIN ===== */
.grid-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 1000px) {
  .grid-admin {
    grid-template-columns: 1fr;
  }
}

/* ===== LISTA DE USUÁRIOS ===== */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.user-item {
  background: #1f2937;
  border-radius: 10px;
  padding: 12px 15px;
}

.user-item summary {
  cursor: pointer;
  list-style: none;
}

.user-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-summary span {
  font-size: 13px;
  opacity: 0.7;
}

/* ===== BADGE PERFIL ===== */
.badge.perfil-admin {
  background: #7f1d1d;
  color: #fecaca;
}

.badge.perfil-tecnico {
  background: #1e3a8a;
  color: #93c5fd;
}

.badge.perfil-usuario {
  background: #064e3b;
  color: #6ee7b7;
}

/* ===== FORM EDIT ===== */
.form-edit {
  margin-top: 15px;
}

.checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-success {
  background: #16a34a;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-success:hover {
  background: #15803d;
}

/* ===== TEXTAREA PROPORCIONAL ===== */
.textarea-full {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #1f2937;
  color: white;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

/* Garante que a seção ocupe largura total no grid */
.full-width {
  grid-column: 1 / -1;
}


/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 10px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}