@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d0d1a;
  --bg2: #13132a;
  --bg3: #1c1c38;
  --accent: #6c63ff;
  --accent2: #00d4aa;
  --text: #e8e8f0;
  --text2: #9898b8;
  --border: #2a2a4a;
  --card: #16163a;
  --danger: #ff4757;
  --warning: #ffa502;
  --success: #2ed573;
  --info: #1e90ff;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(108,99,255,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ---- PUBLIC LAYOUT ---- */
.public-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d0d1a 0%, #13132a 50%, #1a0a2e 100%);
}

.public-header {
  background: rgba(22,22,58,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.public-nav a {
  color: var(--text2);
  text-decoration: none;
  margin-left: 24px;
  font-size: 14px;
  transition: color 0.2s;
}
.public-nav a:hover { color: var(--accent); }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group select option { background: var(--bg2); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a52e8; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #000; }
.btn-success:hover { background: #25c463; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e03040; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.badge-aberto { background: rgba(30,144,255,0.2); color: var(--info); border: 1px solid rgba(30,144,255,0.3); }
.badge-em_andamento { background: rgba(255,165,2,0.2); color: var(--warning); border: 1px solid rgba(255,165,2,0.3); }
.badge-aguardando { background: rgba(152,152,184,0.2); color: var(--text2); border: 1px solid var(--border); }
.badge-resolvido { background: rgba(46,213,115,0.2); color: var(--success); border: 1px solid rgba(46,213,115,0.3); }
.badge-fechado { background: rgba(255,71,87,0.15); color: var(--danger); border: 1px solid rgba(255,71,87,0.3); }

.badge-baixa { background: rgba(46,213,115,0.15); color: var(--success); }
.badge-normal { background: rgba(30,144,255,0.15); color: var(--info); }
.badge-alta { background: rgba(255,165,2,0.15); color: var(--warning); }
.badge-urgente { background: rgba(255,71,87,0.15); color: var(--danger); }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--bg3);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(42,42,74,0.5);
  vertical-align: middle;
}
tr:hover td { background: rgba(108,99,255,0.04); }
tr:last-child td { border-bottom: none; }

/* ---- ADMIN SIDEBAR ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text2);
  padding: 8px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--text); background: rgba(108,99,255,0.08); }
.nav-item.active { color: var(--accent); background: rgba(108,99,255,0.12); border-left-color: var(--accent); }
.nav-item .icon { width: 18px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.user-info { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.user-name { font-weight: 600; color: var(--text); }

.admin-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.page-title { font-size: 20px; font-weight: 700; }
.admin-main { padding: 28px; }

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-label { font-size: 12px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-value { font-size: 32px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-icon { font-size: 24px; margin-bottom: 4px; }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: rgba(46,213,115,0.12); border: 1px solid rgba(46,213,115,0.3); color: var(--success); }
.alert-danger { background: rgba(255,71,87,0.12); border: 1px solid rgba(255,71,87,0.3); color: var(--danger); }
.alert-info { background: rgba(30,144,255,0.12); border: 1px solid rgba(30,144,255,0.3); color: var(--info); }

/* ---- TICKET DETAIL ---- */
.reply-box { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 12px; }
.reply-item { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.reply-item:last-child { border-bottom: none; margin-bottom: 0; }
.reply-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.reply-author { font-weight: 600; font-size: 13px; }
.reply-time { font-size: 11px; color: var(--text2); }
.reply-body { font-size: 13px; line-height: 1.7; color: var(--text); }
.reply-internal { background: rgba(255,165,2,0.06); border-left: 3px solid var(--warning); padding: 12px; border-radius: 0 8px 8px 0; }

/* ---- GRIDS ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---- TICKET NUMBER ---- */
.ticket-num { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); }

/* ---- HERO ---- */
.hero {
  padding: 80px 32px 60px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 { font-size: 42px; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text2); font-size: 16px; line-height: 1.7; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.public-container { max-width: 800px; margin: 0 auto; padding: 0 24px 60px; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.section-sub { color: var(--text2); margin-bottom: 24px; }

/* ---- MISC ---- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text2); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.fw-bold { font-weight: 700; }

/* ---- SEARCH BOX ---- */
.search-box { position: relative; }
.search-box input { padding-left: 40px; }
.search-box::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; }

/* ---- LOGIN PAGE ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0d0d1a, #13132a, #1a0a2e); }
.login-card { width: 400px; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .admin-content { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
