/* ==============================================================================
   KETUPAT ADMIN DASHBOARD - PRODUCTION STYLESHEET
   Light Mode, Clean SaaS Admin Design, Material Symbols Outlined
   ============================================================================== */

:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-border: #a7f3d0;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;

  --accent-blue: #0284c7;
  --accent-blue-bg: #e0f2fe;
  --accent-amber: #d97706;
  --accent-amber-bg: #fef3c7;
  --accent-red: #dc2626;
  --accent-red-bg: #fee2e2;
  --accent-purple: #7c3aed;
  --accent-purple-bg: #ede9fe;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --sidebar-width: 250px;
  --header-height: 64px;
}

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

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

body, button, input, select, textarea, optgroup, option, table, th, td, h1, h2, h3, h4, h5, h6, p, a, div, span:not(.material-symbols-outlined) {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Material Symbols Outlined Helper */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  display: inline-block;
  user-select: none;
}

/* App Shell Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-text p {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 12px 12px 6px;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item-link:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.nav-item-link .nav-icon {
  font-size: 1.25rem;
}

.nav-pill-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid #fde68a;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: #fafbfc;
}

.db-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #94a3b8;
}

.status-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-dot.offline {
  background-color: #ef4444;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Top Navigation Bar */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

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

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-refresh:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-dark);
}

.btn-refresh.spinning .btn-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Main Page Container */
.content-area {
  padding: 24px;
  flex: 1;
}

.view-section {
  display: none;
}

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

/* Metric / KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-icon-green { background-color: var(--primary-light); color: var(--primary); }
.kpi-icon-blue { background-color: var(--accent-blue-bg); color: var(--accent-blue); }
.kpi-icon-amber { background-color: var(--accent-amber-bg); color: var(--accent-amber); }
.kpi-icon-purple { background-color: var(--accent-purple-bg); color: var(--accent-purple); }
.kpi-icon-red { background-color: var(--accent-red-bg); color: var(--accent-red); }

.kpi-info {
  min-width: 0;
}

.kpi-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 2px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Card Container */
.admin-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background-color: #fff;
}

.card-header-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Filter Controls & Search Bar */
.search-input-wrap {
  position: relative;
  min-width: 240px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.4;
  user-select: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-dark);
  color: var(--text-main);
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  gap: 5px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  gap: 4px;
  line-height: 1.2;
}

