/* ============================================================
   THEME - Neumorphism Colorido
   ============================================================ */
:root {
  /* Paleta base */
  --bg: #eef0f9;
  --bg-deep: #e1e4f3;
  --surface: #eef0f9;
  --surface-soft: #f6f7fc;

  /* Acentos coloridos */
  --primary: #6c5ce7;
  --primary-soft: #a29bfe;
  --primary-glow: rgba(108, 92, 231, 0.35);

  --accent: #fd79a8;
  --accent-soft: #ffb6d0;
  --accent-glow: rgba(253, 121, 168, 0.32);

  --success: #00b894;
  --success-soft: #55efc4;
  --warning: #fdcb6e;
  --warning-soft: #ffeaa7;
  --danger: #ff6b6b;
  --danger-soft: #ffa3a3;
  --info: #74b9ff;
  --info-soft: #b3d8ff;

  /* Tipografia */
  --ink: #2d2f4a;
  --ink-soft: #5a5d80;
  --muted: #8a8eb0;

  /* Sombras neumorphism - chave do estilo */
  --shadow-light: rgba(255, 255, 255, 0.85);
  --shadow-dark: rgba(160, 168, 210, 0.6);
  --shadow-deep: rgba(108, 116, 168, 0.35);

  /* Sombras compostas */
  --neu-out:
    -8px -8px 18px var(--shadow-light),
    8px 8px 22px var(--shadow-dark);
  --neu-out-soft:
    -4px -4px 10px var(--shadow-light),
    4px 4px 12px var(--shadow-dark);
  --neu-in:
    inset 5px 5px 12px var(--shadow-dark),
    inset -5px -5px 12px var(--shadow-light);
  --neu-in-soft:
    inset 3px 3px 8px var(--shadow-dark),
    inset -3px -3px 8px var(--shadow-light);

  /* Bordas e raios */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  /* Animação */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-soft: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --speed-fast: 160ms;
  --speed-mid: 280ms;
  --speed-slow: 520ms;

  /* Gradientes */
  --grad-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --grad-accent: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%);
  --grad-success: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
  --grad-danger: linear-gradient(135deg, #ff6b6b 0%, #fd79a8 100%);
  --grad-info: linear-gradient(135deg, #74b9ff 0%, #a29bfe 100%);
  --grad-aurora:
    radial-gradient(at 20% 30%, rgba(162, 155, 254, 0.4), transparent 60%),
    radial-gradient(at 80% 20%, rgba(253, 121, 168, 0.32), transparent 55%),
    radial-gradient(at 70% 80%, rgba(116, 185, 255, 0.32), transparent 55%),
    radial-gradient(at 20% 90%, rgba(85, 239, 196, 0.28), transparent 55%);
}

/* Tema escuro automático opcional - ativado por classe .dark no body */
body.dark {
  --bg: #1c1d2e;
  --bg-deep: #15162a;
  --surface: #1c1d2e;
  --surface-soft: #25263c;
  --shadow-light: rgba(60, 62, 100, 0.45);
  --shadow-dark: rgba(10, 11, 25, 0.85);
  --ink: #e8e9ff;
  --ink-soft: #b6b9d8;
  --muted: #7d80a6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family:
    "Inter",
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--grad-aurora);
  background-attachment: fixed;
  background-size: 200% 200%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  animation: aurora-shift 24s ease-in-out infinite alternate;
}

@keyframes aurora-shift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* Tipografia */
h1, h2, h3, h4 {
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); font-weight: 800; }
h2 { font-size: clamp(1.15rem, 1.8vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; color: var(--ink-soft); line-height: 1.55; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.muted { color: var(--muted); }
.subtitle { color: var(--ink-soft); font-size: 0.92rem; }
.hidden { display: none !important; }
.no-scroll { overflow: hidden; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 18px; }
.stack { display: grid; gap: 14px; }
.spacer { flex: 1; }

/* Container base */
.app-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   COMPONENTES BASE
   ============================================================ */

/* Card neumorphic */
.neu-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-out);
  padding: 22px;
  transition: box-shadow var(--speed-mid) var(--ease);
}
.neu-card:hover { box-shadow: var(--neu-out-soft); }

