* {
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #1e293b;
  --panel-2: #0b1220;
  --border: #334155;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #166534;
  --warning: #92400e;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

.wrap {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar h1 {
  margin: 0 0 18px 0;
  font-size: 24px;
  color: #ffffff;
  letter-spacing: 0.4px;
}

.sidebar button {
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
}

/* CONTENT */
.content {
  flex: 1;
  padding: 24px;
  overflow-x: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 24px;
  color: #ffffff;
}

/* CARD / GRID */
.card {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* INPUTS */
input,
select,
textarea {
  width: 100%;
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

/* FILTERS */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: start;
}

.filters input,
.filters select {
  margin-bottom: 0;
}

/* BUTTONS */
button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease, opacity 0.2s ease;
}

button:hover {
  background: var(--primary-hover);
}

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

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-hover);
}

/* DIVIDER */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* PRE */
pre {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: #cbd5e1;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

thead tr {
  background: #0b1220;
}

th {
  font-size: 13px;
  color: #cbd5e1;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

/* TABLE ACTION BUTTONS */
td button {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* STATUS / HELP TEXT */
#eventsSummary,
#eventsPaginationInfo {
  color: #cbd5e1;
}

/* MODAL */
#modalImagemEvento,
#modalHistoricoEvento {
  backdrop-filter: blur(2px);
}

#modalImagemEvento h3,
#modalHistoricoEvento h3 {
  color: #ffffff;
}

/* IMAGES */
#imgEventoSelecionado {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #020617;
  padding: 6px;
}

/* LINKS IF ANY */
a {
  color: #93c5fd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* SMALL UTILS */
.muted {
  color: var(--muted);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row > * {
  flex: 1;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .grid2 {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 210px;
  }
}

@media (max-width: 860px) {
  .wrap {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
  }

  .sidebar h1 {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }

  .content {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  h2 {
    font-size: 20px;
  }

  button {
    width: 100%;
  }

  td button {
    width: auto;
  }

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

/* DASHBOARD KPI */

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
  margin-top:20px;
}

.kpi-card{
  background:#0f172a;
  border:1px solid #334155;
  padding:20px;
  border-radius:10px;
  text-align:center;
  transition:all .2s ease;
}

.kpi-card:hover{
  transform:translateY(-2px);
  border-color:#3b82f6;
}

.kpi-title{
  font-size:13px;
  opacity:.7;
  margin-bottom:6px;
}

.kpi-value{
  font-size:28px;
  font-weight:700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.mini-table th,
.mini-table td {
  padding: 10px;
  border-bottom: 1px solid #334155;
  text-align: left;
  font-size: 14px;
}

.mini-table th {
  color: #cbd5e1;
  background: #0b1220;
}

.card h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}