/* ========== agrokurs72.ru/public_html/panel.css SIDE PANEL ========== */
.side-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 20px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: right 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.side-panel.open {
  right: 0;
}

.panel-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 10;
}

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

.close-panel {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.close-panel:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

.panel-content {
  padding: 15px;
}

.panel-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.panel-section:last-child {
  border-bottom: none;
}

.panel-section h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #2c3e50;
  font-weight: 600;
}

/* ========== STATS CARDS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 12px;
  border-radius: 10px;
  color: #fff;
  text-align: center;
}

.stat-card.green {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card.orange {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon {
  font-size: 20px;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  margin: 3px 0;
}

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

/* ========== FILTERS ========== */
.filter-group {
  margin-bottom: 12px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #666;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sort-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.sort-btn {
  padding: 8px;
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  transition: all 0.3s;
}

.sort-btn.active {
  background: #667eea;
  color: #000;
  background: #fff;
  border-color: #667eea;
}

.sort-btn {
  color: #000;
  background: #fff;
}


/* ========== FIELD LIST ========== */
.field-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.field-item:hover {
  background: #e3f2fd;
  border-color: #667eea;
  transform: translateY(-1px);
}

.field-item.selected {
  background: #e3f2fd;
  border-color: #667eea;
}

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

.field-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  flex: 1;
}

.color-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ddd;
  flex-shrink: 0;
}

.field-actions {
  display: flex;
  gap: 4px;
}

.field-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s;
  width: auto;
  margin: 0;
}

.field-actions button:hover {
  background: rgba(102, 126, 234, 0.1);
}

.field-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 11px;
  color: #666;
}

.field-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ========== OPERATIONS HISTORY ========== */
.history-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 20px rgba(0,0,0,0.2);
  z-index: 2100;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.history-panel[style*="display: block"] {
  right: 0;
}

.operation-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 4px solid #667eea;
  position: relative;
}

.operation-item.sowing { border-left-color: #43e97b; }
.operation-item.spraying { border-left-color: #4facfe; }
.operation-item.fertilizing { border-left-color: #fa709a; }
.operation-item.harvesting { border-left-color: #fee140; }
.operation-item.tillage { border-left-color: #9c27b0; }

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

.operation-type {
  font-weight: 600;
  font-size: 13px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 6px;
}

.operation-date {
  font-size: 11px;
  color: #999;
}

.operation-details {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.operation-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #667eea;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 5px;
}

/* ========== EXPORT DROPDOWN ========== */
.export-dropdown {
  display: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

.export-dropdown button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin: 0;
  background: #fff;
  color: #333;
  font-size: 13px;
  border-radius: 0;
}

.export-dropdown button:hover {
  background: #f5f5f5;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: #999;
  font-size: 14px;
}

/* ========== BUTTONS ========== */
.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  margin: 4px 0;
  transition: all 0.3s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn.secondary {
  background: #f5f5f5;
  color: #666;
}

.btn.secondary:hover {
  background: #e0e0e0;
}

.btn.success {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== MODAL ========== */
.modal-body {
  padding: 15px 0;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

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

/* ========== MOBILE ========== */
@media (max-width: 600px) {
  .side-panel,
  .history-panel {
    width: 100%;
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sort-options {
    grid-template-columns: 1fr;
  }

  .panel-section h4 {
    font-size: 13px;
  }

  .field-name {
    font-size: 13px;
  }

  .stat-value {
    font-size: 18px;
  }
}

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

  .panel-header {
    padding: 12px;
  }

  .panel-header h3 {
    font-size: 16px;
  }
}

.season-current-btn {
  color: #000 !important;
  background-color: #fff !important;
}

.season-current-btn .season-label {
  color: #000 !important;
}

/* ========== LEFT PANEL ========== */
.left-panel {
  position: fixed;
  top: 0;
  left: -100%;
  width: 90%;
  max-width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 20px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: left 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.left-panel.open {
  left: 0;
}

.left-panel-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.left-panel-header h3 {
  font-size: 16px;
  margin: 0;
}

.close-left-panel {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-panel-tabs {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 5px;
}

.left-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  color: #2c3e50;
}

.left-tab:hover {
  background: #e3f2fd;
  border-color: #667eea;
}

.left-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: #667eea;
}

.left-tab-icon {
  font-size: 20px;
}

.left-tab-text {
  font-weight: 600;
}

.open-left-panel-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1900;
  background: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.open-left-panel-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

@media (max-width: 600px) {
  .left-panel {
    width: 100%;
    max-width: 100%;
  }
}

.season-link-btn {
  background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
  white-space: nowrap;
}

.season-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

/* ========== LEFT PANEL USER INFO ========== */
.left-panel-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.left-panel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.left-panel-user-info {
  flex: 1;
  min-width: 0;
}

.left-panel-username {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.left-panel-role {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
}

.left-panel-actions {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.left-panel-btn {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.left-panel-btn.admin-btn {
  background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
  color: #fff;
}

.left-panel-btn.admin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.left-panel-btn.logout-btn {
  background: #f44336;
  color: #fff;
}

.left-panel-btn.logout-btn:hover {
  background: #d32f2f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}