/* ============================================================
   MODULOS - Login, Kanban, Mapa, Detalhes
   ============================================================ */

/* ---------- LOGIN ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: var(--grad-primary);
  filter: blur(120px);
  opacity: 0.55;
  top: -120px;
  left: -120px;
  animation: float 12s ease-in-out infinite;
}
.auth-shell::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--grad-accent);
  filter: blur(120px);
  opacity: 0.5;
  bottom: -120px;
  right: -120px;
  animation: float 15s ease-in-out infinite reverse;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-out), 0 30px 80px rgba(20, 22, 50, 0.18);
  padding: 36px 32px 28px;
  animation: scaleIn var(--speed-slow) var(--ease-bounce) both;
}
.auth-card .brand-mark {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  border-radius: var(--radius-xl);
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.8rem;
  box-shadow: 0 12px 30px var(--primary-glow);
  animation: float 4s ease-in-out infinite;
}
.auth-card .brand-mark img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius-lg);
}
.auth-card h1 {
  text-align: center;
  margin-bottom: 6px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-card .auth-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 26px;
  font-size: 0.92rem;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--neu-in-soft);
}
.auth-switch button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--speed-mid) var(--ease);
}
.auth-switch button.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.auth-link {
  display: block;
  text-align: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  margin-top: 14px;
  cursor: pointer;
  background: transparent;
  border: none;
}
.auth-link:hover { text-decoration: underline; }

/* ---------- DASHBOARD ---------- */
.welcome-card {
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 28px 28px 32px;
  box-shadow: 0 18px 40px var(--primary-glow);
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
}
.welcome-card::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  top: -120px;
  right: -120px;
  animation: float 8s ease-in-out infinite;
}
.welcome-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  bottom: -100px;
  left: 20%;
  animation: float 10s ease-in-out infinite reverse;
}
.welcome-card h2 {
  color: #fff;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  position: relative;
}
.welcome-card p { color: rgba(255, 255, 255, 0.88); position: relative; }
.welcome-card .actions {
  position: relative;
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- TEACHER POINT VIEW ---------- */
.point-shell {
  display: grid;
  gap: 16px;
}
.point-map {
  height: 280px;
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-out);
  overflow: hidden;
  position: relative;
}
.point-map .leaflet-container { width: 100%; height: 100%; }

.point-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.point-stat {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-out-soft);
  padding: 14px 12px;
  text-align: center;
}
.point-stat span { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.point-stat strong { display: block; margin-top: 4px; font-size: 1.05rem; }
.point-stat.ok strong { color: var(--success); }
.point-stat.warn strong { color: var(--warning); }
.point-stat.danger strong { color: var(--danger); }

.point-register {
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 18px 40px var(--primary-glow);
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
  transition: transform var(--speed-fast) var(--ease);
}
.point-register::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: calc(var(--radius-xl) - 4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 60%);
  pointer-events: none;
}
.point-register:hover { transform: scale(1.01); }
.point-register:active { transform: scale(0.98); }
.point-register.ready { animation: pulse 2s ease-in-out infinite; }
.point-register[disabled] { opacity: 0.55; }

