/* ==========================================================================
   PROJECT NOX TRACKER 3.0 — OPERATIONAL DESIGN SYSTEM
   Ecosystem: Project Nox (Dark Cosmic / Void / Purple / Gold)
   ========================================================================== */

:root {
  /* Surface & Void Colors (Cosmic Purple-Undertone Palette) */
  --bg-void: #07050d;
  --bg-void-deep: #090611;
  --bg-surface: #0e0a19;
  --bg-surface-elevated: #151025;
  --bg-card: rgba(18, 14, 30, 0.88);
  --bg-card-hover: rgba(26, 20, 44, 0.94);
  --bg-glass: rgba(12, 9, 22, 0.86);
  --bg-input: #100c1d;

  /* Brand Accent Colors */
  --nox-purple: #b59af5;
  --nox-purple-light: #d8b4fe;
  --nox-purple-dark: #7c3aed;
  --nox-purple-glow: rgba(181, 154, 245, 0.24);
  --nox-gold: #c9aa73;
  --nox-gold-light: #e5bd61;
  --nox-gold-glow: rgba(201, 170, 115, 0.20);

  /* Borders & Dividers */
  --border-subtle: rgba(167, 139, 250, 0.12);
  --border-card: rgba(167, 139, 250, 0.18);
  --border-hover: rgba(201, 170, 115, 0.40);
  --border-active: rgba(181, 154, 245, 0.58);
  --border-input: rgba(167, 139, 250, 0.22);

  /* Semantic State Colors (Open = Green, Closed = Neutral Slate, Error = Red) */
  --state-open: #34d399;
  --state-open-bg: rgba(16, 185, 129, 0.12);
  --state-open-border: rgba(52, 211, 153, 0.36);

  --state-closed: #94a3b8;
  --state-closed-bg: rgba(148, 163, 184, 0.12);
  --state-closed-border: rgba(148, 163, 184, 0.30);

  --state-error: #f87171;
  --state-error-bg: rgba(239, 68, 68, 0.12);
  --state-error-border: rgba(248, 113, 113, 0.35);

  --state-warn: #fbbf24;
  --state-warn-bg: rgba(245, 158, 11, 0.12);
  --state-warn-border: rgba(251, 191, 36, 0.32);

  /* Typography Colors */
  --text-main: #f3f4f8;
  --text-secondary: #c5c9da;
  --text-muted: #9398ad;
  --text-dim: #888ea6;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-eyebrow: 'Cinzel', Georgia, serif;

  /* Radii & Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-void);
  color: var(--text-main);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 1000;
  background: var(--nox-purple-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
}

:focus-visible {
  outline: 2px solid var(--nox-purple-light);
  outline-offset: 2px;
}

/* ==========================================================================
   PARTICLE & ATMOSPHERIC BACKGROUND
   ========================================================================== */

.particle-system {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  background: linear-gradient(145deg, #090611 0%, #07050d 48%, #0d0916 100%);
}

.ambient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 52% 38% at 50% 20%, rgba(226, 217, 245, 0.045) 0%, transparent 70%),
    radial-gradient(ellipse 68% 54% at 14% 16%, rgba(103, 51, 168, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 64% 58% at 86% 24%, rgba(73, 33, 133, 0.24) 0%, transparent 65%),
    radial-gradient(ellipse 75% 60% at 50% 52%, rgba(124, 58, 237, 0.13) 0%, transparent 70%),
    radial-gradient(ellipse 68% 58% at 18% 84%, rgba(92, 43, 154, 0.20) 0%, transparent 65%),
    radial-gradient(ellipse 65% 56% at 85% 88%, rgba(67, 31, 119, 0.20) 0%, transparent 65%);
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  opacity: 0.75;
  pointer-events: none;
}

.glow-top {
  width: min(1000px, 120vw);
  height: 520px;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.12) 0%, rgba(99, 102, 241, 0.05) 42%, transparent 72%);
}

.glow-side {
  width: 680px;
  height: 680px;
  top: 28%;
  right: -180px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.10) 0%, rgba(79, 70, 229, 0.04) 48%, transparent 74%);
}

.glow-bottom-left {
  width: 680px;
  height: 680px;
  bottom: -160px;
  left: -140px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.10) 0%, rgba(48, 23, 75, 0.05) 52%, transparent 74%);
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.night-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 54%, rgba(4, 3, 9, 0.52) 100%);
}

.app-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(9, 6, 17, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  min-width: 0;
  flex-shrink: 1;
}

.brand-symbol-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-symbol {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(181, 154, 245, 0.25));
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.brand-project {
  color: var(--text-main);
}

.brand-nox {
  color: var(--nox-gold-light);
}

.brand-tracker {
  color: var(--nox-purple-light);
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--nox-purple-light);
  background: rgba(181, 154, 245, 0.14);
  border: 1px solid rgba(181, 154, 245, 0.28);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-portal-link,
