/* Gangster Game - Dark Theme Moderno e Responsivo */
:root {
  --bg-dark: #0a0c10;
  --bg-card: #12161f;
  --bg-card-hover: #171d29;
  --bg-input: #1a202c;
  --border-color: #262f3f;
  --border-focus: #e5a93b;
  --text-main: #f0f3f8;
  --text-muted: #8b9bb4;
  --gold: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --green: #2ecc71;
  --green-glow: rgba(46, 204, 113, 0.2);
  --red: #e74c3c;
  --red-glow: rgba(231, 76, 60, 0.25);
  --orange: #e67e22;
  --blue: #3498db;
  --purple: #9b59b6;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 50px;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

/* Header & Top Bar */
.topbar {
  background: linear-gradient(180deg, #161b24 0%, #0e1218 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.topbar-commands-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 0;
}

.topbar-commands-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: linear-gradient(135deg, #e5a93b 0%, #b8860b 100%);
  color: #000;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  text-transform: uppercase;
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.session-badge {
  color: var(--gold);
  font-weight: 700;
  font-family: monospace;
  font-size: 0.95rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Indicadores Vitais Móveis no Cabeçalho Fixo (Sticky HUD) */
.topbar-vitals {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 14px;
}

.vital-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.vital-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.vital-value {
  font-weight: 800;
  font-size: 0.88rem;
  font-family: monospace;
}

.vital-value.text-money {
  color: var(--green);
}

@media (max-width: 900px) {
  .topbar-vitals {
    order: 3;
    width: 100%;
    justify-content: space-around;
    padding: 6px 8px;
    gap: 8px;
  }
  .vital-item {
    font-size: 0.78rem;
  }
  .vital-value {
    font-size: 0.82rem;
  }
}

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

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  color: #fff;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #e5a93b 0%, #b8860b 100%);
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--gold-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-success {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
  box-shadow: 0 2px 10px var(--green-glow);
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  box-shadow: 0 2px 10px var(--red-glow);
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #232b3b;
  border-color: #3b475e;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 1rem;
}

/* Alertas & Flash Messages */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.4);
  color: #2ecc71;
}

.alert-warning {
  background: rgba(230, 126, 34, 0.15);
  border-color: rgba(230, 126, 34, 0.4);
  color: #e67e22;
}

.alert-danger {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.4);
  color: #e74c3c;
}

.alert-info {
  background: rgba(52, 152, 219, 0.15);
  border-color: rgba(52, 152, 219, 0.4);
  color: #3498db;
}

/* Banner de Abordagem Policial */
.police-alert {
  background: linear-gradient(135deg, #3d0d0d 0%, #200808 100%);
  border: 2px solid #e74c3c;
  box-shadow: 0 0 25px rgba(231, 76, 60, 0.4);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 10px rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 30px rgba(231, 76, 60, 0.8); }
  100% { box-shadow: 0 0 10px rgba(231, 76, 60, 0.4); }
}

.police-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ff5252;
  margin-bottom: 8px;
}

.police-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.police-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(231, 76, 60, 0.3);
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.police-card h4 {
  font-size: 1rem;
  color: #fff;
}

.police-card p {
  font-size: 0.85rem;
  color: #ccc;
}

/* Banner de Game Over */
.game-over-banner {
  background: linear-gradient(135deg, #1c0000 0%, #300000 100%);
  border: 2px solid #e74c3c;
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  margin-bottom: 24px;
}

.game-over-title {
  font-size: 2.5rem;
  color: #e74c3c;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Dashboard de Status */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-value.money {
  color: var(--green);
}

.stat-value.month {
  color: var(--gold);
}

.progress-bar-container {
  height: 8px;
  background: #1e2430;
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar.health {
  background: linear-gradient(90deg, #e74c3c, #2ecc71);
}

.progress-bar.wanted {
  background: linear-gradient(90deg, #f39c12, #e74c3c);
}

/* Quick Actions Bar */
.actions-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Main Grid Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Cards & Sections */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.game-table th {
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.game-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.game-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Inputs & Form Controls */
.qty-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-qty {
  width: 65px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
}

.input-qty:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
}

/* Logs Feed */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
}

.log-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--blue);
  font-size: 0.85rem;
}

.log-item.success { border-left-color: var(--green); }
.log-item.warning { border-left-color: var(--orange); }
.log-item.danger { border-left-color: var(--red); }
.log-item.info { border-left-color: var(--blue); }

.log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Modais Simples */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 450px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.badge-danger { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.badge-warning { background: rgba(230, 126, 34, 0.2); color: #e67e22; }
.badge-gold { background: rgba(212, 175, 55, 0.2); color: var(--gold); }
