/* ==================== DASHBOARD LAYOUT ==================== */
.dash-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 68px);
}

/* ==================== SIDEBAR ==================== */
.dash-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 0;
  overflow-y: auto;
}

.sidebar-user {
  padding: 28px 22px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.6rem;
  margin: 0 auto 10px;
}

.sidebar-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.sidebar-email {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.sidebar-nav {
  padding: 12px 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(27,156,63,0.06);
  color: var(--text-light);
}

.sidebar-link.active {
  background: rgba(27,156,63,0.08);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg,
.sidebar-link:hover svg {
  opacity: 1;
}

/* ==================== MAIN CONTENT ==================== */
.dash-main {
  background: var(--bg-body);
  padding: 0;
  overflow-y: auto;
}

.dash-section {
  display: none;
}

.dash-section.active {
  display: block;
}

.section-header-bar {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 16px 30px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}

.dash-content-area {
  padding: 30px;
  max-width: 900px;
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
}

.empty-state.small {
  padding: 30px 20px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
}

.empty-icon.gift {
  background: rgba(0,0,0,0.04);
  border-color: var(--text-dim);
  color: var(--text-dim);
  font-size: 2rem;
}

.empty-icon.warning {
  border-color: var(--primary);
  color: var(--primary);
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-light);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ==================== BUTTONS ==================== */
.btn-action {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  text-align: center;
  letter-spacing: 0.5px;
}

.btn-action.green {
  background: linear-gradient(135deg, #1B9C3F, #157A30);
  color: white;
  box-shadow: 0 4px 15px rgba(27,156,63,0.25);
}

.btn-action.green:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27,156,63,0.35);
}

.btn-action.gold {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(27,156,63,0.25);
}

.btn-action.gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27,156,63,0.35);
}

.btn-action.blue {
  background: linear-gradient(135deg, #2979FF, #1565C0);
  color: white;
  box-shadow: 0 4px 15px rgba(41,121,255,0.25);
}

.btn-action.blue:hover {
  transform: translateY(-2px);
}

.btn-action.outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-light);
  padding: 12px 24px;
}

.btn-action.outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-action.full {
  display: block;
  width: 100%;
}

/* ==================== BALANCE CARD ==================== */
.balance-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.balance-row + .balance-row {
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
  padding-top: 16px;
}

.balance-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.balance-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-light);
}

.balance-value.secondary {
  color: var(--accent);
  font-size: 1.1rem;
}

/* ==================== RAFFLE TABS ==================== */
.raffle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.raffle-tab {
  padding: 10px 20px;
  border: 2px solid rgba(27,156,63,0.3);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.raffle-tab:hover {
  border-color: var(--primary);
  background: rgba(27,156,63,0.06);
}

.raffle-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
}

/* ==================== CREDITS GRID ==================== */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.credit-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.credit-card:hover {
  border-color: var(--primary);
}

.credit-card.active {
  border-color: var(--primary);
  background: rgba(27,156,63,0.06);
}

.credit-amount {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 4px;
}

.credit-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* ==================== PREFERENCES ==================== */
.prefs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.prefs-col h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}

.pref-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
}

.pref-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ==================== TICKETS LIST ==================== */
.tickets-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.ticket-num {
  background: var(--bg-elevated);
  border: 1px solid rgba(27,156,63,0.2);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

/* ==================== ORDERS LIST ==================== */
.order-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.order-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.order-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.order-status {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.order-status.aprovado {
  background: rgba(27,156,63,0.1);
  color: #1B9C3F;
}

.order-status.pendente {
  background: rgba(255,193,7,0.15);
  color: #F9A825;
}

.order-status.negado {
  background: rgba(230,57,70,0.1);
  color: #E63946;
}

/* ==================== WITHDRAWAL HISTORY ==================== */
.withdraw-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

/* ==================== HELPERS ==================== */
.dash-subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}

.dash-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 6px;
}

.dash-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 8px;
}

.dash-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 30px 0;
}

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-30 { margin-top: 30px; }

/* ==================== MOBILE SIDEBAR TOGGLE ==================== */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(27,156,63,0.4);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .dash-container {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 998;
    box-shadow: 5px 0 30px rgba(0,0,0,0.15);
  }

  .dash-sidebar.open {
    display: block;
  }

  .sidebar-toggle {
    display: block;
  }

  .credits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .dash-content-area {
    padding: 20px 16px;
  }
}

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

  .balance-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ==================== RAFFLE CARDS GRID ==================== */
.raffle-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.raffle-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.raffle-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.raffle-card.hidden { display: none; }

.raffle-card-img {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.raffle-card-img-text {
  font-size: 2.5rem;
  font-weight: 900;
  color: rgba(255,255,255,0.5);
}

.raffle-card-body { padding: 16px; }
.raffle-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.raffle-card-date {
  font-size: 0.78rem;
  color: #5A5E78;
  margin-bottom: 12px;
}

.raffle-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1B9C3F, #FFC107);
  margin: 0 -16px -16px;
  padding: 12px 16px;
  border-radius: 0 0 14px 14px;
}
.raffle-card-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 20px;
}
.raffle-card-label {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  flex: 1;
}
.raffle-card-arrow {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==================== RAFFLE TICKETS PANEL ==================== */
.raffle-tickets-panel {
  display: none;
  grid-column: 1 / -1;
  animation: fadeIn 0.3s ease;
}
.raffle-tickets-panel.open { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rtp-header {
  background: linear-gradient(135deg, #1B9C3F, #FFC107);
  border-radius: 14px 14px 0 0;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}
.rtp-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900;
}
.rtp-header h3 { font-size: 1.2rem; font-weight: 800; }
.rtp-header p { font-size: 0.85rem; opacity: 0.85; margin-top: 2px; }

.rtp-reminder {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.rtp-reminder small { color: #5A5E78; font-size: 0.78rem; }
.rtp-reminder strong { color: #1A1A2E; font-size: 0.95rem; }
.rtp-reminder span { font-size: 1.4rem; }

.rtp-prizes {
  margin: 20px 0;
}
.rtp-prizes h4 {
  font-size: 1.05rem; font-weight: 800; color: #1A1A2E; margin-bottom: 4px;
}
.rtp-prizes > p {
  font-size: 0.82rem; color: #5A5E78; margin-bottom: 12px;
}
.rtp-prize-item {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  padding: 16px 20px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.rtp-prize-item strong { color: #1A1A2E; font-size: 0.95rem; }
.rtp-prize-item small { color: #5A5E78; }

.rtp-numbers { margin: 20px 0; }
.rtp-numbers h4 {
  font-size: 1.05rem; font-weight: 800; color: #1A1A2E; margin-bottom: 4px;
}
.rtp-numbers > p {
  font-size: 0.82rem; color: #5A5E78; margin-bottom: 14px;
}

.rtp-nums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.rtp-num {
  background: linear-gradient(135deg, #FFC107, #FFD54F);
  border: 2px solid #F9A825;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #1A1A2E;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255,193,7,0.2);
  position: relative;
}
.rtp-num::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: #F5F6FA;
  border-radius: 50%;
}
.rtp-num::after {
  content: '';
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: #F5F6FA;
  border-radius: 50%;
}

.rtp-back {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1B9C3F, #157A30);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 12px rgba(27,156,63,0.2);
}
.rtp-back:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(27,156,63,0.3);
}

@media (max-width: 600px) {
  .raffle-cards-grid {
    grid-template-columns: 1fr;
  }
  .rtp-nums-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
}
