/* ==========================================================================
   CUE ARENA — Admin Console Stylesheet
   ========================================================================== */

/* Page Background */
.admin-body {
  background-color: var(--bg-primary);
  min-height: 100vh;
}

/* ==========================================================================
   AUTH SCREEN (LOGIN)
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(23, 29, 34, 0.92);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 2.8rem 2.4rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow-gold);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: modal-fade 0.35s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 220px;
  height: auto;
  max-width: 100%;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 6px 18px rgba(212, 175, 55, 0.45)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.9));
  transition: transform var(--transition-normal);
  object-fit: contain;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-gold-light) 50%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.auth-tagline {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  margin-top: 4px;
}

.auth-instruction {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 1.8rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(11, 15, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.input-wrap .form-input {
  padding-left: 2.6rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  background: rgba(11, 15, 18, 0.95);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
}

.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  text-align: center;
}

.auth-back-link {
  font-size: 0.82rem;
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-back-link:hover {
  color: var(--accent-gold-light);
  text-decoration: underline;
}

.auth-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.auth-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-gold-light);
  font-family: var(--font-mono);
}

/* ==========================================================================
   ADMIN DASHBOARD LAYOUT
   ========================================================================= */
.dashboard-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-wrapper.hidden,
.auth-wrapper.hidden {
  display: none !important;
}

/* Admin Header */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.8rem;
}

.admin-header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.admin-brand {
  display: flex;
  align-items: center;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  align-items: center;
  background: rgba(11, 15, 18, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #0B0F12;
  background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold) 100%);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.tab-btn.active svg {
  stroke: #0B0F12;
}

/* Header User Controls */
.admin-user-menu {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.admin-clock {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(11, 15, 18, 0.6);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #FF5A5A;
}

/* Admin Main */
.admin-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.8rem 4rem;
}

.tab-panel {
  display: block;
}

.tab-panel.hidden {
  display: none !important;
}

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #FFFFFF;
}

.panel-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   ADMIN TABLE CARDS & CONTROLS
   ========================================================================= */
.admin-tables-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.admin-table-card.occupied {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(239, 68, 68, 0.15);
}

.admin-table-card.paused {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.15);
}

.admin-card-header {
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-card-body {
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
}

/* Control Buttons Grid */
.admin-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.btn-start-large {
  width: 100%;
  padding: 0.95rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.action-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.btn-pause {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FBBF24;
}

.btn-pause:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #F59E0B;
}

.btn-resume {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
}

.btn-resume:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10B981;
}

.btn-end {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #F87171;
}

.btn-end:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
}

.admin-sub-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color var(--transition-fast);
}

.btn-link-action:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.btn-link-action.danger:hover {
  color: #F87171;
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   PRICING SETTINGS PANEL
   ========================================================================= */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.2rem;
  box-shadow: var(--shadow-card);
}

.pricing-notice {
  display: flex;
  gap: 0.85rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--accent-gold-light);
  line-height: 1.5;
}

.notice-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.pricing-item-card {
  background: rgba(11, 15, 18, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pricing-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pricing-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
}

.currency-prefix {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.rate-input {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
  padding: 0;
  width: 100%;
}

.rate-input:focus {
  box-shadow: none;
  background: transparent;
}

.rate-suffix {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.rate-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.pricing-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ==========================================================================
   SESSION HISTORY PANEL
   ========================================================================= */
.history-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.history-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
}

.history-metric-card.highlight-gold {
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, rgba(23, 29, 34, 0.9) 100%);
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0.4rem 0 0.2rem;
}

.highlight-gold .metric-value {
  color: var(--accent-gold-light);
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Filter Bar */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group.flex-1 {
  flex: 1;
  min-width: 220px;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.filter-input {
  min-width: 140px;
}

.filter-actions {
  display: flex;
  align-items: center;
}

/* Table Styling */
.history-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

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

.history-table th {
  background: rgba(11, 15, 18, 0.85);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.history-table td {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
}

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

.history-table .font-mono {
  font-family: var(--font-mono);
}

.history-empty {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   MODALS
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-box {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), var(--shadow-glow-gold);
  animation: modal-fade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box-danger {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(239, 68, 68, 0.2);
}

@keyframes modal-fade {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #FFFFFF;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: #FFFFFF;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-table-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-gold);
}

.modal-info-box {
  background: rgba(11, 15, 18, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  color: #FFFFFF;
  font-weight: 600;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  background: rgba(11, 15, 18, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* Specific End Session Modal */
.modal-alert-icon {
  font-size: 2.2rem;
  text-align: center;
}

.modal-alert-icon.danger {
  color: #EF4444;
}

.end-session-heading {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.end-summary-card {
  background: rgba(11, 15, 18, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summary-line.line-total {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.05rem;
}

.summary-line.line-total strong {
  font-size: 1.35rem;
}

.end-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

.danger-text {
  color: #F87171;
}

.btn-danger {
  background: #EF4444;
  color: #FFFFFF;
  font-weight: 700;
}

.btn-danger:hover {
  background: #DC2626;
}

.input-helper-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.required {
  color: #EF4444;
}

.optional {
  color: var(--text-muted);
  font-weight: normal;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 380px;
}

.toast-success {
  background: rgba(16, 185, 129, 0.95);
  color: #06281E;
}

.toast-error {
  background: rgba(239, 68, 68, 0.95);
  color: #FFFFFF;
}

.toast-warning {
  background: rgba(245, 158, 11, 0.95);
  color: #1A1303;
}

.toast-info {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-gold);
  color: #FFFFFF;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   RESPONSIVE DESIGN FOR ADMIN
   ========================================================================= */
@media (max-width: 1100px) {
  .admin-tables-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .history-metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .admin-tabs {
    overflow-x: auto;
    width: 100%;
  }

  .admin-user-menu {
    justify-content: space-between;
  }

  .admin-tables-grid {
    grid-template-columns: 1fr;
  }

  .filter-card {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-input {
    width: 100%;
  }

  .pricing-actions {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
  }
}
