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

:root {
  --azul-escuro: #1F3864;
  --azul-medio: #2E5AA8;
  --azul-claro: #D6E4F7;
  --ouro: #C4A035;
  --verde: #2ed573;
  --vermelho: #ff4757;
  --bg-escuro: #0a1628;
  --cinza-claro: #f5f5f5;
  --cinza-escuro: #333;
  --fonte: Arial, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--fonte);
  color: var(--cinza-escuro);
  background-color: #fff;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: var(--fonte); font-size: 1rem; }
input, textarea, select {
  font-family: var(--fonte); font-size: 1rem;
  border: 1px solid #ddd; padding: 0.75rem; border-radius: 4px;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--azul-medio);
  box-shadow: 0 0 0 3px rgba(46, 90, 168, 0.1);
}

/* NAVBAR */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--azul-escuro) 0%, var(--azul-medio) 100%);
  color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.navbar-logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 700; }
.navbar-logo .emoji { font-size: 2rem; }
.navbar-links { display: flex; gap: 1.5rem; align-items: center; }
.navbar-links a { color: white; transition: opacity 0.3s; }
.navbar-links a:hover { opacity: 0.8; }
.btn-logout {
  background-color: var(--vermelho); color: white;
  padding: 0.5rem 1rem; border-radius: 4px; transition: background-color 0.3s;
}
.btn-logout:hover { background-color: #ff3838; }

/* BOTOES */
.btn {
  padding: 0.75rem 1.5rem; border-radius: 4px; font-weight: 600;
  transition: all 0.3s; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-primary { background-color: var(--ouro); color: var(--azul-escuro); }
.btn-primary:hover { background-color: #d4b140; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(196, 160, 53, 0.3); }
.btn-secondary { background-color: var(--azul-medio); color: white; }
.btn-secondary:hover { background-color: #254680; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(46, 90, 168, 0.3); }
.btn-danger { background-color: var(--vermelho); color: white; }
.btn-danger:hover { background-color: #ff3838; }
.btn-success { background-color: var(--verde); color: white; }
.btn-success:hover { background-color: #26c46a; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* CARDS */
.card {
  background: white; border-radius: 8px; padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.3s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: translateY(-2px); }
.island-card {
  background: linear-gradient(135deg, var(--azul-escuro) 0%, var(--azul-medio) 100%);
  color: white; padding: 2rem; border-radius: 8px; cursor: pointer;
  position: relative; overflow: hidden;
}
.island-card::before {
  content: ''; position: absolute; top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.island-card-content { position: relative; z-index: 1; }
.island-card .emoji { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.island-card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.island-card p { font-size: 0.9rem; opacity: 0.9; }
.island-card-meta { display: flex; gap: 1rem; margin-top: 1rem; font-size: 0.85rem; opacity: 0.8; }
.island-card-meta span { display: flex; align-items: center; gap: 0.25rem; }

/* BADGE */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-primary { background-color: var(--azul-claro); color: var(--azul-escuro); }
.badge-success { background-color: rgba(46, 213, 115, 0.2); color: var(--verde); }
.badge-danger { background-color: rgba(255, 71, 87, 0.2); color: var(--vermelho); }
.badge-warning { background-color: rgba(196, 160, 53, 0.2); color: var(--ouro); }

/* TOAST */
.toast-container {
  position: fixed; top: 2rem; right: 2rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 1rem;
}
.toast {
  background: white; padding: 1rem 1.5rem; border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 300px;
  display: flex; align-items: center; gap: 1rem; animation: slideIn 0.3s ease-out;
}
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 4px solid var(--verde); }
.toast.error { border-left: 4px solid var(--vermelho); }
.toast.info { border-left: 4px solid var(--azul-medio); }

/* LOADING */
.loading-spinner {
  display: inline-block; width: 2rem; height: 2rem;
  border: 3px solid rgba(46, 90, 168, 0.2); border-top-color: var(--azul-medio);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-full { display: flex; justify-content: center; align-items: center; height: 100vh; }
.spinner-inline { display: flex; justify-content: center; padding: 2rem; }

/* MODAL */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.5); display: none;
  align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white; border-radius: 8px; padding: 2rem;
  max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; transition: color 0.3s; }
.modal-close:hover { color: var(--cinza-escuro); }
.modal-body { margin-bottom: 1.5rem; }
.modal-footer { display: flex; gap: 1rem; justify-content: flex-end; }

/* FORM */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--cinza-escuro); }
.form-group input, .form-group textarea, .form-group select { width: 100%; }
.form-group small { display: block; margin-top: 0.25rem; color: #999; font-size: 0.85rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.radio-group, .checkbox-group { display: flex; gap: 1.5rem; }
.radio-group label, .checkbox-group label { display: flex; align-items: center; gap: 0.5rem; margin: 0; cursor: pointer; }
.radio-group input, .checkbox-group input { margin: 0; width: auto; }

/* TABS */
.tabs { border-bottom: 2px solid #eee; display: flex; gap: 0; }
.tab-button {
  background: none; border: none; padding: 1rem 1.5rem; cursor: pointer;
  font-weight: 600; color: #999; position: relative; transition: color 0.3s;
}
.tab-button:hover { color: var(--azul-medio); }
.tab-button.active { color: var(--azul-medio); }
.tab-button.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background-color: var(--azul-medio);
}
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

/* TABLE */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
thead { background-color: var(--azul-claro); color: var(--azul-escuro); }
th { padding: 1rem; text-align: left; font-weight: 600; }
td { padding: 1rem; border-bottom: 1px solid #eee; }
tbody tr:hover { background-color: #f9f9f9; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.grid { display: grid; gap: 2rem; margin-top: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-header p { color: #666; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .navbar { flex-direction: column; gap: 1rem; padding: 1rem; }
  .navbar-links { width: 100%; justify-content: center; }
  .container { padding: 0 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .modal { width: 95%; padding: 1.5rem; }
  .toast-container { top: 1rem; right: 1rem; left: 1rem; }
  .toast { min-width: auto; }
  .tabs { overflow-x: auto; }
  .tab-button { white-space: nowrap; }
  table { font-size: 0.9rem; }
  th, td { padding: 0.75rem; }
}

/* UTILITY */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #999; }
.text-success { color: var(--verde); }
.text-danger { color: var(--vermelho); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.flex { display: flex; align-items: center; }
.flex-column { flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; }
.hidden { display: none !important; }