.community-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(17, 20, 36, 0.7);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.nav-portal-link:hover,
.community-link:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(25, 29, 50, 0.9);
}

.nav-portal-link {
  color: var(--nox-gold-light);
  border-color: rgba(201, 170, 115, 0.26);
}

.community-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #ffffff;
  border-color: rgba(216, 180, 254, 0.35);
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.32);
}

.button.primary:hover {
  background: linear-gradient(135deg, #9d74fa 0%, #7c3aed 100%);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.42);
}

.button.secondary {
  background: rgba(17, 20, 36, 0.9);
  color: var(--text-main);
  border-color: var(--border-card);
}

.button.secondary:hover {
  border-color: var(--border-active);
  background: rgba(26, 30, 52, 0.95);
}

.btn-text-short {
  display: none;
}

/* ==========================================================================
   MAIN LAYOUT & COMPACT HERO
   ========================================================================== */

main#main-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 48px;
  flex: 1;
}

.hero {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 15%, var(--nox-purple-light) 70%, var(--nox-gold-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto 12px;
  font-size: clamp(0.92rem, 1.4vw, 1.03rem);
  color: var(--text-secondary);
  max-width: 640px;
  text-wrap: balance;
}

.notice-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: rgba(18, 14, 30, 0.82);
  border: 1px solid rgba(201, 170, 115, 0.24);
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-align: center;
  line-height: 1.45;
}

.notice-text {
  margin: 0;
  text-align: center;
  text-wrap: balance;
}

.notice-sub {
  color: var(--text-muted);
}

/* ==========================================================================
   SUMMARY INDICATORS (EXACTLY 3 CARDS: TOTAL, ABERTAS, FECHADAS)
   ========================================================================== */

.stats-panel {
  margin-bottom: 18px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  padding-left: 10px;
  border-left: 3px solid var(--nox-purple);
}

.stats-scope-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--nox-purple-light);
  background: rgba(181, 154, 245, 0.14);
  border: 1px solid rgba(181, 154, 245, 0.28);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.section-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.stat-card.active {
  background: rgba(24, 26, 48, 0.96);
  border-color: var(--nox-purple);
  box-shadow: 0 0 0 1px var(--nox-purple), 0 8px 22px rgba(124, 58, 237, 0.20);
}

.stat-card.stat-card-open.active {
  border-color: var(--state-open);
  box-shadow: 0 0 0 1px var(--state-open), 0 8px 22px rgba(16, 185, 129, 0.16);
}

.stat-card.stat-card-closed.active {
  border-color: var(--state-closed);
  box-shadow: 0 0 0 1px var(--state-closed), 0 8px 22px rgba(148, 163, 184, 0.14);
}

.stat-card.active::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 28px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: currentColor;
  opacity: 0.75;
}

.stat-card[data-filter-stat="total"].active::after {
  background: var(--nox-gold-light);
}

.stat-card[data-filter-stat="open"].active::after {
  background: var(--state-open);
}

.stat-card[data-filter-stat="closed"].active::after {
  background: var(--state-closed);
}

.stat-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-total {
  background: var(--nox-gold-light);
}

.dot-open {
  background: var(--state-open);
}

.dot-closed {
  background: var(--state-closed);
}

.stat-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-number {
  font-size: 2.05rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.text-total {
  color: var(--nox-gold-light);
}

.text-open {
  color: var(--state-open);
}

.text-closed {
  color: var(--state-closed);
}

/* ==========================================================================
   CONTROLS & FILTERS PANEL
   ========================================================================== */

.controls-card {
  padding: 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-row {
  width: 100%;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.search-hint {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--nox-purple);
  box-shadow: 0 0 0 3px rgba(181, 154, 245, 0.16);
  outline: none;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

.filter-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
}

.type-segmented {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  gap: 3px;
}

.type-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.type-btn:hover {
  color: var(--text-main);
  background: rgba(181, 154, 245, 0.08);
}

.type-btn.active {
  background: rgba(124, 58, 237, 0.28);
  color: #ffffff;
  border-color: rgba(181, 154, 245, 0.48);
}

.custom-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.custom-select:focus {
  border-color: var(--nox-purple);
  outline: none;
}

.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.active-filters-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(181, 154, 245, 0.30);
  background: rgba(181, 154, 245, 0.12);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover {
  background: rgba(181, 154, 245, 0.22);
}

.btn-clear-all {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--nox-purple-light);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
}

.btn-clear-all:hover {
  border-color: var(--border-active);
  background: rgba(181, 154, 245, 0.10);
}

/* ==========================================================================
   RESULTS BAR
   ========================================================================== */

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.results-count {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.results-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sync-status.is-stale {
  color: var(--state-warn);
}

.sync-status.is-error {
  color: var(--state-error);
}

.refresh-button,
.motion-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: rgba(17, 20, 36, 0.85);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.refresh-button:hover,
.motion-button:hover {
  color: var(--text-main);
  border-color: var(--border-active);
}

.refresh-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.refresh-button.spinning .refresh-icon {
  display: inline-block;
  animation: nox-spin 0.8s linear infinite;
}

.motion-button[aria-pressed="true"] {
  border-color: var(--nox-gold);
  color: var(--nox-gold-light);
}

@keyframes nox-spin {
  to {
    transform: rotate(360deg);
  }
}

.closed-state-note {
  margin: -6px 0 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(20, 15, 34, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}

.noscript-notice a {
  color: var(--nox-purple-light);
  text-decoration: underline;
}

/* ==========================================================================
   TICKETS GRID & CARDS
   ========================================================================== */

.tickets-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ticket-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
  min-width: 0;
}

.ticket-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.ticket-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ticket-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text-main);
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-title.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.title-expand-btn {
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--nox-purple-light);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.title-expand-btn:hover {
  color: #ffffff;
}

.ticket-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.state-open {
  color: var(--state-open);
  background: var(--state-open-bg);
  border: 1px solid var(--state-open-border);
}

.state-closed {
  color: var(--state-closed);
  background: var(--state-closed-bg);
  border: 1px solid var(--state-closed-border);
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.open-dot {
  background: var(--state-open);
}

.closed-dot {
  background: var(--state-closed);
}

.ticket-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.badge-tag.tag-manga {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.24);
}

.badge-tag.tag-anime {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.24);
}