.neu-card.flat { box-shadow: var(--neu-in-soft); background: var(--surface-soft); }
.neu-card.glow {
  box-shadow:
    var(--neu-out),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

/* Botões */
.btn {
  appearance: none;
  border: none;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--neu-out-soft);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  cursor: pointer;
  position: relative;
  transition:
    box-shadow var(--speed-fast) var(--ease),
    transform var(--speed-fast) var(--ease),
    background var(--speed-mid) var(--ease),
    color var(--speed-mid) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active {
  transform: translateY(1px);
  box-shadow: var(--neu-in-soft);
}
.btn:focus-visible {
  outline: none;
  box-shadow:
    var(--neu-out-soft),
    0 0 0 3px var(--primary-glow);
}
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow:
    -4px -4px 10px var(--shadow-light),
    4px 4px 14px var(--primary-glow);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { box-shadow: var(--neu-in-soft); filter: none; }

.btn.accent {
  background: var(--grad-accent);
  color: #fff;
  box-shadow:
    -4px -4px 10px var(--shadow-light),
    4px 4px 14px var(--accent-glow);
}

.btn.success { background: var(--grad-success); color: #fff; }
.btn.danger { background: var(--grad-danger); color: #fff; }
.btn.info { background: var(--grad-info); color: #fff; }

.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--surface);
  box-shadow: var(--neu-out-soft);
}

.btn.icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn.sm { padding: 8px 14px; font-size: 0.82rem; min-height: 36px; }
.btn.lg { padding: 16px 28px; font-size: 1.05rem; min-height: 52px; }
.btn.block { width: 100%; }

/* Inputs */
.field {
  display: grid;
  gap: 6px;
}
.field label,
.field .label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 6px;
}
.input,
.select,
.textarea {
  width: 100%;
  border: none;
  background: var(--surface);
  box-shadow: var(--neu-in-soft);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font: inherit;
  color: var(--ink);
  min-height: 48px;
  transition:
    box-shadow var(--speed-mid) var(--ease),
    background var(--speed-mid) var(--ease);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  box-shadow:
    var(--neu-in-soft),
    0 0 0 3px var(--primary-glow);
}
.input::placeholder,
.textarea::placeholder { color: var(--muted); }
.textarea { resize: vertical; min-height: 110px; }

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-group .input { padding-right: 50px; }
.input-group .input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.input-group .input-action:hover { color: var(--primary); background: var(--surface-soft); }

/* Toggle / Switch */
.toggle {
  --w: 52px;
  --h: 28px;
  position: relative;
  width: var(--w);
  height: var(--h);
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--neu-in-soft);
  cursor: pointer;
  transition: background var(--speed-mid) var(--ease);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(var(--h) - 6px);
  height: calc(var(--h) - 6px);
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--neu-out-soft);
  transition: transform var(--speed-mid) var(--ease);
}
.toggle.on { background: var(--grad-primary); }
.toggle.on::after { transform: translateX(calc(var(--w) - var(--h))); background: #fff; }

/* Chips / Badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface);
  box-shadow: var(--neu-out-soft);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.chip.primary { background: var(--grad-primary); color: #fff; }
.chip.accent { background: var(--grad-accent); color: #fff; }
.chip.success { background: var(--grad-success); color: #fff; }
.chip.warning { background: linear-gradient(135deg, #fdcb6e, #ffa502); color: #2d2f4a; }
.chip.danger { background: var(--grad-danger); color: #fff; }
.chip.info { background: var(--grad-info); color: #fff; }
.chip.ghost { box-shadow: var(--neu-in-soft); }

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.priority-Critica { background: linear-gradient(135deg, #ff4757, #ff6b6b); color: #fff; }
.priority-Alta { background: linear-gradient(135deg, #ff7f50, #fdcb6e); color: #fff; }
.priority-Media { background: linear-gradient(135deg, #74b9ff, #a29bfe); color: #fff; }
.priority-Baixa { background: linear-gradient(135deg, #55efc4, #00b894); color: #fff; }

/* Status do chamado */
.status-Aberto { background: linear-gradient(135deg, #ff7675, #fd79a8); color: #fff; }
.status-EmAndamento { background: linear-gradient(135deg, #74b9ff, #6c5ce7); color: #fff; }
.status-Aguardando { background: linear-gradient(135deg, #fdcb6e, #f39c12); color: #2d2f4a; }
.status-Resolvido { background: linear-gradient(135deg, #00b894, #55efc4); color: #fff; }
.status-Fechado { background: linear-gradient(135deg, #b2bec3, #636e72); color: #fff; }

/* Avatar */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  box-shadow: var(--neu-out-soft);
  flex-shrink: 0;
}

/* Mini-icones em pure SVG inline (usaremos lucide-style strokes inline) */
.icon-wrap {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
}
.icon-wrap svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Scrollbar mais leve */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(108, 92, 231, 0.25);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(108, 92, 231, 0.5); }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--surface);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--neu-out);
  font-weight: 600;
  font-size: 0.92rem;
  opacity: 0;
  transition: opacity var(--speed-mid) var(--ease), transform var(--speed-mid) var(--ease-bounce);
  pointer-events: none;
  z-index: 9999;
  max-width: min(440px, 90vw);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--grad-success); color: #fff; }
.toast.error { background: var(--grad-danger); color: #fff; }
.toast.info { background: var(--grad-info); color: #fff; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 50, 0.45);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn var(--speed-mid) var(--ease) both;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-out), 0 20px 60px rgba(20, 22, 50, 0.3);
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  animation: scaleIn var(--speed-mid) var(--ease-bounce) both;
}
.modal.lg { width: min(820px, 100%); }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.modal-header h2 { margin-bottom: 4px; }
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  cursor: pointer;
  box-shadow: var(--neu-out-soft);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}
.modal-close:hover { color: var(--primary); }
.modal-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Loader */
.loader {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), var(--accent), var(--primary));
  -webkit-mask: radial-gradient(farthest-side, transparent 60%, black 61%);
          mask: radial-gradient(farthest-side, transparent 60%, black 61%);
  animation: spin 1.1s linear infinite;
}
.loader-block {
  display: grid;
  place-items: center;
  padding: 40px 12px;
  gap: 12px;
  color: var(--muted);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 14px transparent; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Empty state */
.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
.empty svg { opacity: 0.5; margin-bottom: 10px; }
