/* Admin Panel Styles - Brown Theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f5f0;
  color: #4a4a4a;
  min-height: 100vh;
}

/* Main Layout - No Sidebar */
.admin-main {
  min-height: calc(100vh - 70px - 60px);
  margin-top: 70px;
  padding-bottom: 60px;
}

/* Admin Header Bar with Dropdown */
.admin-header-bar {
    background: white;
    border-bottom: 2px solid #e8dcc8;
    padding: 36px 32px;
    position: sticky;
    top: 70px;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(120, 100, 58, 0.08);
}

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

.admin-title {
  color: #78643a;
  font-size: 24px;
  font-weight: 700;
}

/* Dropdown Navigation */
.admin-nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f5f1e8 0%, #ede6d9 100%);
  border: 2px solid #e8dcc8;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #78643a;
  transition: all 0.3s ease;
  min-width: 200px;
}

.nav-dropdown-btn:hover {
  background: linear-gradient(135deg, #ede6d9 0%, #e8dcc8 100%);
  border-color: #c9b99a;
}

.nav-dropdown-btn.active {
  background: linear-gradient(135deg, #a88264 0%, #8b7355 100%);
  color: white;
  border-color: #8b7355;
}

.current-section-icon {
  font-size: 20px;
}

.current-section-text {
  flex: 1;
  text-align: left;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.nav-dropdown-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 2px solid #e8dcc8;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(120, 100, 58, 0.15);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
  overflow: hidden;
}

.nav-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.dropdown-nav-item:hover {
  background: #f5f1e8;
  color: #78643a;
  border-left-color: #a88264;
}

.dropdown-nav-item.active {
  background: linear-gradient(90deg, #f5f1e8 0%, white 100%);
  color: #78643a;
  border-left-color: #78643a;
  font-weight: 600;
}

.dropdown-nav-item .nav-icon {
  font-size: 18px;
}

/* Main Content - Full Width */
.admin-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  min-height: calc(100vh - 70px - 100px);
}

/* Sections */
.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header h1 {
  color: #78643a;
  font-size: 28px;
  font-weight: 700;
}

.section-header p {
  color: #888;
  font-size: 14px;
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(120, 100, 58, 0.08);
  border: 1px solid #e8dcc8;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(120, 100, 58, 0.15);
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.users-icon {
  background: linear-gradient(135deg, #e8f4fd 0%, #bee3f8 100%);
}

.competitions-icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
}

.results-icon {
  background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
}

.schools-icon {
  background: linear-gradient(135deg, #fce7f3 0%, #f9a8d4 100%);
}

.stat-info h3 {
  font-size: 32px;
  font-weight: 700;
  color: #78643a;
  line-height: 1;
}

.stat-info p {
  color: #888;
  font-size: 14px;
  margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dashboard-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(120, 100, 58, 0.08);
  border: 1px solid #e8dcc8;
}

.dashboard-card.full-width {
  grid-column: 1 / -1;
}

.dashboard-card h3 {
  color: #78643a;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f5f1e8;
}

/* Chart Container */
.chart-container {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  height: 100%;
  width: 100%;
  justify-content: space-around;
}

.chart-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 80px;
}

.bar {
  width: 100%;
  max-width: 50px;
  border-radius: 8px 8px 0 0;
  transition: height 0.5s ease;
  min-height: 10px;
}

.bar-label {
  font-size: 12px;
  color: #666;
  text-align: center;
}

.bar-value {
  font-size: 14px;
  font-weight: 600;
  color: #78643a;
}

/* Activity List */
.activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f0ebe0;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f1e8;
  font-size: 18px;
}

.activity-content {
  flex: 1;
}

.activity-text {
  color: #4a4a4a;
  font-size: 14px;
}

.activity-time {
  color: #999;
  font-size: 12px;
  margin-top: 2px;
}

/* Filters Bar */
.filters-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-input,
.filter-select,
.date-input {
  padding: 12px 16px;
  border: 2px solid #e8dcc8;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.search-input {
  flex: 1;
  min-width: 200px;
}

.filter-select {
  min-width: 150px;
}

.search-input:focus,
.filter-select:focus,
.date-input:focus {
  outline: none;
  border-color: #a88264;
  box-shadow: 0 0 0 3px rgba(168, 130, 100, 0.15);
}

/* Table Container */
.table-container {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(120, 100, 58, 0.08);
  border: 1px solid #e8dcc8;
}

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

.data-table th,
.data-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #f0ebe0;
}

.data-table th {
  background: linear-gradient(135deg, #f5f1e8 0%, #ede6d9 100%);
  color: #78643a;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.data-table td {
  color: #4a4a4a;
  font-size: 14px;
}

.data-table .loading {
  text-align: center;
  color: #999;
  padding: 40px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-active {
  background: #d1fae5;
  color: #059669;
}

.status-completed {
  background: #dbeafe;
  color: #2563eb;
}

.status-upcoming {
  background: #fef3c7;
  color: #d97706;
}

.status-cancelled {
  background: #fee2e2;
  color: #dc2626;
}

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.role-учень {
  background: #e0f2fe;
  color: #0369a1;
}

.role-вчитель {
  background: #fef3c7;
  color: #b45309;
}

.role-методист {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Action Buttons */
.action-btns {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.btn-edit {
  background: #fef3c7;
  color: #b45309;
}

.btn-edit:hover {
  background: #fcd34d;
}

.btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

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

.btn-view {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-view:hover {
  background: #7dd3fc;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #a88264 0%, #8b7355 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(168, 130, 100, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(168, 130, 100, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f5f1e8;
  color: #78643a;
  border: 2px solid #e8dcc8;
}

.btn-secondary:hover {
  background: #ede6d9;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 2px solid #e8dcc8;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
  background: #78643a;
  color: white;
  border-color: #78643a;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  padding: 0 16px;
  color: #666;
  font-size: 14px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

.modal-lg {
  max-width: 700px;
}

.modal-sm {
  max-width: 400px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #f0ebe0;
}

.modal-header h2 {
  color: #78643a;
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f1e8;
  border-radius: 10px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 2px solid #f0ebe0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Styles */
form {
  padding: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #4a4a4a;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8dcc8;
  border-radius: 10px;
  font-size: 14px;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #a88264;
  box-shadow: 0 0 0 3px rgba(168, 130, 100, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Logs Container */
.logs-container {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(120, 100, 58, 0.08);
  border: 1px solid #e8dcc8;
  max-height: 600px;
  overflow-y: auto;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: #faf8f5;
}

.log-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.log-user {
  background: #e0f2fe;
}

.log-competition {
  background: #fef3c7;
}

.log-result {
  background: #d1fae5;
}

.log-auth {
  background: #f3e8ff;
}

.log-content {
  flex: 1;
}

.log-message {
  color: #4a4a4a;
  font-size: 14px;
  margin-bottom: 4px;
}

.log-time {
  color: #999;
  font-size: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

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

.toast.success {
  background: #059669;
}

.toast.error {
  background: #dc2626;
}

.toast.warning {
  background: #d97706;
}

.toast.info {
  background: #2563eb;
}

/* Loading State */
.loading {
  color: #999;
  font-style: italic;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
  .admin-content {
    padding: 24px;
  }

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

@media (max-width: 768px) {
  .admin-header-bar {
    padding: 12px 16px;
  }

  .admin-header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .admin-title {
    font-size: 20px;
    text-align: center;
  }

  .nav-dropdown-btn {
    width: 100%;
    justify-content: center;
  }

  .nav-dropdown-menu {
    left: 0;
    right: 0;
  }

  .admin-content {
    padding: 20px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header h1 {
    font-size: 24px;
  }

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

  .filters-bar {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 8px;
  }

  .action-btns {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .admin-content {
    padding: 16px;
  }

  .section-header h1 {
    font-size: 20px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .stat-info h3 {
    font-size: 24px;
  }

  .modal-content {
    margin: 10px;
    border-radius: 16px;
  }

  form {
    padding: 16px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar,
.logs-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.table-container::-webkit-scrollbar-track,
.logs-container::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: #f5f1e8;
}

.table-container::-webkit-scrollbar-thumb,
.logs-container::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: #c9b99a;
  border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.logs-container::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: #a88264;
}
