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

:root {
  --bg-main: #121520;
  --bg-panel: #1c1f2d;
  --bg-sidebar: #151823;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-active: rgba(255, 255, 255, 0.15);
  --text-primary: #ffffff;
  --text-muted: #8d94ab;
  --color-green: #09c480;
  --color-red: #ff5c6a;
  --color-blue: #026fd3;
  --color-blue-hover: #0056b3;
  --color-primary: #026fd3;
  --color-yellow: #ffb800;
  --font-main: 'Inter', 'Roboto', sans-serif;
}

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

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow: hidden;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Standalone Admin Dashboard UI */
.admin-dashboard {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0c0e16;
  color: #e2e8f0;
  display: flex;
  z-index: 100;
  font-family: var(--font-main);
}

/* Sidebar Styling */
.admin-sidebar {
  width: 260px;
  background-color: #111422;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.admin-sidebar__logo {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.admin-nav {
  flex: 1;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav-item {
  background: none;
  border: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.admin-nav-item svg {
  opacity: 0.7;
}

.admin-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.admin-nav-item.active {
  background-color: rgba(2, 111, 211, 0.08);
  color: var(--color-blue);
  font-weight: 600;
}

.admin-nav-item.active svg {
  opacity: 1;
  stroke: var(--color-blue);
}

.admin-sidebar__footer {
  padding: 20px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-admin-logout {
  width: 100%;
  background: rgba(255, 92, 106, 0.05);
  border: 1px solid rgba(255, 92, 106, 0.15);
  color: var(--color-red);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-logout:hover {
  background: var(--color-red);
  color: #fff;
}

.btn-theme-toggle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-theme-toggle:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.06);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #0c0e16;
}

.admin-main-header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #111422;
}

.admin-header-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.admin-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-blue);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.admin-role {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-content-area {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Panels */
.admin-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.admin-panel.active {
  display: block;
}

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

/* Metrics Cards Grid */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  background: #111422;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.metric-card__title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-card__value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-family: monospace;
}

.metric-card__value.highlight-yellow {
  color: var(--color-yellow);
}

.metric-card__value.highlight-blue {
  color: var(--color-blue);
}

.metric-card__desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Section Title */
.admin-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-top: 0;
  margin-bottom: 16px;
}