/* ---------- KANBAN ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.kanban-col {
  background: var(--surface-soft);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--neu-in-soft);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 200px);
  min-height: 280px;
}
.kanban-col header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  border-bottom: 1px dashed rgba(108, 92, 231, 0.18);
}
.kanban-col header strong {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kanban-col header .count {
  background: var(--surface);
  box-shadow: var(--neu-out-soft);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.kanban-col[data-status="Aberto"] header strong { color: #ff7675; }
.kanban-col[data-status="EmAndamento"] header strong { color: #6c5ce7; }
.kanban-col[data-status="Aguardando"] header strong { color: #f39c12; }
.kanban-col[data-status="Resolvido"] header strong { color: #00b894; }
.kanban-col[data-status="Fechado"] header strong { color: #636e72; }

.kanban-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 4px 2px;
}

.ticket-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-out-soft);
  padding: 14px;
  cursor: pointer;
  border-left: 4px solid var(--primary);
  transition: transform var(--speed-mid) var(--ease), box-shadow var(--speed-mid) var(--ease);
  animation: slideUp var(--speed-mid) var(--ease) both;
}
.ticket-card:hover { transform: translateY(-2px); box-shadow: var(--neu-out); }
.ticket-card[data-priority="Critica"] { border-left-color: #ff4757; }
.ticket-card[data-priority="Alta"] { border-left-color: #ff7f50; }
.ticket-card[data-priority="Media"] { border-left-color: #74b9ff; }
.ticket-card[data-priority="Baixa"] { border-left-color: #55efc4; }

.ticket-card .ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ticket-card .ticket-head .num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.ticket-card h4 {
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 6px;
}
.ticket-card .ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ticket-card .ticket-meta .chip { font-size: 0.68rem; padding: 4px 10px; }
.ticket-card .ticket-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(108, 92, 231, 0.16);
  font-size: 0.74rem;
  color: var(--muted);
}
.ticket-card .ticket-foot .sla {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.ticket-card .ticket-foot .sla.ok { color: var(--success); }
.ticket-card .ticket-foot .sla.warning { color: var(--warning); }
.ticket-card .ticket-foot .sla.overdue { color: var(--danger); animation: pulse 1.5s infinite; }

@media (max-width: 960px) {
  .kanban-board {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 82%;
    scroll-padding-left: 12px;
  }
  .kanban-col { max-height: none; }
}

/* ---------- TICKET DETAIL ---------- */
.ticket-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}
@media (max-width: 960px) {
  .ticket-detail { grid-template-columns: 1fr; }
}
.ticket-detail .comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment {
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-in-soft);
  padding: 14px;
}
.comment.internal { border-left: 3px solid var(--warning); }
.comment header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.comment header strong { font-size: 0.86rem; }
.comment header time { font-size: 0.74rem; color: var(--muted); }
.comment p { color: var(--ink); white-space: pre-wrap; }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
}
.history-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad-primary);
  margin-top: 5px;
  flex-shrink: 0;
}
.history-item .content { display: flex; flex-direction: column; gap: 2px; }
.history-item time { font-size: 0.7rem; color: var(--muted); }

/* ---------- ADMIN PANEL ---------- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.color-input {
  appearance: none;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  box-shadow: var(--neu-out-soft);
  cursor: pointer;
  padding: 6px;
}
.color-input::-webkit-color-swatch { border: none; border-radius: var(--radius-sm); }
.color-input::-moz-color-swatch { border: none; border-radius: var(--radius-sm); }

.logo-uploader {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  padding: 18px;
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-in-soft);
  border: 2px dashed rgba(108, 92, 231, 0.2);
  cursor: pointer;
  transition: all var(--speed-mid) var(--ease);
}
.logo-uploader:hover { border-color: var(--primary); }
.logo-uploader img {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--neu-out-soft);
}
.logo-uploader input[type="file"] { display: none; }

/* ---------- Profile dialog ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.profile-stat {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-in-soft);
  padding: 14px 12px;
  text-align: center;
}
.profile-stat span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.profile-stat strong { display: block; margin-top: 6px; font-size: 1.05rem; }

/* Floating action button (mobile) */
.fab {
  position: fixed;
  right: 18px;
  bottom: 90px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--grad-accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px var(--accent-glow);
  cursor: pointer;
  z-index: 70;
  transition: transform var(--speed-mid) var(--ease);
}
.fab:hover { transform: scale(1.08); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.4; }

/* Selectable items */
.select-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.checkbox-pill {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: var(--neu-in-soft);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-pill input { display: none; }
.checkbox-pill .check { opacity: 0; transition: opacity var(--speed-fast) var(--ease); }
.checkbox-pill.checked { background: var(--grad-primary); }
.checkbox-pill.checked .check { opacity: 1; color: #fff; }
