/* Okabdt Admin Panel — Solid & Mobile Responsive Design System */
:root {
  --bg-page: #f4f5f7;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-dark: #0f172a;
  --primary: #0f172a;
  --accent: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  outline: none;
}

/* Auth Modal Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.auth-card {
  background: var(--bg-card);
  border: 2px solid var(--border-dark);
  border-radius: 8px;
  width: 100%;
  max-width: 380px;
  padding: 24px 20px;
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  font-size: 15px;
  color: var(--text-main);
  background: #ffffff;
}

.form-input:focus {
  border-color: var(--border-dark);
}

.btn-primary {
  width: 100%;
  height: 46px;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:active {
  opacity: 0.9;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  margin-top: 12px;
  text-align: center;
  display: none;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Mobile Header Bar */
.mobile-top-bar {
  display: none;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid #e2e8f0;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 500;
}

.mobile-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-hamburger {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
}

/* Sidebar Drawer Overlay for Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 900;
}

.sidebar-backdrop.show {
  display: block;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 950;
}

.brand {
  padding: 20px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-text span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  padding: 12px 10px;
  flex: 1;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.nav-link:hover {
  background: var(--bg-page);
}

.nav-link.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid #e2e8f0;
}

.btn-logout {
  width: 100%;
  height: 42px;
  background: #ffffff;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.top-title h2 {
  font-size: 18px;
  font-weight: 800;
}

.content-body {
  padding: 24px;
  flex: 1;
  min-width: 0;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Dashboard Stat Cards Grid (ONLY Dashboard keeps border styles) */
#tabDashboard .stat-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 18px 16px;
  border: none !important;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.stat-sub {
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 700;
}

/* Tables & Card Tables (NO BORDERS ON NON-DASHBOARD PAGES) */
.tab-pane:not(#tabDashboard) .card-table,
.tab-pane:not(#tabDashboard) .module-card,
.tab-pane:not(#tabDashboard) .btn-dot,
.tab-pane:not(#tabDashboard) .dropdown-menu {
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.card-table {
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  border: none !important;
}

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

.table-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.table-search {
  width: 260px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  white-space: nowrap;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
}

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

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

/* Pagination Controls Styling */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-page {
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  background: #f8fafc;
  border: none !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Solid Badges (COMPLETELY NO BORDER COLORS) */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  border: none !important;
}

.badge-success { background: #f0fdf4; color: #16a34a; }
.badge-danger { background: #fef2f2; color: #dc2626; }
.badge-warning { background: #fffbeb; color: #d97706; }

/* 3-Dot Action Button & Dropdown */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.btn-dot {
  width: 36px;
  height: 36px;
  background: #f8fafc;
  border: none !important;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

/* Bottom Sheet Dialog for User Management Actions */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 10000;
}

.bottom-sheet-overlay.show {
  display: flex;
}

.bottom-sheet-card {
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px 28px;
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
}

.bottom-sheet-overlay.show .bottom-sheet-card {
  transform: translateY(0);
}

.bottom-sheet-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.bottom-sheet-header h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.bottom-sheet-header p {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.bottom-sheet-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bottom-sheet-btn {
  width: 100%;
  height: 48px;
  background: #f8fafc;
  border: none !important;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-sheet-btn.danger {
  color: var(--danger);
  background: #fef2f2;
}

.bottom-sheet-btn.cancel {
  background: #ffffff;
  border: 1px solid var(--border-color) !important;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Game Control Modules Grid (NO BORDER COLORS) */
.control-modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.module-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 20px 16px;
  cursor: pointer;
  position: relative;
  border: none !important;
}

.module-card.selected {
  background: #ffffff;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.module-title {
  font-size: 15px;
  font-weight: 800;
}

.radio-indicator {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-card.selected .radio-indicator {
  border-color: var(--border-dark);
  background: var(--border-dark);
}

.radio-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  display: none;
}

.module-card.selected .radio-indicator::after {
  display: block;
}

.module-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  font-weight: 500;
}

.manual-preset-controls {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.btn-choice {
  flex: 1;
  height: 42px;
  border: none !important;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}

.btn-choice.btn-big.active {
  background: #dc2626;
  color: #ffffff;
}

.btn-choice.btn-small.active {
  background: #2563eb;
  color: #ffffff;
}

/* Action Buttons */
.btn-sm {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  border: none !important;
}

.btn-sm-success { background: #16a34a; color: #ffffff; }
.btn-sm-danger { background: #dc2626; color: #ffffff; }

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  border: none !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
}

/* Toast Notice */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100000;
}

.toast {
  background: var(--border-dark);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  display: none;
}

.toast.show {
  display: block;
}

/* Responsive Breakpoints for Mobile & Tablet */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .control-modules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-top-bar {
    display: flex;
  }
  .top-bar {
    display: none;
  }
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    width: 270px;
    transition: left 0.25s ease-in-out;
  }
  .sidebar.open {
    left: 0;
  }
  .content-body {
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .table-search {
    width: 100%;
  }
  .card-table {
    margin-bottom: 16px;
  }
}