/* Tables Styling */
.admin-table-wrapper {
  background: #111422;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-table th {
  background: rgba(0, 0, 0, 0.15);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* Finance Tabs */
.finance-tab {
  transition: all 0.2s;
}

.finance-tab.active {
  background: rgba(2, 111, 211, 0.08) !important;
  color: var(--color-blue) !important;
}

.finance-panel {
  display: none;
}

.finance-panel.active {
  display: block;
}

/* Cards Grid (KYC & Finance) */
.admin-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Admin Cards */
.admin-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-card__title {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  display: flex;
  justify-content: space-between;
}
.admin-card__body {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.admin-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-admin-action {
  flex: 1;
  border: none;
  padding: 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn-admin-action.approve {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}
.btn-admin-action.reject {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}
.btn-admin-action.approve:hover {
  background: #2ecc71;
  color: #fff;
}
.btn-admin-action.reject:hover {
  background: #e74c3c;
  color: #fff;
}

/* Status Badges */
.status-badge {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}
.status-badge.pending {
  background: rgba(255, 184, 0, 0.1);
  color: var(--color-yellow);
}
.status-badge.replied {
  background: rgba(2, 111, 211, 0.1);
  color: var(--color-blue);
}
.status-badge.approved {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.status-badge.rejected {
  background: rgba(255, 92, 106, 0.1);
  color: var(--color-red);
}
.status-badge.closed {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Ticket Chat Bubble inside Admin */
.ticket-bubble {
  padding: 10px;
  border-radius: 8px;
  max-width: 75%;
  font-size: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.ticket-bubble.user {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px 8px 8px 0;
}
.ticket-bubble.admin {
  align-self: flex-end;
  background: rgba(2, 111, 211, 0.1);
  border: 1px solid rgba(2, 111, 211, 0.2);
  border-radius: 8px 8px 0 8px;
}

/* Modals Styling */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  display: none;
}

/* Dynamic connection error overlay */
.connection-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0c0e16;
  z-index: 20000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

/* Dedicated Admin Login Screen CSS */
.admin-login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0c0e16;
  background-image: radial-gradient(circle at 50% 50%, rgba(2, 111, 211, 0.15) 0%, transparent 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  font-family: var(--font-main);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(21, 24, 35, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.login-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-input-group label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrapper input {
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.25s ease;
}

.login-input-wrapper input:focus {
  border-color: var(--color-blue);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(2, 111, 211, 0.2);
}

.btn-login-submit {
  height: 44px;
  background: var(--color-blue);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login-submit:hover {
  background: var(--color-blue-hover);
  box-shadow: 0 4px 15px rgba(2, 111, 211, 0.4);
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error-msg {
  background: rgba(255, 92, 106, 0.1);
  border: 1px solid rgba(255, 92, 106, 0.2);
  color: var(--color-red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  display: none;
}

/* White Theme Overrides for Admin Dashboard */
body.theme-white {
  --bg-main: #f3f4f6;
  --bg-panel: #ffffff;
  --bg-sidebar: #ebedf2;
  --border-color: rgba(0, 0, 0, 0.08);
  --text-primary: #1f2937;
  --text-muted: #6b7280;
}

body.theme-white .admin-dashboard {
  background-color: #f3f4f6 !important;
  color: #1f2937 !important;
}

body.theme-white .admin-sidebar {
  background-color: #ebedf2 !important;
  border-right-color: rgba(0, 0, 0, 0.08) !important;
}

body.theme-white .admin-sidebar__logo {
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

body.theme-white .admin-sidebar__logo .logo-text {
  color: #1f2937 !important;
}

body.theme-white .admin-nav-item {
  color: #4b5563 !important;
}

body.theme-white .admin-nav-item:hover {
  background-color: rgba(0, 0, 0, 0.02) !important;
  color: #1f2937 !important;
}

body.theme-white .admin-nav-item.active {
  background-color: #ffffff !important;
  color: var(--color-blue) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.theme-white .btn-admin-logout {
  background-color: rgba(255, 92, 106, 0.08) !important;
  border-color: rgba(255, 92, 106, 0.15) !important;
}

body.theme-white .btn-admin-logout:hover {
  background-color: var(--color-red) !important;
  color: #fff !important;
}

body.theme-white .btn-theme-toggle {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #4b5563 !important;
}

body.theme-white .btn-theme-toggle:hover {
  background-color: #f9fafb !important;
  color: #1f2937 !important;
}

body.theme-white .admin-main {
  background-color: #f3f4f6 !important;
}

body.theme-white .admin-main-header {
  background-color: #ffffff !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

body.theme-white .admin-header-title {
  color: #1f2937 !important;
}

body.theme-white .admin-name {
  color: #1f2937 !important;
}

body.theme-white .admin-user-info .admin-role {
  color: #6b7280 !important;
}

body.theme-white .metric-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

body.theme-white .metric-card:hover {
  border-color: rgba(0, 0, 0, 0.15) !important;
}

body.theme-white .metric-card__title {
  color: #6b7280 !important;
}

body.theme-white .metric-card__value {
  color: #1f2937 !important;
}

body.theme-white .metric-card__desc {
  color: #9ca3af !important;
}

body.theme-white .admin-section-title {
  color: #1f2937 !important;
}

body.theme-white .admin-table-wrapper {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

body.theme-white .admin-table th {
  background: rgba(0, 0, 0, 0.02) !important;
  color: #6b7280 !important;
}

body.theme-white .admin-table td {
  border-bottom-color: rgba(0, 0, 0, 0.04) !important;
  color: #4b5563 !important;
}

body.theme-white .admin-table tr:hover {
  background-color: rgba(0, 0, 0, 0.01) !important;
}

body.theme-white .admin-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

body.theme-white .admin-card__title {
  color: #1f2937 !important;
}

body.theme-white .admin-card__body {
  color: #4b5563 !important;
}

/* Spinner */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border-left-color: #fff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Gerenciar Mercado & Torneios specific styles */
.btn-admin-action.edit {
  background: rgba(2, 111, 211, 0.15);
  border: 1px solid rgba(2, 111, 211, 0.3);
  color: var(--color-blue);
}
.btn-admin-action.edit:hover {
  background: var(--color-blue);
  color: #fff;
}

body.theme-white .btn-admin-action.edit {
  background: rgba(2, 111, 211, 0.08) !important;
  border-color: rgba(2, 111, 211, 0.15) !important;
}
body.theme-white .btn-admin-action.edit:hover {
  background: var(--color-blue) !important;
  color: #fff !important;
}