.btn-large {
  padding: 12px 24px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

.btn-icon-tiny {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

.btn-icon-right {
  font-size: 16px;
  margin-left: 2px;
  display: inline-block;
  vertical-align: middle;
}

.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-action .form-input {
  padding-right: 42px;
}

.btn-reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.btn-reveal:hover {
  color: var(--text-main);
  background-color: var(--bg-subtle);
}

.pool-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.pool-tab-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pool-tab-btn:hover {
  color: var(--text-main);
}

.pool-tab-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #fafbfc;
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-processing {
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid #fde68a;
}

.badge-delivered {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-cancelled {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid #fecaca;
}

.badge-tag {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Player Mini Cell */
.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.player-name-bold {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-sub-mono {
  font-size: 0.74rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
}

.flag-tiny {
  width: 16px;
  height: 11px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Action Button Group */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background-color: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-dark);
}

.action-icon-btn.btn-approve:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.action-icon-btn.btn-reject:hover {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
  border-color: #fca5a5;
}

/* Giveaway Winner Roll Arena */
.giveaway-arena-card {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.giveaway-arena-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 10%, transparent 60%);
  pointer-events: none;
}

.arena-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.arena-desc {
  font-size: 0.9rem;
  color: #a7f3d0;
  max-width: 500px;
  margin: 6px auto 20px;
}

.arena-stats-strip {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.arena-stat-box {
  background: rgba(255, 255, 255, 0.12);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.arena-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.arena-stat-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #d1fae5;
  letter-spacing: 0.05em;
}

.btn-roll-winner {
  background-color: #fbbf24;
  color: #78350f;
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
  transition: all 0.15s ease;
}

.btn-roll-winner:hover {
  background-color: #f59e0b;
  transform: scale(1.03);
}

.btn-roll-winner:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Roll Winner Spinner Box */
.winner-ticker-box {
  background: rgba(0, 0, 0, 0.25);
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 16px;
  max-width: 450px;
  margin: 20px auto 0;
  display: none;
}

.winner-ticker-box.active {
  display: block;
  animation: pulse 1s infinite alternate;
}

.winner-name-display {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fef08a;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.btn-close-modal:hover {
  color: var(--text-main);
  background-color: var(--bg-subtle);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background-color: #fafbfc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: #fff;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Toast Notifications */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Empty State Message */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.empty-state .material-symbols-outlined {
  font-size: 3rem;
  margin-bottom: 8px;
}

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

/* Responsive Mobile Breakpoints */
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .btn-mobile-menu {
    display: inline-flex !important;
  }
}

.btn-mobile-menu {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Additional PHP Admin Enhancements */
.badge-highest-access {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.badge-standard-access {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.callout-highest-access {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(2, 132, 199, 0.08));
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.callout-highest-access .callout-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.callout-highest-access .callout-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.spin {
  animation: spinAnim 1s linear infinite;
}

@keyframes spinAnim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.user-cell-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #e2e8f0;
}

.user-cell-text {
  display: flex;
  flex-direction: column;
}

.user-cell-email {
  font-weight: 600;
  color: var(--text-main);
}

.user-cell-ign {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==============================================================================
   USER DEVICE GALLERY BROWSER & LIGHTBOX STYLES
   ============================================================================== */

.gallery-hero-strip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.gallery-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.gallery-photo-card {
  position: relative;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.gallery-photo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  z-index: 2;
}

.gallery-card-badge.avatar-badge {
  background: linear-gradient(135deg, #059669, #047857);
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  z-index: 3;
}

.gallery-photo-card:hover .gallery-card-overlay {
  opacity: 1;
}

.gallery-card-quick-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  z-index: 5;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.gallery-card-quick-del:hover {
  background: #dc2626;
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.55);
  color: #ffffff;
}

.gallery-card-quick-del:active {
  transform: scale(0.95);
}

.overlay-top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 38px;
}

.overlay-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.overlay-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

.overlay-btn.btn-del:hover {
  background: var(--accent-red);
  color: #fff;
}

.overlay-bottom-info {
  color: #fff;
}

.overlay-photo-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-photo-meta {
  font-size: 0.68rem;
  color: #cbd5e1;
}

/* Modal Lightbox */
.modal-lightbox .lightbox-container {
  background: #0f172a;
  border-radius: var(--radius-lg);
  width: 95vw;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-header {
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.lightbox-title-wrap {
  display: flex;
  flex-direction: column;
}

.lightbox-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.lightbox-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

.lightbox-body {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  padding: 20px;
  min-height: 480px;
}

.lightbox-image-wrap {
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn.prev {
  left: 20px;
}

.lightbox-nav-btn.next {
  right: 20px;
}

/* ==============================================================================
   METRIC STATS GRID & CARDS (Dashboard Overview)
   ============================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.users-bg { background-color: #e0f2fe; color: #0284c7; }
.devices-bg { background-color: #e0f2fe; color: #0284c7; }
.orders-bg { background-color: #ecfdf5; color: #059669; }
.pending-bg { background-color: #fef3c7; color: #d97706; }
.diamonds-bg { background-color: #ede9fe; color: #7c3aed; }
.tickets-bg { background-color: #fee2e2; color: #dc2626; }
.dlyyz-bg { background-color: #ede9fe; color: #7c3aed; }

.stat-content {
  min-width: 0;
  flex: 1;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 3px;
}

/* ==============================================================================
   TABLE CARD & SECTION TOOLBARS
   ============================================================================== */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background-color: #ffffff;
}

.table-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.table-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.2rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background-color: #ffffff;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==============================================================================
   SETTINGS GRID & CARDS
   ============================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.settings-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.settings-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.status-msg {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-msg.success {
  background-color: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-hover);
}

.status-msg.error {
  background-color: var(--accent-red-bg);
  border-color: #fecaca;
  color: var(--accent-red);
}

/* ==============================================================================
   FORM ROWS & EXTENDED BADGES
   ============================================================================== */
.form-row {
  display: flex;
  gap: 12px;
}

.form-select-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  cursor: pointer;
}

.gallery-grid-container {
  width: 100%;
}

.bind-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-pending {
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid #fde68a;
}

.badge-bound {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-unbound {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid #fecaca;
}

.badge-region-pill {
  display: inline-block;
  padding: 2px 8px;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ==============================================================================
   HELPER UTILITY CLASSES
   ============================================================================== */
.flex-1 { flex: 1; min-width: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-danger, .text-red { color: var(--accent-red); }
.text-amber { color: var(--accent-amber); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.hidden { display: none !important; }


/* =============================================================================
   COMMAND CENTER THEME
   Tactical gaming interface layer. Existing class names are intentionally kept
   so the PHP data views and admin.js interactions remain unchanged.
   ============================================================================= */
:root {
  --primary: #27ddff;
  --primary-hover: #8c74ff;
  --primary-light: rgba(39, 221, 255, 0.13);
  --primary-border: rgba(39, 221, 255, 0.38);
  --bg-main: #070913;
  --bg-card: #111626;
  --bg-subtle: #151c30;
  --bg-hover: #1a2238;
  --text-main: #f3f7ff;
  --text-muted: #9ba8c3;
  --text-light: #66738e;
  --border-color: rgba(155, 177, 222, 0.17);
  --border-dark: rgba(94, 222, 255, 0.42);
  --accent-blue: #27ddff;
  --accent-blue-bg: rgba(39, 221, 255, 0.12);
  --accent-amber: #ffc84a;
  --accent-amber-bg: rgba(255, 200, 74, 0.13);
  --accent-red: #ff5d7d;
  --accent-red-bg: rgba(255, 93, 125, 0.13);
  --accent-purple: #a88cff;
  --accent-purple-bg: rgba(168, 140, 255, 0.14);
  --shadow-sm: 0 12px 24px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 20px 42px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 68px rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 272px;
  --header-height: 82px;
}

html {
  min-height: 100%;
  background: #070913;
}

body.command-center {
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% -12%, rgba(87, 65, 255, 0.28), transparent 27rem),
    radial-gradient(circle at 33% 4%, rgba(39, 221, 255, 0.12), transparent 28rem),
    #070913;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
}

body.command-center::selection {
  color: #061016;
  background: #73edff;
}

body.command-center::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(149, 170, 226, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(149, 170, 226, 0.055) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.command-center button,
.command-center input,
.command-center select,
.command-center textarea {
  font: inherit;
}

.command-center button:focus-visible,
.command-center a:focus-visible,
.command-center input:focus-visible,
.command-center select:focus-visible,
.command-center textarea:focus-visible {
  outline: 2px solid #65eaff;
  outline-offset: 3px;
}

.command-center ::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.command-center ::-webkit-scrollbar-track {
  background: #090c16;
}

.command-center ::-webkit-scrollbar-thumb {
  background: #303c5d;
  border: 2px solid #090c16;
  border-radius: 999px;
}

.command-center ::-webkit-scrollbar-thumb:hover {
  background: #64739b;
}

.admin-layout {
  position: relative;
  min-height: 100vh;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(21, 28, 48, 0.97), rgba(7, 9, 19, 0.98)),
    #0a0d18;
  border-right: 1px solid rgba(118, 140, 191, 0.19);
  box-shadow: 18px 0 56px rgba(0, 0, 0, 0.19);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(#2ae6ff 0 18%, #9178ff 52%, transparent 84%);
  box-shadow: 0 0 18px rgba(39, 221, 255, 0.72);
}

.sidebar-header {
  height: 92px;
  padding: 0 25px 0 27px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.045), transparent 75%);
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #07111a;
  background: linear-gradient(135deg, #8ef5ff 0%, #2cddff 48%, #806dff 100%);
  border: 1px solid rgba(236, 255, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(39, 221, 255, 0.08), 0 8px 22px rgba(39, 221, 255, 0.32);
  transform: rotate(-8deg);
}

.logo-badge .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  transform: rotate(8deg);
}

.brand-text h1 {
  color: #fff;
  font-size: 1.08rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.brand-text p {
  margin-top: 2px;
  color: #65eaff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.sidebar-nav {
  padding: 20px 14px;
  gap: 6px;
}

.nav-section-title {
  padding: 17px 13px 8px;
  color: #7180a1;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.nav-item-link {
  position: relative;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aeb9d0;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  overflow: hidden;
}

.nav-item-link::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.13), rgba(142, 116, 255, 0.1));
  transition: opacity 0.18s ease;
}

.nav-item-link > * {
  position: relative;
  z-index: 1;
}

.nav-item-link:hover {
  color: #eff8ff;
  background: rgba(119, 137, 187, 0.08);
  border-color: rgba(151, 174, 222, 0.15);
}

.nav-item-link:hover::before {
  opacity: 1;
}

.nav-item-link.active {
  color: #e9fbff;
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.2), rgba(130, 103, 255, 0.16));
  border-color: rgba(89, 222, 255, 0.44);
  box-shadow: inset 3px 0 #5ce8ff, 0 7px 20px rgba(6, 14, 35, 0.38);
}

.nav-item-link.active .nav-icon {
  color: #61edff;
  font-variation-settings: 'FILL' 1, 'wght' 550, 'GRAD' 0, 'opsz' 24;
}

.nav-pill-badge {
  min-width: 24px;
  padding: 3px 7px;
  color: #171001;
  background: #ffcf56 !important;
  border: 0;
  box-shadow: 0 0 14px rgba(255, 200, 74, 0.25);
}

.sidebar-footer {
  padding: 20px 22px 23px;
  border-top: 1px solid var(--border-color);
  background: rgba(4, 6, 13, 0.38);
}

.db-pill {
  padding: 10px 12px;
  border: 1px solid rgba(103, 231, 177, 0.22);
  border-radius: 10px;
  color: #b4c6d8;
  background: rgba(29, 207, 140, 0.055);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.status-dot.online {
  background: #38ebaa;
  box-shadow: 0 0 0 3px rgba(56, 235, 170, 0.13), 0 0 12px rgba(56, 235, 170, 0.78);
}

.main-wrapper {
  background: transparent;
}

.top-header {
  height: var(--header-height);
  padding: 0 32px;
  color: var(--text-main);
  background: rgba(8, 11, 22, 0.82);
  border-bottom: 1px solid rgba(129, 147, 194, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px);
}

.header-left {
  gap: 15px;
}

.title-cluster {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #7f90b4;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1;
  text-transform: uppercase;
}

.page-kicker .status-dot {
  width: 6px;
  height: 6px;
}

.page-title {
  color: #f6f9ff;
  font-size: 1.25rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.header-right {
  gap: 10px;
}

.filter-select,
.form-select,
.form-select-sm {
  color: #cfdbed;
  background-color: #111827;
  border-color: rgba(138, 159, 204, 0.29);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.filter-select:hover,
.form-select:hover,
.form-select-sm:hover {
  border-color: rgba(90, 230, 255, 0.47);
}

.filter-select:focus,
.form-select:focus,
.form-select-sm:focus {
  border-color: #39dfff;
  box-shadow: 0 0 0 3px rgba(39, 221, 255, 0.13);
}

.filter-select option,
.form-select option,
.form-select-sm option {
  color: #e8efff;
  background: #12192a;
}

.btn-refresh {
  min-height: 38px;
  padding: 8px 14px;
  color: #e8fbff;
  background: linear-gradient(135deg, rgba(39, 221, 255, 0.17), rgba(121, 102, 255, 0.2));
  border-color: rgba(95, 225, 255, 0.4);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.11), 0 8px 18px rgba(4, 11, 28, 0.25);
}

.btn-refresh:hover {
  color: #071018;
  background: linear-gradient(135deg, #70efff, #a188ff);
  border-color: #a7f7ff;
}

.content-area {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 30px 32px 42px;
}

.view-section.active {
  animation: commandViewIn 0.3s ease both;
}

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

.callout-highest-access {
  position: relative;
  padding: 18px 20px;
  color: #f0f6ff;
  background: linear-gradient(100deg, rgba(255, 200, 74, 0.13), rgba(255, 93, 125, 0.09));
  border: 1px solid rgba(255, 200, 74, 0.37);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.callout-highest-access::before {
  content: "ACCESS NOTICE";
  position: absolute;
  top: 8px;
  right: 12px;
  color: rgba(255, 213, 112, 0.48);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.callout-highest-access .callout-text h4 {
  color: #fff6d7;
  font-size: 0.93rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.callout-highest-access .callout-text p {
  max-width: 850px;
  color: #c5cce0;
}

.stats-grid {
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  position: relative;
  min-height: 114px;
  padding: 20px;
  color: #f2f6ff;
  background: linear-gradient(145deg, rgba(23, 31, 52, 0.95), rgba(12, 16, 30, 0.96));
  border-color: rgba(136, 158, 205, 0.2);
  border-radius: 16px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(95, 231, 255, 0.92), transparent);
  opacity: 0.68;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  right: -28px;
  bottom: -32px;
  border: 1px solid rgba(103, 223, 255, 0.15);
  border-radius: 50%;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(83, 226, 255, 0.52);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(39, 221, 255, 0.08);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border: 1px solid currentColor;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 7px 18px rgba(0,0,0,0.17);
}

.users-bg { color: #5ee5ff; background: rgba(39, 221, 255, 0.13); }
.devices-bg { color: #38bdf8; background: rgba(56, 189, 248, 0.14); }
.orders-bg { color: #59e6a9; background: rgba(78, 224, 163, 0.13); }
.pending-bg { color: #ffd060; background: rgba(255, 200, 74, 0.14); }
.diamonds-bg { color: #b19cff; background: rgba(163, 132, 255, 0.14); }
.tickets-bg { color: #ff94a9; background: rgba(255, 93, 125, 0.14); }
.dlyyz-bg { color: #b19cff; background: rgba(163, 132, 255, 0.14); }

.stat-value {
  color: #f8fbff;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.stat-label {
  color: #8e9dbb;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.table-card,
.admin-card,
.settings-card,
.gallery-hero-strip {
  background: linear-gradient(145deg, rgba(18, 24, 41, 0.96), rgba(11, 15, 28, 0.98));
  border-color: rgba(136, 158, 205, 0.2);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.04);
}

.table-card {
  border-radius: 16px;
}

.table-card::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, #27ddff, #806dff 47%, transparent 82%);
}

.table-header,
.card-header-bar {
  min-height: 76px;
  padding: 17px 20px;
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.055), transparent 42%);
  border-color: var(--border-color);
}

.table-title h3,
.card-header-title {
  color: #f4f8ff;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-title h3::before,
.settings-card-title::before {
  content: "// ";
  color: #4fe5ff;
}

.table-title p {
  color: #8795b2;
}

.section-toolbar {
  position: relative;
  min-height: 52px;
  padding: 8px 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(136, 158, 205, 0.14);
}

.search-box input,
.search-input,
.form-input,
.form-textarea {
  color: #e9f1ff;
  background: #0c1221;
  border-color: rgba(137, 160, 208, 0.28);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.22);
}

.search-box input::placeholder,
.search-input::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: #65728e;
}

.search-box .search-icon,
.search-input-wrap .search-icon {
  color: #59e8ff;
}

.search-box input:focus,
.search-input:focus,
.form-input:focus,
.form-textarea:focus {
  color: #fff;
  background: #0e1527;
  border-color: #48e2ff;
  box-shadow: 0 0 0 3px rgba(39, 221, 255, 0.13), inset 0 1px 3px rgba(0,0,0,0.22);
}

.btn {
  border-radius: 10px;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.btn-primary {
  color: #051018;
  background: linear-gradient(135deg, #70efff, #2cddff 48%, #8d77ff);
  border-color: #a8f4ff;
  box-shadow: 0 8px 20px rgba(39, 221, 255, 0.21), inset 0 1px 0 rgba(255,255,255,0.58);
}

.btn-primary:hover {
  color: #040711;
  background: linear-gradient(135deg, #b2faff, #5ce8ff 46%, #a998ff);
  border-color: #d7feff;
  box-shadow: 0 12px 26px rgba(39, 221, 255, 0.31), inset 0 1px 0 rgba(255,255,255,0.75);
  transform: translateY(-1px);
}

.btn-secondary,
.btn-outline {
  color: #c5d2e8;
  background: rgba(33, 43, 70, 0.64);
  border-color: rgba(137, 160, 208, 0.3);
}

.btn-secondary:hover,
.btn-outline:hover {
  color: #eff9ff;
  background: rgba(53, 68, 108, 0.88);
  border-color: rgba(84, 227, 255, 0.52);
}

.btn-danger {
  color: #fff3f6;
  background: linear-gradient(135deg, #ff728d, #e93e64);
  border-color: #ff9eaf;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ff8ca3, #f04c70);
  border-color: #ffd0d8;
}

.btn-gold,
.btn-roll-winner {
  color: #1c1300;
  background: linear-gradient(135deg, #ffe084, #ffbe3d 52%, #ff9c46);
  border-color: #ffe09b;
  box-shadow: 0 8px 22px rgba(255, 181, 45, 0.25);
}

.btn-gold:hover,
.btn-roll-winner:hover {
  color: #1c1300;
  background: linear-gradient(135deg, #fff0b4, #ffd05d 52%, #ffb160);
}

.data-table {
  color: #cbd7eb;
  font-size: 0.82rem;
}

.data-table th {
  padding: 13px 16px;
  color: #7383a4;
  background: rgba(4, 7, 16, 0.42);
  border-color: rgba(136, 158, 205, 0.14);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.data-table td {
  padding: 15px 16px;
  border-color: rgba(136, 158, 205, 0.13);
}

.data-table tbody tr {
  transition: background 0.17s ease, box-shadow 0.17s ease;
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.08), rgba(132, 109, 255, 0.055));
  box-shadow: inset 3px 0 #3ee2ff;
}

.player-name-bold,
.user-cell-email,
.modal-title,
.settings-card-title {
  color: #f2f6ff;
}

.player-sub-mono,
.user-cell-ign,
.player-sub-mono {
  color: #8291ad;
}

.player-avatar-mini,
.user-mini-avatar {
  border-color: rgba(91, 228, 255, 0.37);
  background: #172037;
  box-shadow: 0 0 0 2px rgba(5, 8, 18, 0.8);
}

.badge,
.bind-status-badge,
.badge-region-pill {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.badge-processing,
.badge-pending {
  color: #ffd66f;
  background: rgba(255, 200, 74, 0.13);
  border-color: rgba(255, 200, 74, 0.35);
}

.badge-delivered,
.badge-bound {
  color: #68efb4;
  background: rgba(61, 226, 157, 0.12);
  border-color: rgba(61, 226, 157, 0.34);
}

.badge-cancelled,
.badge-unbound {
  color: #ff9daf;
  background: rgba(255, 93, 125, 0.12);
  border-color: rgba(255, 93, 125, 0.35);
}

.badge-tag,
.badge-region-pill {
  color: #aab8d0;
  background: rgba(128, 146, 187, 0.12);
  border-color: rgba(137, 160, 208, 0.23);
}

.badge-highest-access,
.badge-standard-access {
  min-height: 27px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-highest-access {
  color: #e4feff;
  background: linear-gradient(135deg, rgba(39, 221, 255, 0.26), rgba(128, 109, 255, 0.3));
  border-color: rgba(86, 227, 255, 0.5);
  box-shadow: 0 0 18px rgba(39, 221, 255, 0.13);
}

.badge-standard-access {
  color: #ffe1a0;
  background: rgba(255, 200, 74, 0.1);
  border-color: rgba(255, 200, 74, 0.35);
}

.action-icon-btn {
  color: #a4b5d1;
  background: #11192a;
  border-color: rgba(137, 160, 208, 0.27);
}

.action-icon-btn:hover {
  color: #e9fbff;
  background: #202c46;
  border-color: rgba(84, 227, 255, 0.54);
}

.action-icon-btn.btn-approve:hover {
  color: #5ef0b0;
  background: rgba(61, 226, 157, 0.13);
  border-color: rgba(61, 226, 157, 0.35);
}

.action-icon-btn.btn-reject:hover {
  color: #ff9daf;
  background: rgba(255, 93, 125, 0.13);
  border-color: rgba(255, 93, 125, 0.35);
}

.pool-tabs {
  gap: 5px;
  padding: 5px;
  background: rgba(9, 13, 25, 0.64);
  border-color: rgba(137, 160, 208, 0.25);
  border-radius: 11px;
}

.pool-tab-btn {
  color: #96a4bd;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 750;
}

.pool-tab-btn:hover {
  color: #eaf7ff;
  background: rgba(102, 126, 179, 0.13);
}

.pool-tab-btn.active {
  color: #091019;
  background: linear-gradient(135deg, #66edff, #a18dff);
  border-color: #b8f8ff;
  box-shadow: 0 4px 13px rgba(39, 221, 255, 0.2);
}

.giveaway-arena-card {
  background:
    radial-gradient(circle at 78% 22%, rgba(115, 92, 255, 0.48), transparent 27%),
    radial-gradient(circle at 17% 105%, rgba(39, 221, 255, 0.24), transparent 30%),
    linear-gradient(135deg, #111939, #1b1540 54%, #0e1832);
  border: 1px solid rgba(110, 219, 255, 0.32);
  border-radius: 18px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.11);
}

.arena-title {
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.arena-desc {
  color: #b5c2ea;
}

.arena-stat-box {
  background: rgba(5, 8, 20, 0.3);
  border-color: rgba(117, 235, 255, 0.28);
  border-radius: 12px;
  backdrop-filter: none;
}

.arena-stat-lbl {
  color: #9fb1da;
}

.modal-overlay {
  background: rgba(2, 4, 12, 0.8);
  backdrop-filter: blur(8px);
}

.modal-card {
  color: var(--text-main);
  background: linear-gradient(145deg, #171e34, #0d1222);
  border: 1px solid rgba(112, 151, 220, 0.36);
  border-radius: 17px;
  box-shadow: 0 28px 85px rgba(0,0,0,0.67), 0 0 0 1px rgba(39, 221, 255, 0.04);
}

.modal-header {
  min-height: 66px;
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.075), transparent 56%);
  border-color: var(--border-color);
}

.modal-footer {
  background: rgba(2, 5, 13, 0.27);
  border-color: var(--border-color);
}

.btn-close-modal,
.btn-reveal {
  color: #8797b8;
}

.btn-close-modal:hover,
.btn-reveal:hover {
  color: #f0fbff;
  background: rgba(92, 225, 255, 0.13);
}

.form-label {
  color: #a8b6cd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.form-hint {
  color: #74819c;
}

.form-hint code {
  color: #69e9ff;
  background: rgba(39, 221, 255, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
}

.settings-grid {
  gap: 20px;
}

.settings-card {
  position: relative;
  padding: 24px;
  border-radius: 16px;
  overflow: hidden;
}

.settings-card::before {
  content: "CONFIG NODE";
  position: absolute;
  top: 14px;
  right: 16px;
  color: rgba(114, 139, 192, 0.38);
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.settings-card-header {
  padding-bottom: 17px;
  border-color: var(--border-color);
}

.settings-icon {
  color: #51e8ff;
  background: rgba(39, 221, 255, 0.12);
  border: 1px solid rgba(39, 221, 255, 0.28);
  border-radius: 13px;
}

.settings-card-desc {
  color: #8593af;
}

.status-msg {
  color: #b9c7dd;
  background: rgba(101, 123, 172, 0.1);
  border-color: rgba(137, 160, 208, 0.23);
}

.status-msg.success {
  color: #66edb1;
  background: rgba(61, 226, 157, 0.1);
  border-color: rgba(61, 226, 157, 0.3);
}

.status-msg.error {
  color: #ff9daf;
  background: rgba(255, 93, 125, 0.1);
  border-color: rgba(255, 93, 125, 0.3);
}

.gallery-hero-strip {
  border-radius: 16px;
  padding: 17px 20px;
}

.gallery-hero-strip h4,
#galleryHeroFormattedTitle {
  color: #f2f7ff !important;
}

.gallery-photo-card {
  background: #111827;
  border-color: rgba(136, 158, 205, 0.25);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.gallery-photo-card:hover {
  border-color: rgba(79, 229, 255, 0.55);
  box-shadow: 0 16px 30px rgba(0,0,0,0.34), 0 0 0 1px rgba(39, 221, 255, 0.11);
}

.gallery-card-badge.avatar-badge {
  color: #06121a;
  background: linear-gradient(135deg, #6cefff, #8f7bff);
}

.empty-state {
  color: #75839e;
}

.empty-state p {
  color: #94a4c1;
}

.admin-toast {
  color: #eafaff;
  background: linear-gradient(135deg, #11203a, #17133a);
  border: 1px solid rgba(78, 229, 255, 0.43);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.45), 0 0 24px rgba(39, 221, 255, 0.14);
}

.btn-mobile-menu {
  color: #67ebff;
}

@media (max-width: 900px) {
  .sidebar {
    box-shadow: 18px 0 56px rgba(0, 0, 0, 0.55);
  }

  .top-header {
    padding: 0 20px;
  }

  .content-area {
    padding: 24px 20px 34px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: auto;
  }

  .sidebar-header {
    height: 82px;
  }

  .top-header {
    min-height: 74px;
    height: auto;
    padding: 13px 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-left,
  .header-right {
    min-width: 0;
  }

  .header-left {
    gap: 10px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .header-right .filter-select {
    flex: 1;
    min-width: 0;
  }

  .page-title {
    font-size: 1rem;
  }

  #accessBadgeHeader {
    display: none;
  }

  .content-area {
    padding: 18px 14px 28px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    min-height: 96px;
  }

  .section-toolbar {
    align-items: stretch;
  }

  .search-box {
    min-width: 100%;
    max-width: none;
  }

  .filter-actions,
  .settings-actions {
    width: 100%;
  }

  .filter-actions .btn,
  .settings-actions .btn {
    flex: 1;
  }

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

  .pool-tab-btn {
    flex: 0 0 auto;
  }

  .table-header {
    align-items: flex-start;
  }

  .callout-highest-access {
    align-items: flex-start;
    flex-direction: column;
  }

  .callout-highest-access .btn {
    width: 100%;
  }

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

  .settings-card {
    padding: 19px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-body,
  .modal-header,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-footer .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* =============================================================================
   GALLERY BROWSER: MODERN DEVICE GRID HUB & DETAIL INSPECTOR
   ============================================================================= */
#viewGallery .section-toolbar {
  display: block;
  min-height: 0;
  padding: 0 0 16px;
}

.gallery-subview {
  animation: fadeInSubview 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* 1. Device Grid Hub Toolbar */
.gallery-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gallery-hub-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gallery-hub-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(39, 221, 255, 0.16), rgba(140, 116, 255, 0.12));
  border: 1px solid rgba(39, 221, 255, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.gallery-hub-heading {
  font-size: 1.12rem;
  font-weight: 800;
  color: #f3f7ff;
  letter-spacing: 0.02em;
  margin: 0;
}

.gallery-hub-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Filter Strip & Search */
.gallery-filter-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(17, 22, 38, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(155, 177, 222, 0.14);
  border-radius: var(--radius-md);
}

.gallery-search-box {
  position: relative;
  flex: 1 1 320px;
  max-width: 520px;
}

.gallery-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #7b8ea8;
  pointer-events: none;
}

.gallery-search-box input {
  width: 100%;
  padding-left: 38px;
  padding-right: 36px;
  height: 40px;
  background: rgba(7, 9, 19, 0.75);
  border: 1px solid rgba(155, 177, 222, 0.2);
  border-radius: var(--radius-sm);
  color: #f3f7ff;
  font-size: 0.82rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gallery-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39, 221, 255, 0.15);
  outline: none;
}

.btn-clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #7b8ea8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-search:hover {
  color: #f3f7ff;
}

.gallery-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  border: 1px solid rgba(155, 177, 222, 0.18);
  background: rgba(21, 28, 48, 0.7);
  color: #9ba8c3;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: rgba(39, 221, 255, 0.4);
  color: #f3f7ff;
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(39, 221, 255, 0.2), rgba(140, 116, 255, 0.15));
  border-color: var(--primary);
  color: #27ddff;
  box-shadow: 0 0 12px rgba(39, 221, 255, 0.2);
}

/* 2. Device Cards Grid */
.gallery-devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.device-card {
  background: linear-gradient(165deg, rgba(17, 22, 38, 0.95), rgba(11, 15, 28, 0.98));
  border: 1px solid rgba(155, 177, 222, 0.16);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(39, 221, 255, 0.45), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.device-card:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 221, 255, 0.48);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36), 0 0 20px rgba(39, 221, 255, 0.15);
}

.device-card:hover::before {
  opacity: 1;
}

.device-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.device-card-device-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.device-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(39, 221, 255, 0.08);
  border: 1px solid rgba(39, 221, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.device-card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.device-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.device-status-dot.pending {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.device-card-titles {
  min-width: 0;
}

.device-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f3f7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.device-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-family: monospace;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.device-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.device-card-badge.granted {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.device-card-badge.avatar-only {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.device-card-badge.none {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Device Card Body Meta */
.device-card-meta {
  background: rgba(7, 9, 19, 0.55);
  border: 1px solid rgba(155, 177, 222, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.72rem;
}

.device-meta-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.device-meta-label {
  color: #6b7a94;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.device-meta-value {
  color: #cbd5e1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-meta-value.highlight {
  color: #27ddff;
}

/* Preview Photos Strip in Device Card - Strict 1x1 Uniform Frame */
.device-card-previews {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  position: relative;
}

.device-preview-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(4, 7, 18, 0.65);
  border: 1.5px solid rgba(155, 177, 222, 0.16);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.device-card:hover .device-preview-thumb {
  border-color: rgba(39, 221, 255, 0.28);
}

.device-preview-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.device-preview-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 19, 36, 0.45);
  border: 1.5px dashed rgba(155, 177, 222, 0.18);
  color: rgba(155, 177, 222, 0.28);
}

.device-preview-thumb-empty .material-symbols-outlined {
  font-size: 18px;
  color: rgba(155, 177, 222, 0.28);
}

/* Device Card Footer */
.device-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(155, 177, 222, 0.12);
}

.device-photos-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
}

.device-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #27ddff;
  background: rgba(39, 221, 255, 0.1);
  border: 1px solid rgba(39, 221, 255, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.device-card:hover .device-card-btn {
  background: var(--primary);
  color: #070913;
  box-shadow: 0 0 12px rgba(39, 221, 255, 0.4);
}

/* 3. Detail View Breadcrumb & Navigation */
.gallery-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.gallery-nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.breadcrumb-root {
  color: #7b8ea8;
  font-weight: 600;
  transition: color 0.2s;
}

.breadcrumb-root:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  font-size: 16px;
  color: #4b5563;
}

.breadcrumb-active {
  color: #f3f7ff;
  font-weight: 800;
}

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

/* 4. Sub-Menu Tabs Navigation */
.gallery-detail-tabs-wrap {
  border-bottom: 1px solid rgba(155, 177, 222, 0.16);
  padding-bottom: 2px;
}

.gallery-detail-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.gallery-detail-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #9ba8c3;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gallery-detail-tab:hover {
  color: #f3f7ff;
  background: rgba(39, 221, 255, 0.05);
}

.gallery-detail-tab.active {
  color: #27ddff;
  border-bottom-color: var(--primary);
  background: linear-gradient(to top, rgba(39, 221, 255, 0.12), transparent);
}

.gallery-detail-tab .tab-count-pill {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(39, 221, 255, 0.2);
  color: #27ddff;
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid rgba(39, 221, 255, 0.35);
}

.gallery-tab-pane {
  animation: fadeInSubview 0.2s ease-in-out;
}

/* 5. Photos Toolbar in Tab */
.gallery-photos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(17, 22, 38, 0.6);
  border: 1px solid rgba(155, 177, 222, 0.12);
  border-radius: var(--radius-sm);
}

.gallery-photos-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 6. Hardware Spec & MLBB Profile Grids */
.device-spec-grid,
.mlbb-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.spec-card {
  background: linear-gradient(165deg, rgba(17, 22, 38, 0.95), rgba(11, 15, 28, 0.98));
  border: 1px solid rgba(155, 177, 222, 0.16);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.spec-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(155, 177, 222, 0.12);
}

.spec-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(39, 221, 255, 0.1);
  border: 1px solid rgba(39, 221, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.spec-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f3f7ff;
  margin: 0;
}

.spec-card-desc {
  font-size: 0.72rem;
  color: #7b8ea8;
  margin: 0;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
}

.spec-item-stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.spec-label {
  color: #8c9cb6;
  font-weight: 600;
  font-size: 0.75rem;
}

.spec-val {
  color: #f3f7ff;
  font-weight: 700;
  text-align: right;
  word-break: break-all;
}

.spec-val .badge-highest-access,
.spec-val .badge-pending,
.spec-val .badge-unbound {
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.spec-val.code {
  font-family: monospace;
  font-size: 0.75rem;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.spec-val.code:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Binds badge pills */
.binds-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.bind-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.bind-pill.bound {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.bind-pill.unbound {
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.18);
}

.gallery-device-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.gallery-device-summary {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.gallery-hero-avatar {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 auto;
}

.gallery-device-copy {
  min-width: 0;
}

.gallery-device-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#galleryHeroFormattedTitle {
  display: -webkit-box;
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: #f2f7ff !important;
  font-size: clamp(1rem, 1.8vw, 1.15rem) !important;
  line-height: 1.25;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gallery-device-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  max-width: min(38%, 210px);
  min-width: 0;
  padding: 5px 8px;
  overflow: hidden;
  color: #83edff;
  background: rgba(39, 221, 255, 0.1);
  border: 1px solid rgba(39, 221, 255, 0.3);
  border-radius: 8px;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1;
}

.gallery-device-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px !important;
  color: #93a2be;
  font-size: 0.71rem;
  line-height: 1.35;
}

.gallery-device-meta strong {
  color: #c5d1e5;
}

.gallery-meta-label {
  color: #6f7f9d;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-device-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.gallery-access-badge,
.gallery-photo-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0;
  white-space: nowrap;
}

.gallery-access-badge {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-access-badge > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-photo-count {
  flex: 0 0 auto;
  padding: 4px 9px;
}

@media (max-width: 1100px) {
  .gallery-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-right .filter-select,
  .header-right .btn-refresh {
    height: 44px;
    min-height: 44px;
  }

  .gallery-toolbar {
    gap: 12px;
  }

  .gallery-device-picker {
    gap: 8px;
  }

  .gallery-device-picker .form-label {
    font-size: 0.63rem;
  }

  #btnRefreshGallery,
  .gallery-action-btn {
    min-height: 44px;
    height: 44px;
    padding-right: 9px;
    padding-left: 9px;
    font-size: 0.7rem;
    letter-spacing: 0.025em;
  }

  .gallery-actions {
    gap: 8px;
  }

  .gallery-device-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 17px;
  }

  .gallery-device-summary {
    gap: 11px;
  }

  .gallery-device-heading {
    align-items: flex-start;
  }

  #galleryHeroFormattedTitle {
    font-size: 1rem !important;
    -webkit-line-clamp: 2;
  }

  #galleryHeroDeviceBadge {
    display: none !important;
  }

  .gallery-device-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 10px;
    font-size: 0.68rem;
  }

  .gallery-device-meta > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .gallery-meta-email,
  .gallery-meta-model {
    display: none;
  }

  .gallery-device-status {
    justify-content: space-between;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid rgba(136, 158, 205, 0.18);
  }

  .gallery-access-badge {
    max-width: calc(100% - 94px);
  }
}

@media (max-width: 380px) {
  .gallery-device-picker {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .gallery-device-picker .form-label {
    grid-column: 1 / -1;
  }

  .gallery-device-summary {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .gallery-hero-avatar {
    width: 42px !important;
    height: 42px !important;
  }

  .gallery-device-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 350px) {
  .gallery-actions {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   BATCH SELECTION STYLES (TABLES, DEVICES GRID, PHOTOS GRID)
   ============================================================================== */
.table-select-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--primary);
  vertical-align: middle;
  border-radius: 4px;
}

.data-table tbody tr.row-selected {
  background: linear-gradient(90deg, rgba(39, 221, 255, 0.16), rgba(132, 109, 255, 0.12)) !important;
  box-shadow: inset 3px 0 var(--primary) !important;
}

.device-card-select-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-card-checkbox,
.photo-card-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 4px;
}

.device-card.selected {
  border-color: rgba(39, 221, 255, 0.85) !important;
  box-shadow: 0 0 0 1px rgba(39, 221, 255, 0.6), 0 12px 32px rgba(39, 221, 255, 0.25) !important;
  background: linear-gradient(165deg, rgba(23, 38, 62, 0.98), rgba(15, 23, 44, 0.98)) !important;
}

.photo-card-select-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(11, 15, 28, 0.78);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(136, 158, 205, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gallery-photo-card.has-select .gallery-card-badge.avatar-badge {
  left: 42px;
}

.gallery-photo-card.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  box-shadow: 0 0 20px rgba(39, 221, 255, 0.45) !important;
}