/* ========== Admin Panel Styles ========== */

.admin-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 20px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  overflow-x: auto;
}

.admin-tabs .tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  white-space: nowrap;
}

.admin-tabs .tab.active {
  background: #1890ff;
  color: white;
}

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

.admin-header h3 {
  margin: 0;
}

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

.admin-item {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}

.admin-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-main {
  flex: 1;
  min-width: 0;
}

.item-category {
  display: inline-block;
  background: #e6f7ff;
  color: #1890ff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 8px;
}

.item-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
}

.item-status.active {
  background: #f6ffed;
  color: #52c41a;
}

.item-status.inactive {
  background: #fff1f0;
  color: #ff4d4f;
}

.item-name {
  font-weight: 600;
  font-size: 16px;
  color: #262626;
}

.item-phone {
  color: #8c8c8c;
  font-size: 14px;
  margin-left: 12px;
}

.item-level {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
}

.item-level.VIP {
  background: #fff7e6;
  color: #fa8c16;
}

.item-level.SVIP {
  background: #f9f0ff;
  color: #722ed1;
}

.item-level.普通 {
  background: #f5f5f5;
  color: #8c8c8c;
}

.item-question {
  font-weight: 500;
  color: #262626;
  margin: 8px 0;
}

.item-answer {
  color: #595959;
  font-size: 14px;
  line-height: 1.5;
}

.item-tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-tags .tag {
  background: #f0f0f0;
  color: #595959;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* Forms */

.kb-form-container {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.kb-form h4 {
  margin: 0 0 16px 0;
}

.form-row {
  display: flex;
  gap: 16px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Buttons */

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-primary {
  background: #1890ff;
  color: white;
}

.btn-primary:hover {
  background: #40a9ff;
}

.btn-success {
  background: #52c41a;
  color: white;
}

.btn-success:hover {
  background: #73d13d;
}

.btn-secondary {
  background: #f5f5f5;
  color: #595959;
}

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

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

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

.btn-ghost {
  background: transparent;
  color: #8c8c8c;
  border: 1px solid #d9d9d9;
}

.btn-ghost:hover {
  color: #595959;
  border-color: #8c8c8c;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

.btn-mini {
  padding: 2px 8px;
  font-size: 12px;
}

/* Search */

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  width: 200px;
}

.search-box input:focus {
  outline: none;
  border-color: #1890ff;
}

/* Settings */

.settings-form {
  max-width: 800px;
}

.settings-section {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h4 {
  margin: 0 0 16px 0;
  color: #262626;
}

.message {
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 16px;
}

.message.success {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.message.error {
  background: #fff1f0;
  color: #ff4d4f;
  border: 1px solid #ffccc7;
}

/* Data Management */

.data-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.data-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 20px;
}

.data-card h4 {
  margin: 0 0 8px 0;
}

.data-card p {
  color: #8c8c8c;
  font-size: 14px;
  margin-bottom: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #1890ff;
}

.stat-label {
  font-size: 14px;
  color: #8c8c8c;
  margin-top: 4px;
}

/* Modal */

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

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h4 {
  margin: 0 0 16px 0;
}

/* Empty State */

.empty-state {
  text-align: center;
  padding: 40px;
  color: #8c8c8c;
  font-size: 14px;
}

/* Responsive */

@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .item-actions {
    margin-left: 0;
    margin-top: 12px;
  }
  
  .admin-item {
    flex-direction: column;
  }
  
  .search-box {
    width: 100%;
  }
  
  .search-box input {
    flex: 1;
  }
}