.badge-tag.tag-adult {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.26);
}

.badge-tag.tag-priority {
  color: var(--nox-gold-light);
  background: rgba(201, 170, 115, 0.12);
  border-color: rgba(201, 170, 115, 0.28);
}

.ticket-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.meta-number {
  font-weight: 700;
  color: var(--text-secondary);
}

.meta-votes.has-votes {
  color: var(--nox-gold-light);
  font-weight: 700;
}

.meta-author {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.ticket-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(181, 154, 245, 0.10);
  border: 1px solid rgba(181, 154, 245, 0.22);
  color: var(--nox-purple-light);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ticket-link:hover {
  background: rgba(181, 154, 245, 0.18);
  border-color: var(--border-active);
  color: #ffffff;
}

/* ==========================================================================
   EMPTY, LOADING, ERROR & PROGRESSIVE LOADING
   ========================================================================== */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: var(--text-main);
}

.empty-state p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.load-more-bar {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.load-more-btn {
  min-width: 220px;
  height: 42px;
}

/* ==========================================================================
   MODAL (ABRIR SOLICITAÇÃO)
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 8, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: #0d0f1b;
  border: 1px solid var(--border-active);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-eyebrow {
  font-family: var(--font-eyebrow);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--nox-gold-light);
  text-transform: uppercase;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.10);
}

.modal-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.template-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(17, 20, 36, 0.86);
  border: 1px solid var(--border-card);
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.template-option:hover {
  border-color: var(--border-hover);
  background: rgba(26, 30, 52, 0.96);
}

.template-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.template-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.template-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.template-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.template-arrow {
  color: var(--nox-purple-light);
  font-weight: 700;
  flex-shrink: 0;
}

.modal-github-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(181, 154, 245, 0.08);
  border: 1px solid rgba(181, 154, 245, 0.22);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.modal-github-notice p {
  margin: 0;
}

.modal-guidelines {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-guidelines ul {
  margin: 6px 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(9, 6, 17, 0.88);
  padding: 18px 24px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--nox-purple-light);
  text-decoration: underline;
}

/* ==========================================================================
   REDUCED MOTION & PAUSED ANIMATIONS
   ========================================================================== */

.animations-paused .particle-canvas {
  display: none;
}

.animations-paused *,
.animations-paused *::before,
.animations-paused *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .particle-canvas {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
  .tickets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .type-control-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 10px 14px;
  }

  .brand-sub,
  .brand-badge,
  .nav-label {
    display: none;
  }

  .nav-portal-link,
  .community-link {
    width: 36px;
    padding: 0;
  }

  .btn-text-full {
    display: none;
  }

  .btn-text-short {
    display: inline;
  }

  .header-cta {
    padding: 0 11px;
    height: 36px;
    font-size: 0.82rem;
  }

  main#main-content {
    padding: 14px 12px 36px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 78px;
    padding: 10px 8px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  .tickets-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-header {
    gap: 6px;
    padding: 8px 10px;
  }

  .brand-title-row {
    font-size: 0.8rem;
  }

  .brand-project {
    display: none;
  }

  .header-symbol {
    width: 28px;
    height: 28px;
  }

  .nav-links {
    gap: 5px;
  }

  .nav-portal-link,
  .community-link {
    width: 38px;
    height: 38px;
  }

  .header-cta {
    height: 38px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  .type-segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .type-btn {
    padding: 0 6px;
    font-size: 0.8rem;
  }
}

@media (max-width: 340px) {
  .stat-number {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .nav-portal-link,
  .community-link {
    width: 36px;
    height: 36px;
  }

  .brand-title-row {
    font-size: 0.74rem;
  }
}
