.admin-console {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.admin-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(135, 206, 235, 0.3);
}

.admin-title {
  color: #333;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.btn-refresh {
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.admin-status-banner {
  padding: 15px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border-radius: 10px;
  margin-bottom: 20px;
}

.admin-status-banner p {
  color: #856404;
  margin: 0;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.admin-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.admin-tab:hover {
  background: rgba(135, 206, 235, 0.1);
  color: #333;
}

.admin-tab.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.admin-panel {
  display: none;
}

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

.admin-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.section-title {
  color: #333;
  font-size: 18px;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(135, 206, 235, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  padding: 3px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.badge-warning {
  background: #ffc107;
}

.badge-info {
  background: #17a2b8;
}

.table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.admin-table thead tr {
  background: linear-gradient(135deg, #87CEEB 0%, #a8d8ea 100%);
  color: white;
}

.admin-table th,
.admin-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.admin-table th.col-center,
.admin-table td.col-center {
  text-align: center;
}

.admin-table th.col-actions,
.admin-table td.col-actions {
  text-align: center;
  width: 150px;
}

.admin-table tbody tr:hover {
  background: rgba(135, 206, 235, 0.05);
}

.empty-cell {
  padding: 30px !important;
  text-align: center !important;
  color: #888;
}

.db-console-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  min-height: 500px;
}

.db-sidebar {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.db-sidebar-header {
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.db-sidebar-header h4 {
  margin: 0;
  font-size: 14px;
}

.db-table-list {
  padding: 10px;
}

.db-table-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 5px;
}

.db-table-item:hover {
  background: rgba(102, 126, 234, 0.1);
}

.db-table-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.table-icon {
  font-size: 16px;
}

.table-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.table-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.db-main {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.db-stats {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.stat-card-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-card-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.stat-card-info {
  background: linear-gradient(135deg, #17a2b8 0%, #87CEEB 100%);
  color: white;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
}

.db-schema {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

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

.schema-header h4 {
  margin: 0;
  font-size: 14px;
  color: #333;
}

.column-count {
  background: #667eea;
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
}

.schema-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schema-column {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8f9fa;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
}

.col-name {
  font-weight: 600;
  color: #333;
}

.col-type {
  color: #667eea;
  font-family: monospace;
  font-size: 11px;
}

.col-required {
  background: #dc3545;
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
}

.db-data {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.data-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-count {
  font-size: 13px;
  color: #666;
}

.btn-action {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-add {
  background: #28a745;
  color: white;
}

.btn-add:hover {
  background: #218838;
}

.btn-delete {
  background: #dc3545;
  color: white;
}

.btn-delete:hover {
  background: #c82333;
}

.btn-export {
  background: #17a2b8;
  color: white;
}

.btn-export:hover {
  background: #138496;
}

.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead tr {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table th.col-select,
.data-table td.col-select {
  width: 40px;
  text-align: center;
}

.data-table th.col-actions,
.data-table td.col-actions {
  width: 80px;
  text-align: center;
}

.data-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.null-value {
  color: #999;
  font-style: italic;
}

.json-value {
  color: #667eea;
  font-family: monospace;
  font-size: 11px;
}

.btn-icon {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background: transparent;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.1);
}

.btn-icon.btn-edit:hover {
  background: rgba(23, 162, 184, 0.2);
}

.btn-icon.btn-delete:hover {
  background: rgba(220, 53, 69, 0.2);
}

.db-pagination {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.page-btn {
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.page-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

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

.page-dots {
  padding: 8px;
  color: #666;
}

.stats-placeholder,
.data-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #888;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-text {
  color: #888;
  font-size: 14px;
}

.btn-add-row {
  margin-top: 20px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.loading-text {
  padding: 20px;
  text-align: center;
  color: #888;
}

.error-text {
  padding: 20px;
  text-align: center;
  color: #dc3545;
}

.db-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.db-modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.db-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.db-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.modal-close:hover {
  opacity: 1;
}

.db-modal-body {
  padding: 20px;
  max-height: 50vh;
  overflow-y: auto;
}

.form-field {
  margin-bottom: 15px;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
  font-size: 13px;
}

.form-field .required {
  color: #dc3545;
}

.form-field .field-type {
  display: block;
  font-size: 11px;
  color: #667eea;
  font-family: monospace;
  margin-bottom: 5px;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: #667eea;
}

.form-field textarea {
  min-height: 80px;
  resize: vertical;
}

.form-field.readonly input {
  background: #f8f9fa;
  cursor: not-allowed;
}

.db-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.btn-cancel {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-submit {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.admin-loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #eee;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

.stats-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.stats-section h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 14px;
}

.table-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.table-stat-item .table-name {
  font-weight: 500;
  color: #333;
}

.table-stat-item .table-count {
  background: #667eea;
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 13px;
}

.activity-feature {
  font-weight: 500;
  color: #667eea;
}

.activity-platform {
  color: #666;
}

.activity-time {
  color: #999;
  font-size: 11px;
}

.no-activity {
  padding: 20px;
  text-align: center;
  color: #888;
}

@media (max-width: 768px) {
  .db-console-layout {
    grid-template-columns: 1fr;
  }
  
  .db-sidebar {
    order: 1;
  }
  
  .db-main {
    order: 2;
  }
  
  .admin-tabs {
    flex-wrap: wrap;
  }
  
  .admin-tab {
    flex: 1;
    min-width: 100px;
    text-align: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .data-toolbar {
    flex-direction: column;
    gap: 10px;
  }
}
